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.

IPCFrameOut will make audio thread's CPU usage to more than 90%.

Hello,now we use dm8168 / dvrrdk 3.0 to develop a MultiMediaServer.

But now we encounter a problem.

We use PCIe of DM8168 to receive Video Frame from FPGA. We use IPCFrameOutLink,and use SharedRegion1.

And now when we use IPCFrameOut Link to transfer video frame,the audio playback thread with MMAP mode will be unnormal. The variable in the audio playback thread will be changed unexpectedly,and then audio playback thread's cpu usage will be up to more than 90%.

What may cause this problem?

  • If variables are changing unexpectedly it is  memory corruption. Pls check if you are copying beyond the allocated buffer when receiving video frames.

    Try enabling page_poison and kmemcheck .You may be lucky and able to catch the corruption although if it is DMA xfer causing memory corruption it will not be caught .

    Couple of things to try,

      - If you are doing PCIe xfer from multiple threads try changing to single thread.

     - If you are using EDMA for PCIe copy try changing to CPU memcpy.

  • Thanks for your reply.

    According to our tests,the reason may be audio playback thread.

    Now we use MMAP mode in DVRRDk 3.0 to avoid underrun error.But now we found this event unexpected.The variable of alsa in audioplay thread will be changed unexpected.

    Some user case will trigger the event.

    For example,adding OSD in video will trigger this event,but after we change code,make OSD to use buffer in SR0,the problem disappear.When OSD use buffer in SR1,the problem appear.

    To make DM8168 receive video frame from PCIe will trigger the event,PCIe channel's IC's Some driver open,ioctl func will trigger this problem.

    When we write MP4 file to HDD will trigger this event.

    How to locate the problem?