[GH-ISSUE #197] no sound output (most of the time) #134

Closed
opened 2026-02-27 19:29:01 +03:00 by kerem · 11 comments
Owner

Originally created by @idevsoftware on GitHub (Apr 1, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/197

Hi, I built librespot with the hope of having a spotify connect client on my linux arcade cab. It seems to work fine since it connects, authenticates and shows other clients (like my desktop computer and mobile phone). Whenever I try to play a track, however, it loads and the remote client shows it as it's playing, but I get no sound most of the time. The few times it works I only get sound for a few seconds (tipically 2-3, sometimes for a fraction of a second), but most of the time no sound at all. Also when this happens I am unable to quit librespot (ctrl+c) and I have to kill the process instead.

I am attaching the output from a session on which I got no sound at all. Note at the end how it gets the ^C and the last message is Shutting down player thread ..., however it stays there indefinitely without ever returning control.

librespot.log

Originally created by @idevsoftware on GitHub (Apr 1, 2018). Original GitHub issue: https://github.com/librespot-org/librespot/issues/197 Hi, I built librespot with the hope of having a spotify connect client on my linux arcade cab. It seems to work fine since it connects, authenticates and shows other clients (like my desktop computer and mobile phone). Whenever I try to play a track, however, it loads and the remote client shows it as it's playing, but I get no sound most of the time. The few times it works I only get sound for a few seconds (tipically 2-3, sometimes for a fraction of a second), but most of the time no sound at all. Also when this happens I am unable to quit librespot (ctrl+c) and I have to kill the process instead. I am attaching the output from a session on which I got no sound at all. Note at the end how it gets the `^C` and the last message is `Shutting down player thread ...`, however it stays there indefinitely without ever returning control. [librespot.log](https://github.com/librespot-org/librespot/files/1866596/librespot.log)
kerem closed this issue 2026-02-27 19:29:01 +03:00
Author
Owner

@machsFuel commented on GitHub (Apr 1, 2018):

I've had similar problems, have you tried muting and unmuting your alsa outputs?

<!-- gh-comment-id:377815036 --> @machsFuel commented on GitHub (Apr 1, 2018): I've had similar problems, have you tried muting and unmuting your alsa outputs?
Author
Owner

@ComlOnline commented on GitHub (Apr 11, 2018):

I think I've had this as well I thought it was some thing I had done elsewhere. Ill look tonight and see if I can reproduce it again.

<!-- gh-comment-id:380561425 --> @ComlOnline commented on GitHub (Apr 11, 2018): I think I've had this as well I thought it was some thing I had done elsewhere. Ill look tonight and see if I can reproduce it again.
Author
Owner

@lrbalt commented on GitHub (Apr 30, 2018):

From the ALSA errors I think you have a configuration issue on your Linux system. Those errors are not from Librespot but from portaudio calling into ALSA.

A fix was merged today to better respond to Ctrl-C. But your problem could be that Librespot hangs on ALSA not working properly.

<!-- gh-comment-id:385530923 --> @lrbalt commented on GitHub (Apr 30, 2018): From the ALSA errors I think you have a configuration issue on your Linux system. Those errors are not from Librespot but from portaudio calling into ALSA. A fix was merged today to better respond to Ctrl-C. But your problem could be that Librespot hangs on ALSA not working properly.
Author
Owner

@idevsoftware commented on GitHub (Apr 30, 2018):

hi @lrbalt, thanks for your response. I don't think that's the case since I know alsa is correctly configured, with every other audio app on my system being able to play sound without any issues. I'll try building with the newly merged code you mention and take a second look at my alsa conf later today, I'll let you know how it goes.

<!-- gh-comment-id:385533423 --> @idevsoftware commented on GitHub (Apr 30, 2018): hi @lrbalt, thanks for your response. I don't think that's the case since I know alsa is correctly configured, with every other audio app on my system being able to play sound without any issues. I'll try building with the newly merged code you mention and take a second look at my alsa conf later today, I'll let you know how it goes.
Author
Owner

@lrbalt commented on GitHub (Apr 30, 2018):

Ok, please look at your pulse audio config too, or try using the ALSA backend instead of pulseaudio

<!-- gh-comment-id:385534017 --> @lrbalt commented on GitHub (Apr 30, 2018): Ok, please look at your pulse audio config too, or try using the ALSA backend instead of pulseaudio
Author
Owner

@idevsoftware commented on GitHub (Apr 30, 2018):

I don't use pulse audio at all, just plain old alsa

<!-- gh-comment-id:385534283 --> @idevsoftware commented on GitHub (Apr 30, 2018): I don't use pulse audio at all, just plain old alsa
Author
Owner

@lrbalt commented on GitHub (Apr 30, 2018):

Sorry, I meant portaudio which is mentioned in your log. If you only use ALSA, you can change backend in Config.toml

<!-- gh-comment-id:385534819 --> @lrbalt commented on GitHub (Apr 30, 2018): Sorry, I meant portaudio which is mentioned in your log. If you only use ALSA, you can change backend in Config.toml
Author
Owner

@idevsoftware commented on GitHub (Apr 30, 2018):

Gotcha. But isn't portaudio actually required by librespot as a cross-platform, higher level audio interface?

<!-- gh-comment-id:385535329 --> @idevsoftware commented on GitHub (Apr 30, 2018): Gotcha. But isn't portaudio actually required by librespot as a cross-platform, higher level audio interface?
Author
Owner

@lrbalt commented on GitHub (Apr 30, 2018):

It is not required afaics. Idk

<!-- gh-comment-id:385535732 --> @lrbalt commented on GitHub (Apr 30, 2018): It is not required afaics. Idk
Author
Owner

@idevsoftware commented on GitHub (May 5, 2018):

ok, so a few updates. I just pulled the latest version and rebuilt. ctrl+c now works as expected, and switching to the ALSA backend (as opposed to PortAudio) solved the audio issue. However there is a noticeable delay between what the Spotify client says and what's playing: when playing a song it can take about 15 seconds for it to actually play, but the client time mark starts moving ahead as soon as I hit 'play'. Also, play/pause commands have a delay of about 2-3 seconds. FWIW I'm testing with the iPhone Spotify App as client, connected to my home Wi-Fi network. The machine where the librespot client is running is directly hooked up to the same LAN segment via Ethernet. I don't have any other noticeable delays on regular network operations from the same computer.

<!-- gh-comment-id:386774661 --> @idevsoftware commented on GitHub (May 5, 2018): ok, so a few updates. I just pulled the latest version and rebuilt. ctrl+c now works as expected, and switching to the ALSA backend (as opposed to PortAudio) solved the audio issue. However there is a noticeable delay between what the Spotify client says and what's playing: when playing a song it can take about 15 seconds for it to actually play, but the client time mark starts moving ahead as soon as I hit 'play'. Also, play/pause commands have a delay of about 2-3 seconds. FWIW I'm testing with the iPhone Spotify App as client, connected to my home Wi-Fi network. The machine where the librespot client is running is directly hooked up to the same LAN segment via Ethernet. I don't have any other noticeable delays on regular network operations from the same computer.
Author
Owner

@roderickvd commented on GitHub (May 25, 2021):

If it was silent on PortAudio, then it's likely that PA opened audio output in some format other than 16-bit signed integer. There's been a lot of development since this issue was reported, so I'm closing this for now but feel free to re-open if the issue persists.

<!-- gh-comment-id:848221454 --> @roderickvd commented on GitHub (May 25, 2021): If it was silent on PortAudio, then it's likely that PA opened audio output in some format other than 16-bit signed integer. There's been a lot of development since this issue was reported, so I'm closing this for now but feel free to re-open if the issue persists.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#134
No description provided.