DM8127+tvp5150视频输入不成功,什么原因?如何调试?

硬件:DM8127+tvp5150;开发包:ipnc-rdk3.5
DM8127+tvp5150视频输入不成功,什么原因?如何调试?

tvp5150的驱动是仿照/opt/ipnc/Source/ipnc_rdk/ipnc_mcfw/mcfw/src_linux/devices/tvp5158进行添加,添加以后能正确读写tvp5150的寄存器。tvp5150的视频输入源是PAL制式,640*480分辨率的视频;输出为bt656,至DM8127的接口是VIN[0]A_D[0:7]。

以/opt/ipnc/Source/ipnc_rdk/ipnc_mcfw/mcfw/src_linux/mcfw_api/usecases/multich_encode_decode.c为基础进行例程的修改,captureLink参数设置如下:

    CaptureLink_CreateParams        capturePrm;

    capturePrm.numVipInst = 1;
    capturePrm.outQueParams[0].nextLink = gIpcFramesOutVpssToHostId;
    capturePrm.tilerEnable = FALSE;
    capturePrm.enableSdCrop = FALSE;
    capturePrm.numBufsPerCh = 6;
    capturePrm.numExtraBufs = 0;
    capturePrm.fakeHdMode = FALSE;
    capturePrm.doCropInCapture = FALSE;
    capturePrm.isPalMode = Vcap_isPalMode();

    for(i=0; i<capturePrm.numVipInst; i++)
    {
    pCaptureInstPrm = &capturePrm.vipInst[i];////
    pCaptureInstPrm->vipInstId = SYSTEM_CAPTURE_INST_VIP0_PORTA;

    pCaptureInstPrm->videoDecoderId = SYSTEM_DEVICE_VID_DEC_TVP5150_DRV;

    //added by qiu
    capturePrm.numVipInst = 1;
    //capturePrm.outQueParams[0].nextLink = gIpcOutVpssId;
    capturePrm.outQueParams[0].nextLink = gIpcFramesOutVpssToHostId;
    capturePrm.tilerEnable = FALSE;
    capturePrm.enableSdCrop = FALSE;
    capturePrm.numBufsPerCh = 6;
    capturePrm.numExtraBufs = 0;
    capturePrm.fakeHdMode = FALSE;
    capturePrm.doCropInCapture = FALSE;
    capturePrm.isPalMode = Vcap_isPalMode();


        pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422P;
        pCaptureInstPrm->standard           = SYSTEM_STD_D1;
        pCaptureInstPrm->numOutput = 1;

        pCaptureOutPrm = &pCaptureInstPrm->outParams[i];
        pCaptureOutPrm->dataFormat = SYSTEM_DF_YUV422I_YUYV;
        pCaptureOutPrm->scEnable = FALSE;
        pCaptureOutPrm->scOutWidth = 0;
        pCaptureOutPrm->scOutHeight = 0;
        pCaptureOutPrm->outQueId = 0;
    }

  • 串口输出如下:

     [host]
    ********* ---- Vcap_init() ---- ********

     [host] Vsys_allocBuf - addr = 0x4d1ff000,size = 65011712

     [host] MCFW_IPCBITS:App_streamSysInit:virt addr of 85000000 cir buffer  is 4d1ff000
    ##########pInfo->totalsize 63897600

     [host] MemMng_memcpy_open:OSA_dmaOpen passed with ch id = 4

     [host] CacheMng_MemCpy_open:OSA_dmaOpen passed with ch id = 10
    Creat queue id:131076
    queue id:131076
    queue id:65538

     [host] Entered IPC Bits Handler function
     [m3vpss ] VPS_DCTRL_INST_0
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_DVO2
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_HDMI
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_OUTPUT SYSTEM_DC_VENC_SD
     [m3vpss ] IOCTL_VPS_DCTRL_SET_VENC_CLK_SRC VPS_DC_VENC_HDMI | VPS_DC_VENC_DVO2

     [host] MultiCh_createEncA8Dec:OSA_dmaOpen passed with ch id = 11

     [host]
    ********** ENC A8 DEC USE CASE ********
     [host]
    ********* Entered Encode + Decode usecase - H264 1080p @30fps Encode + H264 1080p @30fps Decode ********
     [host]  SYSTEM: ID ( procID = 2, System_getSelfProcId()= 3
     [host]  187: MCFW  : CPU Revision [ES2.1] !!!
     [host]  187: MCFW  : Detected [UNKNOWN] Board !!!
     [host]  187: MCFW  : Base Board Revision [REV A] !!!
     [host]
    ********* ----------Config Video Decoder------- ********
     [host] createArgs.deviceI2cAddr[0] = 93!!!
     [host]
    CAPTURE: Detected video (720x288@50Hz, 1)!!!
     [host]
     Audio Channels are not supported

     [m3vpss ]  10080: CAPTURE: Create in progress !!!
     [m3vpss ] CAPTURE: inWidth = 720;  inHeight = 576
     [m3vpss ]  10122: CAPTURE: VIP0 PortA capture mode is [ 8-bit, Non-mux Embedded Sync] !!!
     [m3vpss ] before  CaptureLink_drvSimVideoSourceSelect() ...

     [host]  683: IPC_FRAMES_IN   : Create in progress !!!

     [host]  683: SYSTEM: Opening ListMP [VPSS-M3_IPC_OUT_23] ...

     [host]  685: SYSTEM: Opening ListMP [VPSS-M3_IPC_IN_23] ...

     [host]  689: IPC_FRAMES_IN   : Create Done !!!

     [host] USECASE SETUP DONE

     [m3vpss ] CAPTURE::HEAPID:0USED:192
     [m3vpss ]  10162: CAPTURE: Create Done !!!
     [m3vpss ]  10163: IPC_FRAMES_OUT   : Create in progress !!!

     [m3vpss ]  10167: IPC_FRAMES_OUT   : Create Done !!!
     [m3vpss ]  10175: NULL   : Create Done !!!
    ApproDrvInit: 3
    queue id:131076

    queue id:0
    queue id:32769
     [m3vpss ]  10528: CAPTURE: Start in progress !!!
     [m3vpss ]  10528: CAPTURE: Start Done !!!

     [host]
    Application Run Completed
    after App_runDemo()

     [m3vpss ]  10653: CAPTURE: Fields = 0 (fps = 0), Total Resets = 0 (Avg 0 ms per reset)
    queue id:0
    ApproDrvInit: 7
    queue id:131076
    TimeOut occure in boot_proc.
    Program exit.
    TimeOut occure in boot_proc.
    Program exit.

    没有接收到视频数据

  • 回复 Huchong Li:

    首先确定视频源和tvp5150的问题,用示波器去量输出时钟和数据管脚,均有输出信号。

    tvp5150的部分寄存器值如下:

     [host] ////************ regValue_current **************////
     [host] regAddr: 0x 0   regValue: 0x 0
     [host] regAddr: 0x 1   regValue: 0x15
     [host] regAddr: 0x 3   regValue: 0x6f
     [host] regAddr: 0x d   regValue: 0x47
     [host] regAddr: 0x28   regValue: 0x 0
     [host] regAddr: 0xc2   regValue: 0x 4
     [host] regAddr: 0x 4   regValue: 0xc0
     [host] regAddr: 0x 9   regValue: 0x80
     [host] regAddr: 0x a   regValue: 0x80
     [host] regAddr: 0x b   regValue: 0x 0
     [host] regAddr: 0x c   regValue: 0x80
     [host] regAddr: 0x f   regValue: 0x 8
     [host] regAddr: 0x80   regValue: 0x51
     [host] regAddr: 0x81   regValue: 0x50
     [host] regAddr: 0x82   regValue: 0x 4
     [host] regAddr: 0x83   regValue: 0x 0
     [host] regAddr: 0x84   regValue: 0x 2
     [host] regAddr: 0x85   regValue: 0x71
     [host] regAddr: 0x88   regValue: 0x66
     [host] regAddr: 0x89   regValue: 0x18
     [host] regAddr: 0x8a   regValue: 0x22
     [host] regAddr: 0x8b   regValue: 0xdf
     [host] regAddr: 0x8c   regValue: 0x83

    从0x88的值为0x66判断,tvp5150锁住了vertical sync lock status和horizontal sync lock status

    因此,到tvp5150这里的输出应该是没有问题的。

    为了进一步确认,将tvp5150设置为黑屏输出,即寄存器0x0设置为 0x8,串口的输出依然是没有接收到视频。

  • 回复 Huchong Li:

    进一步地想从vpss驱动找原因,发现不知道怎么下手,用仿真器去连接DM8127,也访问不了vpss寄存器,显示都是????

    请问:1)tvp5150能不能解码640*480分辨率的PAL信号?解码后输出为720*576吗?

    2)上述的代码配置有没有问题?

    3)下一步该如何进行调试?

    谢谢指点!!!

  • 回复 Huchong Li:

    你好;

    640x480 是 vesa 的格式标准,不是 pal 制分辨率,pal 分辨率 为 720x576 ;

  • Huchong Li
    pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422P;

    这里建议修改为:pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422I_YUYV;

  • 回复 ternence hsu:

    usecase 建议参考 : multichhd_vcap_venc_vdis.c 或者 multich_vcap_vdis.c 调试

  • 回复 ternence hsu:

    ternence hsu您好,十分感谢您的回复!

    我照您的建议进行了测试:

    1)修改usecase ,参考  multich_vcap_vdis.c 进行调试,测试结果采集还是没有成功。

    2)修改pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422I_YUYV。编译可以通过,但是运行时报错

    [m3vpss ]  11465: Assertion @ Line: 767 in links_m3vpss/capture/captureLink_drv.c: pInst->captureVipHandle != NULL : failed !!!

    另外还尝试改成

      pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422SP_UV;
      pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422I_UYVY;

    同样是运行时报错

    [m3vpss ]  11465: Assertion @ Line: 767 in links_m3vpss/capture/captureLink_drv.c: pInst->captureVipHandle != NULL : failed !!!

    只有pCaptureInstPrm->inDataFormat = SYSTEM_DF_YUV422P不会报错。

    这是为什么呢?

    3)关于tvp5150的输入源,其实我想问的是tvp5150能不能解码640*480分辨率、场频率为50场/秒、隔行扫描的cvbs信号?如果可以解码,那么解码后输出的信号分辨率是多少?这样的解码信号输出,vpss能不能采集到?

    4)在http://www.deyisupport.com/question_answer/dsp_arm/davinci_digital_media_processors/f/39/t/110514.aspx这个帖中, 用ccs看到了vpss寄存器的值

    但是我自己用560v2仿真器去连DM8127,却无法访问,显示都是???

    以前调uboot都能成功访问寄存器,为什么vpss不行呢?

    5)最后,我把tvp5150的输出和vpss输入的同步模式都改为分离同步,即Non-mux Discrete Sync - HSYNC_VSYNC,串口输出的报错为

     [m3vpss ]  13325: CAPTURE: Fields = 0 (fps = 0), Total Resets = 0 (Avg 0 ms per reset)
     [m3vpss ]  13325: CAPTURE: Overflow detected on VIP0, Total Resets = 1
     [m3vpss ]  13341: CAPTURE: Overflow detected on VIP0, Total Resets = 2
     [m3vpss ]  13357: CAPTURE: Overflow detected on VIP0, Total Resets = 3
     [m3vpss ]  13373: CAPTURE: Overflow detected on VIP0, Total Resets = 4
    queue id:0
    ApproDrvInit: 7
    queue id:131076
    TimeOut occure in boot_proc.
    Program exit.
    TimeOut occure in boot_proc.
    Program exit.

    这里的Overflow detected on VIP0如何分析?

    再次感谢您的回复!!!

  • 回复 Huchong Li:

    采集输入格式应当为 pCaptureInstPrm->inDataFormat       = SYSTEM_DF_YUV422P; 

    试试这个。

  • 回复 Huchong Li:

    最后发现,其实数据进来了,只是在/opt/ipnc/Source/ipnc_rdk/ipnc_mcfw/mcfw/src_bios6/links_m3vpss/capture/captureLink_drv.c中,更新串口信息的时间太长,改短一些就可以输出视频接收信息了

    Int32 CaptureLink_drvProcessData(CaptureLink_Obj * pObj)

    {

        //if ((elaspedTime - pObj->prevTime) > 30 * 60 * 1000)

        if ((elaspedTime - pObj->prevTime) > 20 * 1000)  //ms

        {

            Vps_printf("CAPTURE: elaspedTime =  %d !!!\n", elaspedTime);

            Vps_printf("CAPTURE: pObj->captureDequeuedFrameCount =  %d !!!\n", pObj->captureDequeuedFrameCount);

            CaptureLink_getCpuLoad();

     

            CaptureLink_drvPrintRtStatus(pObj,

                                         pObj->captureDequeuedFrameCount -

                                         pObj->prevFrameCount,

                                         elaspedTime - pObj->prevTime);

     

            pObj->prevFrameCount = pObj->captureDequeuedFrameCount;

            pObj->prevTime = elaspedTime;

        }

     }