Page 1 of 1

DOP DSD64 over SpDif

Posted: Fri Sep 06, 2013 1:37 pm
by mmar
Based on http://www.xcore.com/projects/dsd-dop-over-spdif-rx

i open forum question as i write to project comment.
Have issue with SpdifReceive.S code .
It decode failure frame bits.

See image comment.
Waveform48_issue.PNG

Re: DOP DSD64 over SpDif

Posted: Sun Sep 08, 2013 12:49 pm
by Ross
Hello,

Sorry I cannot understand the issue or the project description. Also, the source code zip is actually just a PNG file. Please upload your source code if you would like assistance.

Re: DOP DSD64 over SpDif

Posted: Mon Sep 09, 2013 8:03 am
by mmar
Ok Ross i add code parts to project.

DSP thread code work with spdif rx as first in function static void getSamplesFromHost(streaming chanend c).
This is send to audio and scoped as on image.

In test wav file we have samples repeat, but on scope is errors.

Re: DOP DSD64 over SpDif

Posted: Thu Sep 12, 2013 10:58 am
by mmar
Sorry i have mistake in wav , we mix hex and dec
decode work ok, but pcm is jittered and not playable.

PS: Code is downloadable from project page.

Re: DOP DSD64 over SpDif

Posted: Fri Sep 13, 2013 7:31 pm
by mmar
This SpdifReceive have requirments for 80Mips thread.

I plan make dualboot xs mode,
one for usb audio and second for spdif.

How this i can compile or better question is how this write to main?

All audio and Spdif use 7 threads, that is out of 80 on 500Mips L1.

Re: DOP DSD64 over SpDif

Posted: Wed Sep 18, 2013 4:21 pm
by Ross
This is probably worth its own thread, but this example should help you out:

https://github.com/xcore/sw_flash_multiboot_example

Basically create your two applications, and use a boot-loader in flash to decide which image to boot (based on a input such as a switch)

Re: DOP DSD64 over SpDif

Posted: Sat Sep 21, 2013 9:29 pm
by mmar
Thanks Ross,
i plan this boot as last resort. Now i try inbuild endpoint and spdifrx into one core,
and set usb pin to reset when rx is in progress. Next core buffer i suspend to wait event.
This for spdif makes only 5 cores active on time.each 100 MHz i mean.

I need help with method for detection of spdif samplerate actual and changes.

Re: DOP DSD64 over SpDif

Posted: Tue Sep 24, 2013 10:23 am
by Ross
mmar wrote: I need help with method for detection of spdif samplerate actual and changes.
You can just count samples in a given period?

Re: DOP DSD64 over SpDif

Posted: Tue Sep 24, 2013 5:10 pm
by mmar
Yeap as simple, yes i try count or timer this.

Second query is for starting of spdif mode. I plan detect on spdif_rx port 1 bit with buffering 4.
But this port is assigned to core spdifreceive, and if i need in other thread this pin , compiler say no no no...

Is any choice to do this in xc, or i need use asm and some as PEEK port?

In detection thread i only detect full zero / full one / spdif signal by this code now:
case p_spdif_rx when pinsneq(0) :> eventb:

tdfu=500000;temp=0;
while(tdfu--) {p_spdif_rx :> eventb;
temp+=eventb;}

if(temp==500000) // power off signal full one
{
rstUSB(); // off driver usb

p_spdif_rx when pinsneq(1) :> eventb;

device_reboot();
}

...... for detect not full zero or one switch to spdif mode over chan to thread xx?
break;

Re: DOP DSD64 over SpDif

Posted: Fri Oct 04, 2013 11:23 am
by Ross
This doesn't sound like a good approach. Why not check for valid S/PDIF samples from the S/PDIF Rx thread of over the channel - you can check the parity, something like:

Code: Select all

while(1)
{
    /* Receive sample from S/PDIF RX thread (steaming chan) */
    c_spdif_rx :> tmp:
                
    /* Check parity and ignore if bad */
    if(badParity(tmp))
       continue;
    else
    {
        /* Valid S/PDIF sample received.. handle it..*/
    }
where badParity() looks something like:

Code: Select all

static inline int badParity(unsigned x)
{
    unsigned X = (x>>4);
    crc32(X, 0, 1);
    return X & 1;
}