Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash on playback, Termux, Aarch64 #1345

Open
WyntrHeart opened this issue Dec 6, 2023 · 12 comments
Open

Crash on playback, Termux, Aarch64 #1345

WyntrHeart opened this issue Dec 6, 2023 · 12 comments
Labels
bug Something isn't working

Comments

@WyntrHeart
Copy link

WyntrHeart commented Dec 6, 2023

Describe the bug
Attempting to play any song instantly crashes ncspot without any error message.

To Reproduce

  1. Install ncspot by doing 'pkg install ncspot'
  2. Open ncspot
  3. Attempt to play any song

Expected behavior
The song should play

System (please complete the following information):

  • OS: Android 9
  • Terminal: Termux
  • Version: v0.13.4
  • Installed from: Termux

Backtrace/Debug log
"https://github.com/hrkfdn/ncspot#debugging" doesn't exist, and I don't know where to obtain the relevant logs. If someone tells me how to obtain these logs I will provide them.
I can't do a backtrace because this issue is with a release build.

Additional context
I tried to work around the problem by building from source, which is the only solution I found in similar issues, but using either "cargo install ncspot" or "cargo build --release" from a source directory just hangs indefinitely for me on the second to last step.

@WyntrHeart WyntrHeart added the bug Something isn't working label Dec 6, 2023
@galen8183
Copy link

galen8183 commented Dec 25, 2023

Use the -d/--debug option to enable debug logging to a file.
See ncspot --help or man ncspot for more.

@ThomasFrans
Copy link
Contributor

I can't do a backtrace because this issue is with a release build.

It would probably be useful regardless of the build. The backtrace also includes the reason why the program crashed, even though the backtrace itself won't be that helpful. It should be automatically generated in the ncspot cache directory after a crash.

@WyntrHeart
Copy link
Author

So I hadn't touched ncspot at all since my previous post, and I just tried to start it to get the debug logs as instructed, but now it doesn't even open the player. The login screen works, but once I login it crashes immediately. I did find the backtrace and got a debug log, but the debug log may not show whatever caused the original issue since this new issue has appeared.
ncspot-debug.log
backtrace.log

@ThomasFrans
Copy link
Contributor

ThomasFrans commented Jan 2, 2024

Ah, I think I already see from the backtrace. This is something I added about a month or so ago. It's some code to look for a runtime directory for runtime files (like the IPC socket) that probably can't find any suitable runtime directory on Android. It used the user cache directory before from what I remember, but that shouldn't be used for runtime files so it was instead moved to directories like /run/user/ or /tmp/. I don't know what the available directories are on Termux. I'll try to have a look and see what's going wrong.

EDIT: If I can't find a suitable runtime directory for Android, I'll create a PR soon to disable IPC until a better solution is found, if that's OK. Then at least it won't crash anymore.

@WyntrHeart
Copy link
Author

there is a tmp directory at /data/data/com.termux/files/usr/tmp

@ThomasFrans
Copy link
Contributor

ThomasFrans commented Jan 2, 2024

I just disabled IPC on platforms with unknown user runtime directory for now which seems like the simplest fix. I'll let @hrkfdn decide what the best approach is in this case. I don't want one of my changes to completely bork Android support, but it's not a supported platform and there would have to be a contributor who is familiar with it and enough interest probably to properly support the platform (different directories, other differences...) I wonder whether Zellij works on Android and if so, what approach it uses since it also uses the user runtime directory. I looked at how Zellij did it when I added the feature here.

@ThomasFrans
Copy link
Contributor

The crash should now be fixed on the main branch. The initial bug related to this issue is probably still there though. If you want you could share another debug log & backtrace for that :)

@WyntrHeart
Copy link
Author

Crash fix worked (and it actually compiles on my phone now too, idk what was up with that)
backtrace.log
ncspot-debug.log

@WyntrHeart
Copy link
Author

I hadn't actually checked the contents of the backtrace until just now, looks like its the same one from before. Is there something I can do to make it generate a new one?

Also some additional info I hadn't specified before: when this crash happens it breaks the whole terminal session and I have to close it with ctrl + D and open a new one

@ThomasFrans
Copy link
Contributor

ThomasFrans commented Jan 7, 2024

The Ctrl+D was probably because ncspot doesn't reset the terminal after a crash, which leaves it in a weird state making it unusable.

@ThomasFrans
Copy link
Contributor

The last line in the log mentions an issue with the connection to PulseAudio. I don't know Android well enough to know what could cause this or whether PulseAudio is even installed/running in Termux. I don't know what could have changed in the newer versions that causes this crash. My guess would be that you could use a different audio backend like ALSA which wouldn't require PulseAudio to be installed/running.

[2024-01-06][18:05:57] [librespot_playback::player] [ERROR] Audio Sink Error Connection Refused: <PulseAudioSink> Connection refused

@WyntrHeart
Copy link
Author

WyntrHeart commented Jan 7, 2024

Termux does have PulseAudio, and does not have ALSA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants