Thank you for your donation!


Reduce delay changing software volume?
#1
I am using a basic DAC with no hardware volume control so I am relying on the software volume. One thing I have noticed is that there is a significant delay between changing the volume (especially in large steps) and the volume actually going up or down. I say significant, its about half a second, but it causes people to think nothing has happened who don't know and will then over adjust. I was wondering is there any way to reduce that delay down?
Reply
#2
I'm not able to repro such a large delay using Pi4 + Allo Boss DAC. I did notice a very slight delay though compared to Hardware volume which is instant.

Whats your platform: Pi, DAC, etc.

There is this newly discovered issue with MPD Software volume being much louder at a given level as compared to Hardware volume. They should be almost identical loudness at a given level. Possibly there are some bugs in Software volume routine ??

Someone will need to reproduce this level difference using a DAC that supports Hardware volume, Stock Raspbian Buster or Raspberry Pi OS and stock MPD 0.21.24, then submit an issue to MPD maintainer.

-Tim
Reply
#3
Probably, that depends on the DAC and its driver. As I said before in the other thread, I don't have any volume level difference between Software and Hardware volume levels on 0dB point, and there is no distortion, when EQ is off. So, this is applicable to your setup, not to all.
Reply
#4
I always put the lag down to the 4MB mpd buffer. Theres a distinct 1-2 sec delay between making a volume control change on the GUI or USB knob, and hearing the effect of the change in volume. Is it possible the delay gets worse with lower bitrates as 4MB corresponds to more time at 44.1k than 384k for example?
Reply
#5
Volume changes are communicated to the audio device using MPD setvol command. These protocol commands are processed separately and in parallel with audio data being received into the MPD audio buffer.

Client -> change volume knob -> send MPD setvol command ------> NETWORK ------> MPD on Pi (Server) -> Audio device.

Lag in processing protocol commands would suggest performance issues in Client, Network or Server.
Reply
#6
Everything else works instantaneously. The GUI updates the instant the change is made, it just takes a bit to hear the volume change in the audio.

Isn't it the case that software volume is applied by mpd as the data is filling the input side of the FIFO, but we hear the output side of the FIFO some time later in the DAC, the time depending on buffer size and bit rate? This would explain the lag, no? I might try setting the buffer larger, see if it affects the lag. I guess it cant be set below 4MB, which would be interesting to see if reduced the lag issue.

If however you are saying that mpd applies software volume to the output side of the buffer, right before the DAC, then we have a different issue I guess.

Edit: just tested and found that bitrate and buffer size apparently have no effect on the lag.
Reply
#7
Heres a screen grab showing the lag. 

https://www.dropbox.com/s/g2rzj916nzrnje...g.mp4?dl=0
Reply
#8
(07-05-2020, 11:27 PM)mtnbrit Wrote: Everything else works instantaneously. The GUI updates the instant the change is made, it just takes a bit to hear the volume change in the audio.

Isn't it the case that software volume is applied by mpd as the data is filling the input side of the FIFO, but we hear the output side of the FIFO some time later in the DAC, the time depending on buffer size and bit rate? This would explain the lag, no? I might try setting the buffer larger, see if it affects the lag. I guess it cant be set below 4MB, which would be interesting to see if reduced the lag issue.

If however you are saying that mpd applies software volume to the output side of the buffer, right before the DAC, then we have a different issue I guess.

Edit: just tested and found that bitrate and buffer size apparently have no effect on the lag.

The audio buffer exists in RAM and like any other buffer operates at CPU/RAM speeds. The only delays that could occur would be in an upstream process thats slow to deliver data to the buffer or in some down stream process thats slow in  doing something with the data after it's been read.

The audio buffer has nothing to do with laggy software volume.
Reply


Forum Jump: