Moode Forum

Full Version: Spotify mixer options
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Currently Moode-Spotify is using softvol for the mixer, which my personal feeling is that sound / volume is bit decreased, so I made a little changes in renderer.php, the result is good for me:

 ' --mixer alsa' .
 ' --alsa-mixer-device hw:0,0' . 
 ' --alsa-mixer-control Digital' . // check the control device name in alsamixer.
 ' --alsa-mixer-index 0' .
 

Suggest to add mixer options in the Moode-Spotify configuration settings.
When librespot gets a connection from a Spotify client the script /var/local/www/commandw/spotevent.sh is executed and will set ALSA volume to 100% (0dB) if the audio device supports hardware volume. This is done because --softvol is used as the mixer. Then IIRC the Spotify client volume will be reset to the value specified in --initial-volume. Then playback will begin.

When --mixer is set to alsa there is a risk due to the way the current spotevent.sh script is coded that the device will be left at 100% volume if the --initial-volume setting fails to work. To correctly handle librespot using hardware volume the script would first need to check the mixer type and if set to "alsa" then ALSA volume would first be set to 0%.

What you should see in alsamixer on your end with librespot using hardware volume is that it first gets set to 100% then reset to --initial-volume.
(11-03-2022, 11:10 AM)Tim Curtis Wrote: [ -> ]When librespot gets a connection from a Spotify client the script /var/local/www/commandw/spotevent.sh is executed and will set ALSA volume to 100% (0dB) if the audio device supports hardware volume. This is done because --softvol is used as the mixer. Then IIRC the Spotify client volume will be reset to the value specified in --initial-volume. Then playback will begin.

When --mixer is set to alsa there is a risk due to the way the current spotevent.sh script is coded that the device will be left at 100% volume if the --initial-volume setting fails to work. To correctly handle librespot using hardware volume the script would first need to check the mixer type and if set to "alsa" then ALSA volume would first be set to 0%.

What you should see in alsamixer on your end with librespot using hardware volume is that it first gets set to 100% then reset to --initial-volume.

Yes, correct, the volume is jumping to 100% when Spotify starts playing if the initial volume is not 0%, so I set the initial volume to be 0% right now, not smart but ok for me Smile
Prolly not OK for other users though if they forget to set initial volume or they set it -1 (use cached volume) because they will end up with damaged speakers or worse if they are wearing headphones. The spotevent.sh script has to be modified as I described in previous post for this to have a chance at being ok.

Years ago hardware volume was an option in the UI for both Airplay and Spotify but there were reliability issues and so it was scrapped. Since then reliability has been excellent.
(11-03-2022, 11:53 AM)Tim Curtis Wrote: [ -> ]Prolly not OK for other users though if they forget to set initial volume or they set it -1 (use cached volume) because they will end up with damaged speakers or worse if they are wearing headphones. The spotevent.sh script has to be modified as I described in previous post for this to have a chance at being ok.

Years ago hardware volume was an option in the UI for both Airplay and Spotify but there were reliability issues and so it was scrapped. Since then reliability has been excellent.

Agreed for the reliability is the first priority.