Greetings,
I have a custom board with a ITE HDMI receiver. My sdk is latest one v5.03.01
I am trying to the video capture with v4l2 drivers.
What I have did is:
(1) Applying sub_devices_calls_removed.patch and make_select_decoder.patch
(2) comment following codes in ti81xxin_main.c
/*
for (i = 0; i < 1; i++) {
subdevdata = &config->subdev_info[i];
ti81xxvin_obj.sd[i] =
v4l2_i2c_new_subdev_board(&ti81xxvin_obj.v4l2_dev,
i2c_adap,
&subdevdata->board_info,
NULL, 0);
//if (!ti81xxvin_obj.sd[i]) {
//ti81xxvin_err("Error registering test v4l2 subdevice\n");
//goto probe_subdev_out;
// }
if (subdevdata->ti81xxvin_select_decoder)
err = subdevdata->ti81xxvin_select_decoder(
subdevdata->decoder_id);
if (err < 0) {
ti81xxvin_err("Error selecting decoder\n");
goto probe_subdev_out;
}
if (subdevdata->ti81xxvin_set_mode)
err = subdevdata->ti81xxvin_set_mode(
FVID2_STD_1080P_60);
if (err < 0) {
ti81xxvin_err("Error setting mode on decoder\n");
goto probe_subdev_out;
}
v4l2_info(&ti81xxvin_obj.v4l2_dev, "registered sub device %s\n",
subdevdata->name);
if (ti81xxvin_obj.sd[i])
ti81xxvin_obj.sd[i]->grp_id = 1 << i;
}
*/
(3) change the bus width of original codes the bus width. (ti81xxin_main.c)
I changed as following:
mbus_framefmt.width = 1920;
mbus_framefmt.height = 1080;
mbus_framefmt.code = V4L2_MBUS_FMT_RGB444_2X8_PADHI_BE;//V4L2_MBUS_FMT_YUYV8_2X8;
mbus_framefmt.field = V4L2_FIELD_NONE;
mbus_framefmt.colorspace = V4L2_COLORSPACE_REC709;
(4) change the ti81xx_fb.c to let the chip working the discrete sync;
static struct ti81xxvin_subdev_info hdvpss_capture_sdev_info[] = {
{
.name = TVP7002_INST0,
.board_info = {
/* TODO Find the correct address
of the TVP7002 connected */
I2C_BOARD_INFO("tvp7002", 0x5d),
.platform_data = &tvp7002_pdata,
},
.vip_port_cfg = {
.ctrlChanSel = VPS_VIP_CTRL_CHAN_DONT_CARE, //VPS_VIP_CTRL_CHAN_SEL_15_8,
// .ctrlChanSel = VPS_VIP_CTRL_CHAN_SEL_15_8,
.ancChSel8b = VPS_VIP_ANC_CH_SEL_DONT_CARE,
.pixClkEdgePol = VPS_VIP_PIX_CLK_EDGE_POL_RISING,
.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_ACTVID,
// .lineCaptureStyle =
// VPS_VIP_LINE_CAPTURE_STYLE_ACTVID,//VPS_VIP_LINE_CAPTURE_STYLE_HSYNC, //VPS_VIP_LINE_CAPTURE_STYLE_DONT_CARE,
.fidDetectMode =VPS_VIP_FID_DETECT_MODE_DONT_CARE,
//VPS_VIP_FID_DETECT_MODE_PIN,//VPS_VIP_FID_DETECT_MODE_DONT_CARE,
.actvidPol = VPS_VIP_POLARITY_HIGH , //VPS_VIP_POLARITY_DONT_CARE,
.vsyncPol = VPS_VIP_POLARITY_HIGH, //VPS_VIP_POLARITY_DONT_CARE,
.hsyncPol = VPS_VIP_POLARITY_HIGH, //VPS_VIP_POLARITY_DONT_CARE,
}
},
.video_capture_mode =
//VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC,
VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_HSYNC_VSYNC,
.video_if_mode = VPS_CAPT_VIDEO_IF_MODE_24BIT,
.input_data_format = FVID2_DF_RGB24_888,
},
(3) load v4l2 firmwares and make new modules like vpss.ko ti81xxvin.ko and ti81xxfb.ko
===============================================
Then I tried some examples /sa-examples/video/ and the only one I can let it work is saLoopBackFbdev.
I tested my hdmi rx, everything is fine and I can detect the sync and de sginals. I feed the board with 1080P source and H+V+
Problems: (1) capt.dv_preset.preset cannot detect the source, the return value is always 0.
(2) saLoopBackFbdev can always capture one frame for me. However, when I replayed it, the image is 1080i and color space is BGR instead of RGB
(3) Gstreamer v4l2 capture does not work.
What I am missing?
Regards,
Jun