How do I add a volume control for my JustBoom Digi?
The JustBoom Digi HAT and Zero by default do not offer a volume control and that’s because generally speaking that’s not the way these type of cards should be used. The “role” to control the volume is delegated to the Amp to which you should normally connect them too.
However there is a way to add software volume control using asound, where you can control the volume using amixer. This option may be if you don’t have volume control on the receiver side of your audio setup, which in some cases is a possibility.
Create or edit /etc/asound.conf or ~/.asound.conf to contain the following:
pcm "plughw:" # Typically device number 0 (if onboard audio is disabled) or else device number 1
name "softvol-mixer" # The name of your mixer-device in /etc/mpd.conf
Then edit the audio output section of /etc/mpd.conf to contain the following:
name "JustBoom Digi Zero"
This will allow you to adjust the output level from the digital output and prevent clipping as it might occur in your DAC.
To make this work with Shairport-sync, enter the following as your Alsa output device:
output_device = "softvol";