DSD silence pattern" (e.g. 0x69) instead of "zeros"

Discuss client development (or even MPD development if you feel so inclined), ask questions about the client libs, MPD feature requests from client developers, etc...
Post Reply
VAMP
Posts: 12
Joined: June 28th, 2016, 4:35 pm

DSD silence pattern" (e.g. 0x69) instead of "zeros"

Post by VAMP » June 28th, 2016, 4:40 pm

Hi! I speak about it on ixbt forum, so besides bug tracker, was asked to write issue here!

I ask Daphile developer!
How he create DoP/DSD support without clics/pops! And he tell:


You have to study DoP format specification. You also have to understand that you may not use zero bits for padding in the last frame of the stream (between tracks). If you handle DoP encoding track by track, then you must use such a padding that don't cause audible clicks. Search Internet for DSD silence patterns (eg. 0x69).

ALSO fow question how to do this, he says

Any competent developer should be able implement it as long as she/he understands to use "DSD silence pattern" (e.g. 0x69) instead of "zeros" for padding the incomplete DoP frames.

ALSO

I found some info in his patches

if (d->sample_bytes && bytes >= (2 * d->sample_bytes)) {
// byte(s) left fill frame with silence byte(s) and play
int i;
for (i = d->sample_bytes; i < bytes_per_frame; i++)
*(iptrl + i) = *(iptrr + i) = 0x69;
frames = 1;
} else {
// should not get here due to wrapping m/2 for dsd should never result in 0 as header len is always even
LOG_INFO("frames got to zero");
return DECODE_COMPLETE;
}


// fill silence buffer with 10101100 which represents dsd silence
void dsd_silence_frames(u32_t *ptr, frames_t frames) {
while (frames--) {
*ptr++ = 0x69696969;
*ptr++ = 0x69696969;
}
}

If you have any question i can ask him!

PS. Can you also add support DSD_U32_LE for new version of MPD?

tortuga_Bob
Posts: 7
Joined: December 7th, 2015, 11:26 pm

Re: DSD silence pattern" (e.g. 0x69) instead of "zeros"

Post by tortuga_Bob » June 29th, 2016, 1:46 pm

Are you aware that some (many?) DSD recordings contain "pops" or "ticks" in between tracks? These sounds are part of the recording and will be heard irrespective of the music player used. I don't know if this has any relevance to your post, but I thought that I would mention it. BTW, this "pops" are also retained if the DSD recording is converted to PCM format.

VAMP
Posts: 12
Joined: June 28th, 2016, 4:35 pm

Re: DSD silence pattern" (e.g. 0x69) instead of "zeros"

Post by VAMP » June 29th, 2016, 7:13 pm

The problems, which I wrote, appear only when manual rewinding and switch. So you're a bit out of topic! 8-)

VAMP
Posts: 12
Joined: June 28th, 2016, 4:35 pm

Re: DSD silence pattern" (e.g. 0x69) instead of "zeros"

Post by VAMP » July 29th, 2016, 10:23 am

With DSD, the “silence” pattern is now 0x69 instead of 0x00. Thank you!
Are this add to the git version? :roll:

VAMP
Posts: 12
Joined: June 28th, 2016, 4:35 pm

Re: DSD silence pattern" (e.g. 0x69) instead of "zeros"

Post by VAMP » August 14th, 2016, 10:04 am

I try to test with DSD files and compare new version without this addon, and new version!
Nevermind - click`s are in both versions((
:cry: :cry: :cry: :cry:

Code: Select all

 if (d->sample_bytes && bytes >= (2 * d->sample_bytes)) {
                // byte(s) left fill frame with silence byte(s) and play
                int i;
                for (i = d->sample_bytes; i < bytes_per_frame; i++)
                    *(iptrl + i) = *(iptrr + i) = 0x69;
                 frames = 1;
             } else {
                // should not get here due to wrapping m/2 for dsd should never result in 0 as header len is always even
                 LOG_INFO("frames got to zero");
                 return DECODE_COMPLETE;
             }


 // fill silence buffer with 10101100 which represents dsd silence
 void dsd_silence_frames(u32_t *ptr, frames_t frames) {
     while (frames--) {
         *ptr++ = 0x69696969;
         *ptr++ = 0x69696969;
     }
 }
for new version of MPD but id does not help ((((
CRY ((

https://www.musicpd.org/news/2016/07/mp ... -released/

With DSD, the “silence” pattern is now 0x69 instead of 0x00.
Change log

Code: Select all

extern void dsd2pcm_reset(dsd2pcm_ctx* ptr)
{
	int i;
	for (i=0; i<FIFOSIZE; ++i)
		ptr->fifo[i] = 0x69; /* my favorite silence pattern */
	ptr->fifopos = 0;
	/* 0x69 = 01101001
	 * This pattern "on repeat" makes a low energy 352.8 kHz tone
	 * and a high energy 1.0584 MHz tone which should be filtered
	 * out completely by any playback system --> silence
	 */
}
Silence.cxx

Code: Select all

void
PcmSilence(WritableBuffer<void> dest, SampleFormat format)
{
	uint8_t pattern = 0;
	if (format == SampleFormat::DSD)
		pattern = 0x69;

	memset(dest.data, pattern, dest.size);
}

VAMP
Posts: 12
Joined: June 28th, 2016, 4:35 pm

Re: DSD silence pattern" (e.g. 0x69) instead of "zeros"

Post by VAMP » August 15th, 2016, 2:34 pm

I like to understand what to do in the new version. DSD, the "silence" pattern is now 0x69 - is added to dsd2pcm codec - which operates in the DSD mode - the PCM and works as DOP disabled. Now, when I listen to the DoP mode = off clicks in the sound is not!
How to add this for DOP mode? Not for DSD-PCM convert! :cry:

tuxx
Posts: 16
Joined: March 21st, 2015, 5:21 pm

Re: DSD silence pattern" (e.g. 0x69) instead of "zeros"

Post by tuxx » April 25th, 2017, 1:26 pm

Just a quick question because my coding knowledge is almost zero.

I noticed that months ago the silence pattern was changed to 0x69. Does this affect DoP or is it only for native DSD?

I keep getting pops/clicks when I change tracks using DoP and I am trying to understand if MPD should block this noise or not.

I did my tests with latest self-compiled MPD 0.20.6.

Many thanks in advance.

P.S. My dac is Aune S16

tuxx
Posts: 16
Joined: March 21st, 2015, 5:21 pm

Re: DSD silence pattern" (e.g. 0x69) instead of "zeros"

Post by tuxx » January 4th, 2018, 9:49 am

I've done some tests with 2 devices:

- 9018k2m DIY Dac with Diyinhk XMOS USB board
- Aune S16 (XMOS based)

Transport: Latest ArchlinuxARM with Odroid C2 (kernel 4.14.10) and official self-compiled MPD 0.20.14.


- With the DIY dac everything is fine in both DoP and Native DSD mode. I used it after more than a year ago and I remember having pops/clicks (the usual effects of wrong dsd silence) with DSD. As it seems both MPD and alsa fixes* worked for this device.

- With the Aune S16 DSD reproduction is not ok. It's an XMOS based dac and this implementation only supports DoP. I am still getting (very loud) pops and clicks when switching DSD tracks, repositioning within the track etc..

It's a little bit confusing for me to see that all these patches fixed the issues with the DIY dac but not with the Aune S16. I assume that the appropriate DSD silence is not enough (or not affecting DoP completely) and something is wrong with the implementation of my device.

*Apart from the MPD silence code, there's also an Alsa patch (upstream long ago) that in theory should fix these kind of issues but as I understand it's for native DSD only and not DoP.:

https://www.spinics.net/lists/alsa-devel/msg57771.html


-----

- mpd --version --> http://paste.debian.net/1003527/
- mpd.conf --> http://paste.debian.net/1003528/
- mpd verbose log (Aune S16 with DoP enabled)--> http://paste.debian.net/1003530/

Post Reply