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.

Linux/TMS320DM368: DM368 performance issue if audio enabled along with H264+1080p combination.

Part Number: TMS320DM368

Tool/software: Linux

Hi,

 I am currently working on a custom camera board based on DM368. We are facing performance issues if enable audio along with a specific video configuration. Following is the video configuration:
      
                       Video mode - Dual stream
                       Primary codec - H264
                       Primary resolution - 1080p
                       Secondary codec - H264/MPEG4/MJPEG(any of these codec selected)
                       Secondary resolution - D1/4CIF/VGA/CIF/QCIF/QVGA(any of these resolution selected)

We are using internal voice codec of DM368 and following is the configuration:

                       Encoding - g711/AAC (any of these encoding selected)
                       sample rate - 8khz/16khz(any of these sample rate selected)

   Noise in audio is getting increased gradually and becomes worse after sometime with above configuration. Issue gets resolved if we just change primary stream codec to MPEG4/MJPEG or primary resolution to 960p/lower. It is observed that edma_error interrupt count in /proc/interrupts is getting increased with this specific configuration, this count is zero if any other video combination selected.                    

cat /proc/interrupts:

CPU0

0: 2542 AINTC csl

1: 0 AINTC csl

2: 1406 AINTC csl

3: 0 AINTC csl

4: 0 AINTC csl

5: 0 AINTC csl

6: 0 AINTC csl

8: 12798 AINTC vpbe-v4l2

9: 194 AINTC IRQK_Handler

10: 2116 AINTC IRQK_Handler

12: 1 AINTC musb-hdrc

16: 8878 AINTC edma

17: 616 AINTC edma_error

26: 0 AINTC mmc0

32: 52787 AINTC clockevent

33: 0 AINTC free-run counter

39: 2462 AINTC i2c_davinci

40: 759 AINTC serial

41: 1 AINTC serial

52: 0 AINTC eth0

53: 9 AINTC eth0

54: 34 AINTC eth0

55: 0 AINTC eth0

Err: 0

         The edma_error interrupt count start increasing on board bootup itself and audio issue gets recreated once this interrupt count is around 7000.  We tried to reduce processing load by configuring low FPS, in this case rate of edma_error count increment reduced and issue recreation time increased. Does H264 encoder DMA handling have any dependency with 1080p resolution?

Any help would be greatly appreciated

  • Hi,

    I have forwarded  this query to the respective team.

    Regards,

    Anuj

  • Hi Geethu,

    May be 1080p encoded video data overlaps to audio memory layout.

    can you please try to increase size of H264 memory layout in mem_mng.c file?

    Regards,

    Prashant

  • Hi Prashant,

             Thanks for your suggetion. We tried by changing the mem_size and cache_size of memory layout used for dual stream(MEM_LAYOUT_7). But still getting same audio noise issue and edma_error interrupt count also increasing.

    Regards,

          Geethu

  • Hi Geethu,

    Assuming you are using IPNC package, have you checked if the Audio stream in the Audio Thread, at the capture time itself is having issue or later when it is encoded and played ?

    You can dump the audio coming in AUDIO_audioTskRun() function before encoding in file Source/ipnc_rdk/av_capture/application/ipnc/av_server/src/audio/audioThr.c
  • Hi Geethu,

    Please do enable debug logs in edma driver, that would give an idea on whether EDMA events being missed.Mostly we suspect DDR Bandwidth for EDMA , We hope you already verified there are no EDMA errors in only in video case audio capture disabled . Please reduce FPS and bitrate keeping resolution the same to confirm it is EDMA Miss which is causing issue.

    Thanks & Regards,

    Vishwanath Patil

  • Hi,

    Thanks for your reply.

    EDMA error interrupts are coming only when audio eanbled along with above mentioned video combination. After changing gAVSERVER_UI_config.mode (in UI_setConfig function in av_capture/application/ipnc/av_server/src/common/avServerUi.c file) to AVSERVER_UI_CAPTURE_MODE_1080P_D1, EDMA error become zero in all cases. But audio noise issue is not fixed. Need to power cycle the board to recover from the issue.

    Issue remains with lower FPS and bitrate, but it is observed that the time required to recreate issue is increased as compared to normal case.

    Also we have observed same noise in raw data which is captured using arecord.

  • Hi,

    Thanks for your reply.

    EDMA error interrupts are coming only when audio eanbled along with above mentioned video combination. After changing gAVSERVER_UI_config.mode (in UI_setConfig function in av_capture/application/ipnc/av_server/src/common/avServerUi.c file) to AVSERVER_UI_CAPTURE_MODE_1080P_D1 EDMA error become zero in all cases. But audio noise issue is not fixed. Need to power cycle the board to recover from the issue.

    Issue remains with lower FPS and bitrate, but it is observed that the time required to recreate issue is increased as compared to normal case.

    Also we have observed same noise in raw data which is captured using arecord.
  • Hi Ansu,

    I hope you have not modified any registers of voice codec.

    Please share the audio.dump in which you are observing audio noise.