Moode Forum
[PROBLEM] MPD fails to play DSD on PCM DAC (7.3) - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: Support (https://moodeaudio.org/forum/forumdisplay.php?fid=7)
+--- Thread: [PROBLEM] MPD fails to play DSD on PCM DAC (7.3) (/showthread.php?tid=4175)



MPD fails to play DSD on PCM DAC (7.3) - gooko - 09-01-2021

Hello, new user here Wink
I'm trying to use version 7.3 with a mix of my Flac 16/44.1, 24/96 and vynil rips DSD64/128
My main DAC works nicely (it's 32/384 PCM and DSD256 capable).

I'm having problems with a second dac in my basement which is only 24/96 PCM capable. I have the same issue with the raspberry pi3b+ audio out.

When playing DSD files I must enable sox resampling to 24/96 (or anything) or I get no audio out from the dac or pi analog output.
It looks like mpd is having issues with the on-the-fly pcm encoding if the DAC is not DSD capable.

I tried a combination of options for mpd/alsa/sox but my preferred way would be to use the hardware mixer and play as much in bit-perfect mode as possible.

The error I get when disabling SOX is
Code:
exception: Failed to open "ALSA Default" (alsa); Error opening ALSA device "_audioout"; snd_pcm_hw_params() failed: Invalid argument

The DAC is "Sharkoon Gaming DAC Pro S", ID be57:020e. It supports 44.1, 48 and 96 sampling and 16 or 24 bit resolution.


In mpd restart, mpd complains like so:
Code:
config: Missing audio_format, without selective_resample_mode is deactivated.

and my mpd.conf looks like this:
Code:
music_directory "/var/lib/mpd/music"
playlist_directory "/var/lib/mpd/playlists"
db_file "/var/lib/mpd/database"
log_file "/var/log/mpd/log"
pid_file "/var/run/mpd/pid"
state_file "/var/lib/mpd/state"
sticker_file "/var/lib/mpd/sticker.sql"
user "mpd"
group "audio"
bind_to_address "any"
port "6600"
log_level "default"
restore_paused "yes"
auto_update "no"
follow_outside_symlinks "yes"
follow_inside_symlinks "yes"
zeroconf_enabled "no"
zeroconf_name "Moode MPD"
filesystem_charset "UTF-8"
metadata_to_use "+comment"
replaygain "off"
replaygain_preamp "0"
volume_normalization "no"
audio_buffer_size "8192"
max_output_buffer_size "131072"
selective_resample_mode "8"
max_playlist_length "16384"
max_connections "128"

decoder {
plugin "ffmpeg"
enabled "yes"
}

input {
plugin "curl"
}

input_cache {
size "128 MB"
}

resampler {
plugin "soxr"
quality "very high"
threads "0"
}

audio_output {
type "alsa"
name "ALSA Default"
device "_audioout"
mixer_type "hardware"
mixer_control "PCM"
mixer_device "hw:2"
mixer_index "0"
dop "no"
}

audio_output {
type "alsa"
name "ALSA Bluetooth"
device "_audioout"
mixer_type "software"
}

audio_output {
type "httpd"
name "HTTP Server"
port "8000"
encoder "flac"
compression "0"
tags "yes"
always_on "yes"
}

Is this an issue I can fix or is it with moode/mpd/alsa related?

PS: After more fiddling, it looks like if I disable alsa (use direct hw) mpd will actually play DSD, altough at a much lower volume when I use the hardware mixer or at near-max volume when I use the software mixer (?!??!)

Any hints on how to proceed from here?


RE: MPD fails to play DSD on PCM DAC (7.3) - Tim Curtis - 09-01-2021

The MPD message is just an info message but I agree it comes across as some sort of error. I'll mention it to @bitlab since I think its part of the selective resampling enhancement that he maintains.

For the DSD issue try setting ALSA output mode to "Direct (hw)" in Audio Config. Set DSD support to "Native" and turn SoX resampling off in MPD config.

You should get DSD to PCM on-the-fly conversion with these settings.


RE: MPD fails to play DSD on PCM DAC (7.3) - gooko - 09-01-2021

Hi Tim, I figured I needed to set the "Direct (hw)" path and press "set". What put me off is that I'm using hardware mixer (listening in a headphone for tests) and the DSD volume is way down when compared to the native PCM files. Also, when I set it to software mixer, I cannot set the volume. It stays at 100 in this case. But this is to be expected.

The rest has been a piece of cake. Nice !

If I may: looking at the network, I noticed that a lot of php-fpm processes are listening on the default address (0.0.0.0) all interfaces. Not sure why that is as the php-fpm pool directive is set properly to listen on the unix socket only.


RE: MPD fails to play DSD on PCM DAC (7.3) - Tim Curtis - 09-01-2021

I dunno. I don't think it's an issue but I'm not a PHP expert and so if you can suggest some configuration changes I'll try them out.

For DSD format the only configuration where MPD Hardware volume will work is if the audio device has the capabilities listed below.
1. Hardware volume controller
2. Either DoP or Native DSD bitstream support
3. DAC chip performs volume attenuation during some part of digitally filtering DSD format

There are number of DACS that do this including Audiophonics 9028/9038 DAC, Allo Katana, Revolution and Boss2 DAC's, Several Topping models, other USB DAC's, etc.