Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Spotify/Bluetooth: Hardware Volume Control on Pi 3 + HiFiBerry Amp - Best Practices
#1
Hi everyone,

I'm trying to get hardware volume control working for Spotify Connect and Bluetooth on my Pi 3 + HiFiBerry Amp 0.9 setup. I'm using Moode Player 9.3.0

I've identified that Moode uses `librespot` and that it's launched with the
Code:
--mixer softvol
option, which is the problem i think. I would like to change `softvol` to
Code:
--mixer alsa --mixer-name 'Channels'
Where do i find the starting options of librespot? And where are the corresponding settings for Bluetooth?


As workaround i have set the master channel to 50% in alsamixer (so i can hear spotify and bluetooth in acceptable volume..) but i guess this is not the propper solution..

What's the recommended way to switch to hardware volume control (using the HiFiBerry's "Channels" mixer)?
 

Thanks for any help!
Reply
#2
Since volume is controlled by the client, when a client connects to a renderer moode sets hardware volume to 0dB (100%). This ensures that when the client volume is set to 100% the overall system volume is 100%.

Bluetooth seems to have a very hot volume curve and so there are ALSA and CDSP max volume settings in the Bluetooth section of Renderer Config.

The Spotify volume curve seems normal and so a maxvol setting was not implemented.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
Thanks for the response, Tim.

I'm still trying to understand the reasoning behind using `--mixer="softvol"`
with librespot, instead of directly controlling the hardware volume.

Is there a specific reason why `softvol` is generally preferred over direct hardware volume control?
Or, to put it another way, is hardware volume primarily intended for use with web radio (and possibly the local library)?

According to the Librespot Wiki, it seems that using `--mixer="alsa"` and `--alsa-mixer-control="Channels"` should work for hardware volume control.
The wiki also suggests trying `--volume-ctrl linear` when using a hardware mixer.

I haven't yet been able to figure out how Bluetooth is configured, nor have I located the exact file where librespot is started.
I only know it's running with `softvol` based on `ps aux | grep librespot` output.
And i also did noticed the systemd service files are not used for starting spotify/bluetooth.

As it stands, I've had to reduce the master level in alsamixer to around 50% to achieve a reasonable volume level for Spotify and Bluetooth. 
This works, but it also means I have to increase the volume for web radio to around 75% to achieve a similar loudness, which is less than ideal.

Any further insights or suggestions would be greatly appreciated!

Thanks again for your time and consideration.
Reply
#4
I'm not really into Bluetooth on Linux or moOde, so cannot comment on that.

But reasons for software volume:

1. librespot's softvol works in 64-bit floating point. It will have higher accuracy than any hardware volume control, which works in integer.
2. Hardware volume control is very fussy to sync across renderers. moOde has chosen to stop trying some years ago, and I understand why.

When you say that loudness differs between sources, how sure are you that their mastering levels are the same?
Do you have volume normalization in Spotify enabled or disabled?
maintainer of librespot and pleezer, working on a qobuz connect player. sponsor me: https://github.com/sponsors/roderickvd
Reply
#5
I think @stifio is trying to achieve volume normalization at the renderer level for Bluetooth, Spotify Connect and MPD.

Thats not possible even if the audio device has hardware volume because each renderer and corresponding client app uses a different volume curve. A slider setting of 30% in a given app will result in a different output volume thus there is no single ALSA volume setting that will ever work.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#6
Alright thank you @roderickvd and @Tim Curtis for the insight. i will try to tweak it with max volume and volume range instead
Reply


Forum Jump: