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 change 4d1 usecase in DVRRDK to 1ch D1?

Other Parts Discussed in Thread: TVP5158

Dear all,

we use DVRRDK_04.00.00.03 on DM810X_BCH_120_DVR demo board.For a testing purpose, we need to change the 4d1_vcap_venc_vdec_vdis usecase to one channel D1 capture+enc+dec+display.

Now, data from TVP5158 is multiplexed, and we want to change it to single channel non multiplexed.I had tried to do some changes in file multich_progressive_4d1_vcap_venc_vdec_vdis.c ,but it didn't work. Can anybody list out the key point?

Best regards!

Sivan

  •  Attached is the patch on top of RDK 4.0 release to convert 4D1 DVR usecase into 1 ch encode only usecase.

    Usecase details:
    1. Started with 4 channel 8107 DVR usecase on UD DVR board.
    a. Disabled Capture channel 1,2,3 by setting FID mask to skip all fields
    b. Disable Display and Swms by not starting display and swms links
    c. Disable Decode channels
    d. Disable FBDEV
    e. Disable DEI DEI_SC output que.

    2. After above changes Usecase is
     Capture –(1ch D1 60 fields)  NSF--(1ch D1 60 fields) DEI ---VIP_SC –(D1 30 fps)  SWOSD                               -- > Encode Channel 0
                                                                                                        ---VIP_SC_SECONDARY (CIF  30 fps)  SWOSD + TD -- > Encode Channel 1

     Enabled file write of 1 channel to NFS

    Attached is patch to convert 4 channel D1 usecase into 1D1 encode usecase

    diff --git a/demos/mcfw_api_demos/mcfw_demo/demo.h b/demos/mcfw_api_demos/mcfw_demo/demo.h
    index d2360e1..8b3281f 100755
    --- a/demos/mcfw_api_demos/mcfw_demo/demo.h
    +++ b/demos/mcfw_api_demos/mcfw_demo/demo.h
    @@ -49,7 +49,7 @@
     #endif
     
     #if defined(TI_8107_BUILD)
    -#define USE_FBDEV   1
    +#define USE_FBDEV   0
     #endif
     
     #if defined(TI_816X_BUILD)
    diff --git a/demos/mcfw_api_demos/mcfw_demo/demo_scd_bits_wr.c b/demos/mcfw_api_demos/mcfw_demo/demo_scd_bits_wr.c
    index 4ca178e..5dca776 100755
    --- a/demos/mcfw_api_demos/mcfw_demo/demo_scd_bits_wr.c
    +++ b/demos/mcfw_api_demos/mcfw_demo/demo_scd_bits_wr.c
    @@ -886,8 +886,8 @@ int  Scd_TrackMotionOnDisplay(VALG_FRAMERESULTBUF_S *pBuf)
         UInt32 scdResultBuffChanId;
         Scd_ChInfo  *pChInfo;
         UInt32      blkIdx;
    -#if USE_FBDEV
         UInt32 winIdx = 0;
    +#if USE_FBDEV
     
         int  width, height;
         int  startX, startY;
    diff --git a/mcfw/interfaces/link_api/captureLink.h b/mcfw/interfaces/link_api/captureLink.h
    index d696c2f..d97855c 100755
    --- a/mcfw/interfaces/link_api/captureLink.h
    +++ b/mcfw/interfaces/link_api/captureLink.h
    @@ -72,6 +72,8 @@ extern "C" {
     /** \brief 1/4 odd fields will be skipped */
     #define CAPTURE_LINK_ODD_FIELD_SKIP_1_4    (3)
     
    +#define CAPTURE_LINK_EVEN_ODD_FIELD_SKIP   (4)
    +
     
     /* @} */
     
    diff --git a/mcfw/src_bios6/links_m3vpss/capture/captureLink_drv.c b/mcfw/src_bios6/links_m3vpss/capture/captureLink_drv.c
    index 41ae5ee..6d224d9 100755
    --- a/mcfw/src_bios6/links_m3vpss/capture/captureLink_drv.c
    +++ b/mcfw/src_bios6/links_m3vpss/capture/captureLink_drv.c
    @@ -181,6 +181,11 @@ Int32 CaptureLink_drvSkipOddFields(
                             pChObj->frameSkipMask = 0x45454545;
                             break;
                         }
    +					case CAPTURE_LINK_EVEN_ODD_FIELD_SKIP:
    +                    {
    +                        pChObj->frameSkipMask = 0xFFFFFFFF;
    +                        break;
    +                    }
                         case CAPTURE_LINK_ODD_FIELD_SKIP_NONE:
                         case CAPTURE_LINK_ODD_FIELD_SKIP_1_2:
                         default:
    diff --git a/mcfw/src_linux/mcfw_api/usecases/ti810x/multich_progressive_4d1_vcap_venc_vdec_vdis.c b/mcfw/src_linux/mcfw_api/usecases/ti810x/multich_progressive_4d1_vcap_venc_vdec_vdis.c
    index edc85ec..8d5d487 100755
    --- a/mcfw/src_linux/mcfw_api/usecases/ti810x/multich_progressive_4d1_vcap_venc_vdec_vdis.c
    +++ b/mcfw/src_linux/mcfw_api/usecases/ti810x/multich_progressive_4d1_vcap_venc_vdec_vdis.c
    @@ -1212,6 +1212,54 @@ Void MultiCh_createProgressive4D1VcapVencVdecVdis()
     
         /* To make sure IVAHD freq/voltage is set at the beginning */
         m_prevDecRun = 2;
    +	//SINGLE CHANNEL D1 ENCODE HACKS 
    +    gVdisModuleContext.swMsId[0]      = SYSTEM_LINK_ID_INVALID;
    +    gVdisModuleContext.swMsId[1]      = SYSTEM_LINK_ID_INVALID;
    +    for(i=0; i<2; i++)
    +    {
    +        gVdisModuleContext.displayId[i] = SYSTEM_LINK_ID_INVALID;
    +	}
    +	{
    +	    DeiLink_ChannelInfo chParams;
    +		
    +		for (i = 0; i < 4; i++)
    +		{
    +		    Int32 status;
    +			
    +			chParams.streamId = DEI_LINK_OUT_QUE_DEI_SC;
    +			chParams.enable   = FALSE;
    +			chParams.channelId = i;
    +			status =
    +			System_linkControl(gVcapModuleContext.deiId[0],DEI_LINK_CMD_ENABLE_CHANNEL,
    +								&chParams,sizeof(chParams),TRUE);
    +			OSA_assert(status == 0);
    +        }
    +	}
    +	{
    +		Int32 status;
    +	    CaptureLink_SkipOddFields skipFieldPrm;
    +	    
    +		skipFieldPrm.queId = 0;
    +		skipFieldPrm.skipOddFieldsChBitMask = 0xE;
    +		skipFieldPrm.oddFieldSkipRatio = CAPTURE_LINK_EVEN_ODD_FIELD_SKIP;
    +		status =
    +	    System_linkControl (gVcapModuleContext.captureId, CAPTURE_LINK_CMD_SKIP_ODD_FIELDS,
    +		                    &skipFieldPrm, sizeof(skipFieldPrm),TRUE);
    +        OSA_assert(status == 0);
    +    }
    +	{
    +		Int32 status;
    +	    DecLink_ChannelInfo chInfo;
    +		
    +		for (i = 0; i < 4; i++)
    +		{
    +            chInfo.chId = i;
    +			status =
    +			System_linkControl (gVdecModuleContext.decId, DEC_LINK_CMD_DISABLE_CHANNEL,
    +								&chInfo, sizeof(chInfo),TRUE);
    +			OSA_assert(status == 0);
    +        }		
    +	}
     }
     
     Void MultiCh_deleteProgressive4D1VcapVencVdecVdis()
    @@ -1223,6 +1271,14 @@ Void MultiCh_deleteProgressive4D1VcapVencVdecVdis()
         UInt32 dupId[NUM_DUP_LINK];
         UInt32 ipcOutVpssId, ipcInVpssId;
         UInt32 ipcOutVideoId, ipcInVideoId;
    +	
    +	//SINGLE CHANNEL D1 ENCODE HACKS 
    +    gVdisModuleContext.swMsId[0]      = SYSTEM_LINK_ID_SW_MS_MULTI_INST_0;
    +    gVdisModuleContext.swMsId[1]      = SYSTEM_LINK_ID_SW_MS_MULTI_INST_1;
    +    for(i=0; i<2; i++)
    +    {
    +        gVdisModuleContext.displayId[i] = SYSTEM_LINK_ID_DISPLAY_0 + i;
    +	}
     
         mergeId[LIVE_DECODE_MERGE_LINK_IDX]     = SYSTEM_VPSS_LINK_ID_MERGE_0;
         mergeId[D1_CIF_MERGE_LINK_IDX]          = SYSTEM_VPSS_LINK_ID_MERGE_1;
    

     

    Based on what features you want you can enable features like decode/display/swms.

     

    It is not easy to convert the 4d1 usecase to single channel non-muxed D1 capture configuration .It is better you just create a new usecase .