The HiFiBerry DAC+ and Amp/Amp+ comes with integrated volume control.
In some distributions, the needed tools are not installed by default. Therefore you should install them first. On Debian based distributions this can be done with the following command:
sudo apt-get install alsa-utils
The easiest way is using “alsamixer”. You can also use “amixer” if you want to set a specific volume non-interactively.
Controls of the cards
While there are a lot of mixer controls at the DAC+, you only need to care about one named “PCM”.
amixer sset PCM 90%
All other mixer control allow access to low-level functions of the sound chip. You won’t need them. Unfortunately it is not easy to remove these controls as they are part of a kernel driver that is not maintained by us. Just make sure, the “Playback Boost” is set to 0%.
To get the full output volume without clipping, the settings should be like this:
amixer sset 'PCM' 96% amixer sset 'Playback Boost' 0%
There are 2 controls:
Channels. With the master control you control the overall volume while “Channels” can be used to set different volumes on the left and right channel. Note that excessive volumes can damage your speakers. Therefore we recommend setting the volume not too high on startup.
amixer sset Master 70% amixer sset Channels 70%,70%
Store/restore volume settings
On Raspbian shutdown a shutdown script is used to store the current volume settings. However many people shutdown their system by removing the power (not optimal, but usually this works without problems). In this case, the latest volume settings are not stored. You can do this by hand with the command