This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

To disable EDMA for MCASP audio in ti sdk 8

Dear TI E2E Community,

Am facing lots of overrun & underrun issues in ti sdk 8 audio, but I don't see such issues in ti sdk 7, & I see this is major feature that is implemented w.r.t audio in ti sdk 8 is audio data transfers happening through EDMA, where this is not in case of ti sdk 7

I don't see such issues, when I run aplay or arecord, but when I run my application like GSM call & PJSIP I encounter those errors

So inorder to resolve this issue, am planning to isolate EDMA feature in ti sdk 8, could you please let me know how this can be disabled

Am trying from many days

Kindly do the needful as early as possible

  • I'm forwarding this to the SW team. By the way, see this wiki too: processors.wiki.ti.com/.../Linux_Core_Audio_User%27s_Guide
  • Hi Srini,

    Remove the CONFIG_SND_EDMA_SOC from your defconfig file.
    Also try reverting audio driver sources to the older ones (from SDK7). You can use a diff tool, i.e. meld, to see differences between audio drivers in SDK7.0 & SDK8.0 and quickly make the changes.

    Best Regards,
    Yordan
  • Dear Yordan,

    Thanks a lot for your suggestions will definitely start it reverting to sdk 7

    If am using 8K sampling rate, How can I verify that am receiving full 8000 samples in the mcasp buffers??

    Yordan, could you please let me know Is it possible that how can I print & verify in mcasp buffer, that I have received 16 bit 8000 samples, could you pls let me know with what base address & the offset I can verify inorder to ensure am getting 8000 samples

    Could you please help me out how can I print these Samples values using printk,

    If it is unable to print full 8000 samples, Am eager to verify the first 10 samples (base address) & the last 10 samples (base address + end of offset ie., end address of 8K buffer) inorder to ensure that am receiving all 8000 samples

    After I verify mcasp buffer, could you please let me know how this can be verified in alsa layer inorder to ensure that am receiving & transmitting full 8000 samples


    Could you please, help me out in this, If I verify this, I think would be able to fix in ti sdk 8 itself

    Kindly do the needful as early as possible

    Awaiting for your replies,
    Many Thanks in advance again
  • Srini said:
    could you please let me know Is it possible that how can I print & verify in mcasp buffer, that I have received 16 bit 8000 samples, could you pls let me know with what base address & the offset I can verify inorder to ensure am getting 8000 samples

     

    Have you tried reading the RBUF_0 to RBUF_5 registers? Check AM335x TRM, Section 22.4.1 MCASP Registers. 

    MCASP0 Data regs base address is: 0x4600_0000 to 0x463F_FFFF       

    MCASP1 Data regs base address is: 0x4640_0000 to 0x467F_FFFF

    MCASP0 CFG regs base address is: 0x4803_8000 to 0x4803_9FFF

    MCASP1 CFG regs base address is: 0x4803_C000 to 0x4803_DFFF

    Best Regards, 

    Yordan

  • Dear Yordan,

    Thanks a lot for your replies & sorry to push you hard will verify your inputs & keep you updated for sure

    Am verifying all these things because am seeing lots of overrun & broken pipes in alsa application

    A. As per TRM page number 4593, does the event AXEVT gets generated every 16 bits of data transfers??

    B .Am using 16 bit 8 Khz sampling rate, I2S mode , could you please let me know what is the correct value that needs to be configured in tx-num-evt & rx-num-evt????

    Currently am configuring as per below is this correct???

    tx-num-evt = <1>;

    rx-num-evt = <1>;

    If I set the tx-num-evt = <1>; & rx-num-evt = <1>;

    I see that means for one DMA transfers am I transfering 32 bit of data or 16 bit of data????? please correct me if my understanding is correct

    C. Could you please let me know in what order of  the sequence  the below files gets called by ALSA ??

    1. davinci-evm.c

    2. davinci-mcasp.c

    3. davinci-i2s.c

    4. davinci-pcm.c

    5. davinci-vcif.c

    6.edma-pcm.c

    D. Am trying to calculate buffer_size in alsa application, could you please let me know how this is calculated ie., buffersize = period_size * period (am using 16 bit 8Khz sampling rate) & set in ALSA application

    I hope that the period_size & period are MCASP dependent, could you please let me know how to calculate period_size & periods w.r.t MCASP

    E.In davinci-pcm.c, In the below structures, am unable to understand how this values are derived & set

    Could you please explain: How are the following values derived:

        .buffer_bytes_max = 128 * 1024,
        .period_bytes_min = 32,
        .period_bytes_max = 8 * 1024,
        .periods_min = 16,
        .periods_max = 255,

    The size available for McASP is 4MB

    static struct snd_pcm_hardware pcm_hardware_playback = {

    .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
    SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
    SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME|
    SNDRV_PCM_INFO_BATCH),
    .buffer_bytes_max = 128 * 1024,
    .period_bytes_min = 32,
    .period_bytes_max = 8 * 1024,
    .periods_min = 16,
    .periods_max = 255,
    .fifo_size = 0,
    };

    static struct snd_pcm_hardware pcm_hardware_capture = {
    .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
    SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
    SNDRV_PCM_INFO_PAUSE |
    SNDRV_PCM_INFO_BATCH),
    .buffer_bytes_max = 128 * 1024,
    .period_bytes_min = 32,
    .period_bytes_max = 8 * 1024,
    .periods_min = 16,
    .periods_max = 255,
    .fifo_size = 0,
    };

    Dear Yordan could you please provide your guidance w.r.t the above queries, Hope that would be useful in resolving all the issues w.r.t XRUNS, broken pipes, etc..,

    Once again really appreciate for your prompt responses w.r..t this thread

    Kindly do the needful as early as possible

    Many Many Thanks in advance

  • Dear Yordan,
    Thanks a lot for your replies & sorry to push you hard will verify your inputs & keep you updated for sure


    Am verifying all these things because am seeing lots of overrun & broken pipes in alsa application


    A. As per TRM page number 4593, does the event AXEVT gets generated every 16 bits of data transfers??


    B .Am using 16 bit 8 Khz sampling rate, I2S mode , could you please let me know what is the correct value that needs to be configured in tx-num-evt & rx-num-evt????
    Currently am configuring as per below is this correct???
    tx-num-evt = <1>;
    rx-num-evt = <1>;
    If I set the tx-num-evt = <1>; & rx-num-evt = <1>;
    I see that means for one DMA transfers am I transfering 32 bit of data or 16 bit of data????? please correct me if my understanding is correct


    C. Could you please let me know in what order of the sequence the below files gets called by ALSA ??
    1. davinci-evm.c
    2. davinci-mcasp.c
    3. davinci-i2s.c
    4. davinci-pcm.c
    5. davinci-vcif.c
    6.edma-pcm.c


    D. Am trying to calculate buffer_size in alsa application, could you please let me know how this is calculated ie., buffersize = period_size * period (am using 16 bit 8Khz sampling rate) & set in ALSA application
    I hope that the period_size & period are MCASP dependent, could you please let me know how to calculate period_size & periods w.r.t MCASP


    E.In davinci-pcm.c, In the below structures, am unable to understand how this values are derived & set


    Could you please explain: How are the following values derived:
    .buffer_bytes_max = 128 * 1024,
    .period_bytes_min = 32,
    .period_bytes_max = 8 * 1024,
    .periods_min = 16,
    .periods_max = 255,
    The size available for McASP is 4MB
    static struct snd_pcm_hardware pcm_hardware_playback = {
    .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
    SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
    SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME|
    SNDRV_PCM_INFO_BATCH),
    .buffer_bytes_max = 128 * 1024,
    .period_bytes_min = 32,
    .period_bytes_max = 8 * 1024,
    .periods_min = 16,
    .periods_max = 255,
    .fifo_size = 0,
    };
    static struct snd_pcm_hardware pcm_hardware_capture = {
    .info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
    SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
    SNDRV_PCM_INFO_PAUSE |
    SNDRV_PCM_INFO_BATCH),
    .buffer_bytes_max = 128 * 1024,
    .period_bytes_min = 32,
    .period_bytes_max = 8 * 1024,
    .periods_min = 16,
    .periods_max = 255,
    .fifo_size = 0,
    };

    Dear Yordan could you please provide your guidance w.r.t the above queries, Hope that would be useful in resolving all the issues w.r.t XRUNS, broken pipes, etc..,


    Once again really appreciate for your prompt responses w.r..t this thread


    Kindly do the needful as early as possible
    Many Many Thanks in advance

  • Dear Yordan,

    As am still trying to fix this issue with EDMA feature  ie., -EPIPE error in alsa application

    Could you please provide any inputs w.r.t the above queries ie., A, B, C D & E points, Hope your inputs will help me to resolve all the above issues

    Mainly could you please address the below query ie.,

    Am trying to calculate buffer_size in alsa application, could you please let me know how this is calculated ie., buffersize = period_size * period (am using 16 bit 8Khz sampling rate) & set in ALSA application
    I hope that the period_size & period are MCASP dependent, could you please let me know how to calculate period_size & periods w.r.t MCASP

    In point no. C, I dont think so we are using davinci-pcm.cdavinci-i2s.c & davinci-vcif.c for MCASP & for UDa1345ts codec

    Could you please let me know how this values are derived in edma-pcm.c

    .buffer_bytes_max = 128 * 1024,
    .period_bytes_min = 512,
    .period_bytes_max = 64 * 1024,
    .periods_min = 2,
    .periods_max = 19, /* Limit by edma dmaengine driver */

    static const struct snd_pcm_hardware edma_pcm_hardware = {
    .info = SNDRV_PCM_INFO_MMAP |
    SNDRV_PCM_INFO_MMAP_VALID |
    SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME |
    SNDRV_PCM_INFO_NO_PERIOD_WAKEUP |
    SNDRV_PCM_INFO_INTERLEAVED,
    .buffer_bytes_max = 128 * 1024,
    .period_bytes_min = 512,
    .period_bytes_max = 64 * 1024,
    .periods_min = 2,
    .periods_max = 19, /* Limit by edma dmaengine driver */
    };

     

    Kindly do the needful as early as possible

    Thanks in advance

  • Dear Yordan,

    Am was going through reference manaul as per below section it says that it is unable to access RBUF's could you please clearly  let me know how to print these RBUF sample values

    As still am using ti sdk 8 with EDMA feature, could you please let me know

    I don't see the MACRO DAVINCI_MCASP_RXBUF_REG 0x280 being used anywhere in the code to print the samples , could you please let me know


    Could you please help me out where exactly & how to add the printk's in davinci-mcasp.c, could you please add & send across the patch Yordan

    Kindly do the needful as early as possible, as am trying to isolate this issue from driver side

    Many Thanks in advance once again