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.

dec thread Unhandled Exception

hi all .i init create one dec channel . and then i use the function Vdec_createChn() to create another dec channel,also i have set a flag to read the second channel data in the thread .but i found i can't see the printf information before the following thread Unhandled Exception

Open Channel: 1
 [m3video] DECLINK_H264:HEAPID:0        USED:4264
 [m3video] DECLINK_H264:HEAPID:3        USED:9363456
 [m3video]  37282: DECODE: Creating CH0 of 1920 x 1080 [PROGRESSIVE] [TILED      ],target bitrate = 2000 Kbps ...
 [m3video]  37283: DECODE: All CH Create ... DONE !!!
 [m3video] DECLINK:HEAPID:0     USED:4384
 [m3video] DECLINK:HEAPID:3     USED:9363456
 [m3video]  37286: DECODE: Create ... DONE !!!
 [m3video]  37286: IPC_OUT_M3   : Create in progress !!!
 [m3video]  37287: IPC_OUT_M3   : Create Done !!!
 [m3video]  37288: DECODE: CH0:
 [m3video] Queueing last frame in prev IVA[2]
 [m3video]  37288: DECODE: CH0:
 [m3video] Iva Map Change Serialization: Last Frame of Prev IVA [2] received
 [m3video]  37288: DECODE: CH0:
 [m3video] Queueing first frame in next IVA[0]
 [m3video]  37288: DECODE: CH0:
 [m3video] Iva Map Change Serialization: First Frame of Next IVA [0] received
 [m3video]  37288: DECODE: CH0:
 [m3video] Iva Map Change Serialization: First Frame of Next IVA [0] received. Serialization complete!!
 [m3video] DECLINK_H264:HEAPID:0        USED:2368
 [m3video] DECLINK_H264:HEAPID:3        USED:9363456
 [m3video] Unhandled Exception:
 [m3video] Exception occurred in ThreadType_Task
 [m3video] handle: 0x3ce21ff8.
 [m3video] stack base: 0x3d862200.
 [m3video] stack size: 0x8000.
 [m3video] R0 = 0x00000006  R8  = 0x3d442e34
 [m3video] R1 = 0x68004808  R9  = 0x00000003
 [m3video] R2 = 0x00000000  R10 = 0x00000000
 [m3video] R3 = 0x00000000  R11 = 0x3d86a0c0
 [m3video] R4 = 0x00000000  R12 = 0x3d425680
 [m3video] R5 = 0x3d441388  SP(R13) = 0x3d86a0b0
 [m3video] R6 = 0x00001ea0  LR(R14) = 0x00322e95
 [m3video] R7 = 0x0000003c  PC(R15) = 0x00322ee6
 [m3video] PSR = 0x41000000
 [m3video] ICSR = 0x0440f803
 [m3video] MMFSR = 0x00
 [m3video] BFSR = 0x82
 [m3video] UFSR = 0x0000
 [m3video] HFSR = 0x40000000
 [m3video] DFSR = 0x00000000
 [m3video] MMAR = 0x6800482c
 [m3video] BFAR = 0x6800482c
 [m3video] AFSR = 0x00000000
 [m3video] Terminating Execution...

  • You have to initialize the maximum number of channels you will be using in your application at ipcBitsOutLinkHLOS and decLink create time. You cannot create decLink for 1 channels (channel 0) and then dynamically open channel 1.

    You can configure the decoder to not create algotirhm and output buffers if you don't want to create all channels by setting decPrm.DecLink_ChCreateParams[chId].algCreateStatus = DEC_LINK_ALG_CREATE_STATUS_DONOT_CREATE

    Then you can dynamically create channel using Vdec_createChn.

     

  • hi badri .thank you for your answer .

    you mean that we have 2 ways to fix the problem.

    firstly ,we need to init the maximum number of channel ,then delete the channel that we don't need,then we can use the create interface to create a dec channel dynamicly

    sencondly,we can configure the decoder at the func DecLink_CreateParams_Init().    set the
    pPrm->chCreateParams[i].algCreateStatus  is DEC_LINK_ALG_CREATE_STATUS_DONOT_CREATE

    static inline void DecLink_CreateParams_Init(DecLink_CreateParams *pPrm)
    {
        UInt32 i;

        memset(pPrm, 0, sizeof(*pPrm));

        pPrm->inQueParams.prevLinkId = SYSTEM_LINK_ID_INVALID;
        pPrm->outQueParams.nextLink = SYSTEM_LINK_ID_INVALID;

        /* when set 0, decoder will take default value based on system
           defined default on BIOS side */
        for (i=0; i<DEC_LINK_MAX_CH;i++)
        {
            pPrm->chCreateParams[i].dpbBufSizeInFrames =
                                    DEC_LINK_DPB_SIZE_IN_FRAMES_DEFAULT;
            pPrm->chCreateParams[i].numBufPerCh = 0;
            pPrm->chCreateParams[i].displayDelay = 0;
            pPrm->chCreateParams[i].algCreateStatus =
                                    DEC_LINK_ALG_CREATE_STATUS_CREATE;
            pPrm->chCreateParams[i].tilerEnable = FALSE;
            pPrm->chCreateParams[i].decodeFrameType = VDEC_DECODE_ALL;
            pPrm->chCreateParams[i].enableFrameSkipDue2AccumuInNextLink = FALSE;
            pPrm->chCreateParams[i].processCallLevel= VDEC_FRAMELEVELPROCESSCALL;
            pPrm->chCreateParams[i].fieldMergeDecodeEnable = FALSE;
        }
    }

  • No in your application when setting decPrm set algCreateStatus to DONOTCREATE.Dont modify decLink.h

     

        for (i=0; i<gVdecModuleContext.vdecConfig.numChn; i++) {

            ...

            ...         

            decPrm.chCreateParams[i].format                 = DEC_LINK_ALG_CREATE_STATUS_DONOT_CREATE;  

     

        }

  • thank you for your help.

    i will try again

  • as you told ,i modify the Multich_vdec_vdis.c file

    the function MultiCh_createVdecVdis() like following:but still can not create dec channel successfully

    for (i=0; i<ipcBitsOutHostPrm.inQueInfo.numCh; i++)
        {
            /*if(gVdecModuleContext.vdecConfig.decChannelParams[i].isCodec == VDEC_CHN_H264)
                decPrm.chCreateParams[i].format                 = IVIDEO_H264HP;
            else if(gVdecModuleContext.vdecConfig.decChannelParams[i].isCodec == VDEC_CHN_MPEG4)
                decPrm.chCreateParams[i].format                 = IVIDEO_MPEG4ASP;
            else if(gVdecModuleContext.vdecConfig.decChannelParams[i].isCodec == VDEC_CHN_MJPEG)
                decPrm.chCreateParams[i].format                 = IVIDEO_MJPEG;*/

     

             decPrm.chCreateParams[i].format                 = DEC_LINK_ALG_CREATE_STATUS_DONOT_CREATE; 

         ..........
         }

  • and i set the VDEC_CHN_CREATE_PARAMS_S parameters like following:

                       VDEC_CHN_CREATE_PARAMS_S vdecCrePrm;
                        vdecCrePrm.chNum = 1;
                        vdecCrePrm.decFormat = VDEC_CHN_H264;
                        vdecCrePrm.targetMaxWidth = 1920;
                        vdecCrePrm.targetMaxHeight = 1080;
                        //decode参数结构体中无此参数,暂时设置的为1080P的BitRate
                        vdecCrePrm.targetBitRate = 4 * 1000 * 1000;
                        vdecCrePrm.targetFrameRate = 30;
                        vdecCrePrm.scanFormat = 1;
                        //displayDelay valid only for H264, stream specific value
                        vdecCrePrm.displayDelay = 2;
                        vdecCrePrm.numBufPerCh = 6;
                        vdecCrePrm.decodeFrameType = 0;
                        vdecCrePrm.processCallLevel= VDEC_FRAMELEVELPROCESSCALL;
                        vdecCrePrm.fieldMergeDecodeEnable = FALSE;
                        vdecCrePrm.tilerEnable = 0;
                        vdecCrePrm.chMaxReqBufSize = (vdecCrePrm.targetMaxWidth * vdecCrePrm.targetMaxHeight);
                        
                        //Decode_StreamResolution res = STREAM_HD;///1
                        vdecCrePrm.totalBitStreamBufferSize =   (vdecCrePrm.chMaxReqBufSize*5);//Demo_decodeGetBitBufLimit(res)

                        Vdec_createChn(&vdecCrePrm);:

  • Share your usecase file and console logs from kernel boot to when error occurs