Noise in DSD files

Hello,

I’m currently building an embedded system that exclusively runs Mopidy with ALSA, based on Buildroot. The main goal is to make the system as small and simple as possible with low latency. This is why I don’t want to use PulseAudio, PipeWire, or Jack.

Everything is working fine except for playing DSD (DSF) files. When I play these files, I get static white noise in the background. Same result when using gst-play

Here are some demo contents that I tested with (the playback is also noisy with other DSD files in my library):

OPPO Digital - Demo Tracks by DSD Pioneer Musician David Elias

I have a reference system, which is a stock Ubuntu 22.04 with the latest Mopidy installed from the apt.mopidy.com repo. I also get the same result on this system (DSD playback is noisy).

The USB DAC is the same for both systems: it’s a Focusrite Scarlett Solo.

I suspect the problem lies with GStreamer, as the DSD content is also noisy with gst-play. Where should I go, and what should I examine? Has anyone else successfully played DSD files with Mopidy and/or gst-play? I believe that if I can solve this problem in Ubuntu, I will be able to implement the solution in my own embedded system.

Thanks!

Some information about the reference (Ubuntu) system:

Ubuntu 22.04 Server (up to date)
Kernel 5.15.0-87-generic
Mopidy 3.4.1
Gstreamer 1.20.3
gir1.2-gst-plugins-base-1.0
gir1.2-gstreamer-1.0
gstreamer1.0-alsa
gtreamer1.0-gl
gstreamer1.0-libav (as I know, this library is responsible for DSD decoding)
gstreamer1.0-plugins-base
gstreamer1.0-plugins-base-apps
gstreamer1.0-plugins-good
gstreamer1.0-plugins-ugly
gstreamer1.0-tools
gstreamer1.0-vaapi
gstreamer1.0-x
libgstreamer-gl1.0-0
libgstreamer-plugins-bad1.0-0
libgstreamer-plugins-base1.0-0
libgstreamer-plugins-good1.0-0
libgstreamer1.0-0
python3-gst-1.0

Relevant(?) part of mopidy.conf

I try to change the mixer options, and also use Mopidy-ALSAMixer extension, but no luck :frowning:

[audio]
mixer = software
mixer_volume =
output = alsasink
buffer_time =

[softwaremixer]
enabled = true

aplay -l

**** List of PLAYBACK Hardware Devices ****
card 1: USB [Scarlett Solo USB], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

mopidy deps

Executable: /usr/bin/mopidy
Platform: Linux-5.15.0-87-generic-x86_64-with-glibc2.35
Python: CPython 3.10.12 from /usr/lib/python3.10
Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
Mopidy-MusicBox-Webclient: 3.1.0 from /usr/local/lib/python3.10/dist-packages
Pykka: 2.0.3 from /usr/lib/python3/dist-packages
Mopidy: 3.4.1 from /usr/lib/python3/dist-packages
setuptools: 59.6.0 from /usr/lib/python3/dist-packages
GStreamer: 1.20.3.0 from /usr/lib/python3/dist-packages/gi
Detailed information:
Python wrapper: python-gi 3.42.1
Relevant elements:
Found:
uridecodebin
souphttpsrc
appsrc
alsasink
osssink
oss4sink
pulsesink
id3demux
id3v2mux
lamemp3enc
mpegaudioparse
mpg123audiodec
vorbisdec
vorbisenc
vorbisparse
oggdemux
oggmux
oggparse
flacdec
flacparse
shout2send
Not found:
flump3dec
mad

Never tried DSD. Gstreamer have forums at https://discourse.gstreamer.org/

Thanks! In the meantime, I found the solution, but unfortunately I have no idea why this fix the issue. By specifying the sink device as follows, the noise disappears:

gst-play-1.0 --audiosink=‘alsasink device=hw:CARD=1’ ./file.dsf

and in mopidy.conf:

[audio]
mixer = software
mixer_volume =
output = alsasink device=hw:CARD=1
buffer_time =

No other soundcard, DAC or any other alsa device/card in the system, so when the problem was present, it was the only device gstreamer could use. Strange…

I thought the card array was zero-based. What’s at card=0

You could compare the working and non-working gst-play commands with GST_DEBUG set and play a game of spot the difference.