TI中文支持网
TI专业的中文技术问题咨询交流网站

DM8168 Capture YUV and save with NVP6324 error

Hello,

I have some problems about video capture on DM8168,

1080P AHD video –> NVP6324 –> DM8168, in arch/arm/mach-omap2/ti81x_vss.c, the port has been configured as the following:

{
.name = NVP6324_INST,
.board_info =
{
I2C_BOARD_INFO(NVP6324_INST, NVP6324_SADDR),
},
.vip_port_cfg =
{
.ctrlChanSel = VPS_VIP_CTRL_CHAN_SEL_7_0,
.ancChSel8b = VPS_VIP_ANC_CH_SEL_DONT_CARE,
.pixClkEdgePol = VPS_VIP_PIX_CLK_EDGE_POL_FALLING,
.invertFidPol = 0,
.embConfig =
{
.errCorrEnable = 1,
.srcNumPos = VPS_VIP_SRC_NUM_POS_DONT_CARE,
.isMaxChan3Bits = 0,
},
.disConfig =
{
.fidSkewPostCnt = 0,
.fidSkewPreCnt = 0,
.lineCaptureStyle = VPS_VIP_LINE_CAPTURE_STYLE_DONT_CARE,
.fidDetectMode = VPS_VIP_FID_DETECT_MODE_DONT_CARE,
.actvidPol = VPS_VIP_POLARITY_DONT_CARE,
.vsyncPol = VPS_VIP_POLARITY_DONT_CARE,
.hsyncPol = VPS_VIP_POLARITY_DONT_CARE,
}
},
.video_capture_mode = VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC,
.video_if_mode =VPS_CAPT_VIDEO_IF_MODE_8BIT,
.input_data_format =FVID2_DF_YUV422I_UYVY,
},
and the system link chain is set up as:
#define WITH_DISPLAY 0

void chain_cap_dis_save_create()
{
/* links in chain */
gVcapModuleContext.captureId = SYSTEM_LINK_ID_CAPTURE;
gVcapModuleContext.ipcFramesOutVpssToHostId = SYSTEM_VPSS_LINK_ID_IPC_FRAMES_OUT_0;
gVcapModuleContext.ipcFramesInHostId = SYSTEM_HOST_LINK_ID_IPC_FRAMES_IN_0;

#if WITH_DISPLAY
gVdisModuleContext.displayId[0] = SYSTEM_LINK_ID_DISPLAY_0;
#endif

int lid_dup = SYSTEM_VPSS_LINK_ID_DUP_0;

/* capture link init */
CaptureLink_CreateParams prm_capture;
CaptureLink_CreateParams_Init(&prm_capture);
prm_capture.outQueParams[0].nextLink = lid_dup;
prm_capture.numVipInst = 1;
prm_capture.tilerEnable = FALSE;
prm_capture.numBufsPerCh = 8;
prm_capture.maxBlindAreasPerCh = 4;
prm_capture.isPalMode = FALSE;
prm_capture.doCropInCapture = FALSE;
prm_capture.enableSdCrop = FALSE;

/* capture instance init */
CaptureLink_VipInstParams *prm_cap_inst = &prm_capture.vipInst[0];
prm_cap_inst->vipInstId = (memmapper_vcap_id(VideoIndex) + 0 ) % SYSTEM_CAPTURE_INST_MAX;
prm_cap_inst->inDataFormat = SYSTEM_DF_YUV422I_UYVY;
prm_cap_inst->numOutput = 1;

prm_cap_inst->standard = SYSTEM_STD_1080P_30;
prm_cap_inst->videoIfMode = DEVICE_CAPT_VIDEO_IF_MODE_8BIT;
prm_cap_inst->videoCaptureMode = DEVICE_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC;

/* capture out init */
CaptureLink_OutParams *prm_cap_out = &prm_cap_inst->outParams[0];
prm_cap_out->dataFormat = SYSTEM_DF_YUV422I_UYVY;
prm_cap_out->scEnable = FALSE;
prm_cap_out->scOutWidth = 0;
prm_cap_out->scOutHeight = 0;
prm_cap_out->outQueId = 0;

/* dup link */
DupLink_CreateParams dupPrm;
dupPrm.inQueParams.prevLinkId = gVcapModuleContext.captureId;
dupPrm.inQueParams.prevLinkQueId = 0;
dupPrm.numOutQue = 2;

#if WITH_DISPLAY
dupPrm.outQueParams[1].nextLink = gVdisModuleContext.displayId[0];
#endif

dupPrm.outQueParams[0].nextLink = gVcapModuleContext.ipcFramesOutVpssToHostId;

/* VPSSout link init */
IpcFramesOutLinkRTOS_CreateParams prm_vpss_out;
MULTICH_INIT_STRUCT(IpcFramesOutLinkRTOS_CreateParams ,prm_vpss_out);
prm_vpss_out.baseCreateParams.noNotifyMode = TRUE;
prm_vpss_out.baseCreateParams.notifyNextLink = TRUE;
prm_vpss_out.baseCreateParams.notifyPrevLink = TRUE;
prm_vpss_out.baseCreateParams.inQueParams.prevLinkId = lid_dup;
prm_vpss_out.baseCreateParams.inQueParams.prevLinkQueId = 0;
prm_vpss_out.baseCreateParams.outQueParams[0].nextLink = gVcapModuleContext.ipcFramesInHostId;

/* hostin link init */
IpcFramesInLinkHLOS_CreateParams prm_host_in;
MULTICH_INIT_STRUCT(IpcFramesInLinkHLOS_CreateParams, prm_host_in);
prm_host_in.baseCreateParams.noNotifyMode = TRUE;
prm_host_in.baseCreateParams.notifyNextLink = TRUE;
prm_host_in.baseCreateParams.notifyPrevLink = TRUE;
prm_host_in.baseCreateParams.notifyProcessLink = TRUE;
prm_host_in.baseCreateParams.inQueParams.prevLinkId = gVcapModuleContext.ipcFramesOutVpssToHostId;
prm_host_in.baseCreateParams.inQueParams.prevLinkQueId = 0;
prm_host_in.cbCtx = NULL;
prm_host_in.cbFxn = save_frames;

#if WITH_DISPLAY
/* display link init */
DisplayLink_CreateParams prm_dis;
MULTICH_INIT_STRUCT(DisplayLink_CreateParams, prm_dis);
prm_dis.inQueParams[0].prevLinkId = lid_dup;
prm_dis.inQueParams[0].prevLinkQueId = 1;
prm_dis.displayRes = VSYS_STD_1080P_30;
#endif

System_linkControl( SYSTEM_LINK_ID_M3VPSS, SYSTEM_M3VPSS_CMD_RESET_VIDEO_DEVICES, NULL, 0, TRUE);

/* create link */
System_linkCreate(gVcapModuleContext.captureId, &prm_capture, sizeof(prm_capture));
System_linkCreate(lid_dup, &dupPrm, sizeof(dupPrm));
System_linkCreate(gVcapModuleContext.ipcFramesOutVpssToHostId, &prm_vpss_out, sizeof(prm_vpss_out));
System_linkCreate(gVcapModuleContext.ipcFramesInHostId, &prm_host_in, sizeof(prm_host_in));

#if WITH_DISPLAY
System_linkCreate(gVdisModuleContext.displayId[0], &prm_dis, sizeof(prm_dis));
/* setting frames from which channel should be display */
DisplayLink_SwitchChannelParams prm_switch_ch;
prm_switch_ch.activeChId = IDX_CAHNNEL_SAVE;
System_linkControl(gVdisModuleContext.displayId[0], DISPLAY_LINK_CMD_SWITCH_CH, &prm_switch_ch, sizeof(prm_switch_ch), TRUE);
#endif
}
and I run this test app, fail and get some logs as:
[nvp6324_init]
[nvp6324_probe]
[nvp6324_probe]
nvp6324 2-0030: NVP6324 is found @ 0x30 (OMAP I2C adapter)
[nvp6324_probe]
nvp6324 2-0030: Rev. b0 detected.
[nvp6324_probe]
reg[08]=[0x2], err=0
reg[09]=[0x2], err=0
reg[0a]=[0x2], err=0
reg[0b]=[0x2], err=0
reg[18]=[0x13], err=0
reg[19]=[0x13], err=0
reg[1a]=[0x13], err=0
reg[1b]=[0x13], err=0
[nvp6324_probe]
reg[08]=[0x2], err=0
reg[09]=[0x2], err=0
reg[0a]=[0x2], err=0
reg[0b]=[0x2], err=0
reg[18]=[0x13], err=0
reg[19]=[0x13], err=0
reg[1a]=[0x13], err=0
reg[1b]=[0x13], err=0
[nvp6324_probe]
ti81xxvin ti81xxvin: registered sub device nvp6324
ti81xxvin ti81xxvin: TI81xx HDVPSS Capture driver initialized
root@dm816x-evm:~#
root@dm816x-evm:~#
root@dm816x-evm:~#
root@dm816x-evm:~#
root@dm816x-evm:~#
0: SYSTEM: System Common Init in progress !!!
0: SYSTEM: IPC init in progress !!!
20: SYSTEM: CPU [DSP] syslink proc ID is [0] !!!
20: SYSTEM: CPU [VIDEO-M3] syslink proc ID is [1] !!!
20: SYSTEM: CPU [VPSS-M3] syslink proc ID is [2] !!!
20: SYSTEM: CPU [HOST] syslink proc ID is [3] !!!
20: SYSTEM: Creating MsgQ Heap [IPC_MSGQ_MSG_HEAP_3] …
23: SYSTEM: Creating MsgQ [HOST_MSGQ] …
25: SYSTEM: Creating MsgQ [HOST_ACK_MSGQ] …
26: SYSTEM: Opening MsgQ [DSP_MSGQ] …
27: SYSTEM: Opening MsgQ [VIDEO-M3_MSGQ] …
27: SYSTEM: Opening MsgQ [VPSS-M3_MSGQ] …
28: SYSTEM: Notify register to [DSP] line 0, event 15 …
29: SYSTEM: Notify register to [VIDEO-M3] line 0, event 15 …
30: SYSTEM: Notify register to [VPSS-M3] line 0, event 15 …
30: SYSTEM: IPC init DONE !!!
32: SYSTEM: Creating ListMP [HOST_IPC_OUT_24] in region 0 …
34: SYSTEM: Creating ListMP [HOST_IPC_IN_24] in region 0 …
36: SYSTEM: ListElem Shared Addr = 0x40aa3680
37: SYSTEM: Creating ListMP [HOST_IPC_OUT_25] in region 0 …
39: SYSTEM: Creating ListMP [HOST_IPC_IN_25] in region 0 …
41: SYSTEM: ListElem Shared Addr = 0x40ada480
42: SYSTEM: Creating ListMP [HOST_IPC_OUT_19] in region 0 …
44: SYSTEM: Creating ListMP [HOST_IPC_IN_19] in region 0 …
46: SYSTEM: ListElem Shared Addr = 0x40b11280
47: SYSTEM: Creating ListMP [HOST_IPC_OUT_20] in region 0 …
49: SYSTEM: Creating ListMP [HOST_IPC_IN_20] in region 0 …
51: SYSTEM: ListElem Shared Addr = 0x40b54580
52: SYSTEM: Creating ListMP [HOST_IPC_OUT_21] in region 0 …
55: SYSTEM: Creating ListMP [HOST_IPC_IN_21] in region 0 …
56: SYSTEM: ListElem Shared Addr = 0x40b97880
73: SYSTEM: System Common Init Done !!!
[m3vpss ] 26636: CAPTURE: Create in progress !!!
[m3vpss ] 26666: CAPTURE: VIP0 PortA capture mode is [ 8-bit, Non-mux Embedded Sync] !!!
[m3vpss ] 26666: Assertion @ Line: 832 in links_m3vpss/capture/captureLink_drv.c: pInst->captureVipHandle != NULL : failed !!!

Anyone can help ?

thanks in advance.

Chris Meng:

你好,

请问你使用的软件是DVR RDK4.01么?

请问NVP6324和DM8168连接时通过4路8-bit 656么?如果是,建议参考TVP5158的相关驱动。DVR RDK支持4片TVP5158的输入。

user6313936:

回复 Chris Meng:

Hi Chris,

感谢回复。我这边使用的是:DVR RDK V4. 1 GA Release

NVP6324 通过4路 bt656输出4路AHD视频到dm8168,分辨率是:1080P30fps

您提到的TVP5158,驱动是在哪个位置呢?

[22:01:29:957] [m3vpss ]  26666: Assertion @ Line: 832 in links_m3vpss/capture/captureLink_drv.c: pInst->captureVipHandle != NULL : failed !!!

这个错误,是需要debug哪个部分呢?video decoder驱动还是applicaton呢?

第一次接触这个平台,请多指教。

user6313936:

回复 Chris Meng:

你好,感谢回复。

我看到了这个部分的code,还是很困惑。
video decoder的驱动不是应该在linux kernel这一端去实现吗,还是说这里的tvp5158的驱动是在dsp端的呢?
从这里编译出来的bin或执行程序要如何更新到板子上去呢?

下面wiki描述的方式适用8168吗?
processors.wiki.ti.com/…/DM81xx_AM38xx_Adding_External_Decoders_to_V4L2_Capture_Driver

我看到论坛有不少的vin采集,都是arm/arch/mach-omap2/下的vpss,加入新的video decoder。

谢谢!

Chris Meng:

回复 user6313936:

你好,

TVP5158是比较特殊,在M3控制,你可以参考其BT656部分。

在Linux下实现video decoder的驱动也是可以的。

user6313936:

回复 Chris Meng:

非常感谢您的回复。

可以帮我看看我的配置吗?

IO配置,static void __init ti81xx_video_mux(void)在这里,

// video in channel 1 by @deepin
omap_mux_init_signal("vin0_d8", TI81XX_MUX_MODE1);
omap_mux_init_signal("vin0_d9", TI81XX_MUX_MODE1);
omap_mux_init_signal("vin0_d10", TI81XX_MUX_MODE1);
omap_mux_init_signal("vin0_d11", TI81XX_MUX_MODE1);
omap_mux_init_signal("vin0_d12", TI81XX_MUX_MODE1);
omap_mux_init_signal("vin0_d13", TI81XX_MUX_MODE1);
omap_mux_init_signal("vin0_d14", TI81XX_MUX_MODE1);
omap_mux_init_signal("vin0_d15", TI81XX_MUX_MODE1);
omap_mux_init_signal("vin0_clk1", TI81XX_MUX_MODE2);

vpss的配置在 static struct ti81xxvin_subdev_info hdvpss_capture_sdev_info[] ,是这样的,

{
.name = NVP6324_INST,
.board_info =
{
I2C_BOARD_INFO(NVP6324_INST, NVP6324_SADDR),
},
.vip_port_cfg =
{
.ctrlChanSel = VPS_VIP_CTRL_CHAN_SEL_15_8,
.ancChSel8b = VPS_VIP_ANC_CH_SEL_DONT_CARE,
.pixClkEdgePol = VPS_VIP_PIX_CLK_EDGE_POL_FALLING,
.invertFidPol = 0,
.embConfig =
{
.errCorrEnable = 1,
.srcNumPos = VPS_VIP_SRC_NUM_POS_DONT_CARE,
.isMaxChan3Bits = 0,
},
.disConfig =
{
.fidSkewPostCnt = 0,
.fidSkewPreCnt = 0,
.lineCaptureStyle = VPS_VIP_LINE_CAPTURE_STYLE_DONT_CARE,
.fidDetectMode = VPS_VIP_FID_DETECT_MODE_DONT_CARE,
.actvidPol = VPS_VIP_POLARITY_DONT_CARE,
.vsyncPol = VPS_VIP_POLARITY_DONT_CARE,
.hsyncPol = VPS_VIP_POLARITY_DONT_CARE,
}
},
.video_capture_mode = VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC,
.video_if_mode = VPS_CAPT_VIDEO_IF_MODE_8BIT,
.input_data_format =FVID2_DF_YUV422I_UYVY,
},
NVP6324配置成了1080P30fps,YUV422,但是在运行程序capture yuv and save,在syslink 创建capture句柄
就失败了,我查看了下code,在这个函数:

/* * Create global VIP capture handle, used for dequeue, * queue from all active captures */ pObj->fvidHandleVipAll = FVID2_create(FVID2_VPS_CAPT_VIP_DRV, VPS_CAPT_INST_VIP_ALL, NULL, NULL, NULL); UTILS_assert(pObj->fvidHandleVipAll != NULL);

这会是哪里没有配置正确呢?

赞(0)
未经允许不得转载:TI中文支持网 » DM8168 Capture YUV and save with NVP6324 error
分享到: 更多 (0)