Volume not restored after boot/reboot

I have change alsa setting by doing
sudo alsactl store
and I can see kernel generate /var/lib/alsa/asound.state
The next time I reboot, all alsa setting is being restored except volume setting
I also try to execute in rc.local below but still doesn’t help
/usr/sbin/alsactl -f /etc/asound.state restore
Am I missing something? Please help

I think you will need to set the volume in Kodi. Otherwise Kodi will override any settings you have made elsewhere.

Kodi won’t override ALSA volumes (IIRC) as that would impact userspace. But it has its own volume settings.

The default sink on Pi is also PiSink – not BCM2835-alsa. So this has to be set through Kodi.

so that means alsactl restore should take effect, right?
also i try to use alsa dmix with asound.conf below
it gives error “Error: ALSA lib pcm_dmix.c:1109:(snd_pcm_dmix_open) unable to open slave”

asound.conf
---------------------------------------------------------------------------------------
pcm.!default {
    type plug
    slave.pcm "dmixed"
}

pcm.dmixed {
    type dmix
    ipc_key 555555
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 8192
        rate 44100
        channels 2
        format S16_LE
    }
    bindings {
        0 0
        1 1
    }
}

I fixed your post for you, when including files like you did, please use the </> tag to format them properly :wink: