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.

"FAILED to create local codec" when h264 encoder is running

platform: DM368

I can run DMAI demo application image_encode_io1_dm368.x470MV successfully when the h264 encoder is not running.
However, if I started the encode application from dvsdk_demos, and run the jpeg encoder application again, it would throw such error:

@4,161,211us: [+7 T:0x403165e0 S:0xbeb486d4] ti.sdo.ce.alg.Algorithm - Algorithm_create> Assignment of alg resources through RMAN FAILED (0x7)

@4,503,826us: [+0 T:0x403165e0 S:0xbeb486d4] ti.sdo.ce.alg.Algorithm - Algorithm_create> return (0x0)
@4,503,955us: [+6 T:0x403165e0 S:0xbeb48714] CV - VISA_create2> FAILED to create local codec.
@4,504,080us: [+0 T:0x403165e0 S:0xbeb486ec] CV - VISA_delete(0x587e8)
@4,504,273us: [+5 T:0x403165e0 S:0xbeb486ec] CV - VISA_delete> deleting codec (localQueue=0xffff, remoteQueue=0xffff)
@4,504,431us: [+0 T:0x403165e0 S:0xbeb486cc] OM - Memory_free> Enter(0x587e8, 0x34)
@4,504,608us: [+0 T:0x403165e0 S:0xbeb486cc] OM - Memory_free> return (0x1)
@4,504,749us: [+0 T:0x403165e0 S:0xbeb4884c] ti.sdo.ce.image1.IMGENC1 - IMGENC_create> return (0x0)
@4,504,889us: [+7 T:0x403165e0 S:0xbeb48874] ti.sdo.dmai - [Ienc1] Can't open imaging encode algorithm
Failed to create image encoder: jpegenc

I have 116MB memory reserved for CMEM use, it's probably not because of shortage of memory.

I tried solution in this post
http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/100/t/86319.aspx#298344

but it's not making any difference. I modified "image_encode_io1_dm368.cfg" to add EDMA3.maxrequests=128.

Thanks for your help.

  • Forgot to mention: I am using DVSDK4.02

  • Found the problem:

    in my encode.cfg, I had

    var myEngine = Engine.create("encode", [
        {name: "h264enc", mod: H264ENC, local: true, groupId: 1},
        {name: "jpegenc", mod: JPEGENC, local: true, groupId: 2},
        {name: "jpegdec", mod: JPEGDEC, local: true, groupId: 2},
    ]);

    in image_encode_io1_dm368.cfg, I had

    var myEngine = Engine.create("encode", [
        {name: "jpegenc", mod: JPEGENC, local: true, groupId: 0},
    ]);

    I removed jpegenc/jpegdec from encode.cfg and changed groupID to 1 in image_encode_io1_dm368.cfg, now it's working!