Setting volume of Allo Boss2 DAC on boot

Kia ora, @MichaIng and all DietPi fans :kiwi_fruit: :wave:

This is possibly a very simply question, but: how to I set the volume of my DietPi-running Allo Boss2 DAC to a specific value on every boot?

Many thanks!

PS. Congrats on the migration to Discourse, and especially on getting all the old forum discussions copied across – that’s an awesome achievement!

Ah, I think I’ve found the answer to my own question, so I’ll document it here, in case anyone else searches for something similar.

It seems that ALSA automatically stores the current configuration of the many and various settings it has in a file named /var/lib/alsa/asound.state when the host is shutting down. So, if everything goes OK, you shouldn’t need to programmatically set the volume to a specific level on rebet: it should be done automagically for you.

However, I have found that I can use the following commands to set the volume as I wish:

sudo amixer set Master 90%
sudo amixer set Digital 90%

Hope that helps,

Also alsamixer can be used for this. The states are stored to disk on shutdown and restored on boot :slight_smile:.