[solved] Delay in volume commands

Hello,

I setup Mopidy on rasberry Pi Zero W with a Pimoroni Pirate audio board (hifiberry dac). Everything is running fine except that I have a delay of about 1s between volume change commands (up, down, mute) and the actual change when I use the software mixer. Play, pause and chaging tracks are working correctly.

Is this topic still relevant?

I tried to setup alsamixer

[alsamixer]
enabled = True
card = 0
control = PCM
min_volume = 0
max_volume = 30

[audio]
mixer = alsamixer
mixer_volume = 5
output = alsasink device=hw:sndrpihifiberry
#output = alsasink
#buffer_time = 100

but then the volume is not controled by Mopidy. I tried different alsamixer controls (default, PCM, Digital) with no success. I understand that the hifiberry dac as no alsa control as I could check running alsamixer.

I also tried to set an /etc/asound.conf file as per this page. Still no volume control. I’m not sure of what I am doing here and if the asound.conf file is even taken into account.

Is there a way to fix the volume delay? Will the use of alsamixer fix the issue once I find the correct settings?

Thanks

Well I didn’t try hard enough.

Defining correctlu a new pcm in /etc/asound.conf did fix the lag in the volume command. Fpr reference:

pcm.!default  {
 type plug
 slave.pcm "speakerphat"
}

ctl.!default {
 type hw
 card 0
}

pcm.speakerphat {
  type softvol
  slave.pcm "plughw:0"
  control.name "SoftMaster"
  control.card 0
}

then in mopidy.conf

[alsamixer]
enabled = true
card = 0
control = SoftMaster
min_volume = 0
max_volume = 80       
                                                                                                                                                                                                                       
[audio]mixer = alsamixer
mixer_volume = 5
#output = alsasink device=hw:sndrpihifiberry
output = alsasink 

The trick:

output = alsasink device=hw:sndrpihifiberry

had to be changed to

output = alsasink