0

I am trying to install bit perfect audio. Up to and including Debian 11 that was not much of a problem. However, now I am on Debian 13 (Trixie) and Pulseaudio and Pipewire are giving me a hard time.

The setup is mpd over TOSLink to a DAC. The DAC works on all bit rates 44.1 kHz/16 bit up to 192.0 kHz/24 bit. What I have achieved so far is to make the DAC accessible to pavucontrol and preserve the audio bit rates.

The bit depth is the real problem for which I could not find any hint on the internet and manuals.

The configuration:

pactl info|grep "Server Name" Server Name: PulseAudio (on PipeWire 1.4.2) 

The audio devices:

aplay -L null Discard all samples (playback) or generate zero samples (capture) sysdefault Default Audio Device pipewire PipeWire Sound Server default Default ALSA Output (currently PipeWire Media Server) hw:CARD=Audio,DEV=0 USB Audio, USB Audio Direct hardware device without any conversions hw:CARD=Audio,DEV=1 USB Audio, USB Audio #1 Direct hardware device without any conversions hw:CARD=Audio,DEV=2 USB Audio, USB Audio #2 Direct hardware device without any conversions hw:CARD=Audio,DEV=3 USB Audio, USB Audio #3 Direct hardware device without any conversions plughw:CARD=Audio,DEV=0 USB Audio, USB Audio Hardware device with all software conversions plughw:CARD=Audio,DEV=1 USB Audio, USB Audio #1 Hardware device with all software conversions plughw:CARD=Audio,DEV=2 USB Audio, USB Audio #2 Hardware device with all software conversions plughw:CARD=Audio,DEV=3 USB Audio, USB Audio #3 Hardware device with all software conversions sysdefault:CARD=Audio USB Audio, USB Audio Default Audio Device front:CARD=Audio,DEV=0 USB Audio, USB Audio Front output / input surround21:CARD=Audio,DEV=0 USB Audio, USB Audio 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=Audio,DEV=0 USB Audio, USB Audio 4.0 Surround output to Front and Rear speakers surround41:CARD=Audio,DEV=0 USB Audio, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=Audio,DEV=0 USB Audio, USB Audio 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=Audio,DEV=0 USB Audio, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=Audio,DEV=0 USB Audio, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=Audio,DEV=0 USB Audio, USB Audio IEC958 (S/PDIF) Digital Audio Output iec958:CARD=Audio,DEV=1 USB Audio, USB Audio #1 IEC958 (S/PDIF) Digital Audio Output dmix:CARD=Audio,DEV=0 USB Audio, USB Audio Direct sample mixing device dmix:CARD=Audio,DEV=1 USB Audio, USB Audio #1 Direct sample mixing device dmix:CARD=Audio,DEV=2 USB Audio, USB Audio #2 Direct sample mixing device dmix:CARD=Audio,DEV=3 USB Audio, USB Audio #3 Direct sample mixing device hw:CARD=HDMI,DEV=3 HDA ATI HDMI, HDMI 0 Direct hardware device without any conversions hw:CARD=HDMI,DEV=7 HDA ATI HDMI, HDMI 1 Direct hardware device without any conversions hw:CARD=HDMI,DEV=8 HDA ATI HDMI, HDMI 2 Direct hardware device without any conversions hw:CARD=HDMI,DEV=9 HDA ATI HDMI, HDMI 3 Direct hardware device without any conversions plughw:CARD=HDMI,DEV=3 HDA ATI HDMI, HDMI 0 Hardware device with all software conversions plughw:CARD=HDMI,DEV=7 HDA ATI HDMI, HDMI 1 Hardware device with all software conversions plughw:CARD=HDMI,DEV=8 HDA ATI HDMI, HDMI 2 Hardware device with all software conversions plughw:CARD=HDMI,DEV=9 HDA ATI HDMI, HDMI 3 Hardware device with all software conversions hdmi:CARD=HDMI,DEV=0 HDA ATI HDMI, HDMI 0 HDMI Audio Output hdmi:CARD=HDMI,DEV=1 HDA ATI HDMI, HDMI 1 HDMI Audio Output hdmi:CARD=HDMI,DEV=2 HDA ATI HDMI, HDMI 2 HDMI Audio Output hdmi:CARD=HDMI,DEV=3 HDA ATI HDMI, HDMI 3 HDMI Audio Output dmix:CARD=HDMI,DEV=3 HDA ATI HDMI, HDMI 0 Direct sample mixing device dmix:CARD=HDMI,DEV=7 HDA ATI HDMI, HDMI 1 Direct sample mixing device dmix:CARD=HDMI,DEV=8 HDA ATI HDMI, HDMI 2 Direct sample mixing device dmix:CARD=HDMI,DEV=9 HDA ATI HDMI, HDMI 3 Direct sample mixing device hw:CARD=Generic_1,DEV=3 HD-Audio Generic, HDMI 0 Direct hardware device without any conversions hw:CARD=Generic_1,DEV=7 HD-Audio Generic, HDMI 1 Direct hardware device without any conversions hw:CARD=Generic_1,DEV=8 HD-Audio Generic, HDMI 2 Direct hardware device without any conversions hw:CARD=Generic_1,DEV=9 HD-Audio Generic, HDMI 3 Direct hardware device without any conversions plughw:CARD=Generic_1,DEV=3 HD-Audio Generic, HDMI 0 Hardware device with all software conversions plughw:CARD=Generic_1,DEV=7 HD-Audio Generic, HDMI 1 Hardware device with all software conversions plughw:CARD=Generic_1,DEV=8 HD-Audio Generic, HDMI 2 Hardware device with all software conversions plughw:CARD=Generic_1,DEV=9 HD-Audio Generic, HDMI 3 Hardware device with all software conversions hdmi:CARD=Generic_1,DEV=0 HD-Audio Generic, HDMI 0 HDMI Audio Output hdmi:CARD=Generic_1,DEV=1 HD-Audio Generic, HDMI 1 HDMI Audio Output hdmi:CARD=Generic_1,DEV=2 HD-Audio Generic, HDMI 2 HDMI Audio Output hdmi:CARD=Generic_1,DEV=3 HD-Audio Generic, HDMI 3 HDMI Audio Output dmix:CARD=Generic_1,DEV=3 HD-Audio Generic, HDMI 0 Direct sample mixing device dmix:CARD=Generic_1,DEV=7 HD-Audio Generic, HDMI 1 Direct sample mixing device dmix:CARD=Generic_1,DEV=8 HD-Audio Generic, HDMI 2 Direct sample mixing device dmix:CARD=Generic_1,DEV=9 HD-Audio Generic, HDMI 3 Direct sample mixing device front:CARD=Generic Front output / input surround21:CARD=Generic 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=Generic 4.0 Surround output to Front and Rear speakers surround41:CARD=Generic 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=Generic 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=Generic 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=Generic 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers 

Note the above contains

iec958:CARD=Audio,DEV=0 USB Audio, USB Audio IEC958 (S/PDIF) Digital Audio Output iec958:CARD=Audio,DEV=1 USB Audio, USB Audio #1 IEC958 (S/PDIF) Digital Audio Output 

/etc/mpd.conf looks like

 audio_output { type "pulse" name "Musical Fidelity M1Dac Optical" device "hw:CARD=Audio,DEV=0" mixer_type "none" auto_resample "no" auto_channels "no" auto_format "no" } 

Uncommented the lines and added bit rates in /usr/share/pipewire.conf

 default.clock.rate = 48000 default.clock.allowed-rates = [ 44100 48000 88200 96000 176400 192000 ] 

Playing a 192 kHz kHz/24 bit FLAC gives

pw-top S ID QUANT RATE WAIT BUSY W/Q B/Q ERR FORMAT NAME S 30 0 0 --- --- --- --- 0 Dummy-Driver S 31 0 0 --- --- --- --- 0 Freewheel-Driver S 55 0 0 --- --- --- --- 0 Midi-Bridge S 58 0 0 --- --- --- --- 0 bluez_midi.server R 61 8192 192000 60.8us 10.8us 0.00 0.00 0 S16LE 2 192000 alsa_output.usb-Generic_USB_Audio-00.HiFi__SPDIF__sink R 82 8192 192000 27.3us 27.6us 0.00 0.00 0 S24_32 2 192000 + Music Player Daemon S 62 0 0 --- --- --- --- 0 alsa_output.usb-Generic_USB_Audio-00.HiFi__Headphones__sink S 63 0 0 --- --- --- --- 0 alsa_output.usb-Generic_USB_Audio-00.HiFi__Speaker__sink S 64 0 0 --- --- --- --- 0 alsa_input.usb-Generic_USB_Audio-00.HiFi__Mic1__source S 65 0 0 --- --- --- --- 0 alsa_input.usb-Generic_USB_Audio-00.HiFi__Line1__source 

My understanding is: mpd is sending a signed 32 bit container with 24 bit audio information at a sample rate of 192000 Hz. The sound device receives a signed 16 bit container at 192 kHz. The result is some clicking noise from the speakers. The DAC is displaying a sample rate of 48 kHz. Clearly, this has to fail due to misalignment.

Playing a 48kHz kHz/16 bit (maybe it is 24 bit, it is DVD audio) FLAC gives

pw-top S ID QUANT RATE WAIT BUSY W/Q B/Q ERR FORMAT NAME S 30 0 0 --- --- --- --- 0 Dummy-Driver S 31 0 0 --- --- --- --- 0 Freewheel-Driver S 55 0 0 --- --- --- --- 0 Midi-Bridge S 58 0 0 --- --- --- --- 0 bluez_midi.server R 61 2048 48000 40.3us 10.0us 0.00 0.00 0 S16LE 2 48000 alsa_output.usb-Generic_USB_Audio-00.HiFi__SPDIF__sink R 82 8192 48000 14.1us 18.2us 0.00 0.00 0 S24_32 2 48000 + Music Player Daemon S 62 0 0 --- --- --- --- 0 alsa_output.usb-Generic_USB_Audio-00.HiFi__Headphones__sink S 63 0 0 --- --- --- --- 0 alsa_output.usb-Generic_USB_Audio-00.HiFi__Speaker__sink S 64 0 0 --- --- --- --- 0 alsa_input.usb-Generic_USB_Audio-00.HiFi__Mic1__source S 65 0 0 --- --- --- --- 0 alsa_input.usb-Generic_USB_Audio-00.HiFi__Line1__source 

with clean undistorted playback. Given that at mpd are 48 kHz/16 bit, at the audio device are 48 kHz/16 bit and the DAC is running at 48kHz this is the expected result.

My suspicion is that the bit depth has to adjusted to either 16 or 24 bit depending on the FLAC. Can someone please help! Thanks in advance for your time and effort.

Nick 
4
  • FYR wiki.archlinux.org/title/…. Most likely you are using wireplumber. I have no idea about the relationship between audio.rate in a session manager update-props rule and default.clock.rate / default.clock.allowed-rates in the pipewire context.properties though. Commented Sep 7 at 17:54
  • (I don't think they would be like two layers of "resampling (target)", but somehow you claimed that The DAC is displaying a sample rate of 48 kHz even when pw-top reports S16LE 2 192000 alsa_output.usb-Generic_USB_Audio-00.HiFi__SPDIF__sink. See if this helps getting you some hints or answers.) Commented Sep 7 at 17:57
  • Tom, thanks for the url. Gives me something to read. BTW: the bit rate is not resampled. Somehow the output format seems to changed from S24_32 to S16LE. Commented Sep 8 at 12:20
  • What I meant is, unless it is a hardware (or driver compatibility) problem, 192000 ... alsa_output.usb-Generic_USB_Audio-00.HiFi__SPDIF__sink shown in pw-top should be reporting what your USB sound card receive / was open at, but I don't how exactly pipewire works (with this "session manager" thing), I don't know what those two sample rate configurations mean / would do respectively. As for the sample format, it is not surprised that the samples got truncated to 16bit because it is quite expected it would be the default in configuration. Commented Sep 8 at 14:06

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.