Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSD64 plays too fast if played after 96khz PCM #953

Closed
snake3ca opened this issue Sep 8, 2020 · 5 comments
Closed

DSD64 plays too fast if played after 96khz PCM #953

snake3ca opened this issue Sep 8, 2020 · 5 comments

Comments

@snake3ca
Copy link

snake3ca commented Sep 8, 2020

Bug report

Describe the bug

If you play a DSD64 track right after MPD starts up it plays too fast (Double speed). If you then play a 44.1khz file then go back to a DSD64 track it plays at the correct speed. If you then play a 96khz track then play another DSD64 track it plays too fast again. Issue happens with both Wavpack DSD and regular DSD.

Expected Behavior

DSD to play at correct speed.

Actual Behavior

DSD plays too fast when played after a 96khz track.

Version

Music Player Daemon 0.21.25 (0.21.25)
Copyright 2003-2007 Warren Dukes [email protected]
Copyright 2008-2018 Max Kellermann [email protected]
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

Storage plugins:
local

Decoders plugins:
[mpg123] mp3
[oggflac] ogg oga
[flac] flac
[dsdiff] dff
[dsf] dsf
[hybrid_dsd] m4a
[wavpack] wv
[pcm]

Filters:
soxr

Tag plugins:
id3tag

Output plugins:
null alsa

Input plugins:
file alsa

Playlist plugins:
extm3u m3u pls flac

Protocols:
alsa://

Other features:
epoll icu inotify tcp

Log

Sep 08 19:48 : playlist: play 0:"Police/(1978) Outlandos d'Amour (DSD64 2.8Mhz)/03 - Roxanne.wv"
Sep 08 19:48 : client: [12] command returned 0
Sep 08 19:48 : playlist: queue song 1:"Police/(1978) Outlandos d'Amour (DSD64 2.8Mhz)/09 - Be My Girl Sally.wv"
Sep 08 19:48 : decoder_thread: probing plugin wavpack
Sep 08 19:48 : decoder: audio_format=dsd64:2, seekable=true
Sep 08 19:48 : alsa_output: opened hw:0,0 type=HW
Sep 08 19:48 : alsa_output: buffer: size=24..131072 time=272..1486078
Sep 08 19:48 : alsa_output: period: size=12..65536 time=136..743039
Sep 08 19:48 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000
Sep 08 19:48 : alsa_output: format=DSD_U32_BE (Direct Stream Digital, 4-byte (x32), big endian, oldest bits in MSB)
Sep 08 19:48 : alsa_output: buffer_size=44100 period_size=11025
Sep 08 19:48 : output: opened "Topping D30 (#1)" (alsa) audio_format=dsd64:2

@snake3ca
Copy link
Author

snake3ca commented Sep 8, 2020

Here is the complete log

https://pastebin.com/n09TfQut

@MaxKellermann
Copy link
Member

In your logs, both plays of that DSD file look exactly the same. The ALSA setup is the same, the buffers are the same, the audio format is the same. From MPD's perspective, there is no difference. The only possible explanation I could give is a hardware driver or ALSA bug.
Does this happen every time you start MPD?
What if you play that FLAC file, stop playback, quickly restart MPD restart and quickly start playing DSD?

@snake3ca
Copy link
Author

snake3ca commented Sep 8, 2020

Yeah I couldnt notice any issue in the log output.

I have had the bug on both Debian 9.0 & Debian 10.0 and have tried several different kernels but it is possible its a driver or ALSA bug.

Yeah it happens everytime I start MPD which is usualy only when the computer reboots.

I played a 44.1khz flac then restarted MPD then quickly played a DSD and it played fine. Then playing a 96khz followed by a DSD64 caused it too play too fast again.

The playback time bar in the MPD clients also scrolls too fast along with the song when this happens.

I played a 3m 14s song and timed it and it took 2m 55s to play, so its not playing back at double speed but about 10% too fast.

This issue is also happening with DSD128.

This issue is not happening with DOP DSD playback.

@snake3ca
Copy link
Author

snake3ca commented Sep 8, 2020

Upon further testing the playback speed of DSD actually seems to vary from 10% to 50% speedup, it is slightly different everytime you play a song.

@MaxKellermann
Copy link
Member

I played a 44.1khz flac then restarted MPD then quickly played a DSD and it played fine

This strongly suggests that the bug is not in MPD, but rather in the device driver.

This issue is not happening with DOP DSD playback.

May because then the device driver doesn't know that it's DSD, because the DSD samples get tunneled inside PCM samples.

Report this problem to the driver authors, and if they believe it's MPD's fault, come back here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants