native DSD and Pops/Clicks

Sub forums for various specialist XMOS applications. e.g. USB audio, motor control and robotics.
Post Reply
kasemann
Member
Posts: 11
Joined: Tue Dec 20, 2016 4:09 pm

native DSD and Pops/Clicks

Post by kasemann »

Hi there

As stated in this thread (http://www.xcore.com/viewtopic.php?f=37&t=5145) we have implemented the USB-audio functionality on an XUF208 and have succeeded so far. Most everything is working, including DSD support. But whenever the DSD-stream stops there are nasty pops or clicks. I have tried to corner this problem from various perspectives, but I could not solve it, yet.

I am guessing:
The problem arises from the fact, that the I2S/DSD clocks are stopped when playback is stopped (is that correct? - if so,why!!!) or I2S/DSD-Data_out is set to 0 when the track is paused ( is that correct? ). Both result in the DAC (an ESS Sabre model) reading zeros which in the DSD-case doesn't mean zero, but negative full-scale. That is also what I see on the oscilloscope.

I tried using the UserAudioStreamStop() functions to eliminate this problem (mute the DAC), but for two reasons that doesn't work properly:
  • UserAudioStreamStop() is called only a few hundred microseconds before the plop. I need about a millisecond to mute or otherwise kill the DAC output. Thus, I can shorten the plop, but it is still nasty of course.
  • Also, the UserAudioStreamStop() function does not seem to be called when the stream is paused. But there is a plop when the stream is paused.
Can the problem be solved where it arises? In other words - is there a possibility to continue writing 0xAAAAAAAA to the DSD out after the stream stopped? If so - how and where in the code?

Is there another way around this? Am I doing something wrong here?

You cannot possibly consider this normal behaviour - in my humble opinion the implementation is broken if it is only possible to enter or leave a DSD stream with a full-scale blow to the output....


User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am
Contact:

Post by mon2 »

kasemann
Member
Posts: 11
Joined: Tue Dec 20, 2016 4:09 pm

Post by kasemann »

yes - I've seen and read this post, but it is mostly about DOP, not native DSD - and it suggests using the UserAudioStreamStop() functions which I did and it did not help for the reasons beforementioned. Therefore the questions remain...
kasemann
Member
Posts: 11
Joined: Tue Dec 20, 2016 4:09 pm

Post by kasemann »

UPDATE:

I've measured the I2S signals under pause, stop and stream conditions (you might argue that I should have done this before and you would be right :) and it shows: Whenever the stream is paused or stopped, the port switches back to I2S mode - in other words: For a 2.8MHz DSD signal there is suddenly a 176.4kHz left-right clock on the dsd_data_1 port, zeros on data_2 and 11.2MHz on the bit clock (instead of 2.8MHz).

Where is this controlled in the source code? How can I replace this with 2.8MHz bit clock and 0xAAAAAAAA on both data outs?
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

This is odd. DoP of course drops out of DSD mode as soon as a non-DoP header is seen. However DSD native should remain in that mode (and will underflow with DSD silence word) until the stream format changes. This can only happen if the host sends the command:

Code: Select all

      else if(command == SET_STREAM_FORMAT_OUT)
                {
                    /* Off = 0
                     * DOP = 1
                     * Native = 2
                     */
                    dsdMode = inuint(c_mix_out);
                    curSamRes_DAC = inuint(c_mix_out);
inuint is getting a data token from upstream (which originates from the control endpoint). Is your host machine changing the alternate interface in USB when streaming DSD native stops?
Silas
Junior Member
Posts: 4
Joined: Wed Mar 25, 2015 2:49 pm

Post by Silas »

The method I use is to have a couple of hardware signals out from the XU208 that signal I2S/DSD and Mute to the DAC.
In extensions/audiohw.xc I mute the external DAC, switch the DAC between I2S and DSD/DoP by checking dsdMode, set the MCLK source, then unmute. With this the DAC is then happy when the source player application stops sending DSD over USB and reverts to I2S (so you don't need to generate additional mute DSD output in the XMOS).
User avatar
infiniteimprobability
XCore Legend
Posts: 1126
Joined: Thu May 27, 2010 10:08 am
Contact:

Post by infiniteimprobability »

This is the best way to do it - hardware mute on the DAC when doing anything other than streaming.

Still strange that the host flips between I2S and DSD when you stop on DSD, but the above would cover for that host behaviour
Post Reply