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.

Setting priorities on Video and other background processes - DM8168

Hi All,

     We are using the DM8169 with software based on EZSDK 5.05.02.01.

    Our system is pretty much complete, it plays some H264 1080p videos correctly, however, while running other tasks in background like copy (cp) or tftp the process playing the videos (omx based) starts dropping frames. The videos that we are using are here:

https://dl.dropboxusercontent.com/u/62771102/videosDropIssue.tar.gz

You can see the problem using the decode_display application included in the EZSDK:

./decode_display_a8host_debug.xv5T -i A07_H264_1920x1080_2997i_1609_FMA.h264  -w 1920 -h 1080 -f 30 -g 0 -d 0  -c h264 &

and running a copy in the background:

cp A13_H264_1920x1080_2997i_1609_EPS_48kHz_AAC.m2t  A13_H264_1920x1080_2997i_1609_EPS_48kHz_AAC_copy.m2t 

you will see how the system starts dropping frames. We tried using nice to change the priority, it behaves better but under more load the problem still appears.

nice -n 19 cp /media/A13_H264_1920x1080_2997i_1609_EPS_48kHz_AAC.m2t  /

For us it doesn't matter how much time the copy takes, the copy is the lowest priority. Is there other way to change the priority of the video pipeline?

Thanks in advance,

-David

  • Hello David,


    I will check this issue.
    Have you tried to change the display component priority in the overlay for example?

    Have you tried to increase the buffers as well?


    BR
    Margarita

  • David,

    I tried with the default setup on dm8168EVM and I was able to reproduce it 100%
    ./decode_display_a8host_debug.xv5T -i /home/root/A07_H264_1920x1080_2997i_1609_FMA.h264 -w 1920 -h 1080 -f 30 -g 0 -d 0 -c h264 &
    cp /home/root/A13_H264_1920x1080_2997i_1609_EPS_48kHz_AAC.m2t A13_H264_1920x1080_2997i_1609_EPS_48kHz_AAC_copy.m2t

    I changed :
    #define IL_CLIENT_DECODER_INPUT_BUFFER_COUNT (6)
    #define IL_CLIENT_DECODER_OUTPUT_BUFFER_COUNT (8)
    #define IL_CLIENT_SCALAR_INPUT_BUFFER_COUNT IL_CLIENT_DECODER_OUTPUT_BUFFER_COUNT
    #define IL_CLIENT_SCALAR_OUTPUT_BUFFER_COUNT (8)
    ....
    in the decode_display demo.
    I tried few times I can not reproduce it, at least is not 100% reproducible, any more.

    Could you try on your side and let me know the results?

    BR
    Margarita
  • Hi Margarita,

    Thanks for your help. I gave the decode_display demo as example to reproduce the problem, we are actually using gstreamer however it should be the same since it is just a wrapper for OMX. We are already using a good amount of buffers for the components but we still see the problem.

    To display we use v4l2sink which basically sends messages directly to the proxy server running on the VPSS driver, I am not sure if it would be possible change the priority of this one. Also, where could I change the priority of the encoder/decoder components in the overlay? that could help.

    I was also thinking in some tool to limit the CPU usage of the copy command and checking the EDMA channel used for the M3 video encoding/decoding tasks, do you know where I can check the DMA channel used for this components? I know that the channel 1 and 2 are the more capable ones for the EDMA. Checking in the kernel for the channel used for the MMC (we boot from SD) it seems that the SD card uses channel 1 which should be okay, but I wonder which one is used by the encoders and decoders

    drivers/mmc/host/davinci_mmc.c

    /* Acquire master DMA write channel */
    r = edma_alloc_channel(host->txdma, mmc_davinci_dma_cb, host,
    EVENTQ_DEFAULT);

    arch/arm/common/edma.c

    if (!edma_info[j]->default_queue)
    edma_info[j]->default_queue = EVENTQ_1;

    Thanks in advance,
    -David
  • Hello David,

    You could find the task priority on every component in the _priv.h file. For decoder vdec folder search for omx_vdec_priv.h

     OMX_VIDDEC_TASK_PRIORITY.

    I have not checked is the task priority change  will makes the difference since the increasing buffers in the demo works for me on first look. 

    I am wondering are you able to reproduce this problem when you not perform cp from/to SD card. Could you try to load CPU with some other operations witch are not connected with r/w on SD card.

    BR

    Margarita

  • Hi Margarita,

    Using nice -19 for the video process and nice 19 for the other process helped to solve the problem. Thanks for your help!

    Regards,
    -David
  • Glad that this issue is solved.

    BR
    Margarita