# Volume change on boot

**URL:** <https://discourse.mopidy.com/t/volume-change-on-boot/971>\
**Category:** Pi MusicBox (archive)\
**Created:** [November 13, 2015, 6:22pm UTC](https://discourse.mopidy.com/t/volume-change-on-boot/971 "2015-11-13T18:22:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_Jordan](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@Rob\_Jordan](https://discourse.mopidy.com/u/Rob_Jordan)\
**Post date:** [November 13, 2015, 6:22pm UTC](https://discourse.mopidy.com/t/volume-change-on-boot/971/1 "2015-11-13T18:22:17Z")

</div>

Hi,

I have a hifiberry amp, all working fine apart from the hi volume. I have the volume on 1 and it’s still to loud.  
I’ve been ssh’ing in everytime and reducing the volume with:

“amixter sset Master 70%” (and closing with sudo reboot rather than just turning power off)

this works fine accept I’d rather the command ran on boot.

What I’ve tried:

“alsactl store 1”

also

using @reboot in the crontab

Hoping someone can help?  
Kind regards,

Rob

---

<div class="post-metadata">

**Author:** ![Florian\_Kutschera](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/florian_kutschera/32/230_2.png) [@Florian\_Kutschera](https://discourse.mopidy.com/u/Florian_Kutschera)\
**Post date:** [November 13, 2015, 8:38pm UTC](https://discourse.mopidy.com/t/volume-change-on-boot/971/2 "2015-11-13T20:38:16Z")

</div>

Can’t you use `alsamxier` ? If I change the volume in `alsamxier` it stays as it want it to – even after reboot or poweroff.

---

<div class="post-metadata">

**Author:** ![Rob\_Jordan1](https://avatars.discourse-cdn.com/v4/letter/r/4af34b/32.png) [@Rob\_Jordan1](https://discourse.mopidy.com/u/Rob_Jordan1)\
**Post date:** [November 13, 2015, 11:36pm UTC](https://discourse.mopidy.com/t/volume-change-on-boot/971/3 "2015-11-13T23:36:23Z")

</div>

Thanks, I had a go with the alsamixer. Lowered the volume and pressed F4 to capture but “alas” it did not save the volume setting after reboot.

the settings.ini file looks like this…

output = hifiberry\_amp

[audio]  
hash Set the startup volume of MusicBox  
hash Values: from 0 to 100  
mixer\_volume = 1

output = alsasink  
mixer = software

hash Optionally, you can use alsamixer. This enables you to use hardware mixers of$  
hash Set the previous setting to:  
hash mixer = alsamixer  
hash And set the card and contol below. E.g.  
hash card = 1

not sure if having two outputs selected helps but I seem to remember that hashing out “output = alsaink” stopped the local host loading up??

thanks,  
Rob

---

<div class="post-metadata">

**Author:** ![Rob\_Jordan](https://avatars.discourse-cdn.com/v4/letter/r/9d8465/32.png) [@Rob\_Jordan](https://discourse.mopidy.com/u/Rob_Jordan)\
**Post date:** [November 18, 2015, 7:16am UTC](https://discourse.mopidy.com/t/volume-change-on-boot/971/4 "2015-11-18T07:16:26Z")

</div>

Sorry to bump.  
Any ideas?

What would be a way to run a script/command on boot?

Thanks,  
Rob

---

<div class="post-metadata">

**Author:** ![dublok](https://avatars.discourse-cdn.com/v4/letter/d/bbce88/32.png) [@dublok](https://discourse.mopidy.com/u/dublok)\
**Post date:** [December 13, 2015, 3:12pm UTC](https://discourse.mopidy.com/t/volume-change-on-boot/971/5 "2015-12-13T15:12:48Z")

</div>

Hi Rob,  
if you remove the value from mixer\_volume, mopidy will not overwrite the stored alsamixer volume at startup (tested with pi and hifiberry amp+):

[audio]  
mixer = alsamixer  
mixer\_volume =  
output = alsasink

[alsamixer]  
enabled = true  
card = 0  
control = Master

Kind regards

---

<div class="post-metadata">

**Author:** ![jcass77](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/jcass77/32/721_2.png) [@jcass77](https://discourse.mopidy.com/u/jcass77)\
**Post date:** [December 23, 2015, 4:25am UTC](https://discourse.mopidy.com/t/volume-change-on-boot/971/6 "2015-12-23T04:25:58Z")

</div>

The Pi Musicbox uses `setsound.sh` to set the volume level on every reboot. To ensure that the volume is set to your preference, you would change `setsound.sh` to include:

```
VOLUME=<your preference here>

```

…and then reference this value in:

```
# Set initial hardware volume
amixer set -c $CARD "$CTL" ${VOLUME}% unmute > /dev/null 2>&1 || true
```

---

<div class="post-metadata">

**Author:** ![jodal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/jodal/32/2564_2.png) [@jodal](https://discourse.mopidy.com/u/jodal)\
**Post date:** [February 19, 2026, 11:47am UTC](https://discourse.mopidy.com/t/volume-change-on-boot/971/7 "2026-02-19T11:47:34Z")

</div>


