Hi there,
While doing some testing, I saw that after repeatedly running OMX applications (successfully with no errors), I eventually hit an OMX_GetHandle() call that blocks and never return. I am using the setup provided in EZSDK 5.03.01.15
To be sure that this not just an issue with my code, I have reproduced this with minor modifications to the decode_display demo. More specifically, I have removed the thread execution so that the program merely performs a clean init and deinit. I did this as to alleviate the need to wait a a couple minutes for each invocation to finish.
Attached is a patch that induces this failure, and a script that runs the modified decode demo in a loop. This crashes for me within 5 minutes of starting this script.
I see that this failure seems to only occur when an OMX deinit is quickly followed by an init (e.g., running applications back-to-back in a tight while loop from the shell). Is there some specified time delay that must be between a program shutting down and calling OMX_Deinit() and another program starting up calling OMX_Init()/OMX_GetHandle()?
Could someone else reproduce this failure with the provided patch and script and confirm whether or not this is either
(1) A bug in the OpenMax API or M3 firmware
(2) A bug induced by my modifications. (If so -- why? I didn't see any reason why not running frames through components should be an issue.)
Thank you,
Jon
Files:
--- decode_display.orig/src/ilclient.c 2012-03-12 14:52:44.943499408 -0400 +++ decode_display/src/ilclient.c 2012-03-12 15:12:12.179100762 -0400 @@ -752,6 +752,7 @@ to component in this function. Component would be loaded state post this call */ + printf("Getting decoder component handle...\n"); eError = OMX_GetHandle (&pAppData->pDecHandle, (OMX_STRING) "OMX.TI.DUCATI.VIDDEC", pAppData->decILComp, @@ -776,6 +777,7 @@ /* Create Scalar component, it creatd OMX compponnet for scalar writeback , Int this client we are passing the same callbacks to all the component */ + printf("Getting scalar component handle...\n"); eError = OMX_GetHandle (&pAppData->pScHandle, (OMX_STRING) "OMX.TI.VPSSM3.VFPC.INDTXSCWB", @@ -821,6 +823,7 @@ /* Create the display component */ /* getting display component handle */ + printf("Getting display component handle...\n"); eError = OMX_GetHandle (&pAppData->pDisHandle, "OMX.TI.VPSSM3.VFDC", pAppData->disILComp, &pAppData->pCb); @@ -836,6 +839,7 @@ /* getting display controller component handle, Display contrller is implemented as an OMX component, however it does not have any input or output ports. It is used only for controling display hw */ + printf("Getting display controller component handle...\n"); eError = OMX_GetHandle (&pAppData->pctrlHandle, "OMX.TI.VPSSM3.CTRL.DC", pAppData->disILComp, &pAppData->pCb); @@ -1120,6 +1124,7 @@ printf (" decoder state execute \n "); +#if 0 /* Create Graphics Thread */ if (args->gfx) { @@ -1202,6 +1207,7 @@ /* Waiting for this semaphore to be posted by the bitstream read thread */ semp_pend (pAppData->disILComp->eos); +#endif printf (" tearing down the decode-display example\n "); @@ -1446,6 +1452,7 @@ pAppData->fIn = NULL; } +#if 0 /* terminate the threads */ if (args->gfx) { @@ -1460,6 +1467,7 @@ pthread_join (pAppData->scILComp->connDataStrmThrdId, &ret_value); pthread_join (pAppData->disILComp->connDataStrmThrdId, &ret_value); +#endif IL_ClientDeInit (pAppData);
#!/bin/sh echo 0 > /sys/devices/platform/vpss/graphics0/enabled LOOP_COUNT=1 while [[ 1 ]]; do #echo "=====================================================================" #echo -e "Loop numeber: $LOOP_COUNT" #echo "---------------------------------------------------------------------" ./decode_display_a8host_debug.xv5T -i /usr/share/ti/data/videos/dm816x_1080p_demo.264 -w 1920 -h 1080 -f 30 -g 0 -d 0 -c h264 #echo "=====================================================================" #echo -e "\n\n\n" #LOOP_COUNT=`expr $LOOP_COUNT + 1` done