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.

Histogram dequeue buffer error

Hi,

I am using PSP_1_10_03 in DM6437 built board. So far, I am able to successfully test and run video capture/display programs.

When I tried to capture the histogram, GIO_submit(histHandle, PSP_VPSS_DEQUEUE, &histReadBuffer, &sizeOfbuff, NULL); returned error -2.

I traced it to ddc_hist.c file, and found out that

PAL_osSemTake (channelDB->semIsr, DDC_HIST_ISRSEM_TMOUT)) returned error.

Note: there is no problem to enqueue the buffer.

Additional information: the capture program runs slower than the CCDC interrupt, due to the long wait in histogram capture.  Another word, there could be several frames captured in CCDC, but only one histogram is requested.

Could you tell me where it might be wrong, and how to fix it?

Thanks

Alan

  • Alan,

    First of all, I would like you to refer the section 4.2 of the BIOS_Histogram_Driver_UserGuide (in the path \pspdrivers_1_10_03\packages\ti\sdo\pspdrivers\drivers\histogram\docs), since there are some dependancies which needs to be considered while building and loading the application.

    Alan said:

    PAL_osSemTake (channelDB->semIsr, DDC_HIST_ISRSEM_TMOUT)) returned error.

    Could you please mention the error message thrown here. I guess, the error message was for time out, please confirm.

    Basically the reason for not able to dequeue a buffer is unavalability of the processed buffer. When we enqueue the buffer, once after completing the buffer operation, an ISR will be generated and which post a semaphore. In the dequeue operation, we check for the availability of the semaphore with a time out value "DDC_HIST_ISRSEM_TMOUT" (ddc_hist.h). Unless this is release in the ISR (by an occurrence of the interrupt), the PAL_osSemTake() can not proceed further and then it will get time out.

    So, it is worth to put a breakpoint in the DDC_HISTEdmaisr(), to check whether the interrupt is occurs or not. If it is occurring once after throwing an error from PAL_osSemTake(), then we can have the larger time out value.

    Let me know the result and your comments.

    Thanks and Regards,

    Sandeep K  

  • Yes, it is timeout error. I read the user guide, and did not find anything wrong with my code (basically the same as the sample).

    I put a breakpoint at DDC_HISTEdmaisr(). There is NO interrupt at all.

    I also checked the DDC_HISTEnequebuffer(), and it did request EDMA channel successfully, and buffers are enqueued.

    --- additional findings:

    I further checked the VPFE HIST registers, and found out that although HIST.registers are all set correctly,  FMTCFG.VPEN is not enabled. (Note: I did not enable previewer engine, because I did not need it.)

    So I manually set FMTCFG.VPEN=1. However, there is still no interrupt in histogram. Buffer dequeue failed again.

    Please advise how to proceed.

    Thanks.

     

  • Alan,

    Still it looks like the Macros "PSP_VIDEO_PATH_ENABLE" has not been enabled in psp_vpfe.h file (as mentioned in the section 4.2.2 of BIOS_Histogram_Driver_UserGuide).

    Once enabling it, you need to build the VPFE driver and then the histogram application.

    Because, if you refer the file pspdrivers_1_10_03\packages\ti\sdo\pspdrivers\drivers\vpfe\src\ddc_vpfeCcdc.c, the function to enable the video port "LLC_setCcdcVideoPortEnable()" is under the macro "PSP_VIDEO_PATH_ENABLE". Without enabling the macro, no way the video port and CCDC are getting enabled.

    Please put breakpoint under "PSP_VIDEO_PATH_ENABLE" in the file ddc_vpfeCcdc.c to see all the CCDC registers are getting updated as per your requirement.

    Let me know the result.

    Thanks and Regards,

    Sandeep K

  • Sandeep:

    Thanks.  You are right. After I enabled PSP_VIDEO_PATH_ENABLE, the histogram interrupt occurred, and histogram buffer dequeued successfully.

    However, the histogram data I received is wrong. Even if I close the lens and the image is blank, there are lots of data come out of histogram. I am investigating it.  If you have any hint, please advise.

    One more question, after I enabled PSP_VIDEO_PATH_ENABLE, can I still use previewer engine in one-shot mode to convert (post-processed) bayer image in DDR2 to YUV image (also DDR2), instead of the on-the-fly mode?

    Thanks.

    Alan