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.

jpeg encoder usage

I fixed the code by adding the following:

=======

    inbufdesc.numBufs = 1;
    inbufdesc.descs[0].buf = ptr;
    inbufdesc.descs[0].bufSize = width*height*2;
    outbufdesc.numBufs = 1;
    outbufdesc.descs[0].buf = tmpbuf;
    outbufdesc.descs[0].bufSize = width*height*2;
   
    res = IMGENC1_process(ieh, &inbufdesc, &outbufdesc, &inargs, &outargs) ;

=====

Now, it appear to run without errors and returns IMGENC1_EOK.

However number of bytes generated is 6291456 bytes. (JPEG encoded: 6291456 bytes). The content of the buffer does not look like a JPEG file. Looks more like YUV data (I used that buffer to process the YUV data).

What's wrong now?

  • FYI, I moved this to the Codec Forum... for those just tuning in, the original discussion started here, and includes some source code for background.

    Chris

  • I have added CE_CHECK=1 and CE_DEBUG=1 and got the following result:

    ===
    Capture initialized
    @0,754,587us: [+6 T:0x4001e320] CE - Engine_init> CE debugging on (CE_DEBUG=1; a
    llowed CE_DEBUG levels: 1=min, 2=good, 3=max)
    CE params set OK
    Input buffers needed: 1
    Input buffer 0 size: 1
    Output buffers needed: 1
    Output buffer 0 size: 1
    JPEG encoded: 6291456 bytes
    Cleaning capture
    ===

    with CE_DEBUG=3:

    ===
    Capture initialized
    @0,595,717us: [+4 T:0x4001e320 S:0xbecf08e4] OG - Global_init> This program was
    built with the following packages:
    @0,596,622us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package gnu.targets.arm.rt
    sv5T (/home/vmplanet/dvsdk/dvsdk_3_10_00_19/xdctools_3_16_01_27/packages/gnu/tar
    gets/arm/rtsv5T/) [1, 0, 0, 0]
    @0,597,301us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.xdais.dm.exampl
    es.imgenc1_copy (/home/vmplanet/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05_16/e
    xamples/ti/xdais/dm/examples/imgenc1_copy/) [2, 0, 0]
    @0,597,770us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.ce.global (
    /home/vmplanet/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05_16/packages/ti/sdo/ce
    /global/) [1, 0, 0]
    @0,598,205us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.xdais.dm (/home
    /vmplanet/dvsdk/dvsdk_3_10_00_19/xdais_6_25_02_11/packages/ti/xdais/dm/) [1, 0,
    5]
    @0,598,606us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.xdais (/home/vm
    planet/dvsdk/dvsdk_3_10_00_19/xdais_6_25_02_11/packages/ti/xdais/) [1, 2.0, 1]
    @0,599,013us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.ce.node (/h
    ome/vmplanet/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05_16/packages/ti/sdo/ce/n
    ode/) [1, 0, 0]
    @0,599,637us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.utils.trace
     (/home/vmplanet/dvsdk/dvsdk_3_10_00_19/framework_components_2_25_02_06/packages
    /ti/sdo/utils/trace/) [1, 0, 0]
    @0,600,443us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.ce.utils.xd
    m (/home/vmplanet/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05_16/packages/ti/sdo
    /ce/utils/xdm/) [1, 0, 2]
    @0,600,957us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.fc.global (
    /home/vmplanet/dvsdk/dvsdk_3_10_00_19/framework_components_2_25_02_06/packages/t
    i/sdo/fc/global/) [1, 0, 0]
    @0,601,396us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.linuxutils.
    cmem (/home/vmplanet/dvsdk/dvsdk_3_10_00_19/linuxutils_2_25_04_10/packages/ti/sd
    o/linuxutils/cmem/) [2, 2, 0]
    @0,601,820us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.fc.memutils
     (/home/vmplanet/dvsdk/dvsdk_3_10_00_19/framework_components_2_25_02_06/packages
    /ti/sdo/fc/memutils/) [1, 0, 0]
    @0,602,231us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.fc.utils (/
    home/vmplanet/dvsdk/dvsdk_3_10_00_19/framework_components_2_25_02_06/packages/ti
    /sdo/fc/utils/) [1, 0, 2]
    @0,602,648us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.fc.dman3 (/
    home/vmplanet/dvsdk/dvsdk_3_10_00_19/framework_components_2_25_02_06/packages/ti
    /sdo/fc/dman3/) [1, 0, 4]
    @0,603,072us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.fc.acpy3 (/
    home/vmplanet/dvsdk/dvsdk_3_10_00_19/framework_components_2_25_02_06/packages/ti
    /sdo/fc/acpy3/) [1, 0, 4]
    @0,603,492us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package gnu.targets (/home
    /vmplanet/dvsdk/dvsdk_3_10_00_19/xdctools_3_16_01_27/packages/gnu/targets/) [1,
    0, 1]
    @0,603,905us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package gnu.targets.arm (/
    home/vmplanet/dvsdk/dvsdk_3_10_00_19/xdctools_3_16_01_27/packages/gnu/targets/ar
    m/) [1, 0, 0, 0]
    @0,604,315us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.catalog.arm (/h
    ome/vmplanet/dvsdk/dvsdk_3_10_00_19/xdctools_3_16_01_27/packages/ti/catalog/arm/
    ) [1, 0, 1, 0]
    @0,604,724us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.catalog (/home/
    vmplanet/dvsdk/dvsdk_3_10_00_19/xdctools_3_16_01_27/packages/ti/catalog/) [1, 0,
     0]
    @0,605,125us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.platforms.evmDM
    355 (/home/vmplanet/dvsdk/dvsdk_3_10_00_19/xdctools_3_16_01_27/packages/ti/platf
    orms/evmDM355/) [1, 0, 0]
    @0,605,538us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.ce.osal (/h
    ome/vmplanet/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05_16/packages/ti/sdo/ce/o
    sal/) [2, 0, 2]
    @0,605,941us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.ce.osal.lin
    ux (/home/vmplanet/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05_16/packages/ti/sd
    o/ce/osal/linux/) [2, 0, 1]
    @0,606,477us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.ce.ipc (/ho
    me/vmplanet/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05_16/packages/ti/sdo/ce/ip
    c/) [2, 0, 1]
    @0,981,980us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.ce.ipc.linu
    x (/home/vmplanet/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05_16/packages/ti/sdo
    /ce/ipc/linux/) [2, 0, 1]
    @0,982,518us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.ce.alg (/ho
    me/vmplanet/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05_16/packages/ti/sdo/ce/al
    g/) [1, 0, 1]
    @0,983,026us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.ce (/home/v
    mplanet/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05_16/packages/ti/sdo/ce/) [1,
    0, 6]
    @0,983,496us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.ce.image1 (
    /home/vmplanet/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05_16/packages/ti/sdo/ce
    /image1/) [1, 0, 1]
    @0,983,913us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package ti.sdo.ce.examples
    .codecs.imgenc1_copy (/home/vmplanet/dvsdk/dvsdk_3_10_00_19/codec_engine_2_25_05
    _16/examples/ti/sdo/ce/examples/codecs/imgenc1_copy/) [1, 0, 0]
    @0,984,433us: [+4 T:0x4001e320 S:0xbecf08e4] OG -     package local (/home/vmpla
    net/dvsdk/example355/local/) []
    @0,984,913us: [+0 T:0x4001e320 S:0xbecf08ec] OG - Global_atexit> enter (fxn=0x16
    8c8)
    @0,985,389us: [+0 T:0x4001e320 S:0xbecf08ec] OG - Global_atexit> enter (fxn=0x15
    d14)
    @0,986,082us: [+0 T:0x4001e320 S:0xbecf08bc] OM - Memory_alloc> Enter(0x18)
    @0,986,582us: [+0 T:0x4001e320 S:0xbecf08bc] OM - Memory_alloc> return (0x210f0)
    @0,987,015us: [+0 T:0x4001e320 S:0xbecf08dc] OG - Global_atexit> enter (fxn=0x13
    b9c)
    @0,987,982us: [+0 T:0x4001e320 S:0xbecf08dc] OG - Global_atexit> enter (fxn=0x15
    378)
    @0,988,640us: [+0 T:0x4001e320 S:0xbecf08ec] OG - Global_atexit> enter (fxn=0x12
    f40)
    @0,989,412us: [+0 T:0x4001e320 S:0xbecf08d4] ti.sdo.ce.alg - ALG_init> Enter
    @0,989,986us: [+0 T:0x4001e320 S:0xbecf0894] ti.sdo.ce.osal.SemMP - SemMP_create
    > key: 0x4f474c42 count: 1
    @0,990,805us: [+0 T:0x4001e320 S:0xbecf087c] OM - Memory_alloc> Enter(0x4)
    @0,991,331us: [+0 T:0x4001e320 S:0xbecf087c] OM - Memory_alloc> return (0x21228)
    @0,991,764us: [+0 T:0x4001e320 S:0xbecf087c] ti.sdo.ce.osal.SemMP - Entered ente
    rCS> key[0x4c41534f]
    @0,992,536us: [+0 T:0x4001e320 S:0xbecf087c] ti.sdo.ce.osal.SemMP - Leaving ente
    rCS> id[0x60000]
    @0,993,520us: [+0 T:0x4001e320 S:0xbecf0894] ti.sdo.ce.osal.SemMP - SemMP_create
    > semId: 0x68001 refCount: 1
    @0,994,119us: [+0 T:0x4001e320 S:0xbecf087c] ti.sdo.ce.osal.SemMP - Entered exit
    CS> id[0x60000]
    @0,994,642us: [+0 T:0x4001e320 S:0xbecf0894] ti.sdo.ce.osal.SemMP - Leaving exit
    CS
    @0,995,065us: [+0 T:0x4001e320 S:0xbecf0894] ti.sdo.ce.osal.SemMP - Leaving SemM
    P_create> sem[0x21228]
    @0,995,576us: [+0 T:0x4001e320 S:0xbecf08f4] ti.sdo.ce.alg - ALG_init> Exit
    @0,995,983us: [+0 T:0x4001e320 S:0xbecf08ec] OG - Global_atexit> enter (fxn=0x10
    c18)
    @0,996,453us: [+0 T:0x4001e320 S:0xbecf08c4] OM - Memory_alloc> Enter(0x18)
    @0,996,954us: [+0 T:0x4001e320 S:0xbecf08c4] OM - Memory_alloc> return (0x21268)
    @0,997,386us: [+0 T:0x4001e320 S:0xbecf08ec] OG - Global_atexit> enter (fxn=0x15
    868)
    @0,997,999us: [+6 T:0x4001e320 S:0xbecf08e4] CE - Engine_init> CE debugging on (
    CE_DEBUG=3; allowed CE_DEBUG levels: 1=min, 2=good, 3=max)
    @0,998,584us: [+0 T:0x4001e320 S:0xbecf08d4] OG - Global_atexit> enter (fxn=0xdd
    d8)
    @0,999,035us: [+0 T:0x4001e320 S:0xbecf08b4] OM - Memory_alloc> Enter(0x18)
    @0,999,474us: [+0 T:0x4001e320 S:0xbecf08b4] OM - Memory_alloc> return (0x212a8)
    @0,999,984us: [+0 T:0x4001e320 S:0xbecf08b4] OM - Memory_alloc> Enter(0x18)
    @1,000,827us: [+0 T:0x4001e320 S:0xbecf08b4] OM - Memory_alloc> return (0x212c8)
    @1,001,374us: [+0 T:0x4001e320 S:0xbecf08b4] OM - Memory_alloc> Enter(0x18)
    @1,001,814us: [+0 T:0x4001e320 S:0xbecf08b4] OM - Memory_alloc> return (0x212e8)
    @1,002,512us: [+0 T:0x4001e320 S:0xbecf08fc] CS - Server_init()
    @1,002,973us: [+0 T:0x4001e320 S:0xbecf08fc] CS - Server_init> Global_useLinkArb
    iter = 0
    @1,003,402us: [+0 T:0x4001e320 S:0xbecf08fc] OG - Global_atexit> enter (fxn=0xc0
    18)
    @1,004,129us: [+0 T:0x4001e320 S:0xbecf08ac] CE - Engine_open> Enter('imgenc1_co
    py', 0x0, 0xbecf0bd4)
    @1,004,637us: [+0 T:0x4001e320 S:0xbecf0894] OM - Memory_alloc> Enter(0x2c)
    @1,337,033us: [+0 T:0x4001e320 S:0xbecf0894] OM - Memory_alloc> return (0x21338)
    @1,337,563us: [+0 T:0x4001e320 S:0xbecf08ac] CE - Engine_open> return(135992)
    @1,338,118us: [+0 T:0x4001e320 S:0xbecf08e4] ti.sdo.ce.image1.IMGENC1 - IMGENC1_
    create> Enter (engine=0x21338, name='jpegenc', params=0xbecf0ba8)
    @1,338,659us: [+0 T:0x4001e320 S:0xbecf08b4] CV - VISA_create(0x21338, 'jpegenc'
    , 0xbecf0ba8, 0x460, 'ti.sdo.ce.image1.IIMGENC1')
    @1,339,134us: [+0 T:0x4001e320 S:0xbecf07ac] CV - VISA_create2(0x21338, 'jpegenc
    ', 0xbecf0ba8, 0x18, 0x460, 'ti.sdo.ce.image1.IIMGENC1')
    @1,339,858us: [+0 T:0x4001e320 S:0xbecf0794] OM - Memory_alloc> Enter(0x34)
    @1,340,883us: [+0 T:0x4001e320 S:0xbecf0794] OM - Memory_alloc> return (0x213b8)
    @1,341,344us: [+0 T:0x4001e320 S:0xbecf076c] ti.sdo.ce.alg.Algorithm - Algorithm
    _create> Enter (fxns=0x205fc, idma3Fxns=0x0, iresFxns=0x0, params=0xbecf0ba8, at
    trs=0xbecf089c)
    @1,341,818us: [+2 T:0x4001e320 S:0xbecf076c] ti.sdo.ce.alg.Algorithm - Algorithm
    _create> useCachedMem = -1
    @1,342,311us: [+0 T:0x4001e320 S:0xbecf0754] OM - Memory_alloc> Enter(0x14)
    @1,342,734us: [+0 T:0x4001e320 S:0xbecf0754] OM - Memory_alloc> return (0x213f0)
    @1,343,144us: [+0 T:0x4001e320 S:0xbecf0724] ti.sdo.ce.alg - ALG_create> Enter (
    scratchId=1, fxns=0x205fc, parentAlg=0x0, params=0xbecf0ba8, useCacheMem=-1)
    @1,343,677us: [+2 T:0x4001e320 S:0xbecf0724] ti.sdo.ce.alg - ALG_create> algNumA
    lloc 4 memory recs
    @1,344,109us: [+2 T:0x4001e320 S:0xbecf0724] ti.sdo.ce.alg - ALG_create> algAllo
    c returned numRecs=1
    @1,344,503us: [+4 T:0x4001e320 S:0xbecf0724] ti.sdo.ce.alg - ALG_create>  Memory
     requested memTab[0]: size=0x4, align=0x0, space=0x11, attrs=0x1
    @1,345,021us: [+0 T:0x4001e320 S:0xbecf06dc] ti.sdo.ce.alg - _ALG_allocMemory2>
    memTab=0x21408, n=1, useCachedMem=-1
    @1,345,480us: [+0 T:0x4001e320 S:0xbecf06c4] OM - Memory_alloc> Enter(0x4)
    @1,345,883us: [+0 T:0x4001e320 S:0xbecf067c] OM - Memory_contigAlloc> Enter(size
    =4, align=0, cached=FALSE, heap=FALSE)
    @1,346,853us: [+4 T:0x4001e320 S:0xbecf067c] OM - Memory_contigAlloc> CMEM_alloc
    (4) = 0x40022000.
    @1,347,400us: [+4 T:0x4001e320 S:0xbecf067c] OM - Memory_contigAlloc> CMEM_getPh
    ys(0x40022000) = 0x86ac8000.
    @1,347,943us: [+1 T:0x4001e320 S:0xbecf0634] OM - Memory__addContigBuf> Enter(vi
    rtAddr=0x40022000, size=4, physAddr=0x86ac8000)
    @1,348,396us: [+1 T:0x4001e320 S:0xbecf0634] OM - Memory__addContigBuf> creating
     new contigBuf object
    @1,348,782us: [+0 T:0x4001e320 S:0xbecf061c] OM - Memory_alloc> Enter(0x10)
    @1,349,273us: [+0 T:0x4001e320 S:0xbecf061c] OM - Memory_alloc> return (0x21460)
    @1,349,697us: [+1 T:0x4001e320 S:0xbecf0634] OM - Memory__addContigBuf> returnin
    g: cb->phys=0x86ac8000, cb->size=4, cb->virt=0x40022000
    @1,350,560us: [+0 T:0x4001e320 S:0xbecf067c] OM - Memory_contigAlloc> return (0x
    40022000)
    @1,351,042us: [+0 T:0x4001e320 S:0xbecf06c4] OM - Memory_alloc> return (0x400220
    00)
    @1,351,530us: [+0 T:0x4001e320 S:0xbecf06dc] ti.sdo.ce.alg - _ALG_allocMemory2>
    Returning (TRUE)@1,351,762us: [+4 T:0x4001e320 S:0xbecf0724] ti.sdo.ce.alg - ALG
    _create> algInit returned IALG_EOK
    @1,352,574us: [+0 T:0x4001e320 S:0xbecf0724] ti.sdo.ce.alg - ALG_create> Exit (a
    lgHandle=0x40022000)
    @1,353,082us: [+0 T:0x4001e320 S:0xbecf076c] ti.sdo.ce.alg.Algorithm - Algorithm
    _create> return (0x213f0)
    @1,353,635us: [+5 T:0x4001e320 S:0xbecf07ac] CV - VISA_create> local codec creat
    ed (name='jpegenc', handle=0x213f0)
    @1,354,064us: [+0 T:0x4001e320 S:0xbecf08e4] ti.sdo.ce.image1.IMGENC1 - IMGENC_c
    reate> return (0x213b8)
    @1,354,510us: [+0 T:0x4001e320 S:0xbecf0874] XU - XdmUtils_validateExtendedStruc
    t> Enter (pStruct=0xbecf0b88, minSize=0x20, name=dynParams
    @1,355,054us: [+0 T:0x4001e320 S:0xbecf0874] XU - XdmUtils_validateExtendedStruc
    t> return (0x1)
    @1,355,471us: [+0 T:0x4001e320 S:0xbecf0874] XU - XdmUtils_validateExtendedStruc
    t> Enter (pStruct=0xbecf0ae8, minSize=0xa0, name=status
    @1,355,886us: [+0 T:0x4001e320 S:0xbecf0874] XU - XdmUtils_validateExtendedStruc
    t> return (0x1)
    @1,356,381us: [+0 T:0x4001e320 S:0xbecf089c] ti.sdo.ce.image1.IMGENC1 - IMGENC1_
    control> Enter (handle=0x213b8, id=1, dynParams=0xbecf0b88 (size=0x20), status=0
    xbecf0ae8 (size=0xa0)
    @1,689,279us: [+5 T:0x4001e320 S:0xbecf087c] CV - VISA_enter(visa=0x213b8): algH
    andle = 0x213f0
    @1,689,893us: [+0 T:0x4001e320 S:0xbecf086c] ti.sdo.ce.alg.Algorithm - Algorithm
    _activate> Enter(alg=0x213f0)
    @1,690,936us: [+0 T:0x4001e320 S:0xbecf0834] ti.sdo.ce.osal.SemMP - Entered SemM
    P_pend> sem[0x21228] timeout[0xffffffff]
    @1,691,456us: [+0 T:0x4001e320 S:0xbecf0834] ti.sdo.ce.osal.SemMP - Leaving SemM
    P_pend> sem[0x21228] status[0]
    @1,692,020us: [+0 T:0x4001e320 S:0xbecf087c] ti.sdo.ce.alg.Algorithm - Algorithm
    _activate> Exit
    @1,692,449us: [+5 T:0x4001e320 S:0xbecf0884] CV - VISA_exit(visa=0x213b8): algHa
    ndle = 0x213f0
    @1,692,842us: [+0 T:0x4001e320 S:0xbecf0874] ti.sdo.ce.alg.Algorithm - Algorithm
    _deactivate> Enter(alg=0x213f0)
    @1,693,358us: [+0 T:0x4001e320 S:0xbecf0854] ti.sdo.ce.osal.SemMP - Entered SemM
    P_post> sem[0x21228]
    @1,693,819us: [+0 T:0x4001e320 S:0xbecf0854] ti.sdo.ce.osal.SemMP - Leaving SemM
    P_post> sem[0x21228]
    @1,694,241us: [+0 T:0x4001e320 S:0xbecf0884] ti.sdo.ce.alg.Algorithm - Algorithm
    _deactivate> Exit
    @1,694,865us: [+0 T:0x4001e320 S:0xbecf089c] ti.sdo.ce.image1.IMGENC1 - IMGENC1_
    control> Exit (handle=0x213b8, retVal=0x0)
    CE params set OK
    @1,695,501us: [+0 T:0x4001e320 S:0xbecf0874] XU - XdmUtils_validateExtendedStruc
    t> Enter (pStruct=0xbecf0b88, minSize=0x20, name=dynParams
    @1,696,052us: [+0 T:0x4001e320 S:0xbecf0874] XU - XdmUtils_validateExtendedStruc
    t> return (0x1)
    @1,696,478us: [+0 T:0x4001e320 S:0xbecf0874] XU - XdmUtils_validateExtendedStruc
    t> Enter (pStruct=0xbecf0ae8, minSize=0xa0, name=status
    @1,696,903us: [+0 T:0x4001e320 S:0xbecf0874] XU - XdmUtils_validateExtendedStruc
    t> return (0x1)
    @1,697,379us: [+0 T:0x4001e320 S:0xbecf089c] ti.sdo.ce.image1.IMGENC1 - IMGENC1_
    control> Enter (handle=0x213b8, id=5, dynParams=0xbecf0b88 (size=0x20), status=0
    xbecf0ae8 (size=0xa0)
    @1,697,869us: [+5 T:0x4001e320 S:0xbecf087c] CV - VISA_enter(visa=0x213b8): algH
    andle = 0x213f0
    @1,698,289us: [+0 T:0x4001e320 S:0xbecf086c] ti.sdo.ce.alg.Algorithm - Algorithm
    _activate> Enter(alg=0x213f0)
    @1,698,773us: [+0 T:0x4001e320 S:0xbecf0834] ti.sdo.ce.osal.SemMP - Entered SemM
    P_pend> sem[0x21228] timeout[0xffffffff]
    @1,699,263us: [+0 T:0x4001e320 S:0xbecf0834] ti.sdo.ce.osal.SemMP - Leaving SemM
    P_pend> sem[0x21228] status[0]
    @1,699,711us: [+0 T:0x4001e320 S:0xbecf087c] ti.sdo.ce.alg.Algorithm - Algorithm
    _activate> Exit
    @1,700,582us: [+5 T:0x4001e320 S:0xbecf0884] CV - VISA_exit(visa=0x213b8): algHa
    ndle = 0x213f0
    @1,701,054us: [+0 T:0x4001e320 S:0xbecf0874] ti.sdo.ce.alg.Algorithm - Algorithm
    _deactivate> Enter(alg=0x213f0)
    @1,701,591us: [+0 T:0x4001e320 S:0xbecf0854] ti.sdo.ce.osal.SemMP - Entered SemM
    P_post> sem[0x21228]
    @1,702,065us: [+0 T:0x4001e320 S:0xbecf0854] ti.sdo.ce.osal.SemMP - Leaving SemM
    P_post> sem[0x21228]
    @1,702,494us: [+0 T:0x4001e320 S:0xbecf0884] ti.sdo.ce.alg.Algorithm - Algorithm
    _deactivate> Exit
    @1,702,991us: [+0 T:0x4001e320 S:0xbecf089c] ti.sdo.ce.image1.IMGENC1 - IMGENC1_
    control> Exit (handle=0x213b8, retVal=0x0)
    Input buffers needed: 1
    Input buffer 0 size: 1
    Output buffers needed: 1
    Output buffer 0 size: 1
    @1,704,014us: [+0 T:0x4001e320 S:0xbecf0894] XU - XdmUtils_validateExtendedStruc
    t> Enter (pStruct=0xbecf0bd0, minSize=0x4, name=inArgs
    @1,704,558us: [+0 T:0x4001e320 S:0xbecf0894] XU - XdmUtils_validateExtendedStruc
    t> return (0x1)
    @1,704,965us: [+0 T:0x4001e320 S:0xbecf0894] XU - XdmUtils_validateExtendedStruc
    t> Enter (pStruct=0xbecf0bc0, minSize=0x10, name=outArgs
    @1,705,379us: [+0 T:0x4001e320 S:0xbecf0894] XU - XdmUtils_validateExtendedStruc
    t> return (0x1)
    @1,705,879us: [+0 T:0x4001e320 S:0xbecf08bc] ti.sdo.ce.image1.IMGENC1 - IMGENC1_
    process> Enter (handle=0x213b8, inBufs=0xbecf0a24, outBufs=0xbecf0960, inArgs=0x
    becf0bd0, outArgs=0xbecf0bc0)
    @1,706,351us: [+0 T:0x4001e320 S:0xbecf089c] XU - XdmUtils_validateSparseBufDesc
    1> Enter (bufDesc=0xbecf0a24, name=inBufs
    @2,038,715us: [+0 T:0x4001e320 S:0xbecf089c] XU - XdmUtils_validateSparseBufDesc
    1> return (0x1)
    @2,039,220us: [+0 T:0x4001e320 S:0xbecf089c] XU - XdmUtils_validateSparseBufDesc
    1> Enter (bufDesc=0xbecf0960, name=outBufs
    @2,039,743us: [+0 T:0x4001e320 S:0xbecf089c] XU - XdmUtils_validateSparseBufDesc
    1> return (0x1)
    @2,040,540us: [+5 T:0x4001e320 S:0xbecf089c] CV - VISA_enter(visa=0x213b8): algH
    andle = 0x213f0
    @2,041,150us: [+0 T:0x4001e320 S:0xbecf088c] ti.sdo.ce.alg.Algorithm - Algorithm
    _activate> Enter(alg=0x213f0)
    @2,041,625us: [+0 T:0x4001e320 S:0xbecf0854] ti.sdo.ce.osal.SemMP - Entered SemM
    P_pend> sem[0x21228] timeout[0xffffffff]
    @2,042,134us: [+0 T:0x4001e320 S:0xbecf0854] ti.sdo.ce.osal.SemMP - Leaving SemM
    P_pend> sem[0x21228] status[0]
    @2,042,670us: [+0 T:0x4001e320 S:0xbecf089c] ti.sdo.ce.alg.Algorithm - Algorithm
    _activate> Exit
    @2,855,666us: [+5 T:0x4001e320 S:0xbecf08a4] CV - VISA_exit(visa=0x213b8): algHa
    ndle = 0x213f0
    @2,856,296us: [+0 T:0x4001e320 S:0xbecf0894] ti.sdo.ce.alg.Algorithm - Algorithm
    _deactivate> Enter(alg=0x213f0)
    @2,856,765us: [+0 T:0x4001e320 S:0xbecf0874] ti.sdo.ce.osal.SemMP - Entered SemM
    P_post> sem[0x21228]
    @2,857,243us: [+0 T:0x4001e320 S:0xbecf0874] ti.sdo.ce.osal.SemMP - Leaving SemM
    P_post> sem[0x21228]
    @2,857,667us: [+0 T:0x4001e320 S:0xbecf08a4] ti.sdo.ce.alg.Algorithm - Algorithm
    _deactivate> Exit
    @2,858,063us: [+0 T:0x4001e320 S:0xbecf08bc] ti.sdo.ce.image1.IMGENC1 - IMGENC1_
    process> Exit (handle=0x213b8, retVal=0x0)
    JPEG encoded: 6291456 bytes
    @3,570,397us: [+0 T:0x4001e320 S:0xbecf08fc] ti.sdo.ce.image1.IMGENC1 - IMGENC1_
    delete> Enter (handle=0x213b8)
    @3,571,074us: [+0 T:0x4001e320 S:0xbecf08d4] CV - VISA_delete(0x213b8)
    @3,571,502us: [+5 T:0x4001e320 S:0xbecf08d4] CV - VISA_delete> deleting codec (l
    ocalQueue=0xffff, remoteQueue=0xffff)
    @3,571,918us: [+5 T:0x4001e320 S:0xbecf08d4] CV - VISA_delete> deleting codec 0x
    213f0
    @3,572,311us: [+0 T:0x4001e320 S:0xbecf08bc] ti.sdo.ce.alg.Algorithm - Algorithm
    _delete> Enter(alg=0x213f0)
    @3,572,733us: [+0 T:0x4001e320 S:0xbecf086c] ti.sdo.ce.alg - _ALG_freeMemory2> m
    emTab=0x21408, n=1, useCachedMem=0
    @3,573,150us: [+0 T:0x4001e320 S:0xbecf084c] OM - Memory_free> Enter(0x40022000,
     0x4)
    @3,573,545us: [+0 T:0x4001e320 S:0xbecf0814] OM - Memory_contigFree> Enter(addr=
    1073881088, size=4)
    @3,573,940us: [+1 T:0x4001e320 S:0xbecf07ec] OM - Memory__removeContigBuf> Enter
    (virtAddr=0x40022000, size=4)
    @3,574,343us: [+1 T:0x4001e320 S:0xbecf07ec] OM - Memory__removeContigBuf> remov
    ing cb->phys=0x86ac8000, cb->size=0x4, cb->virt=0x40022000
    @3,574,754us: [+0 T:0x4001e320 S:0xbecf07cc] OM - Memory_free> Enter(0x21460, 0x
    10)
    @3,575,155us: [+0 T:0x4001e320 S:0xbecf07cc] OM - Memory_free> return (0x1)
    @3,576,003us: [+0 T:0x4001e320 S:0xbecf0814] OM - Memory_contigFree> return (0x1
    )
    @3,576,514us: [+0 T:0x4001e320 S:0xbecf084c] OM - Memory_free> return (0x1)
    @3,576,935us: [+0 T:0x4001e320 S:0xbecf089c] OM - Memory_free> Enter(0x213f0, 0x
    14)
    @3,577,347us: [+0 T:0x4001e320 S:0xbecf089c] OM - Memory_free> return (0x1)
    @3,577,735us: [+0 T:0x4001e320 S:0xbecf08d4] ti.sdo.ce.alg.Algorithm - Algorithm
    _delete> Exit
    @3,578,121us: [+0 T:0x4001e320 S:0xbecf08b4] OM - Memory_free> Enter(0x213b8, 0x
    34)
    @3,578,516us: [+0 T:0x4001e320 S:0xbecf08b4] OM - Memory_free> return (0x1)
    @3,578,899us: [+0 T:0x4001e320 S:0xbecf090c] ti.sdo.ce.image1.IMGENC1 - IMGENC1_
    delete> return
    @3,579,288us: [+0 T:0x4001e320 S:0xbecf08ec] CE - Engine_close(0x21338)
    @3,579,677us: [+0 T:0x4001e320 S:0xbecf08cc] CS - Server_disconnectTrace('0x2133
    8', 0x0)
    @3,580,403us: [+0 T:0x4001e320 S:0xbecf08cc] CS - Server_connectTrace> return(0)
    @3,580,890us: [+0 T:0x4001e320 S:0xbecf08ec] OM - Memory_free> Enter(0x21338, 0x
    2c)
    @3,581,320us: [+0 T:0x4001e320 S:0xbecf08ec] OM - Memory_free> return (0x1)
    @3,581,720us: [+0 T:0x4001e320 S:0xbecf08fc] OG - Global_exit> enter
    @3,582,081us: [+2 T:0x4001e320 S:0xbecf08fc] OG - Global_exit> calling function
    *0xc018()...
    @3,582,492us: [+2 T:0x4001e320 S:0xbecf08fc] OG - Global_exit> calling function
    *0xddd8()...
    @3,582,981us: [+0 T:0x4001e320 S:0xbecf08cc] OM - Memory_free> Enter(0x212a8, 0x
    18)
    @3,583,440us: [+0 T:0x4001e320 S:0xbecf08cc] OM - Memory_free> return (0x1)
    @3,583,833us: [+0 T:0x4001e320 S:0xbecf08cc] OM - Memory_free> Enter(0x212c8, 0x
    18)
    @3,584,227us: [+0 T:0x4001e320 S:0xbecf08cc] OM - Memory_free> return (0x1)
    @3,584,617us: [+0 T:0x4001e320 S:0xbecf08cc] OM - Memory_free> Enter(0x212e8, 0x
    18)
    @3,585,003us: [+0 T:0x4001e320 S:0xbecf08cc] OM - Memory_free> return (0x1)
    @3,585,402us: [+2 T:0x4001e320 S:0xbecf08fc] OG - Global_exit> calling function
    *0x15868()...
    @3,585,805us: [+2 T:0x4001e320 S:0xbecf08fc] OG - Global_exit> calling function
    *0x10c18()...
    @3,586,205us: [+0 T:0x4001e320 S:0xbecf089c] ti.sdo.ce.osal.SemMP - Entered SemM
    P_delete> sem[0x21228]
    @3,586,607us: [+0 T:0x4001e320 S:0xbecf0884] ti.sdo.ce.osal.SemMP - Entered ente
    rCS> key[0x4c41534f]
    @3,587,074us: [+0 T:0x4001e320 S:0xbecf0884] ti.sdo.ce.osal.SemMP - Leaving ente
    rCS> id[0x70000]
    @3,587,543us: [+0 T:0x4001e320 S:0xbecf089c] ti.sdo.ce.osal.SemMP - SemMP_delete
    > sem: 0x68001, ref count: 1
    @3,588,125us: [+1 T:0x4001e320 S:0xbecf089c] ti.sdo.ce.osal.SemMP - SemMP_delete
    > Deleted semaphore: 0x68001
    @3,588,582us: [+0 T:0x4001e320 S:0xbecf0884] ti.sdo.ce.osal.SemMP - Entered exit
    CS> id[0x70000]
    @3,589,050us: [+0 T:0x4001e320 S:0xbecf089c] ti.sdo.ce.osal.SemMP - Leaving exit
    CS
    @3,589,460us: [+0 T:0x4001e320 S:0xbecf087c] OM - Memory_free> Enter(0x21228, 0x
    4)
    @3,589,880us: [+0 T:0x4001e320 S:0xbecf087c] OM - Memory_free> return (0x1)
    @3,590,778us: [+0 T:0x4001e320 S:0xbecf089c] ti.sdo.ce.osal.SemMP - Leaving SemM
    P_delete>
    @3,923,557us: [+2 T:0x4001e320 S:0xbecf08fc] OG - Global_exit> calling function
    *0x12f40()...
    @3,924,090us: [+2 T:0x4001e320 S:0xbecf08fc] OG - Global_exit> calling function
    *0x15378()...
    @3,924,743us: [+2 T:0x4001e320 S:0xbecf08fc] OG - Global_exit> calling function
    *0x13b9c()...
    @3,925,232us: [+0 T:0x4001e320 S:0xbecf08cc] OM - Memory_free> Enter(0x210f0, 0x
    18)
    @3,925,652us: [+0 T:0x4001e320 S:0xbecf08cc] OM - Memory_free> return (0x1)
    @3,926,233us: [+2 T:0x4001e320 S:0xbecf08fc] OG - Global_exit> calling function
    *0x15d14()...
    @3,926,667us: [+2 T:0x4001e320 S:0xbecf08fc] OG - Global_exit> calling function
    *0x168c8()...
    @3,927,076us: [+2 T:0x4001e320 S:0xbecf08fc] OG - Global_exit> calling function
    *0x15c74()...
    Cleaning capture

    ===

  • Gennadiy Kiryukhin said:
    However number of bytes generated is 6291456 bytes. (JPEG encoded: 6291456 bytes). The content of the buffer does not look like a JPEG file. Looks more like YUV data (I used that buffer to process the YUV data).

    As we found here, it's because you're using one of the example "copy codecs" that your "encoding compression" wasn't very good.  :)

    Gennadiy is looking for a DM355 JPEG Encoder for DM355 - can anyone here help locate that?

    Chris

  • I was wondering about that (see my post regarding .cfg file in the original thread). I could have made similar encoder myself in a second even on a sub$ micro :)

    I have very minuscule understanding of .cfg files, so I took portions of a sample file that referred to jpeg and kept modifying it until the program compiled. Well.. here is the result.

    This morning, I tried using var encoder = xdc.useModule('ti.sdo.codecs.jpegenc.ce.JPEGENC') line and got an error message like this:

    GROUPUTILS ERROR: Please configure GROUPUTILS.sem*Fxn correctly or set the FC.osalPackage to the package that implements the OSA

    Here is the content of my latest .cfg file that does not make (it):

    var Program = xdc.useModule('xdc.cfg.Program');
    var osalGlobal = xdc.useModule('ti.sdo.ce.osal.Global');
    osalGlobal.runtimeEnv = osalGlobal.LINUX;
    var encoder = xdc.useModule('ti.sdo.codecs.jpegenc.ce.JPEGENC');
    var Engine = xdc.useModule('ti.sdo.ce.Engine');
    var myEngine = Engine.create("imgenc1_copy", [
        {name: "jpegenc", mod: encoder, local: true, groupId: 1},
    ]);

  • Well,

    I decided to copy the .cfg file from dvtb project. I compiled and I was able to get a jpeg picture! ...not so fast. I got the following errors:

    ======================================================================
    CMEMK Error: get_phys: Unable to find phys addr for 0x00000000
    CE params set OKCMEMK Error: get_phys: get_user_pages() failed: -14

    Input buffers CMEMK Error: GETPHYS: Failed to convert virtual 0x0 to physical.
    needed: 3
    InputCMEMK Error: get_phys: Unable to find phys addr for 0x00000000
     buffer 0 size: CMEMK Error: get_phys: get_user_pages() failed: -14
    3145728
    Input bCMEMK Error: GETPHYS: Failed to convert virtual 0x0 to physical.
    uffer 1 size: 15CMEMK Error: get_phys: Unable to find phys addr for 0x400275e0
    72864
    Input bufCMEMK Error: get_phys: get_user_pages() failed: -14
    fer 2 size: 1572CMEMK Error: GETPHYS: Failed to convert virtual 0x400275e0 to ph
    ysical.
    864
    Output buffCMEMK Error: get_phys: Unable to find phys addr for 0x400275e0
    ers needed: 1
    OCMEMK Error: get_phys: get_user_pages() failed: -14
    utput buffer 0 sCMEMK Error: GETPHYS: Failed to convert virtual 0x400275e0 to ph
    ysical.
    ize: 6291456
    CMCMEMK Error: get_phys: Unable to find phys addr for 0x00000008
    EM Error: getPhyCMEMK Error: get_phys: get_user_pages() failed: -14
    s: Failed to getCMEMK Error: GETPHYS: Failed to convert virtual 0x8 to physical.
     physical addresCMEMK Error: get_phys: Unable to find phys addr for 0x00000008
    s of 0
    CMEM ErrCMEMK Error: get_phys: get_user_pages() failed: -14
    or: getPhys: FaiCMEMK Error: GETPHYS: Failed to convert virtual 0x8 to physical.
    led to get physiCMEMK Error: get_phys: Unable to find phys addr for 0x400275e8
    cal address of 0CMEMK Error: get_phys: get_user_pages() failed: -14

    CMEM Error: geCMEMK Error: GETPHYS: Failed to convert virtual 0x400275e8 to phys
    ical.
    tPhys: Failed toCMEMK Error: get_phys: Unable to find phys addr for 0x400275e8
     get physical adCMEMK Error: get_phys: get_user_pages() failed: -14
    dress of 0x40027CMEMK Error: GETPHYS: Failed to convert virtual 0x400275e8 to ph
    ysical.
    5e0
    CMEM Error:CMEMK Error: get_phys: Unable to find phys addr for 0x00000010
     getPhys: FailedCMEMK Error: get_phys: get_user_pages() failed: -14
     to get physicalCMEMK Error: GETPHYS: Failed to convert virtual 0x10 to physical
    .
     address of 0x40CMEMK Error: get_phys: Unable to find phys addr for 0x00000010
    0275e0
    CMEM ErrCMEMK Error: get_phys: get_user_pages() failed: -14
    or: getPhys: FaiCMEMK Error: GETPHYS: Failed to convert virtual 0x10 to physical
    .
    led to get physiCMEMK Error: get_phys: Unable to find phys addr for 0x400275f0
    cal address of 0CMEMK Error: get_phys: get_user_pages() failed: -14
    x8
    CMEM Error: CMEMK Error: GETPHYS: Failed to convert virtual 0x400275f0 to physic
    al.
    getPhys: Failed CMEMK Error: get_phys: Unable to find phys addr for 0x400275f0
    to get physical CMEMK Error: get_phys: get_user_pages() failed: -14
    address of 0x8
    CMEMK Error: GETPHYS: Failed to convert virtual 0x400275f0 to physical.
    CMEM Error: getPCMEMK Error: get_phys: Unable to find phys addr for 0x00000000
    hys: Failed to gCMEMK Error: get_phys: get_user_pages() failed: -14
    et physical addrCMEMK Error: GETPHYS: Failed to convert virtual 0x0 to physical.
    ess of 0x400275eCMEMK Error: get_phys: Unable to find phys addr for 0x400275e0
    8
    CMEM Error: gCMEMK Error: get_phys: get_user_pages() failed: -14
    etPhys: Failed tCMEMK Error: GETPHYS: Failed to convert virtual 0x400275e0 to ph
    ysical.
    o get physical address of 0x400275e8
    CMEM Error: getPhys: Failed to get physical address of 0x10
    CMEM Error: getPhys: Failed to get physical address of 0x10
    CMEM Error: getPhys: Failed to get physical address of 0x400275f0
    CMEM Error: getPhys: Failed to get physical address of 0x400275f0
    CMEM Error: getPhys: Failed to get physical address of 0
    CMEM Error: getPhys: Failed to get physical address of 0x400275e0
    CMEMK Error: get_phys: Unable to find phys addr for 0x00000000
    CMEMK Error: get_phys: get_user_pages() failed: -14
    CMEMK Error: GETPHYS: Failed to convert virtual 0x0 to physical.
    CMEMK Error: get_phys: Unable to find phys addr for 0x400275e0
    CMEM Error: getPCMEMK Error: get_phys: get_user_pages() failed: -14
    hys: Failed to gCMEMK Error: GETPHYS: Failed to convert virtual 0x400275e0 to ph
    ysical.
    et physical address of 0
    CMEM Error: getPhys: Failed to get physical address of 0x400275e0
    JPEG encoded: 662026 bytes

    ======================================================

    I addition my picture looks like this (was scaled down from 2048x1536):

    You can barely make out the duct pipe and the seams in the sealing.

    Update: The file size seems to be a bit too big for this picture (quality factor was set to 75%). I used to see pictures around 200K with Q of 75% a a bit busier content. Could that be just difference in quantization table?

    Also, that noise at the top of the picture is not present in the original YUV input buffer. The input buffer gets saved too after the compression. I have looked at the file using Hexplorer (nice program BTW) in pixel view. It does not do proper display of color but it gives the idea about the patterns. That noise is not present in the original buffer even after compression.

  • For the CMEM errors, it might be time to pull out CE_DEBUG=3 again.  Just from those errors, it feels like there's something funny about the memory you're using.  How are you allocating the input and output buffers?

    (Wouldn't hurt to see if CE_CHECK=1 flags anything either...)

    Chris

  • The buffers are allocated through CMEM_ functions. Originally, the code was used to capture frames from MT9T image sensor and display it on the TV-OUT. I worked, as I was able to capture full res frame (2048x1536) and process a subframe (720x480) through IPIPE and display it. The code was allocating 3 buffers for capture and 3 for display. I have removed the display portion of the code and modified the sizes of the display buffers to use them for processing the captured data. I have modified insmod cmemk command to allocate proper buffer sizes. This is my latest cmemk string:

    insmod cmemk.ko phys_start=0x86000000 phys_end=0x88000000 pools=1x6295552,3x3149824,1x6492160,1x8192,10x41984,20x4096

    Buffer sizes requested in my code are:

    int buf_size_array[] = {ALIGN((2048*1536+4096), 4096), ALIGN((2048*1536+4096), 4096), ALIGN((2048*1536+4096), 4096),
                                           ALIGN((1056*1536*4+4096), 4096) /* <<-buffer 1*/   , ALIGN((4096*2), 4096),    ALIGN((2048*1536*2+4096), 4096) /* <<- buffer 2 */};

    first 3 are for capture, the last three are for processing (actually the one in the middle is a dummy one, leftover from previous code, so I made it small).

    I capture my Bayer frame into buffer 2. Run through IPIPE (twice, one for left and one for right) and put the result into buffer 1 and buffer1 + 2048*1536 so that portions don't overlap. Then, using for(){for()} loops, I combine the two (I know I could use DMA, but this was easy to write; see how much trouble it is just to get one stupid picture of the ceiling :)  into one big picture of 2048x1536x2 bytes. Combined picture is stored back in buffer 2.

    I will try DEBUG and CHECK and post the results here.

  • Here is a portion of spitouts with CE_CHECK=1 and CE_DEBUG=3. This is right after setting dynamic params all the way till process returns with result. Some of the messages are garbled (I guess it is when printf from user overlaps with printk from kernel).

    ======================================

    CE params set OK
    @13,604,605us: [+0 T:0x4001e320 S:0xbebde884] XU - XdmUtils_validateExtendedStruct> Enter (pStruct=0xbebdeb98, minSize=0x20, name=dynParams
    @13,605,133us: [+0 T:0x4001e320 S:0xbebde884] XU - XdmUtils_validateExtendedStruct> return (0x1)
    @13,605,536us: [+0 T:0x4001e320 S:0xbebde884] XU - XdmUtils_validateExtendedStruct> Enter (pStruct=0xbebdeaf8, minSize=0xa0, name=status
    @13,605,941us: [+0 T:0x4001e320 S:0xbebde884] XU - XdmUtils_validateExtendedStruct> return (0x1)
    @13,606,370us: [+0 T:0x4001e320 S:0xbebde8ac] ti.sdo.ce.image1.IMGENC1 - IMGENC1_control> Enter (handle=0x46420, id=5, dynParams=0xbebdeb98 (size=0x20), status=
    0xbebdeaf8 (size=0xa0)
    @13,606,861us: [+5 T:0x4001e320 S:0xbebde88c] CV - VISA_enter(visa=0x46420): algHandle = 0x46458
    @13,607,272us: [+0 T:0x4001e320 S:0xbebde87c] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x46458)
    @13,607,670us: [+0 T:0x4001e320 S:0xbebde844] ti.sdo.ce.osal.SemMP - Entered SemMP_pend> sem[0x46290] timeout[0xffffffff]
    @13,608,229us: [+0 T:0x4001e320 S:0xbebde844] ti.sdo.ce.osal.SemMP - Leaving SemMP_pend> sem[0x46290] status[0]
    @13,608,677us: [+0 T:0x4001e320 S:0xbebde88cCMEMK Error: get_phys: Unable to find phys addr for 0x00000000
    ] ti.sdo.ce.alg.CMEMK Error: get_phys: get_user_pages() failed: -14
    Algorithm - AlgoCMEMK Error: GETPHYS: Failed to convert virtual 0x0 to physical.
    rithm_activate> CMEMK Error: get_phys: Unable to find phys addr for 0x00000000
    Exit
    @13,609,16CMEMK Error: get_phys: get_user_pages() failed: -14
    8us: [+5 T:0x400CMEMK Error: GETPHYS: Failed to convert virtual 0x0 to physical.
    1e320 S:0xbebde8CMEMK Error: get_phys: Unable to find phys addr for 0x400275e0
    94] CV - VISA_exCMEMK Error: get_phys: get_user_pages() failed: -14
    it(visa=0x46420)CMEMK Error: GETPHYS: Failed to convert virtual 0x400275e0 to physical.
    : algHandle = 0xCMEMK Error: get_phys: Unable to find phys addr for 0x400275e0
    46458
    @13,942,3CMEMK Error: get_phys: get_user_pages() failed: -14
    53us: [+0 T:0x40CMEMK Error: GETPHYS: Failed to convert virtual 0x400275e0 to physical.
    01e320 S:0xbebdeCMEMK Error: get_phys: Unable to find phys addr for 0x00000008
    884] ti.sdo.ce.aCMEMK Error: get_phys: get_user_pages() failed: -14
    lg.Algorithm - ACMEMK Error: GETPHYS: Failed to convert virtual 0x8 to physical.
    lgorithm_deactivCMEMK Error: get_phys: Unable to find phys addr for 0x00000008
    ate> Enter(alg=0CMEMK Error: get_phys: get_user_pages() failed: -14
    x46458)
    @13,942CMEMK Error: GETPHYS: Failed to convert virtual 0x8 to physical.
    ,898us: [+0 T:0xCMEMK Error: get_phys: Unable to find phys addr for 0x400275e8
    4001e320 S:0xbebCMEMK Error: get_phys: get_user_pages() failed: -14
    de864] ti.sdo.ceCMEMK Error: GETPHYS: Failed to convert virtual 0x400275e8 to physical.
    .osal.SemMP - EnCMEMK Error: get_phys: Unable to find phys addr for 0x400275e8
    tered SemMP_postCMEMK Error: get_phys: get_user_pages() failed: -14
    > sem[0x46290]
    CMEMK Error: GETPHYS: Failed to convert virtual 0x400275e8 to physical.
    @13,943,462us: [CMEMK Error: get_phys: Unable to find phys addr for 0x00000010
    +0 T:0x4001e320 CMEMK Error: get_phys: get_user_pages() failed: -14
    S:0xbebde864] tiCMEMK Error: GETPHYS: Failed to convert virtual 0x10 to physical.
    .sdo.ce.osal.SemCMEMK Error: get_phys: Unable to find phys addr for 0x00000010
    MP - Leaving SemCMEMK Error: get_phys: get_user_pages() failed: -14
    MP_post> sem[0x4CMEMK Error: GETPHYS: Failed to convert virtual 0x10 to physical.
    6290]
    @13,943,9CMEMK Error: get_phys: Unable to find phys addr for 0x400275f0
    08us: [+0 T:0x40CMEMK Error: get_phys: get_user_pages() failed: -14
    01e320 S:0xbebdeCMEMK Error: GETPHYS: Failed to convert virtual 0x400275f0 to physical.
    894] ti.sdo.ce.aCMEMK Error: get_phys: Unable to find phys addr for 0x400275f0
    lg.Algorithm - ACMEMK Error: get_phys: get_user_pages() failed: -14
    lgorithm_deactivCMEMK Error: GETPHYS: Failed to convert virtual 0x400275f0 to physical.
    ate> Exit
    @13,9CMEMK Error: get_phys: Unable to find phys addr for 0x00000000
    44,322us: [+0 T:CMEMK Error: get_phys: get_user_pages() failed: -14
    0x4001e320 S:0xbCMEMK Error: GETPHYS: Failed to convert virtual 0x0 to physical.
    ebde8ac] ti.sdo.CMEMK Error: get_phys: Unable to find phys addr for 0x400275e0
    ce.image1.IMGENCCMEMK Error: get_phys: get_user_pages() failed: -14
    1 - IMGENC1_contCMEMK Error: GETPHYS: Failed to convert virtual 0x400275e0 to physical.
    rol> Exit (handle=0x46420, retVal=0x0)
    Input buffers needed: 3
    Input buffer 0 size: 3145728
    Input buffer 1 size: 1572864
    Input buffer 2 size: 1572864
    Output buffers needed: 1
    Output buffer 0 size: 6291456
    @13,945,691us: [+0 T:0x4001e320 S:0xbebde8a4] XU - XdmUtils_validateExtendedStruct> Enter (pStruct=0xbebdebe0, minSize=0x4, name=inArgs
    @13,946,180us: [+0 T:0x4001e320 S:0xbebde8a4] XU - XdmUtils_validateExtendedStruct> return (0x1)
    @13,946,577us: [+0 T:0x4001e320 S:0xbebde8a4] XU - XdmUtils_validateExtendedStruct> Enter (pStruct=0xbebdebd0, minSize=0x10, name=outArgs
    @13,946,978us: [+0 T:0x4001e320 S:0xbebde8a4] XU - XdmUtils_validateExtendedStruct> return (0x1)
    @13,947,344us: [+0 T:0x4001e320 S:0xbebde8cc] ti.sdo.ce.image1.IMGENC1 - IMGENC1_process> Enter (handle=0x46420, inBufs=0xbebdea34, outBufs=0xbebde970, inArgs=0
    xbebdebe0, outArgs=0xbebdebd0)
    @13,947,887us: [+0 T:0x4001e320 S:0xbebde8ac] XU - XdmUtils_validateSparseBufDesc1> Enter (bufDesc=0xbebdea34, name=inBufs
    @13,948,287us: [+0 T:0x4001e320 S:0xbebde8ac] XU - XdmUtils_validateSparseBufDesc1> return (0x1)
    @13,948,748us: [+0 T:0x4001e320 S:0xbebde8ac] XU - XdmUtils_validateSparseBufDesc1> Enter (bufDesc=0xbebde970, name=outBufs
    @13,949,253us: [+0 T:0x4001e320 S:0xbebde8ac] XU - XdmUtils_validateSparseBufDesc1> return (0x1)
    @13,949,638us: [+5 T:0x4001e320 S:0xbebde8ac] CV - VISA_enter(visa=0x46420): algHandle = 0x46458
    @13,950,396us: [+0 T:0x4001e320 S:0xbebde89c] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x46458)
    @13,950,900us: [+0 T:0x4001e320 S:0xbebde864] ti.sdo.ce.osal.SemMP - Entered SemMP_pend> sem[0x46290] timeout[0xffffffff]
    @13,951,391us: [+0 T:0x4001e320 S:0xbebde864] ti.sdo.ce.osal.SemMP - Leaving SemMP_pend> sem[0x46290] status[0]
    @13,951,921us: [+0 T:0x4001e320 S:0xbebde8ac] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
    CMEM Error: getPhys: Failed to get physical address of 0
    CMEM Error: gCMEMK Error: get_phys: Unable to find phys addr for 0x00000000
    etPhys: Failed tCMEMK Error: get_phys: get_user_pages() failed: -14
    o get physical aCMEMK Error: GETPHYS: Failed to convert virtual 0x0 to physical.
    ddress of 0
    CMECMEMK Error: get_phys: Unable to find phys addr for 0x400275e0
    M Error: getPhysCMEMK Error: get_phys: get_user_pages() failed: -14
    : Failed to get CMEMK Error: GETPHYS: Failed to convert virtual 0x400275e0 to physical.
    physical address of 0x400275e0
    CMEM Error: getPhys: Failed to get physical address of 0x400275e0
    CMEM Error: getPhys: Failed to get physical address of 0x8
    CMEM Error: getPhys: Failed to get physical address of 0x8
    CMEM Error: getPhys: Failed to get physical address of 0x400275e8
    CMEM Error: getPhys: Failed to get physical address of 0x400275e8
    CMEM Error: getPhys: Failed to get physical address of 0x10
    CMEM Error: getPhys: Failed to get physical address of 0x10
    CMEM Error: getPhys: Failed to get physical address of 0x400275f0
    CMEM Error: getPhys: Failed to get physical address of 0x400275f0
    CMEM Error: getPhys: Failed to get physical address of 0
    CMEM Error: getPhys: Failed to get physical address of 0x400275e0
    CMEM Error: getPhys: Failed to get physical address of 0
    CMEM Error: getPhys: Failed to get physical address of 0x400275e0
    @14,456,365us: [+5 T:0x4001e320 S:0xbebde8b4] CV - VISA_exit(visa=0x46420): algHandle = 0x46458
    @14,456,829us: [+0 T:0x4001e320 S:0xbebde8a4] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x46458)
    @14,457,384us: [+0 T:0x4001e320 S:0xbebde884] ti.sdo.ce.osal.SemMP - Entered SemMP_post> sem[0x46290]
    @14,457,874us: [+0 T:0x4001e320 S:0xbebde884] ti.sdo.ce.osal.SemMP - Leaving SemMP_post> sem[0x46290]
    @14,458,294us: [+0 T:0x4001e320 S:0xbebde8b4] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
    @14,458,778us: [+0 T:0x4001e320 S:0xbebde8cc] ti.sdo.ce.image1.IMGENC1 - IMGENC1_process> Exit (handle=0x46420, retVal=0x0)
    JPEG encoded: 557971 bytes

  • CE told me that I need tree buffers. I guess one for Luma and two for Chroma components. However, my data is in YCYCYCYCYCYC... format. So I gave the _process only one buffer with size equal to size of 3 buffers combined. Could that be the problem?

  • Make sure that the inputChromaFormat dynamic parameter is set to XDM_DEFAULT or XDM_YUV_ 422ILE (default). Please look at the codec user's guide for other codec configuration issues.

    Thanks

    cesar

  • As Cesar says, incorrect input could be the problem.

    Also, FWIW, the CMEM errors appear to be coming from inside the codec's control() and process() calls.  The codec runs in user mode, and internally it maps - with the help of CMEM - some of the physical addresses into the Linux process's address space.

    Let's sort out the format issues first, and if the CMEM warnings continue, we might have to wait for a codec expert to jump in.

    Chris

  • This is that my program does with parameters. I will try your suggestion about chroma format.

        params.size = sizeof(params);
        params.maxHeight = 1536;
        params.maxWidth = 2048;
        params.maxScans = XDM_DEFAULT;
        params.dataEndianness = XDM_BYTE;
        params.forceChromaFormat = XDM_YUV_422P;
        // create JPEG encoder instance
        ieh = IMGENC1_create(ceh, "jpegenc", &params);
     
        dynamicparams.size = sizeof(dynamicparams);
        dynamicparams.numAU = XDM_DEFAULT;     // number of Access units to encode.
                            // (if want to feed the data in chunks to save buffer space)
        dynamicparams.inputChromaFormat = XDM_YUV_422P;    // format of the input data. see enum XDM_ChromaFormat for all formats
        dynamicparams.inputHeight = height;
        dynamicparams.inputWidth = width;
        dynamicparams.captureWidth = 0; // set to zero to use image width. don't know what it's for.
        dynamicparams.generateHeader = XDM_ENCODE_AU; // don't knwo what it's for but this is what dvtb used.
        dynamicparams.qValue = Q; // compress JPEG qith quality = 75%
       
        memset(&status, 0, sizeof(status));
        status.size = sizeof(status); // define the size of status structure

        res = IMGENC1_control(ieh, XDM_SETPARAMS, &dynamicparams, &status);

  • That was it. Here is the picture of the ceiling. Thank you for your help. Colors/contrast/CCDC may need to be massaged a bit to make it look batter.