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.

Issue with running 2 h264 decoder instances on DM6467

Hello All,

I am trying to run 2 decoder instances simultaneously on DM6467 but we are facing some issues. 

I am using codec engine codec_engine_2_10_02 version. Earlier we were facing codec engine instance creation issue but later we applied some patches on codec_engine and tried running the same. But still we are facing some CMEM memory allocation issues. 

One surprising observation is that if we run the 2 instances with CE_DEBUG=3, both the instances decode fine. But for any other value of CE_DEBUG or without debug, we get memory allocation failure.

 CMEMK Error: Failed to find a pool which fits 1117824

CMEM Error: getPool: Failed to get aCMEMK Error: get_phys: Unable to find phys addr for 0x00000000

pool fitting a size 1117824

@0CMEMK Error: get_phys: get_user_pages() failed: -14

x0006a979:[T:0x400176d8] OM - MeCMEMK Error: FREE: Failed to convert virtual 0x0 to physical

mory_contigAlloc> ERROR: CMEM alloc failed

CMEM Error: free: failed to free 0

@0x00070e68:[T:0x400176d8] OM - Memory_contigFree> Warning: CMEM_free(0x0) failed

Memory allocation for output buffers failed

 Here with this I am copying  loadmodules.sh file content which we are using for cmem.ko and dsplink.ko. Can you please have a look at it and suggest if any changes are required in this?

insmod cmemk.ko phys_start=0x88000000 phys_end=0x8D000000 pools=2x10240,14x596736,10x1019904,2x1048576,10x2235648
insmod dsplinkk.ko

rm -f /dev/dsplink
mknod /dev/dsplink c `awk "\\$2==\"dsplink\" {print \\$1}" /proc/devices` 0

Also copying test_h264.sh which we are using to run 2 instances of the decoder. Please let me know if there is any other way to run multiple instances of decoder.

#!/bin/sh

echo "starting instance 1"
./h264hd_dec_app.x470MV.loop in.264 out_264.yuv > /dev/null &
sleep 1
echo "starting instance 2"
./h264hd_dec_app.x470MV.loop2 in2.264 out_264_2.yuv &

Thanks in advance 

Naveen Yanamaddi

  • HI Naveen,

    What is framework you are using to integrate the codec? If you aren't using DVSDK framework, we recommend you integrating the codec using GA qualified DVSDK framework. It has combinations of tools that are tested to be working together.

    http://downloads.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dvsdk/DVSDK_3_10/latest/index_FDS.html

    Regards,

    Manisha

  • Hi Manisha,

    I have a use case where I need to run 2 instances of the decoder. The procedure I am following is, I have created a binary for single instance of the decoder and making a copy of it.

    Now I am running both the binaries through a script. 

    I have taken care of memory and other resources. I am also getting proper outputs from them.

    My concern is, by doing this, I am creating a scenario which is calling Engine_Open() two times. I have not come across any post talking about the behavior of the platform in this case.

    Could you (or anyone in this domain) please highlight if there is any potential issue in making Engine_Open() calls twice?

    Thanks

    Saurabh

  • If what you're doing is working, I'd say go with it.  The release you're using is 6 years old at this point, so the amount of support TI can provide (at least on these free forums) is minimal.

    A few more comments to consider...

    • A single app can create multiple codec instances by simply calling VIDDEC_create() (or whichever codec type you're creating) twice.  No need to introduce a second application and the complexity that entails.
    • You can call Engine_open() multiple times in a single application.  The CE 2.10.02 API reference guide for Engine_open() speaks lightly to this use case and has some guidance.
    • From your description, it sounds like you're running the decoder apps in two separate processes.  This is more complex than the previous 2 bullets, but may be necessary for some use cases.  If you must use 2 separate processes, I _think_ our recommendation back then was to use LAD.  LAD ensures the DSP loading is done in a controlled manner, and enables the separate applications to be started/stopped independently of each other.

    Chris