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.

How to Stop the H264 decoder

ENV:  dm6467t + CCS4.1 + dm6467_h264dec_1_10_05_03_production + DSP/BIOS 5.41

I create a project, and then create a H264 decode  task in DSP/BIOS (only one task ecpect idle task in this project , and the H264decode use the dm6467_h264dec_1_10_05_03_production  code). When i use this project to decode the 264 raw file continuous  (without task switch), the project running OK; But when i use the TSK_sleep blocked the decode task, the decode task cannot run back. If i don't use the decode function , the task switch is ok.

If i don't call the decode code, i can call TSK_sleep() or other SEM_pend() function to blocked my task  and switch task successful.

When i call the decode code and make a breakpoint before call TSK_sleep(), I found that there are a lot of  same message: SEM: post _MEM_mutex (0x8810f524) in the ROV(CCS4.1) LOG_system info. And then i run the TSK_sleep() and halt the task(use the halt button in ccs4,because the task in running and not run back my task), i found the next message in LOG_system: SEM: post _MEM_mutex (0x8810f524); SWI: begin KNL_swi (TSK scheduler) (0x118186f8);TSK: blocked TSK_vehicle (0x83f2406c);TSK: running TSK_idle (0x83f2400c);SWI: end KNL_swi (TSK scheduler) (0x118186f8) state = still ready (The TSK_vehicle is my decode tsk).And i also found my task state in the ROV is "unknown",  the idle task state is "running" . When i halt the task everytime, i found the task run in CSL_intcVectorTable() function (the function in the decode code lib) by use the Disassembly Window. I also found the B3 register address is the "fxnrt" index.  I don't know what's happen in my task.  Because I don't know what happen in the decode lib,maybe there are very offen mutex between dsp,HDVICP,EDMA and so on, so i don't know if the decode lib process is non-blocking process (i don't have the source code of decode lib).  If the process is non-blocking, i want to know how to block the decode process lib.

I also test my task, use the decoder routine to decode just one frame, and free all the resource in code. But that  also cannot blocked my task.

Now, i am afraid that the codec decoder cannot stop after decode just one frame, but i cannot found the answer in user guide of the dm6467_h264dec_1_10_05_03_production and the internet. Ireally want to know if the do-while loop decode process moudule in dm6467_h264dec_1_10_05_03_production's routine can be suspended?

I also found that  if i use the TSK_sleep(X_Ms), my task will be the run to "unknown" state. I means if the task switch have the time thresh, such as 10ms, the task will run in "unknown" state. But if i replace the time with "SYS_FOREVER", my task will be ok (run in the "blocked" state).

And i also found that if i run the decode code, the interrupt arm2dsp has no effection,the HWI  isr will not run. (In my program the am2dsp interrupt will trigger a HWI isr) The decode coder will influence the HWI isr ? 

what's happen? My dm6467 is 990MHz and the clock setting looks like correct. 

Thanks.

  • This thread appears to have moved to the BIOS forum from somewhere else; however, it doesn't seem to really be a BIOS-specific issue.  I am moving it (back?) to the Multimedia Codecs forum in hopes that it will get a faster response there.

    Dave

  • Hi,

    I think if you didn't call process call, then h264dec will stop. So I think it is better to give some message to the decoder task if you want it to stop. And decoder task just doesn't call process.

  • Thank you for your replay.

    I know that if idon't call the h264dec, the h264dec will stop. But my problem is that if i call the h264dec, my task cannot call the TSK_sleep() function. There are also some other similar problem, such as the SEM_pend() timeout function also cannot run back.

    I found that if i call RMAN_assignResources() use the decode lib, the TSK_sleep() will not run back for ever.

    I just create a simple project, and just have a task of h264decode. I don't know if this situation will happen in your computer? Could you help me to try this decode function?

    My env is DM6467T + CCS4.1 + DSP/BIOS 5.41 + XDAIS 6.25 + codec_engine_2_10_01+ dm6467_h264dec_1_10_05_03_production + dm6467_hdvicp_1_01_020_production.

    I am crazy for this problem, but i don't know what's happen in the RMAN_assignResources() function of h264decode lib.

  • I also found that if i run the H264decode function,the systick will not add any more and the PRD tick count will not add. That means the function PRD_F_tick() called by PRD_clock of CLK moudle will not be called, and then the KNL_swi also will not be called. As the pic depict.

    In the rov result, the LOG_system line 3957 and line 3958 is correct, but then the CLK will add and the PRD will not add. The systick is lost, any DSP/BIOS API use the timeout function will lose effectiveness. What‘s happen to the CLOCK ? 

    Thanks.

  • I have found where is the problem.

    Because the h264decode lib example run in the dsp without the BIOS, and then i add the BIOS to the example. So when i run before the H264decode code, the interrupt vector table is built by the BIOS; and after i run the h264decode code, the interrupt vector table is re-built by the CSL lib function in HDVICP_configure function. Even if the interrupt is enable in IER, the ISTP was changed by CSL, the interrupt isr will not be found correctly.

    Thanks.