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.

the problem about integrating c64x+ jpeg encode codec to code server on dm6467-t evm



hi:

     I have downloaded a c64x+ jpeg encode  from

http://software-dl.ti.com/dsps/dsps_public_sw/codecs/C64XPlus_Video//C64XPlus_Video_latest/c64xplus_jpegenc_02_00_01_00_production.bin

and i want to integrate this codec to code server on dm6467-t evm.  but when the application in arm called the api of encode codec,  it always failed. I am using dvsdk_3_10_00_11, codec_engine_2_25_01_06, cs2dm6467_1_00_00_03,xdais_6_25_01_08,framework_components_2_25_01_05,bios_5_41_00_06.

here is the application code:

Engine_Handle ce = NULL;

IMGENC1_Handle enc = NULL;

IMGENC1_Params params;

IMGENC1_Status                  encStatus;

       IMGENC1_DynamicParams           encDynParams;

 

ce = Engine_open(engineName, NULL, NULL);

      

  params.size             = sizeof(IMGENC1_Params);

 params.dataEndianness   = XDM_BYTE;

 params.maxHeight        = 720;          //720

        params.maxWidth         = 480;          //480

        params.maxScans         = 0;

        params.forceChromaFormat        = 2;

 

        enc = IMGENC1_create(ce, encoderName, &params);

   

        encDynParams.inputWidth         = 720;

        encDynParams.inputHeight        = 480;

encDynParams.inputChromaFormat  = 2;

encDynParams.qValue             = 86;

encDynParams.numAU              = 0;

encDynParams.size       = sizeof(IMGENC1_DynamicParams);

encDynParams.numAU      = 0;

encDynParams.generateHeader = XDM_ENCODE_AU;

 

      encStatus.size          = sizeof(IMGENC1_Status);

      //encStatus.data.buf    = NULL;

     //encStatus.data.bufSize        = 0;

     retval = IMGENC1_control(enc, XDM_SETPARAMS, &encDynParams, &encStatus);

 

     when it run to

     "retval = IMGENC1_control(enc, XDM_SETPARAMS, &encDynParams, &encStatus);" it always failed.it returned that:

     

       CMEMK Error: get_phys: Unable to find phys addr for 0x46139f3a

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

CMEMK Error: GETPHYS: Failed to convert virtual 0x46139f3a to physical.

CMEM Error: getPhys: Failed to get physical address of 0x46139f3a

here is the cmem configuration in loadmodules.sh

CMEM_MODPARAMS="phys_start=0x87800000 phys_end=0x88000000 pools=20x4096,10x131072,2x1048576"

by pass

    how did i caculate the number and size of buffer in the pool of cmem? i can not get more information from the c64x+ jpeg encode  codes itself. 

 

 

  • Why are these two lines commented out:

    ll said:
         //encStatus.data.buf    = NULL;
         //encStatus.data.bufSize        = 0;

    By failing to initialize the encStatus.data buf to NULL, Codec Engine thinks you want to send a buffer during the IMGENC1_control() call and tries to find the physical address of the [uninitialized] buffer pointers.  It uses CMEM to do this address translation - and CMEM [correctly, I think] complains.

    Chris

  • thanks for your replay, if I do not comment out

    encStatus.data.buf    = NULL;

    encStatus.data.bufSize        = 0;

    the return value of  IMGENC1_control() will be 0xFFFFFFFF, it also failed

  • A return value of -1 is IMGENC1_EFAIL.  What was the value of encStatus.extendedError upon return?

    http://processors.wiki.ti.com/index.php/XDM_FAQ#How_do_I_decode_extendedError.3F

    Also, setting CE_DEBUG might show how far things got under the covers.

    Chris

  • Hi,

    The jpegenc codec you mention is also part of the standard codecs server provided with the DVSDK 3.10. Did you try your application with that server?

    Also, you can use the DMAI sample app image_encode_io1 as an example. This application does not support DM6467 out of the box but the API calls should be the same.

    Also remember that in order to use the jpegenc on DM6467 you need to perform colorspace conversion to 420SP. Please see similar thread http://e2e.ti.com/support/embedded/f/356/p/72150/262701.aspx#262701

    Cesar

  • Hi,

         I tried my application with the standard codecs server provided with the DVSDK 3.10, whose location is "CE_INSTALL_DIR/cs2dm6467_1_00_00_03/packages/ti/sdo/server/cs/", and added JPEGENC to the server.

        if I did not comment out

       encStatus.data.buf    = NULL;

       encStatus.data.bufSize        = 0;

       the return value of  IMGENC1_control() would be 0xFFFFFFFF, it still failed, and the value

    of encStatus.extendedError is 0.

    if I set CE_DEBUG=2, here is part of print messages

    CEapp-> Creation of codecs succeeded!
    1
    @0,395,747us: [+0 T:0x4001e320] ti.sdo.ce.image1.IMGENC1 - IMGENC1_control> Enter (handle=0x15fb30, id=1, dynParams=0xbef17be8 (size=0x20), status=0xbef17b48 (size=0xa0)
    @0,395,859us: [+4 T:0x4001e320] CV - VISA_getMaxMsgSize(0x15fb30): returning 0x1000
    @0,395,951us: [+5 T:0x4001e320] CV - VISA_allocMsg> Allocating message for messageId=0x00020005
    @0,396,044us: [+0 T:0x4001e320] CV - VISA_call(visa=0x15fb30, msg=0x41212900): messageId=0x00020005, command=0x1
    [DSP] @0,093,407tk: [+5 T:0x8ba070ac] CN - NODE> 0x8fbc4b30(jpegenc#0) call(algHandle=0x8fbc4bf0, msg=0x8ff04900); messageId=0x00020005
    [DSP] @0,093,497tk: [+0 T:0x8ba070ac] XU - XdmUtils_validateExtendedStruct> Enter (pStruct=0x8ff04934, minSize=0x20, name=dynParams
    [DSP] @0,093,563tk: [+0 T:0x8ba070ac] XU - XdmUtils_validateExtendedStruct> return (0x1)
    [DSP] @0,093,605tk: [+0 T:0x8ba070ac] XU - XdmUtils_validateExtendedStruct> Enter (pStruct=0x8ff04954, minSize=0xa0, name=status
    [DSP] @0,093,666tk: [+0 T:0x8ba070ac] XU - XdmUtils_validateExtendedStruct> return (0x1)
    [DSP] @0,093,708tk: [+0 T:0x8ba070ac] ti.sdo.ce.image1.IMGENC1 - IMGENC1_control> Enter (handle=0x8fbc4bf0, id=1, dynParams=0x8ff04934 (size=0x20), status=0x8ff04954 (size=0xa0)
    [DSP] @0,093,805tk: [+5 T:0x8ba070ac] CV - VISA_enter(visa=0x8fbc4bf0): algHandle = 0x8fbc4c28
    [DSP] @0,093,858tk: [+0 T:0x8ba070ac] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x8fbc4c28)
    [DSP] @0,093,915tk: [+0 T:0x8ba070ac] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
    [DSP] @0,093,965tk: [+5 T:0x8ba070ac] CV - VISA_exit(visa=0x8fbc4bf0): algHandle = 0x8fbc4c28
    [DSP] @0,094,017tk: [+0 T:0x8ba070ac] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x8fbc4c28)
    [DSP] @0,094,071tk: [+0 T:0x8ba070ac] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
    [DSP] @0,094,118tk: [+0 T:0x8ba070ac] ti.sdo.ce.image1.IMGENC1 - IMGENC1_control> Exit (handle=0x8fbc4bf0, retVal=0xffffffff)
    [DSP] @0,094,183tk: [+5 T:0x8ba070ac] CN - NODE> returned from call(algHandle=0x8fbc4bf0, msg=0x8ff04900); messageId=0x00020005
    @0,398,417us: [+0 T:0x4001e320] CE - Engine_fwriteTrace> returning count [1590]
    @0,398,521us: [+0 T:0x4001e320] CV - VISA_call Completed: messageId=0x00020005, command=0x1, return(status=-1)
    @0,398,628us: [+5 T:0x4001e320] CV - VISA_freeMsg(0x15fb30, 0x41212900): Freeing message with messageId=0x00020005
    @0,398,724us: [+0 T:0x4001e320] ti.sdo.ce.image1.IMGENC1 - IMGENC1_control> Exit (handle=0x15fb30, retVal=0xffffffff)
    2 0
    @0,398,911us: [+7 T:0x4001e320] ti.sdo.ce.apps.jpegenc - encode control status = 0xffffffff

    "

  • I've moved this to the codec forum.  From the trace you've provided (thanks!), it looks like the framework is doing its job and invoking the remote codec.  We'll need some help from users who knows this particular codec's behavior.

    Chris