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: am5728 run testvpe application has some question

Tool/software: Linux

Hi,

TI,

I run the testvpe demo on the filesystem like that "testvpe 5158.yuv 720 240 yuyv progressive_output.yuv 720 480 yuyv 1 1 200",the cpu usage is about 40%.But if I add some code in the vpetest.c like that.The  cpu usage is about 100%.Why the cpu usage increase so much if I access the dma buf of v4l2 video? If I only add the "printf("data=%d\n", *(int *)(dstBuffers[buf.index]));" in the code,The  cpu usage is also about 100%.Could you post it to the software expert?Help me to find the reason.Thank you very much.

BR,

vefone

  • Hi Vefone,

    The frequent usage of printf always has high cpu resource consumption. A possible workaround is to add messages in a text buffer in the memory instead of printing every time that message. Print the buffer when it is full for example or at fixed number of messages.
    The malloc() does not have a fixed cost ( cpu resource consumption) in terms of latency because of the numerous possible reasons causing the lag. There is a link to an article about malloc() cpu resource cost which is not directly related to your issue environment but in general covers the problem:
    randomascii.wordpress.com/.../

    BR
    Tsvetolin Shulev