DOP DSD64 over SpDif

XCore Project reviews, ideas, videos and proposals.
mmar
Active Member
Posts: 52
Joined: Fri Jul 05, 2013 5:55 pm

DOP DSD64 over SpDif

Postby mmar » Fri Sep 06, 2013 1:37 pm

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
(42.13 KiB) Not downloaded yet
Waveform48_issue.PNG
(42.13 KiB) Not downloaded yet
User avatar
Ross
XCore Expert
Posts: 761
Joined: Thu Dec 10, 2009 9:20 pm

Postby Ross » Sun Sep 08, 2013 12:49 pm

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.
mmar
Active Member
Posts: 52
Joined: Fri Jul 05, 2013 5:55 pm

Postby mmar » Mon Sep 09, 2013 8:03 am

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.
mmar
Active Member
Posts: 52
Joined: Fri Jul 05, 2013 5:55 pm

Postby mmar » Thu Sep 12, 2013 10:58 am

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.
mmar
Active Member
Posts: 52
Joined: Fri Jul 05, 2013 5:55 pm

Postby mmar » Fri Sep 13, 2013 7:31 pm

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.
User avatar
Ross
XCore Expert
Posts: 761
Joined: Thu Dec 10, 2009 9:20 pm

Postby Ross » Wed Sep 18, 2013 4:21 pm

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)
mmar
Active Member
Posts: 52
Joined: Fri Jul 05, 2013 5:55 pm

Postby mmar » Sat Sep 21, 2013 9:29 pm

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.
User avatar
Ross
XCore Expert
Posts: 761
Joined: Thu Dec 10, 2009 9:20 pm

Postby Ross » Tue Sep 24, 2013 10:23 am

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


You can just count samples in a given period?
mmar
Active Member
Posts: 52
Joined: Fri Jul 05, 2013 5:55 pm

Postby mmar » Tue Sep 24, 2013 5:10 pm

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;
User avatar
Ross
XCore Expert
Posts: 761
Joined: Thu Dec 10, 2009 9:20 pm

Postby Ross » Fri Oct 04, 2013 11:23 am

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;
}

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 9 guests