help to understand bit depth issue along mpd-alsa-I2S path

Hello,

I am using RPI with Volumio in the car. Adjusting songs volume while driving is not a good habit, so using Replaygain is a must for my application.
I use IQ-audio Pi-DAC and it sounds really good. But I can’t use it’s hardware volume control with Replaygain due to MPD/DAC volume scale inconsistency.

So, now I am trying to use software Replaygain control in MPD config file:

part of mpd.conf

replaygain "auto"

It is well known that adjusting volume in 16 bit is not a very good idea, so I decided to increase bit depth to 24 bit to reduce potential quality drop during reaplaygain adjustment in mpd.conf:

audio_output {

                 type           "alsa"
                 name           "Output"
                 device         "hw:0,0"
                 dop    "no"
                 format         "*:24:2"
                 replay_gain_handler "software"
}

I checked these settings with Volumio 1.5 and it worked flawlessly for 44.1 and 48 kHz files.

Using following command allows you to get an idea what is going from ALSA to DAC:

cat /proc/asound/card*/pcm*p/sub*/hw_params

access: RW_INTERLEAVED
format: S24_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 4410
buffer_size: 22050

format value is consistent with mpd.conf audio format setting.

But then I faced with known problem of Hi-res files playback in Volumio version 1.5, so I updated Volumio to v. 1.51.
This completely resolved Hi-res files playback issue, but now I have something weird with ALSA audio format.

 cat /proc/asound/card*/pcm*p/sub*/hw_params

access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 44100 (44100/1)
period_size: 4410
buffer_size: 22050

In other words, PCM format is always S32_LE, for any source file bit depth and mpd.conf audio format setting.

So, after this long explanation :laughing: , my questions are:

  1. Does this mean that now I have double bit depth conversion (from 16 bit to 24 bit in MPD and then from 24 to 32 in ALSA)? Is it really a problem?
  2. If so, will I resolve this “double conversion issue” by increasing bit depth to 32bit in MPD config file?
  3. Can someone point me to some good read explaining data flow between MPD, ALSA and DAC? :unamused:

Thanks,
Andrey.