Post Go back to editing

adding link port capability to existing program on 573 EZKIT

Thread Summary

The user aimed to pass audio data between two SHARC devices using the link port, initially facing issues with the ADSP-SC573 EZKIT due to PD_14 pin conflict. The problem was resolved by using the ADSP-SC598-SOM with 10k pull-down resistors, achieving a link port clock speed of 31 MHz. The user successfully integrated the link port into the audio processing framework, adding virtual pins to handle 8 additional TDM channels (65-72) at 96 kHz, making them accessible in SigmaStudio+.
AI Generated Content
Category: Software
Product Number: s
Software Version: cces 2.12

Hi,

my main goal is to use the link port to pass audio data between 2 SHARC devices. 

I have successfully modified the Demo program to bring in/out TDM channel from Dante boards but will need to connect 2 SHARC devices together via the link ports.
I was looking at testing the loopback mechanism by inserting a link port loopback in the path of when in the callback 'SPORTIn_CB' where it takes all the data from SPORTs buffers and passes it on.
I'm a bit confused on what the 'adi_ss_hal_sport_Process2DBuffer' does. Is this an MDMA call from one core to another as i cannot follow where the data is sent too and received.

This was getting very complex so to get a better understanding i've gone to something simpler. Is there a walk through for the Demo code please ?


In order to better understand the workings of the SHARC cores i am now using the project 'MDMA-Based Dual-SHARC+ Parallel Pipeline Audio Talkthrough in SC573' as very kindly created 
in the following link.
How to realize MDMA-Based Dual-SHARC+ Parallel Pipeline Audio Talkthrough in SC573? - Q&A - CrossCore Embedded Studio and Add-ins - EngineerZone (analog.com)
ez.analog.com/.../356979


I can get the playback project to work (once i modified the L2 memory start as described in the source post) and i am know trying to incorporate the link port loopback.
I've been trying for days trying to get something to work. Any suggestions on how to incorporate a link port into the playback project.

I can get the link port lookback test to work in core 1 before any of the playback operations are started but if try sending/receving test data to a link port while the playback is running breaks the playback.

I was also trying to find other listed examples eg. Linkport Descriptor Array DMA Example, Linkport Descriptor List DMA Example to try and get a better understanding.

Many thanks for any help, even if its telling me i'm going about it all wrong.

  • Hi,

    We have modified our sample project as per your requirement and tested it in ADSP-SC589 EZ-Board. In the SHARC0 core, inside the ADC callback function the Linkport_Loopback() is called, it will perform loopback whenever SPORT callback is occurred.

    Please use this example project as a reference for your application.

    Could you please let us know why you are using adi_ss_hal_sport_Process2DBuffer() API? Since it is a SigmaStudio for SHARC API, it is not necessary to use it in multicore application.

    Hope this helps.

    Best Regards,
    Santhakumari.K

    MultiCoreTalkThru_Linkport_SC589.zip

  • Hi Santhakumari.K

    Thank you so much for your help with my problem and supplying code.  I'm sorry i should have been more clear in my question that i'm using a modified 589 code i found in the forum post below. I do not have an SC589 EZ-kit but i only have an SC573 EZKIT.

    How to realize MDMA-Based Dual-SHARC+ Parallel Pipeline Audio Talkthrough in SC573? - Q&A - CrossCore Embedded Studio and Add-ins - EngineerZone (analog.com)
    ez.analog.com/.../356979

    I have modified the project you kindly supplied and am able to pass through audio from the ADC->DAC if i comment out the 

    Linkport_Test();

    in MultiCoreTalkThruSharcSharc_Core1.c

    if i resinstate Linkport_Test(); and  then disable the Rx and Tx linkports after 

    while(!(TX_Done && RX_Done));

    then audio passes through but since the link ports are disabled the submit buffers in Linkport_Loopback fail to trigger a write/read as the 

    link ports are turned off.

    I have attached your modified project for the SC573 EZKIT. Could you please have a look and see if where i've made a mistake.

    As for the 'adi_ss_hal_sport_Process2DBuffer' i was just trying to understand what happens in the SPORTs in callback so i figure out the flow of data from a SPORT to the sigma studio process and from the sigma studio process to the SPORTs outputs.

    static void SPORTIn_CB(void *pCBParam, uint32_t Event, void *pArg)

     static void SPORTOut_CB(void *pCBParam, uint32_t Event, void *pArg)

    in the adi_ss_fw_sport.c

    Many thanks for your help

    MultiCoreTalkThru_Linkport_SC573EZKIT.zip

  • Hi,

    I've been looking more into this and think i've found the issue with using the link port in conjunction with the ADAU1979 ADC on the SC573.  I thinks its due to PD_14 is used with the ADAU1979 and also used as D4 on the link port LP1.  I'm looking into it more and will let you know what i find out.  I will try and use another input method

  • Hi,

    Yes. You are correct. PD_14 is being used for providing frame sync as well as LP1-D4 pin in SC573 Evaluation kit. Looks like we cannot use both peripheral in same application in this kit.  

    Best Regards,
    Santhakumari.K

  • Hi,

    I have managed to us the ADAU1977 as the clock generator and audio input device and also pass the audio data via the linkport loopback and pass it to the DAC ! :-)

    I have tried to increase the linkport clock speed to a high rate but it fails if i use a divider lower than 20. which gives me clock speed of only about 2.8MHz.  This would mean that the SCLK is 112MHz and according to the LP_DIV description in the SC573 hardware reference manual it can be set to 0 which would set the linkport clock to SCLK (112 MHz).

    In case i was creating more chances for problems in my code i used the example project for the linkport loopback (SHARC and Cortex versions tested) available  from the browse examples and attempted to get a faster linkport clock rate but failed to get the divder lower than 20.

    I have the done more tests and found that both test buffers have been sent but only the first received and its contents are correct.

    This works 

    I was wondering if i'm missing something as i noticed that the default setting for the linkport tx clock divider in the example is 232 which sets the link port clock to about 25KHz.

    I have the correct loopback connector for the link ports on the SC573 EZkit.

    i was wondering if anyone has run the linkport on the SC573 EZkit to a high speed ?

    I'm aware that there are some silicon anomalies affecting the linkport operation on some SHARCs but i couldn't see one that would effect what i'm doing. 

    thanks for all your help

  • problem solved. need pull down resistors on CLK and ACK 

  • Hi Beaker,

    Thank you for letting us know the issue got solved. Have you changed pulldown resister in eval kit?

    Best Regards,
    Santhakumari.K

  • Hi,

    I saw on the SC573 schematic that there are 10K pull down resistors there already so i don't understand why it didn't work at higher rates.  I have given up with the SC573 and am now working on an SC598-SOM connected to the EV-SOMCRR-BRKOUT board and experimented with connecting the link port pins together on that and i works just fine to 31MHz clock with 10K pull down resistors.  

    I have now progressed on and as a test i can now pass an audio data buffer of one of my TDM channels via the link port and it works just fine.

    The adi_AudioProcess_Callback is called from when a block of data from the SPORTS inputs are all available.

    I take channels 1 and 2 and pass them via the link port

    in the LINKPORTCallback0 routine

    it receives the data and puts it in the buffer location that the SPORTs input routine would put it.

    it also transfers all the data pointers to framework and triggers the passing the data routine to send to other COREs.

    This works fine as a test for passing data via the link port.

    My application needs to take data to/from the linkport from another SHARC device and bring it in as a separate input/output channels that are visible on sigma studio +.

    I can see in the framework that data is passed by the number of input PINS and its associated channels.  Is that correct ?

    All i can think of is creating another input 'PIN' in the framework to bring in more inputs and an output PIN for the ouputs.

    I cannot add anymore in sigma studio+ as i have used all the SPORTS.

    and using that as a way to pass data to and from the link port and be available to the sigma studio ??

    any suggestions on if i'm doing this correctly or how to proceed greatly appreciated. 

    SECTION("ss_app_code_cb")
    void adi_AudioProcess_Callback(ADI_SS_ARM_FW_AUDIO_DATA_INFO *pInDataPtr[ADI_SS_FW_MAX_PINS], uint32_t nPins)
    {
    //AW send to linkport loopback.
    unsigned int elpResult,elpResult1;
    int32_t nCnt = 0;
    pAppArmCoreInfo = &oAppArmCoreInfo;
    uint32_t nPin =0;
    uint32_t tdm_chn = 0;
    uint32_t samples =0;
    uint32_t dat = 0;
    uint32_t *dat_ptr = NULL;
    uint32_t dat_counter = 0;

    /*
    * as far as can tell only index 0 of buffer. pDataBuff[0][ADI_SS_FW_MAX_NUM_IN_CHANNELS] is used. it may be used if parallel config of DSP

    * uint32_t *pDataBuff[ADI_SS_FW_MAX_NUM_BUFFERS][ADI_SS_FW_MAX_NUM_IN_CHANNELS]; //!< Array of input buffer pointers
    *
    * so try and just take data from index 0 buffer and send it via link port.
    *
    *
    */

    // load up data to send via linkport

    for(tdm_chn=0x00; tdm_chn<2; tdm_chn++) // loop around number of channels per SPORT input. 8 TDM inputs in this case
    {
    dat_ptr = pInDataPtr[nPin]->pDataBuff[0][tdm_chn];

    for(samples=0x00; samples < 32; samples++) // loop around number of 32-bit samples given for each of the TDM inputs.
    {
    nBufferTx0[dat_counter++] = dat_ptr[samples];
    }
    }

    elpResult1 = adi_linkport_DMATransfer(hDevice0,&LP0_Desc,1,ADI_PDMA_STOP_MODE);
    if(elpResult1 != ADI_LINKPORT_SUCCESS)
    printf("Device receiver configuration failed\n");

    elpResult = adi_linkport_DMATransfer(hDevice1,&LP1_Desc,1,ADI_PDMA_STOP_MODE);
    if(elpResult != ADI_LINKPORT_SUCCESS)
    printf("Device transmitter configuration failed\n");


    }


    static void LINKPORTCallback0(void *pCBParam, uint32_t Event, void *pArg)
    {
    int32_t nCnt = 0;
    uint32_t tdm_chn = 0;
    uint32_t samples =0;
    uint32_t dat = 0;
    uint32_t *dat_ptr = NULL;
    uint32_t dat_counter = 0;
    uint32_t nPin = 0; // index of pin input. each pin input is a SPORT data input. each with 8 TDM channels in this case.
    uint32_t nPins;


    ADI_SS_ARM_FW_HANDLE hFWHandle = pAppArmCoreInfo->hssFWHandle;
    tSSARMFWInfo *pSSFwInfo;
    tPinGroup *pPinGroupIn;
    volatile ADI_SS_ARM_FW_AUDIO_DATA_INFO *pInDataPtr[ADI_SS_FW_MAX_PINS];
    tPinInfo *pPinInfo;
    tSSFWSPORT *pSSFWSPORT;

    pSSFwInfo = (tSSARMFWInfo*)hFWHandle;
    tSSFWAudioIO *pSSFWAudioIO = &pSSFwInfo->oAudioIO;
    pPinGroupIn = &pSSFWAudioIO->oSignalInfo.oPinGroupIn;
    nPins = pPinGroupIn->nPins;

    for(nPin=0U; nPin<(pPinGroupIn->nPins); nPin++)
    {
    pPinInfo = &pPinGroupIn->aoPinInfo[nPin];
    pSSFWSPORT = &pPinInfo->oSSFWSPORT;
    pInDataPtr[nPin] = &pPinInfo->oAdiSsArmFwAudioDataInInfo;
    }


    switch (Event)
    {
    case ADI_LINKPORT_EVENT_DMA_PROCESSED:

    nPin = 0;
    for(tdm_chn=0x00; tdm_chn<2; tdm_chn++) // loop around number of channels per SPORT input. 2 TDM inputs in this case
    {
    dat_ptr = pInDataPtr[nPin]->pDataBuff[0][tdm_chn];

    for(samples=0x00; samples < 32; samples++) // loop around number of 32-bit samples given for each of the TDM inputs.
    {
    dat_ptr[samples] = nBufferRx0[dat_counter++];
    }
    }


    for(nCnt=0; nCnt < nPins; nCnt++)
    {
    pAppArmCoreInfo->pInDataPtr[nCnt] = pInDataPtr[nCnt];
    }

    nAudioProcCBParam++;
    pAppArmCoreInfo->nPins = nPins;


    break;
    default:
    break;
    }

    }

  • Hi,

    From your reply, we understand that you attempted to transfer the audio samples from one core to another core using the Link port, and you are able to successfully transfer the audio samples. Since you are using SHARC with SigmaStudio, could you please share a block diagram of your application that helps us to understand the flow.

    If you encounter any issues regarding SigmaStudio or need any information regarding this, please post your query in SigmaStudio for SHARC forum linked below:
    ez.analog.com/.../

    Best Regards,
    Santhakumari.K

  • above is a basic block diagram of what i want to achieve.

    Current status.

    I only have one SC598. therefore i have looped back the link port.

    i have 32  in/out TDM 8 channels from DANTE 1 and  32 in/out channels of TDM 8 from DANTE 2.

    i have routed  (using sigma studio+ project ) audio from dante 1 out of dante 2, also dante 2 inputs routed to dante 1 outputs

    i have the link port looped back on this DSP and can route audio data from the link port and receive it.

    In the framework there are input and output pins which have information on block of channels.  ie. 8 channels of TDM.

    I have modified the code to add a virtual pin and allocate that to data received via the link port. This is then seamlessly added to the data routed in sigma studio process.  Therefore i now have 72 input channels (64 from SPORTS and 8 from linkport) accessible by the sigma studio project.

    I have modified the code to add virtual pin and for the a further 8 output channels (now 72 outputs for sigma studio) from the sigma studio process to be routed to the link port transmitter.   I'm currently having problems tracing where to route the output pin data after it has been processed by the cores when channels 1-64 are sent to the SPORTS.  i need to route 65-72 buffers to the link port transmitter.  any suggestions.

    i can see in 'CheckSHStatCallBack' the pointers to data are loaded into pOutDataPtr. before calling ''adi_AudioDataProcessed_Callback' but this data isn't used.  I'm not sure on the format of this data, if its 2 buffers alternetly used with associated struct information or just audio data i can use ??? any suggestions.

    if you need more information or code of what i've done. please let me know

    Thanks