Page 1 of 1

How to enable DSD_Native on XS1-L1 ?

Posted: Tue Nov 21, 2017 2:40 pm
by xP0W3R
Hi everyone,

I'm new in this community.
Here is my problem, I downloaded the latest release of the software "sw_usb_audio-[sw]_6.15.2rc1" and tried to build a project.
No matter witch one I picked I've got the same errors :

Code: Select all

initializer element is not constant	main.xc	/module_usb_audio	line 121	C/C++ Problem
use of undeclared identifer `PORT_MCLK_COUNT'	main.xc	/module_usb_audio	line 121	C/C++ Problem
I don't know what to do to solve this issue...

For now, someone from outside of my company do the program but we would like to be able to do it on our own.
We would like to be able to do a program for a XS1-L1A-TQ128 and perhaps in the future a XU208-128-TQ64.

Re: issue with module_usb_audio

Posted: Wed Nov 22, 2017 11:26 am
by xP0W3R
I solved the problem !
I might have changed some lines when I was trying something.

And now I have a new issue I don't understand how to enable the DSD NATIVE mode. For now it works in DoP mode.

Re: How to enable DSD_Native on XS1-L1 ?

Posted: Thu Nov 23, 2017 8:44 am
by xP0W3R
Problem solved with the help of 'AN00103'.

New issue !
I want to put a 'dsd_indicator' to show if we run in dsd native or not.
The 'dsd_indicator' is declared to output on port 32A.
As show :

Code: Select all

port32A.h

#ifndef _PORT32A_OUT_
#define _PORT32A_OUT_

/* Bit defs */
#define P32A_USB_RST       0x01           /* ULPI rst line */
#define P32A_COD_RST       0x02           /* Codec rst line */
#define P32A_CLK_SEL       0x04           /* MClk Select line */
#define P32A_LED_A         0x08           /* LED A */
#define P32A_DSD_IND       0x10           /* DSD Indicator */
#define P32A_LED_B         0x20           /* LED B */

#endif
For now, it works when I playback a dsd file. It illuminate a led connected to 'P32A_DSD_IND' and then when I playback a file other than dsd the led extinguished.
But I want also to extinguish the led when I have no playback and here is my issue. I tried when using 'UserAudioStreamStop()' and it didn't work.

Code: Select all

audio.xc

    /* Main Audio I/O loop */
    while (1)
    {
#if (DSD_CHANS_DAC != 0) && (NUM_USB_CHAN_OUT > 0)
        if(dsdMode == DSD_MODE_NATIVE)
        {
            asm("peek %0, res[%1]":"=r"(x):"r"(XS1_PORT_32A));
            x |= P32A_DSD_IND;
            asm("out res[%0], %1"::"r"(XS1_PORT_32A),"r"(x));
        }
        else
        {
            asm("peek %0, res[%1]":"=r"(x):"r"(XS1_PORT_32A));
            x &= (~P32A_DSD_IND);
            x |= P32A_LED_A;
            asm("out res[%0], %1"::"r"(XS1_PORT_32A),"r"(x));
        }
#endif

Code: Select all

audiostream.xc

void UserAudioStreamStop(void)
{
    int x;

    /* Peek at current port value using port 32A resource ID */
    asm("peek %0, res[%1]":"=r"(x):"r"(XS1_PORT_32A));
    // x &= (~P32A_LED_B);
    x &= (~P32A_DSD_IND);
    /* Output to port */
    asm("out res[%0], %1"::"r"(XS1_PORT_32A),"r"(x));
}
If you have any suggestions to help me doing it, thanks.