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.

DM368 video encoder stall - how to diagnose root cause?

Hello,

I am trying to track down a problem using the TIVidenc1 Gstreamer plug-in to encode video on a custom-designed board with a DM368.  The symptoms are that the video codec does not generate any output (and the pipeline stalls).  The exact same software (identical binary image) runs fine on a DM368 LeopardBoard so I suspect either a software configuration problem (DDR2 controller settings, etc.) or a hardware problem.  Also, the pipeline does sometimes run successfully on the custom hardware, although this is rare (maybe one time in ten or twenty attempts).  Can anyone suggest any further ideas to help diagnose the root cause of the problem?

Software is the TI DV SDK v4.02.00.00 with the standard codecs.

Here is the pipeline I'm using as a test case, with sample output when it stalls:

DMAI_DEBUG=2 gst-launch -e videotestsrc ! 'video/x-raw-yuv, format=(fourcc)NV12, width=720, height=576, framerate=(fraction)25/1' ! dmaiperf ! TIVidenc1 engineName=codecServer codecName=mpeg2enc encodingPreset=3 ! fakesink silent=true
@0x00064b46:[T:0x400205c0] ti.sdo.dmai - [Dmai] Dmai log level set to '2'. Note that calling CERuntime_init after this point may cause unexpected change to DMAI tracing behavior.
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
WARNING: from element /GstPipeline:pipeline0/GstDmaiperf:dmaiperf0: There is no codec present that can handle the stream's type.
Additional debug info: gsttidmaiperf.c(285): gst_dmaiperf_start (): /GstPipeline:pipeline0/GstDmaiperf:dmaiperf0: Engine name not specified, not printing DSP information
@0x00169879:[T:0x41105490] ti.sdo.dmai - [Venc1] Creating encoder mpeg2enc for max 720x576 bitrate 2000000 ratectrl 4
INFO: Timestamp: 0:10:11.448349935; bps: 0; fps: 0;
@0x00177469:[T:0x41105490] ti.sdo.dmai - [Venc1] Setting dynParams size 720x576 bitrate 2000000
@0x00177768:[T:0x41105490] ti.sdo.dmai - [Venc1] Made XDM_SETPARAMS control call
@0x00177ac3:[T:0x41105490] ti.sdo.dmai - [Buffer] Alloc Buffer of size 622080 at 0x41556000 (0x84fa5000 phys)
@0x00177d72:[T:0x41105490] ti.sdo.dmai - [Buffer] Alloc Buffer of size 1536000 at 0x415ee000 (0x8503d000 phys)
[...hangs here...]
Although this is encoding SD video with the MPEG-2 codec, I see exactly the same behaviour with HD video and either MPEG-4 or H.264 codecs. I've done most of the investigative work using the H.264 codec as that's the end goal for this application.
By comparing trace output with the working pipeline I believe the codec is stalling within the VIDENC1_process() routine.
If I interrupt the pipeline and run it again, I see the same behaviour. In this case, the CPU is fully loaded and oprofile shows all the time is being spent in a routine waiting for completion of a DMA transfer - specifically, H264V_TI_DMA_Wait() when using the H.264 codec. By dumping the EDMA registers it looks as though there may be an outstanding transfer where both the source and destination addresses are within the HDVICP DMA port address range (although I have not looked at this in great detail).
Since the pipeline is not using any external video capture hardware, I have focused on behaviour of the external SDRAM as a possible reason for the stall. I have checked that the DDR2 controller configuration is correct, and have modified the UBL to run the SDRAM with slacker timing but this makes no apparent difference. I have also been able to run successfully the edma_test module provided with the SDK (although I'm not convinced that's a very aggressive test).
There are obviously some hardware differences between this custom board and the DM368 LeopardBoard used as a reference, but as I mentioned above, the boards are similar enough to run identical software builds. I have since modified the UBL, U-Boot and Linux kernel builds for the custom hardware to ensure that the pin multiplexing and GPIO configuration exactly suits the custom hardware, but again this has not affected the behaviour of the video encode pipeline.
Fundamentally, given that the video encoder and DMA controller hardware are all on-chip, it's hard to think of many differences between the two boards that could cause the observed behaviour. Apart from the external memory timing, and i/o pin configuration, the only other things I can think of are power supply stability and sequencing. Could problems in that area affect the HDVICP/MJCP or EDMA in this way?
To summarise, I'd be very grateful if anyone can suggest either:
  • hardware differences that might cause the video encoder to stall
  • software configuration differences (other than those mentioned) that might cause the video encoder to stall
  • methods to track down the source of the problem

Thanks,

Ian

  • Hello Ian,

    Do you have test case to check HDVICP module? In case of H264 codec you mentioned that it hung in DMA wait. One possible dma transfer will be DDR to HDVICP memory. To know where exactly its hanging pl run H264 encoder with codec debug library(h264venc_ti_arm926_debug.a). It will give more trace prints, may help in which transfer causing the hang.

  • Thanks for your reply.

    The test case for H.264 encoding is very similar:

    DMAI_DEBUG=2 gst-launch -e videotestsrc ! 'video/x-raw-yuv, format=(fourcc)NV12, width=1920, height=1088, framerate=(fraction)25/1' ! dmaiperf ! TIVidenc1 engineName=codecServer codecName=h264enc encodingPreset=3 ! fakesink silent=true

    @0x0000eaa4:[T:0x400205c0] ti.sdo.dmai - [Dmai] Dmai log level set to '2'. Note that calling CERuntime_init after this point may cause unexpected change to DMAI tracing behavior.

    Setting pipeline to PAUSED ...

    Pipeline is PREROLLING ...

    WARNING: from element /GstPipeline:pipeline0/GstDmaiperf:dmaiperf0: There is no codec present that can handle the stream's type.

    Additional debug info:

    gsttidmaiperf.c(285): gst_dmaiperf_start (): /GstPipeline:pipeline0/GstDmaiperf:dmaiperf0:

    Engine name not specified, not printing DSP information

    INFO:

    Timestamp: 0:01:07.601789900; bps: 0; fps: 0;

    @0x000f57cc:[T:0x41105490] ti.sdo.dmai - [Venc1] Creating encoder h264enc for max 1920x1088 bitrate 2000000 ratectrl 4

    @0x00115c19:[T:0x41105490] ti.sdo.dmai - [Venc1] Setting dynParams size 1920x1088 bitrate 2000000

    @0x00115f21:[T:0x41105490] ti.sdo.dmai - [Venc1] Made XDM_SETPARAMS control call

    @0x001162a2:[T:0x41105490] ti.sdo.dmai - [Buffer] Alloc Buffer of size 3133440 at 0x41df3000 (0x8559a000 phys)

    @0x00116500:[T:0x41105490] ti.sdo.dmai - [Buffer] Alloc Buffer of size 3133440 at 0x420f0000 (0x85897000 phys)

    [...hangs here...]

    Please could you tell me how to run the pipeline with the debug version of the codec?

    Thanks,

    Ian

  • HI Ian,

    we want check prints from codec, to run with debug library please change name of h264venc_ti_arm926.a to h264venc_ti_arm926_production.lib and h264venc_ti_arm926_debug. a to h264venc_ti_arm926.a and rebuild your package.

    libs are available at dvsdk_X_XX_00_XX/dm365_codecs_0X_XX_00_XX/packages/ti/sdo/codecs/h264enc/lib


    thanks,

    Veeranna

  • Hello Veeranna,

    Thanks for the instructions.  Here is the output with the debug-enabled codec:

    root@dm368-evm:~# DMAI_DEBUG=2 gst-launch -e videotestsrc ! 'video/x-raw-yuv, format=(fourcc)NV12, width=1920, height=1088, framerate=(fraction)25/1' ! dmaiperf ! TIVidenc1 engineName=codecServer codecName=h264enc encodingPreset=3 ! fakesink silent=true
    @0x00099d8b:[T:0x400205b0] ti.sdo.dmai - [Dmai] Dmai log level set to '2'. Note that calling CERuntime_init after this point may cause unexpected change to DMAI tracing behavior.
    @0x0004a4b1:[T:0x400205c0] ti.sdo.dmai - [Dmai] Dmai log level set to '2'. Note that calling CERuntime_init after this point may cause unexpected change to DMAI tracing behavior.
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    WARNING: from element /GstPipeline:pipeline0/GstDmaiperf:dmaiperf0: There is no codec present that can handle the stream's type.
    Additional debug info:
    gsttidmaiperf.c(285): gst_dmaiperf_start (): /GstPipeline:pipeline0/GstDmaiperf:dmaiperf0:
    Engine name not specified, not printing DSP information
    INFO:
    Timestamp: 0:01:08.034416774; bps: 0; fps: 0;
    @0x001236b7:[T:0x4110c490] ti.sdo.dmai - [Venc1] Creating encoder h264enc for max 1920x1088 bitrate 2000000 ratectrl 4
    CODEC_DEBUG_ENABLE: Inside Funtion to get memtab Requirement -> H264VENC_TI_numAlloc
    CODEC_DEBUG_ENABLE: Number of memtabs required: 15
    CODEC_DEBUG_ENABLE: Inside Funtion to Get Memory Requirements of the current algoirthm instance -> H264VENC_TI_alloc
    CODEC_DEBUG_ENABLE: H264VENC_TI_Obj-memTab[0].size = 0x0710
    CODEC_DEBUG_ENABLE: tH264EncState-memTab[1].size = 0x1498
    CODEC_DEBUG_ENABLE: tH264EncState-memTab[2].size = 0x1498
    CODEC_DEBUG_ENABLE: EXT_MEM_SCRATCH-memTab[3].size = 0x5000
    CODEC_DEBUG_ENABLE: EXT_MEM_PERSIST-memTab[4].size = 0x0800
    CODEC_DEBUG_ENABLE: MAX_REF_BUFFERS-memTab[5].size = 0x6b8800
    CODEC_DEBUG_ENABLE: LIST_SLICE_SIZES-memTab[6].size = 0x0320
    CODEC_DEBUG_ENABLE: uiMaxCodeSize-memTab[7].size = 0xcd94
    CODEC_DEBUG_ENABLE: uiMaxCodeSize-memTab[8].size = 0xcd94
    CODEC_DEBUG_ENABLE: KALEIDO_COMMANDS-memTab[9].size = 0x10600
    CODEC_DEBUG_ENABLE: AIR_BIT_STORAGE-memTab[10].size = 0x20000
    CODEC_DEBUG_ENABLE: AIR_BIT_STORAGE-memTab[11].size = 0x40000
    CODEC_DEBUG_ENABLE: tStPhysicalAddrHandle-memTab[12].size = 0x0280
    CODEC_DEBUG_ENABLE: IMCOP_TO_DDR-memTab[13].size = 0xc000
    CODEC_DEBUG_ENABLE: MEGAPIX_IMCOP_TO_DDR-memTab[14].size = 0x8e80
    CODEC_DEBUG_ENABLE: Exiting Funtion H264VENC_TI_alloc

    CODEC_DEBUG_ENABLE: Inside Init Obj Function
    CODEC_DEBUG_ENABLE: Intialises the memory allocated for a given handle object instance
    CODEC_DEBUG_ENABLE: Checking MemTab Parameters-> Base_Null, Base_Not_Aligned and Overlap
    CODEC_DEBUG_ENABLE: Checking MemTab Parameters-> Base_Null, Base_Not_Aligned and Overlap Completed
    CODEC_DEBUG_ENABLE: Checking Input parameter Values
    CODEC_DEBUG_ENABLE: Checking of Input parameter Completed
    CODEC_DEBUG_ENABLE: Inside H264VENC_TI_Copy_codearm968 Function to Copy Code & Data Sections
    CODEC_DEBUG_ENABLE: Succesfully Copied Code & Data Sections
    CODEC_DEBUG_ENABLE: Inside H264VENC_TI_Copy_codearm968_3 Function to Copy Code & Data Sections
    CODEC_DEBUG_ENABLE: Succesfully Copied Code & Data Sections
    CODEC_DEBUG_ENABLE: Inside H264VENC_TI_Copy_codearm968_4 Function to Copy Code & Data Sections
    CODEC_DEBUG_ENABLE: Succesfully Copied Code & Data Sections
    CODEC_DEBUG_ENABLE: Initializing SPS parameters
    CODEC_DEBUG_ENABLE: SPS parameters initialization Completed
    CODEC_DEBUG_ENABLE: Initializing PPS parameters
    CODEC_DEBUG_ENABLE: SPS parameters initialization Completed
    CODEC_DEBUG_ENABLE: Inside Slice Initilization Call
    CODEC_DEBUG_ENABLE: Slice Initilization Completed
    CODEC_DEBUG_ENABLE: Inside IRES Call to get Number of Resources -> H264VENC_TI_numResourceDescriptors
    CODEC_DEBUG_ENABLE: Number of Resources Required - 50
    CODEC_DEBUG_ENABLE: Inside IRES Call to Get Resource -> H264VENC_TI_getResouceDescriptors
    CODEC_DEBUG_ENABLE: Exiting IRES Call to Get Resource function
    CODEC_DEBUG_ENABLE: Inside DDR allocation
    CODEC_DEBUG_ENABLE: Inside IRES Call to Init Resource -> H264VENC_TI_initResources

    CODEC_DEBUG_ENABLE: Resource Number - 0
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 0
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80000

    CODEC_DEBUG_ENABLE: Resource Number - 1
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 1
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80020

    CODEC_DEBUG_ENABLE: Resource Number - 2
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 4
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80080

    CODEC_DEBUG_ENABLE: Resource Number - 3
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 5
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b800a0

    CODEC_DEBUG_ENABLE: Resource Number - 4
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 6
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b800c0

    CODEC_DEBUG_ENABLE: Resource Number - 5
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 7
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b800e0

    CODEC_DEBUG_ENABLE: Resource Number - 6
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 8
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80100

    CODEC_DEBUG_ENABLE: Resource Number - 7
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 9
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80120

    CODEC_DEBUG_ENABLE: Resource Number - 8
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 10
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80140

    CODEC_DEBUG_ENABLE: Resource Number - 9
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 11
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80160

    CODEC_DEBUG_ENABLE: Resource Number - 10
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 12
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80180

    CODEC_DEBUG_ENABLE: Resource Number - 11
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 13
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b801a0

    CODEC_DEBUG_ENABLE: Resource Number - 12
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 14
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b801c0

    CODEC_DEBUG_ENABLE: Resource Number - 13
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 15
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b801e0

    CODEC_DEBUG_ENABLE: Resource Number - 14
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 16
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80200

    CODEC_DEBUG_ENABLE: Resource Number - 15
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 17
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80220

    CODEC_DEBUG_ENABLE: Resource Number - 16
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 18
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80240

    CODEC_DEBUG_ENABLE: Resource Number - 17
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 19
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80260

    CODEC_DEBUG_ENABLE: Resource Number - 18
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 20
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80280

    CODEC_DEBUG_ENABLE: Resource Number - 19
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 21
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b802a0

    CODEC_DEBUG_ENABLE: Resource Number - 20
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 22
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b802c0

    CODEC_DEBUG_ENABLE: Resource Number - 21
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 23
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b802e0

    CODEC_DEBUG_ENABLE: Resource Number - 22
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 24
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80300

    CODEC_DEBUG_ENABLE: Resource Number - 23
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 25
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80320

    CODEC_DEBUG_ENABLE: Resource Number - 24
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 28
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80380

    CODEC_DEBUG_ENABLE: Resource Number - 25
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 29
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b803a0

    CODEC_DEBUG_ENABLE: Resource Number - 26
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 30
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b803c0

    CODEC_DEBUG_ENABLE: Resource Number - 27
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 31
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b803e0

    CODEC_DEBUG_ENABLE: Resource Number - 28
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 32
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80400

    CODEC_DEBUG_ENABLE: Resource Number - 29
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 33
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80420

    CODEC_DEBUG_ENABLE: Resource Number - 30
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 34
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80440

    CODEC_DEBUG_ENABLE: Resource Number - 31
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 35
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80460

    CODEC_DEBUG_ENABLE: Resource Number - 32
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 36
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80480

    CODEC_DEBUG_ENABLE: Resource Number - 33
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 37
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b804a0

    CODEC_DEBUG_ENABLE: Resource Number - 34
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 38
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b804c0

    CODEC_DEBUG_ENABLE: Resource Number - 35
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 39
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b804e0

    CODEC_DEBUG_ENABLE: Resource Number - 36
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 40
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80500

    CODEC_DEBUG_ENABLE: Resource Number - 37
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 41
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80520

    CODEC_DEBUG_ENABLE: Resource Number - 38
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 42
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80540

    CODEC_DEBUG_ENABLE: Resource Number - 39
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 43
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80560

    CODEC_DEBUG_ENABLE: Resource Number - 40
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 44
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80580

    CODEC_DEBUG_ENABLE: Resource Number - 41
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 45
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b805a0

    CODEC_DEBUG_ENABLE: Resource Number - 42
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 46
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b805c0

    CODEC_DEBUG_ENABLE: Resource Number - 43
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 47
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b805e0

    CODEC_DEBUG_ENABLE: Resource Number - 44
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 48
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80600

    CODEC_DEBUG_ENABLE: Resource Number - 45
    CODEC_DEBUG_ENABLE: Assigned Edma Channel Index: 49
    CODEC_DEBUG_ENABLE: Assigned Number of TCs: 1
    CODEC_DEBUG_ENABLE: Assigned Param Space Address: 0x41b80620
    CODEC_DEBUG_ENABLE: IRES Call to Open EDMA Channel Successfully Completed
    CODEC_DEBUG_ENABLE: Inside IMCOP Resource allocation
    CODEC_DEBUG_ENABLE: IMCOP addr0 :0x11f00000
    CODEC_DEBUG_ENABLE: IMCOP addr1 :0x11f09200
    CODEC_DEBUG_ENABLE: IMCOP addr2 :0x11f0c600
    CODEC_DEBUG_ENABLE: IMCOP addr3 :0x11f0d600
    CODEC_DEBUG_ENABLE: Resource Number - 47
    CODEC_DEBUG_ENABLE: HDVICP resoruce alloted
    @0x001e7a74:[T:0x4110c490] ti.sdo.dmai - [Venc1] Setting dynParams size 1920x1088 bitrate 2000000
    CODEC_DEBUG_ENABLE: Inside Encoder Handle Structure Activate Call -> H264VENC_TI_activate
    CODEC_DEBUG_ENABLE: Inside IRES Call to Activate All Resources -> H264VENC_TI_activateAllResources
    CODEC_DEBUG_ENABLE: Control Call With SETPARAM Command
    CODEC_DEBUG_ENABLE: Control Call With SETPARAM Command Completed Successfully
    CODEC_DEBUG_ENABLE: Inside IRES Call to Deactivate All Resources -> H264VENC_TI_deactivateAllResources
    CODEC_DEBUG_ENABLE: Inside Encoder Handle Structure Deactivate Call -> H264VENC_TI_deactivate
    @0x00239205:[T:0x4110c490] ti.sdo.dmai - [Venc1] Made XDM_SETPARAMS control call
    CODEC_DEBUG_ENABLE: Inside Encoder Handle Structure Activate Call -> H264VENC_TI_activate
    CODEC_DEBUG_ENABLE: Inside IRES Call to Activate All Resources -> H264VENC_TI_activateAllResources
    CODEC_DEBUG_ENABLE: Control Call With GETBUFINFO Command
    CODEC_DEBUG_ENABLE: Control Call With GETBUFINFO Command Completed Successfully
    CODEC_DEBUG_ENABLE: Inside IRES Call to Deactivate All Resources -> H264VENC_TI_deactivateAllResources
    CODEC_DEBUG_ENABLE: Inside Encoder Handle Structure Deactivate Call -> H264VENC_TI_deactivate
    @0x00239707:[T:0x4110c490] ti.sdo.dmai - [Buffer] Alloc Buffer of size 3133440 at 0x41dfa000 (0x8559a000 phys)
    @0x00239961:[T:0x4110c490] ti.sdo.dmai - [Buffer] Alloc Buffer of size 3133440 at 0x420f7000 (0x85897000 phys)
    CODEC_DEBUG_ENABLE: Inside Encoder Handle Structure Activate Call -> H264VENC_TI_activate
    CODEC_DEBUG_ENABLE: Inside IRES Call to Activate All Resources -> H264VENC_TI_activateAllResources
    CODEC_DEBUG_ENABLE: H264VENC_TI_encode function executing..
    CODEC_DEBUG_ENABLE: DEVICE ID CHECK completed
    CODEC_DEBUG_ENABLE: SEI USERDATA INSERTION initialization done..
    CODEC_DEBUG_ENABLE: H264VENC_TI_Init executed..
    CODEC_DEBUG_ENABLE: bitstream initialization done..
    CODEC_DEBUG_ENABLE: pAddrHndl computed and stored..
    CODEC_DEBUG_ENABLE: reset_vIMCOP_every_frame done..
    CODEC_DEBUG_ENABLE: Inside ARM926 H264VENC_TI_Encode_Frame_HeaderGen Function Call
    CODEC_DEBUG_ENABLE: Sequence Scaling Flag is 3
    CODEC_DEBUG_ENABLE: Seq scaling matrix Copied in to CALC command set
    CODEC_DEBUG_ENABLE: Generating the NAL unit containing Sequence Parameter Set SPS
    CODEC_DEBUG_ENABLE: Generation of the NAL unit containing Sequence Parameter Set (SPS) Completed
    CODEC_DEBUG_ENABLE: Generating the NAL unit containing Picture Parameter Set PPS
    CODEC_DEBUG_ENABLE: Generation of NAL unit containing Picture Parameter Set PPS Completed
    CODEC_DEBUG_ENABLE: H264V_TI_DMA_Map_TC executed..
    CODEC_DEBUG_ENABLE: Inside H264VENC_TI_KALEIDO_PSC_Reset Function
    CODEC_DEBUG_ENABLE: Exiting H264VENC_TI_KALEIDO_PSC_Reset Function
    CODEC_DEBUG_ENABLE: Inside H264VENC_TI_KALEIDO_PSC_Enable_InitRam_Low Function
    CODEC_DEBUG_ENABLE: Exiting H264VENC_TI_KALEIDO_PSC_Enable_InitRam_Low Function
    CODEC_DEBUG_ENABLE: Inside H264VENC_TI_Loader_arm968 Function to Load Code & Data Sections

    CODEC_DEBUG_ENABLE: DMA of Section 0 and Parameters are:
    Source Address: 0x854c5000 Destination Address: 0x12040000 Number of Bytes: 32

    That seems to confirm my suspicion about the pending DMA transfer.  Any ideas why it might not be completing?  The address appears to be in range (the hardware has 128 MB SDRAM).

    Cheers,

    Ian

  • Hi Ian,

    Yes it struct in DMA transfer and this is a first DMA transfer. This transfer has source as SDRAM and HDVICP memory as destination. You mentioned that u ran edma test cases to verify the edma functionality. Can you try 2 testcases:

    1)To transfer data between SDRAM and HDVICP memory

    2)CPU write to HDVICP memory.

  • Veeranna,

    Thanks again - good suggestions, with an interesting result.

    I've modified the EDMA test program to use the HDVICP memory at physical address 0x12040000 as the destination for a DMA transfer.  Before carrying out the DMA, the test program zero-fills the destination buffer using ordinary CPU writes.  On the custom hardware, this programmed zero-fill operation hangs (there is no segmentation fault but the kernel module simply stops running).  On the Leopard the test runs successfully.

    I also checked using U-Boot immediately after a power cycle: on the custom hardware, attempts to read and write the HDVICP memory at the same address cause U-Boot to hang, whereas they work as expected on the Leopard.  I see the same behaviour if I swap U-Boot images between the boards - the behaviour does not depend on the U-Boot image, but depends on the hardware.

    So, the question is: what might cause the HDVICP memory to be inaccessible?  On both boards, the HDVICP clock is configured to be 340 MHz which I believe is correct for the DM368.  I'm thinking this may be a problem with power sequencing or delivery to the DM368 - is that a possibility?

    Thanks again for your help so far - very much appreciated.

  • Hi Ian, 

    Two possible reasons for HDVICP to become non responsive.

    no power given to HDVICP or HDVICP is in reset state. Its codec responsibility to bring HDVICP to out of reset, and in log i am seeing that is happening. Do you have testcases to check HDVICP basic functionality(read /write as you tried)?

  • Hello Veeranna,

    Sorry for taking a while to reply.  We have discovered that the problem was related to the DM368 power rail sequencing; with that fixed, the video encoder pipeline is running normally.

    To answer your question above: the simplest test case I found was to use the U-Boot md and mw commands to access the HDVICP memory at 0x12040000.  This would work fine on the Leopard (with no other set-up required) but would hang immediately on the custom hardware.

    Thanks again for your help, much appreciated.

    Ian

  • Hi Ian,

    Thanks for the update, if your issue got solved, please make this post "verify pass'.

    Thanks,

    Veeranna