MusicPlayerDaemon / MPD

Music Player Daemon
https://www.musicpd.org/
GNU General Public License v2.0
2.11k stars 338 forks source link

DSD Native not working #2012

Closed Emilot closed 3 months ago

Emilot commented 3 months ago

Bug report

Describe the bug

Playing a DSD file (dff or dsf) always return dac to PCM mode, even if DAC is capable of playing DSD files Native.

Expected Behavior

Play Native DSD

Actual Behavior

Return PCM mode. DAC is capable to play DSD files native and it uses Thesycon driver (which is implemented in Kernel under device id 0x152a)

Version

Music Player Daemon 0.23.14 (0.23.14) Copyright 2003-2007 Warren Dukes warren.dukes@gmail.com Copyright 2008-2021 Max Kellermann max.kellermann@gmail.com This is free software; see the source for copying conditions. There is NO warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Database plugins: simple proxy upnp

Storage plugins: local udisks curl

Neighbor plugins: upnp udisks

Decoders plugins: [mad] mp3 mp2 [oggflac] ogg oga [flac] flac [sndfile] wav aiff aif au snd paf iff svx sf voc w64 pvf xi htk caf sd2 [audiofile] wav au aiff aif [dsdiff] dff [dsf] dsf [hybrid_dsd] m4a [faad] aac [wavpack] wv [openmpt] mptm mod s3m xm it 669 amf ams c67 dbm digi dmf dsm dtm far imf ice j2b m15 mdl med mms mt2 mtm nst okt plm psm pt36 ptm sfx sfx2 st26 stk stm stp ult wow gdm mo3 oxm umx xpk ppm mmcmp [ffmpeg] 16sv 3g2 3gp 4xm 8svx aa3 aac ac3 adx afc aif aifc aiff al alaw amr anim apc ape asf atrac au aud avi avm2 avs bap bfi c93 cak cin cmv cpk daud dct divx dts dv dvd dxa eac3 film flac flc fli fll flx flv g726 gsm gxf iss m1v m2v m2t m2ts m4a m4b m4v mad mj2 mjpeg mjpg mka mkv mlp mm mmf mov mp+ mp1 mp2 mp3 mp4 mpc mpeg mpg mpga mpp mpu mve mvi mxf nc nsv nut nuv oga ogm ogv ogx oma ogg omg opus psp pva qcp qt r3d ra ram rl2 rm rmvb roq rpl rvc shn smk snd sol son spx str swf tak tgi tgq tgv thp ts tsp tta xa xvid uv uv2 vb vid vob voc vp6 vmd wav webm wma wmv wsaud wsvga wv wve rtp:// rtsp:// rtsps:// [pcm]

Filters: soxr

Tag plugins: id3tag

Output plugins: null fifo pipe alsa

Input plugins: file io_uring alsa qobuz curl ffmpeg

Playlist plugins: extm3u m3u pls xspf asx rss flac cue embcue

Protocols: file:// alsa:// ftp:// ftps:// gopher:// hls+http:// hls+https:// http:// https:// mmsh:// mmst:// qobuz:// rtmp:// rtmpe:// rtmps:// rtmpt:// rtmpte:// rtp:// rtsp:// rtsps:// scp:// sftp:// smb:// srtp://

Other features: avahi dbus udisks epoll icu inotify systemd tcp un

Configuration

follow_outside_symlinks "yes" follow_inside_symlinks "yes" db_file "/var/lib/mpd/mpd.db" log_file "/var/log/mpd.log" music_directory "/var/lib/mpd/music" playlist_directory "/var/lib/mpd/playlists" state_file "/var/lib/mpd/mpdstate" sticker_file "/var/lib/mpd/sticker.sql" user "mpd" bind_to_address "any" bind_to_address "/run/mpd/socket" port "6600" log_level "verbose" volume_normalization "no" audio_buffer_size "4096" filesystem_charset "UTF-8" auto_update "no" mixer_type "disabled" group "audio" max_connections "20" restore_paused "yes"

input_cache { size "1 GB" }

decoder { plugin "ffmpeg" enabled "yes" }

input { plugin "curl" }

resampler {

plugin "soxr"

quality "very high"

}

audio_output { enabled "yes" type "alsa" name "USB Audio" device "hw:0,0"

use the line below when enabling sox resampler

the lines below are just some examples

format "192000:24:2"

format ":24:"

auto_resample "no" auto_channels "no" auto_format "no" dop "no" stop_dsd_silence "yes" thesycon_dsd_workaround "yes" }

Log

Mar 23 01:29 : client: [4] process command "status" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "currentsong" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "playlistinfo "1"" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "status" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "currentsong" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "playlistinfo "1"" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [0] process command "status" Mar 23 01:29 : client: [0] command returned 0 Mar 23 01:29 : client: [0] process command "idle database stored_playlist playlist player mixer output options update partition" Mar 23 01:29 : client: [0] command returned 1 Mar 23 01:29 : client: [4] process command "status" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "currentsong" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "playlistinfo "1"" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [0] process command "stop" Mar 23 01:29 : playlist: stop Mar 23 01:29 : player: played "nas-samba/SACD/Michael Jackson - Thriller (1982)/04 - Thriller.dff/2C_AUDIOTRACK001.dff" Mar 23 01:29 : output: closed "MY DAC" (alsa) Mar 23 01:29 : client: [0] command returned 0 Mar 23 01:29 : client: [0] process command "idle database stored_playlist playlist player mixer output options update partition" Mar 23 01:29 : client: [0] command returned 1 Mar 23 01:29 : client: [4] process command "status" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [2] process command "sticker "set" "song" "nas-samba/SACD/Michael Jackson - Thriller (1982)/04 - Thriller.dff/2C_AUDIOTRACK001.dff" "elapsed" "10"" Mar 23 01:29 : client: [2] command returned 0 Mar 23 01:29 : client: [4] process command "currentsong" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [2] process command "idle sticker" Mar 23 01:29 : client: [2] command returned 1 Mar 23 01:29 : client: [0] process command "status" Mar 23 01:29 : client: [0] command returned 0 Mar 23 01:29 : client: [4] process command "playlistinfo "1"" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [0] process command "idle database stored_playlist playlist player mixer output options update partition" Mar 23 01:29 : client: [0] command returned 1 Mar 23 01:29 : client: [2] process command "idle sticker" Mar 23 01:29 : client: [2] command returned 1 Mar 23 01:29 : client: [0] process command "idle database stored_playlist playlist player mixer output options update partition" Mar 23 01:29 : client: [0] command returned 1 Mar 23 01:29 : client: [0] process command "play" Mar 23 01:29 : playlist: play 0:"nas-samba/SACD/Michael Jackson - Thriller (1982)/04 - Thriller.dff/2C_AUDIOTRACK001.dff" Mar 23 01:29 : client: [0] command returned 0 Mar 23 01:29 : client: [0] process command "idle database stored_playlist playlist player mixer output options update partition" Mar 23 01:29 : client: [0] command returned 1 Mar 23 01:29 : decoder_thread: probing plugin sacdiso Mar 23 01:29 : decoder: audio_format=dsd64:2, seekable=true Mar 23 01:29 : alsa_output: opened hw:0,0 type=HW Mar 23 01:29 : alsa_output: Playing some 44.1 kHz silence Mar 23 01:29 : client: [2] process command "sticker "set" "song" "nas-samba/SACD/Michael Jackson - Thriller (1982)/04 - Thriller.dff/2C_AUDIOTRACK001.dff" "elapsed" "0"" Mar 23 01:29 : client: [2] command returned 0 Mar 23 01:29 : client: [6] process command "idle playlist player mixer options" Mar 23 01:29 : client: [6] command returned 1 Mar 23 01:29 : client: [2] process command "idle sticker" Mar 23 01:29 : client: [2] command returned 1 Mar 23 01:29 : client: [0] process command "status" Mar 23 01:29 : alsa_output: buffer: size=16..88200 time=362..2000000 Mar 23 01:29 : alsa_output: period: size=8..44100 time=181..1000000 Mar 23 01:29 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000 Mar 23 01:29 : alsa_output: format=DSD_U32_BE (Direct Stream Digital, 4-byte (x32), big endian, oldest bits in MSB) Mar 23 01:29 : alsa_output: buffer_size=22050 period_size=5513 Mar 23 01:29 : output: opened "MY DAC" (alsa) audio_format=dsd32:2 Mar 23 01:29 : soxr: soxr engine 'cr32' Mar 23 01:29 : soxr: soxr precision=20, phase_response=50.00, passband_end=0.91, stopband_begin=1.00 Mar 23 01:29 : soxr: samplerate conversion ratio to 0.50 Mar 23 01:29 : exception: Failed to convert for "MY DAC" (alsa); PCM conversion from f to dsd is not implemented Mar 23 01:29 : output: Retrying without DSD Mar 23 01:29 : alsa_output: opened hw:0,0 type=HW Mar 23 01:29 : alsa_output: buffer: size=90..705600 time=255..2000000 Mar 23 01:29 : alsa_output: period: size=45..352800 time=127..1000000 Mar 23 01:29 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000 Mar 23 01:29 : alsa_output: format=S24_3LE (Signed 24 bit Little Endian in 3bytes) Mar 23 01:29 : alsa_output: buffer_size=176400 period_size=44100 Mar 23 01:29 : output: opened "MY DAC" (alsa) audio_format=352800:24:2 Mar 23 01:29 : output: converting in=dsd64:2 -> f=dsd64:2 -> out=352800:24:2 Mar 23 01:29 : client: [0] command returned 0 Mar 23 01:29 : client: [4] process command "status" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [0] process command "idle database stored_playlist playlist player mixer output options update partition" Mar 23 01:29 : client: [0] command returned 1 Mar 23 01:29 : client: [2] process command "idle sticker" Mar 23 01:29 : client: [2] command returned 1 Mar 23 01:29 : client: [0] process command "idle database stored_playlist playlist player mixer output options update partition" Mar 23 01:29 : client: [0] command returned 1 Mar 23 01:29 : client: [4] process command "currentsong" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "playlistinfo "1"" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "status" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "currentsong" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "playlistinfo "1"" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [6] process command "idle playlist player mixer options" Mar 23 01:29 : client: [6] command returned 1 Mar 23 01:29 : client: [4] process command "status" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "currentsong" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "playlistinfo "1"" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "status" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "currentsong" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "playlistinfo "1"" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "status" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [6] process command "idle playlist player mixer options" Mar 23 01:29 : client: [6] command returned 1 Mar 23 01:29 : client: [4] process command "currentsong" Mar 23 01:29 : client: [4] command returned 0 Mar 23 01:29 : client: [4] process command "playlistinfo "1"" Mar 23 01:29 : client: [4] command returned 0

Thanx!!

Emilot commented 3 months ago

aplay --dump-hw-params -D hw:0,0 -f cd /dev/zero Playing raw data '/dev/zero' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo HW Params of device "hw:0,0":

ACCESS: MMAP_INTERLEAVED RW_INTERLEAVED FORMAT: S16_LE S32_LE SPECIAL S24_3LE DSD_U32_BE SUBFORMAT: STD SAMPLE_BITS: [16 32] FRAME_BITS: [32 64] CHANNELS: 2 RATE: [44100 768000] PERIOD_TIME: [125 1000000] PERIOD_SIZE: [8 768000] PERIOD_BYTES: [64 6144000] PERIODS: [2 1024] BUFFER_TIME: (20 2000000] BUFFER_SIZE: [16 1536000] BUFFER_BYTES: [64 12288000] TICK_TIME: ALL

coroner21 commented 3 months ago

I believe you should disable resampling for DSD to work. You can see from the log file that ALSA is first opened for dsd but then it falls back to pcm due to resampling.

Emilot commented 3 months ago

I agree but where is resampling enabled?

it has # to all resample block (here as i see is with bold letters but it is there in mpd.conf)

MaxKellermann commented 3 months ago

You can't enable resampling, the hint was wrong. MPD will resample only if you tell it to or if it is necessary.

You are trying to play a DSD64 file but your DAC is incapable of doing that; the best appromixation your DAC allows is DSD32. MPD even explained that to you in the error message, didn't you see that?

This problem is in your DAC, not in MPD.

Emilot commented 3 months ago

You can't enable resampling, the hint was wrong. MPD will resample only if you tell it to or if it is necessary.

You are trying to play a DSD64 file but your DAC is incapable of doing that; the best appromixation your DAC allows is DSD32. MPD even explained that to you in the error message, didn't you see that?

This problem is in your DAC, not in MPD.

Hmmm....

Nope. DAC can play up to 512DSD.

Emilot commented 3 months ago

Mar 23 17:58 : client: [2] process command "sticker "set" "song" "nas-samba/SACD/Michael Jackson - Thriller (1982)/04 - Thriller.dff/2C_AUDIO__TRACK001.dff" "elapsed" "244"" Mar 23 17:58 : client: [2] command returned 0 Mar 23 17:58 : client: [1] process command "status" Mar 23 17:58 : client: [1] command returned 0 Mar 23 17:58 : client: [3] opened from ::ffff:127.0.0.1:56080 Mar 23 17:58 : client: [4] opened from local Mar 23 17:58 : client: [2] process command "idle sticker" Mar 23 17:58 : client: [2] command returned 1 Mar 23 17:58 : client: [0] process command "status" Mar 23 17:58 : client: [0] command returned 0 Mar 23 17:58 : client: [4] process command "play" Mar 23 17:58 : alsa_output: opened hw:0,0 type=HW Mar 23 17:58 : alsa_output: buffer: size=24..176400 time=272..2000000 Mar 23 17:58 : alsa_output: period: size=12..88200 time=136..1000000 Mar 23 17:58 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000 Mar 23 17:58 : alsa_output: format=DSD_U32_BE (Direct Stream Digital, 4-byte (x32), big endian, oldest bits in MSB) Mar 23 17:58 : alsa_output: buffer_size=44100 period_size=11025 Mar 23 17:58 : output: opened "MY DAC" (alsa) audio_format=dsd64:2 Mar 23 17:58 : client: [4] command returned 0 Mar 23 17:58 : client: [1] process command "currentsong" Mar 23 17:58 : client: [1] command returned 0 Mar 23 17:58 : client: [4] process command list Mar 23 17:58 : client: process command "status" Mar 23 17:58 : client: command returned 0 Mar 23 17:58 : client: process command "currentsong" Mar 23 17:58 : client: command returned 0

This is the correct data. All i was did is to disable "thesycon_dsd_workaround" option.

So i guess is your turn now Max.

Thanx!

Emilot commented 3 months ago

Please re-open this issue Max and let me know if you need from me to provide anything else...

Thank you

MaxKellermann commented 3 months ago

No, there's nothing to discuss here. MPD is working as designed, and you did not provide any data that demonstrates otherwise. Now please stop spamming me here.