librespot icon indicating copy to clipboard operation
librespot copied to clipboard

Version 5 dev (2ea7436) --initial-volume 0 results in full volume

Open moodeaudio opened this issue 1 year ago • 3 comments

Describe the bug The option --initial-volume 0 results in full (100%) volume when iPhone client connects and then starts playback.

The volume slider on the client appears to get set differently depending on whether the client was already playing locally before librespot is started followed by client connecting.

  1. Already playing locally: Slider gets set to 0 position after librespot starts and stays at 0 after connecting, output volume = full
  2. Not playing locally: Slider gets set to 0 position after librespot starts but then goes to almost 100% after connecting + play, output volume = full

In either case actual output volume is full volume (100%)

To reproduce Steps to reproduce the behavior:

  1. Launch librespot with
sudo librespot --name "Moode9 Spotify" --bitrate 320 --format S16 --mixer softvol --initial-volume 0 --volume-ctrl log --volume-range 60 --cache /var/local/www/spotify_cache --disable-audio-cache --backend alsa --device "_audioout" --onevent /var/local/www/commandw/spotevent.sh -v > /var/log/moode_librespot.log 2>&1
  1. In Spotify iPhone App playback should be stopped
  2. Connect to "Moode9 Spotify"
  3. Observe App volume slider position
  4. NOTE: Be sure downstream volume control is set very low!
  5. Start playback
  6. Observe App volume slider position and actual output volume

Log Its ginormous so maybe a link is best :-) moode_librespot.log

Host (what you are running librespot on):

  • OS: RaspiOS Bookworm
  • Platform: Pi5

Additional context

  • Audio device: Allo Boss DAC

moodeaudio avatar Sep 05 '24 22:09 moodeaudio

And to be explicit, this is a regression compared to 0.4, yes?

Related to https://github.com/librespot-org/librespot/issues/41

kingosticks avatar Sep 06 '24 07:09 kingosticks

Certainly possible because I rewrote the way it takes the volume from the initial handshake in 0.5.

This would be a good "first issue" for someone to jump and in contribute. The logic should not be difficult to find and fix.

roderickvd avatar Sep 06 '24 08:09 roderickvd

@kingosticks, yes it appears to be a regression compared to 0.4.

I should also mention that setting --initial-volume to a value greater than 0 seems to work fine.

moodeaudio avatar Sep 06 '24 10:09 moodeaudio

Any takers before releasing 0.5 maybe this weekend?

roderickvd avatar Sep 16 '24 17:09 roderickvd

I'll take care of it in the spirit of hacktober if that's okay :)

BeeJay28 avatar Oct 16 '24 17:10 BeeJay28