[GH-ISSUE #73] [Question] Regarding the use of Sink.stop #62

Closed
opened 2026-02-27 19:28:36 +03:00 by kerem · 1 comment
Owner

Originally created by @sashahilton00 on GitHub (Jan 29, 2018).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/73

Issue by leafy7382
Friday Jul 21, 2017 at 15:42 GMT
Originally opened as https://github.com/plietar/librespot/issues/224


My problem: I have a Rpi3 + Hifiberry Digi+ Pro running VolumioNext (the new build that supports Digi+ Pro) and use the volspotconnect2 that in turn uses librespot. Whether I am using TOSLINK or Coax, I get a mute relay click from my DAC (Schiit Yggdrasil) whenever

  1. Started playing after a stop
  2. Resumed playing after a stop
  3. Next track or previous track before 3 secs into play

Since in the Alsa backend, the format of the stream is fixed (signed 16,44100), the only way that make the DAC relay click is by stopping the output completely and restarting the output.

I've noticed that Sink.stop were called exactly 4 times in

PlayerCommand::Load
PlayerCommand::Stop
PlayerCommand::Pause

and when there is a Vorbis error

Would it be possible to change the stop behaviour to not cut off the whole backend? What I perceive the possible solutions could be one of the following(please correct me if I am wrong):

  • Don't set self.0 = None; in stop, just do nothing
  • Implement a Sink.mute function that outputs 0 constantly (or does nothing) and use Sink.mute instead of Sink.stop for the first 3 scenarios. Than we can keep the Sink.stop behavior for Vorbis errors.
Originally created by @sashahilton00 on GitHub (Jan 29, 2018). Original GitHub issue: https://github.com/librespot-org/librespot/issues/73 <a href="https://github.com/leafy7382"><img src="https://avatars2.githubusercontent.com/u/359465?v=4" align="left" width="96" height="96" hspace="10"></img></a> **Issue by [leafy7382](https://github.com/leafy7382)** _Friday Jul 21, 2017 at 15:42 GMT_ _Originally opened as https://github.com/plietar/librespot/issues/224_ ---- My problem: I have a Rpi3 + Hifiberry Digi+ Pro running VolumioNext (the new build that supports Digi+ Pro) and use the volspotconnect2 that in turn uses librespot. Whether I am using TOSLINK or Coax, I get a mute relay click from my DAC (Schiit Yggdrasil) whenever 1. Started playing after a stop 2. Resumed playing after a stop 3. Next track or previous track before 3 secs into play Since in the Alsa backend, the format of the stream is fixed (signed 16,44100), the only way that make the DAC relay click is by stopping the output completely and restarting the output. I've noticed that Sink.stop were called exactly 4 times in ``` PlayerCommand::Load PlayerCommand::Stop PlayerCommand::Pause ``` and when there is a Vorbis error Would it be possible to change the stop behaviour to not cut off the whole backend? What I perceive the possible solutions could be one of the following(please correct me if I am wrong): - Don't set `self.0 = None;` in stop, just do nothing - Implement a `Sink.mute` function that outputs 0 constantly (or does nothing) and use `Sink.mute` instead of `Sink.stop` for the first 3 scenarios. Than we can keep the `Sink.stop` behavior for Vorbis errors.
kerem 2026-02-27 19:28:36 +03:00
  • closed this issue
  • added the
    imported
    label
Author
Owner

@sashahilton00 commented on GitHub (Jan 29, 2018):

Comment by kingosticks
Friday Jul 21, 2017 at 17:55 GMT


Releasing the ALSA device when stopped, like other applications do, is good, do you really want to lose that? If you don't release it you end up blocking any other applications form using it (unless you configure an ALSA dmix plugin). When you've got a bunch of audio playback applications trying to get along together this is quite important.

If I remember correctly (I might be wrong), the Android Spotify client doesn't actually have a stop button, so bizarrely in this case it's nice that pause has the same behaviour as stop in regards to this.

<!-- gh-comment-id:361274830 --> @sashahilton00 commented on GitHub (Jan 29, 2018): <a href="https://github.com/kingosticks"><img src="https://avatars2.githubusercontent.com/u/934824?v=4" align="left" width="48" height="48" hspace="10"></img></a> **Comment by [kingosticks](https://github.com/kingosticks)** _Friday Jul 21, 2017 at 17:55 GMT_ ---- Releasing the ALSA device when stopped, like other applications do, is good, do you really want to lose that? If you don't release it you end up blocking any other applications form using it (unless you configure an ALSA dmix plugin). When you've got a bunch of audio playback applications trying to get along together this is quite important. If I remember correctly (I might be wrong), the Android Spotify client doesn't actually have a stop button, so bizarrely in this case it's nice that pause has the same behaviour as stop in regards to this.
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#62
No description provided.