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.

Trying to integrate platinum codecs

I'm trying to update our encoder to use the version 2.0 encoder, and I'm having some issues.  I'm following the instructions here since we're still using the DVSDK 2.10:

http://processors.wiki.ti.com/index.php/H.264_DM36x_Ver_2.0_Codec#Usage:_integrate_into_dvsdk2.10.00.18

I've done everything exept the first part, which is:

  • update below software component with dvsdk2.10.00.18, update the H264enc codec package and change the Rules.make for FC_INSTALL_DIR and CMEM_INSTALL_DIR
 framework_components_2_24_01
linuxutils_2_24_03

...I'm unclear what this instruction means.  When I look at our DVSDK directory, I see we're using framework_components_2_25_00_

04 and linuxutils_2_24_03; does this instruction mean I actually need to revert to an older framework component?

Anyway, I did all the other instructions and tweaked a few settings in our alg_vidEnc.c to be compatible with the new encoder, and rebuild kernel/DVSDK/ipnc.  It will boot into linux, and attempt to setup and configure everything, but it seems like it's having some trouble with something to do with DMA?  In the output, I see:

/////////////////////////////////////////////////////
 CAPTURE: Opening ISIF.
 CAPTURE: Opening H3A.
APPRO Setting Applied
 CAPTURE: Opening IPIPE.

 Default Icon TI Logo

 Default Icon TI Logo

 DM365MM Init SuccessfulRate Control Type: IVIDE DRV ERR :DMA_copyFillCreate:437: Unable to request DMA (channel=-1).
O_STORAGE ALG: I DRV ERR :DMA_copyFillCreate:437: Unable to request DMA (channel=-1).
mgEnc: XDM_GETBUFINFO: min in bufs:2 buf(0):307200 buf(1):153600
Rate Control Type: IVIDEO_STORAGE STREAM: Ext 0: 640x480
 STREAM: Ext 1: 640x480
queue id:0
queue id:65538
FF: FF open
DavinciDisplay DavinciDisplay.1: Before finishing with S_FMT:

Once av_server and our app are running, I'll see errors like:

vCache Error: pFrame->realsize = 123593
Cache Error: CacheMng_Video_Cache: CacheMng_Find_Freeblk Fail
Cache Error: CacheMng_Video_Cache: CACHE_FAIL
GOP Error: Lock Gop fail from 254 to 254

 Module   | Avg Time/Frame | Frame-rate | Total time | Total Frames |
 CAPTURE  |          94.01 |      10.64 |      42398 |          451 |
 IPIPE    |          89.14 |      11.22 |      40204 |          451 |
 ENCODE0  |          20.00 |      49.99 |       9002 |          450 |
 ENCODE1  |           7.72 |     129.53 |       3474 |          450 |
 ENCODE2  |           9.27 |     107.91 |       4170 |          450 |
 STREAM   |           0.16 |    6081.08 |        222 |         1350 |

Cache Error: pFrame->realsize = 38714
Cache Error: CacheMng_Video_Cache: CacheMng_Find_Freeblk Fail
Cache Error: CacheMng_Video_Cache: CACHE_FAIL
GOP Error: Lock Gop fail from 509 to 509

Video streaming doesn't seem to work even though I do get performance reports like the above.  Performance does seem like it's substantially better (maybe 30% or more) though.

Does anyone know where I might have messed up the integration?  Thanks!
  • Hi Jeremy,

    Sorry for the delayed reply.

    JNoring said:
    • update below software component with dvsdk2.10.00.18, update the H264enc codec package and change the Rules.make for FC_INSTALL_DIR and CMEM_INSTALL_DIR
     framework_components_2_24_01
    linuxutils_2_24_03

    ...I'm unclear what this instruction means.  When I look at our DVSDK directory, I see we're using framework_components_2_25_00_

    04 and linuxutils_2_24_03; does this instruction mean I actually need to revert to an older framework component?

    You can use the components that you have. No need to go to older components. We have used the components you mentioned in IPNC Ref Design when integrating the latest H.264 codec package.

    Coming to the other error that you had w.r.t. DMA channels, it might most likely be because of th fact that the new codec needs higher number of channels for XDM_HIGHSPEED or XDM_HIGHQUALITY mode. This means you might have to free up some channels from the system. One way is to reduce the EDMA channels assigned in the LSP for different peripherals. We have done the following changes in the kernel code for IPNC Ref Design.

    In ti-davinci\include\asm-arm\arch-davinci\edma.h change as following

    //#define DM365_DMACH2EVENT_MAP0  0x0C00300Cu
    //#define DM365_DMACH2EVENT_MAP1  0x80000F00u
    #define DM365_DMACH2EVENT_MAP0  0x0C00000Cu // Relieved DM365_DMA_IMCOP_IMX0INT etc
    #define DM365_DMACH2EVENT_MAP1  0x80000000u //Relieved EMAC (40,41,42,43)

     Please try it and let me know if you still face problem. BTW, are you trying to create JPEG and H.264 together? If yes, have you changed the maxEDMARequests to 128 in the .cfg file of the application?

    Also, for your information, IPNC Ref Design ver 2.0 is available already which has all the new codecs integrated and showing 1080P30 performance. You might want to look at it and start using in your system.

    Regards,

    anshuman

    PS: Please mark this post as verified, if you think it has answered your question. Thanks.

  • Anshuman,

    Thanks for the suggestions.  I now see I made a mistake when modifying edma.h, which was likely why I had issues.  I now no longer see DMA errors, and it appears the codec is working correctly.  Here's a performance print-out:

     Module   | Avg Time/Frame | Frame-rate | Total time | Total Frames |
     CAPTURE  |          95.13 |      10.51 |     128715 |         1353 |
     IPIPE    |          92.12 |      10.86 |     124642 |         1353 |
     ENCODE0  |          18.54 |      53.95 |      25060 |         1352 |
     ENCODE1  |           7.91 |     126.38 |      10698 |         1352 |
     ENCODE2  |           9.47 |     105.58 |      12805 |         1352 |
     STREAM   |           1.16 |     858.41 |       4725 |         4056 |

    ..considerably better performance.  If you have a moment, could you recommend settings for the highest possible quality?  I'm less concerned about performance (particularly because we have room to spare based on what I see above) than I am about general image quality, so I'd like to make sure I have settings that result in the best possible quality for a given bitrate.

    Yes, we are creating JPEG and H264 at the same time.  We also have two H264 streams (one 960*720 and another 640*480, both capped at 15 fps max).  At some point we do want to upgrade to the most recent IPNC, but because of substantial changes the update is non-trivial (i.e. whole new kernel, DVSDK, etc., and possibly u-boot?).  It'll be a priority at some point, but for now I just wanted to update the encoder itself.

  • Jeremy,

    I guess you would have already seen this, but if not, please refer to the attached App Note. This tell s the good set of parameters.

    http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spraba9

    Regards,

    Anshuman

    PS: Please mark this post as verified, if you think it has answered your question. Thanks.

  • Hello.

    We have passed exactly the same way and came to the encoder working for about 40min.
    After this time, the application which processes 2 NTSC inputs prints out the following errors for 2 seconds:

    CAPTURE: Encode Buf not free for ch 1
    CAPTURE: Encode Buf not free for ch 0

    .......................

    And then several times

    Frame 239882: Missing lines 3 ch=0 i=1244
    Frame 239918: Missing lines 3 ch=1 i=954
    Frame 239955: Missing lines 3 ch=1 i=22
    Frame 239955: Missing lines 4 ch=0 i=23

    And never returns to normal operation. Sometimes, it simply crashes.

    ------------------------------------------------------------------

    If we open the debug printouts as you recommended, we can see in telnet at some moment (after a long run):

    ................................

    @2123,067,161us: [+5 T:0x4237a490] CV - VISA_exit(visa=0x41e970): algHandle = 0x41e9a8
    @2123,067,471us: [+0 T:0x4237a490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x41e9a8)
    @2123,067,935us: [+0 T:0x4237a490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
    @2123,068,245us: [+0 T:0x4237a490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Exit (handle=0x41e970, retVal=0x0)
    @2123,068,542us: [+0 T:0x4237a490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Enter (handle=0x41e970, inBufs=0x42379bdc, outBufs=0x42379bd0, inArgs=0x42379bc4, outArgs=0x42379b4c)
    @2123,068,797us: [+5 T:0x4237a490] CV - VISA_enter(visa=0x41e970): algHandle = 0x41e9a8
    @2123,069,086us: [+0 T:0x4237a490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x41e9a8)
    @2123,069,727us: [+0 T:0x4237a490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
    @2123,075,643us: [+5 T:0x4237a490] CV - VISA_exit(visa=0x41e970): algHandle = 0x41e9a8
    @2123,075,908us: [+0 T:0x4237a490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x41e9a8)
    @2123,076,206us: [+0 T:0x4237a490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
    @2123,076,384us: [+0 T:0x4237a490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Exit (handle=0x41e970, retVal=0x0)
    @2123,085,691us: [+0 T:0x4237a490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Enter (handle=0x41f3a8, inBufs=0x42379bdc, outBufs=0x42379bd0, inArgs=0x42379bc4, outArgs=0x42379b4c)
    @2123,086,019us: [+5 T:0x4237a490] CV - VISA_enter(visa=0x41f3a8): algHandle = 0x41e9c0
    @2123,086,211us: [+0 T:0x4237a490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x41e9c0)
    @2123,086,493us: [+0 T:0x4237a490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
    @2123,092,183us: [+5 T:0x4237a490] CV - VISA_exit(visa=0x41f3a8): algHandle = 0x41e9c0
    @2123,092,451us: [+0 T:0x4237a490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Enter(alg=0x41e9c0)
    @2123,092,756us: [+0 T:0x4237a490] ti.sdo.ce.alg.Algorithm - Algorithm_deactivate> Exit
    @2123,092,940us: [+0 T:0x4237a490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Exit (handle=0x41f3a8, retVal=0x0)
    @2123,093,115us: [+0 T:0x4237a490] ti.sdo.ce.video1.VIDENC1 - VIDENC1_process> Enter (handle=0x41f3a8, inBufs=0x42379bdc, outBufs=0x42379bd0, inArgs=0x42379bc4, outArgs=0x42379b4c)
    @2123,093,314us: [+5 T:0x4237a490] CV - VISA_enter(visa=0x41f3a8): algHandle = 0x41e9c0
    @2123,093,479us: [+0 T:0x4237a490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Enter(alg=0x41e9c0)
    @2123,093,747us: [+0 T:0x4237a490] ti.sdo.ce.alg.Algorithm - Algorithm_activate> Exit
    @2123,099,288us: [+5 T:0x4237a490] CV - VISA_exit(visa=0x41f3a8): algHa

    end then thousands of empty lines (which probably represent garbage)...
    and the application crashes.

    There is no need to say that with the old encoder everything worked perfect for days..

    Any hint will be highly appreciated!!!