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.

RGB24 on input

Other Parts Discussed in Thread: TVP7002

Hello.

In our design we want to capture RGB24 and show it on display. (encoding, decoding may be done in other formats). But now we cannot capture rgb24 with mistral evaluation module for dm8148. I am trying to change linux drivers to make it work.

1) Can anyone give me suggestions how to make linux to capture rgb24? What files need to be changed?

2) I know that dm8148 has a camera capture interface, whicn is not documented nor supported in linux. But i see you have DM8127 IP Camera Reference Design. And it should have softeware support for the camera input. So if we buy "DM8127 IP Camera Reference Design", will we get software, which can be used with dm8148 to capture rgb24?

3) Are you planning to support a rgb24 capture in the nearest release of ezsdk?

  • Alexander,

    Are you trying to capture RGB888 via the parallel port on ISS or the MIPI (CSI2) port?

    From a interface perspective we support multiple RGB formats for capture, however we don't have any plans to support RGB capture in DM8127 IP camera reference design software as of now.

    Did you try using the VIN ports of HDVPSS for doing the capture?

    Regards

    Rajat

  • Hi, Rajat.

    We are now just evaluating, so it doesn't matter which port to use. Now we are trying to use VIN0 port of HDVPPS, but with no luck.

    Best regards,

    Alexander Vasiljev.

  • Hi.

    Now i can capture some image (i hope it is rgb24 image) from my pc through tvp7002 and show it on hdmi display. But the image is shifted to the right and down and has a magenta offset, i.e. the black color is magenta. I have modified tvp7002.c file to make tvp7002 output RGB and modified ti81xx_fb.c to make hdvpss receive rgb. I tried different options, but cannot make it wotk properly.

    I use saLoopBackFbDev.

    The values of the registers for tvp7002 are the same as Hardik Shak suggested here (http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/t/154092.aspx?PageIndex=2)

    Does anyone has ideas what else should be modified to receive 24RGB?

  • Ok. I changed the register 0x10 in tvp7002 from 0x5D to 0x58 and the colors is alright. But the image is still shifted.

  • Hi,

    Can you please send me the image. Also send me ti81xx_fb.c file you have modified for RGB capture.

    Regards,

    Hardik shah

  • Hi, Hardik.

    Here is captdump from saLoopBackFbdev program. The size  is 1280*720.

    3678.captdump.zip

    /*
     *
     * Framebuffer device registration for TI TI816x platforms
     *
     * Copyright (C) 2009 Texas Instruments Inc.
     * Author: Yihe Hu <yihehu@ti.com>
     *
     * Some code and ideas taken from TI OMAP2 Platforms
     * by Tomi Valkeinen.
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but
     * WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     * General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program; if not, write to the Free Software Foundation, Inc.,
     * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
     */
    #include <linux/module.h>
    #include <linux/kernel.h>
    #include <linux/mm.h>
    #include <linux/init.h>
    #include <linux/platform_device.h>
    #include <linux/bootmem.h>
    #include <linux/io.h>
    #include <linux/vps_capture.h>
    #include <linux/ti81xxfb.h>
    #include <linux/ti81xx.h>
    #include <mach/hardware.h>
    #include <mach/board-ti814x.h>
    #include <mach/board-ti816x.h>
    #include <asm/mach/map.h>
    
    
    #if (defined(CONFIG_FB_TI81XX) || defined(CONFIG_FB_TI81XX_MODULE) || \
    	defined(CONFIG_ARCH_TI81XX))
    
    
    #define HDVPSS_CAPTURE_INST0_BASE	0x48105500
    #define HDVPSS_CAPTURE_INST0_SIZE	1024u
    
    #define HDVPSS_CAPTURE_INST2_BASE	0x48105A00
    #define HDVPSS_CAPTURE_INST2_SIZE	1024u
    u8 ti81xx_card_name[] = "TI81xx_catalogue";
    struct ti81xxvin_interface tvp7002_pdata = {
    	.clk_polarity = 0,
    	.hs_polarity = 1,
    	.vs_polarity = 1,
    	.fid_polarity = 0,
    	.sog_polarity = 0,
    
    };
    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, //S_VIP_CTRL_CHAN_DONT_CAREVPS_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_HSYNC,
    				.fidDetectMode =
    					VPS_VIP_FID_DETECT_MODE_PIN,
    				.actvidPol = VPS_VIP_POLARITY_LOW,
    				.vsyncPol =  VPS_VIP_POLARITY_HIGH,
    				.hsyncPol = VPS_VIP_POLARITY_HIGH,
    			}
    		},
    		.video_capture_mode =
    			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,
    	},
    	{
    		.name	= TVP7002_INST1,
    		.board_info = {
    			I2C_BOARD_INFO("tvp7002", 0x5c),
    			.platform_data = &tvp7002_pdata,
    		},
    		.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_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_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_16BIT,
    		.input_data_format = FVID2_DF_YUV422P,
    	},
    };
    
    static const struct v4l2_dv_preset hdvpss_inst0_inp0_presets[] = {
    	{
    		.preset = V4L2_DV_720P60,
    	},
    	{
    		.preset = V4L2_DV_1080I60,
    	},
    	{
    		.preset = V4L2_DV_1080P60,
    	},
    	{
    		.preset = V4L2_DV_1080P30,
    	},
    };
    
    static const struct v4l2_dv_preset hdvpss_inst2_inp0_presets[] = {
    	{
    		.preset = V4L2_DV_720P60,
    	},
    	{
    		.preset = V4L2_DV_1080I60,
    	},
    	{
    		.preset = V4L2_DV_1080P60,
    	},
    	{
    		.preset = V4L2_DV_1080P30,
    	},
    };
    
    static const struct ti81xxvin_input hdvpss_inst0_inputs[] = {
    	{
    		.input = {
    			.index		= 0,
    			.name		= "Component",
    			.type		= V4L2_INPUT_TYPE_CAMERA,
    			.std		= V4L2_STD_UNKNOWN,
    			.capabilities	= V4L2_OUT_CAP_PRESETS,
    		},
    		.subdev_name	= TVP7002_INST0,
    		.dv_presets	= hdvpss_inst0_inp0_presets,
    		.num_dv_presets	= ARRAY_SIZE(hdvpss_inst0_inp0_presets),
    	},
    };
    
    static const struct ti81xxvin_input hdvpss_inst1_inputs[] = {
    	{
    		.input = {
    			.index		= 0,
    			.name		= "Component",
    			.type		= V4L2_INPUT_TYPE_CAMERA,
    			.std		= V4L2_STD_UNKNOWN,
    			.capabilities	= V4L2_OUT_CAP_PRESETS,
    		},
    		.subdev_name	= TVP7002_INST1,
    		.dv_presets	= hdvpss_inst2_inp0_presets,
    		.num_dv_presets	= ARRAY_SIZE(hdvpss_inst2_inp0_presets),
    	},
    };
    
    /* 16 bit decoders are present on the Port A of VIP0 and VIP1 instances. Which
    represents the VIP0 and VIP2 instances in software. While Port B of VIP0 and
    VIP1 are represented by VIP1 and VIP3 instances. On these two instances no
    decoders are present.
    */
    static struct ti81xxvin_config ti81xx_hsvpss_capture_cfg = {
    	.subdev_info = hdvpss_capture_sdev_info,
    	.subdev_count = ARRAY_SIZE(hdvpss_capture_sdev_info),
    	.card_name = ti81xx_card_name,
    	.inst_config[0] = {
    		.inputs = hdvpss_inst0_inputs,
    		.input_count = ARRAY_SIZE(hdvpss_inst0_inputs),
    	},
    	.inst_config[1] = {
    		.inputs = hdvpss_inst0_inputs,
    		.input_count = 0,
    	},
    	.inst_config[2] = {
    		.inputs = hdvpss_inst1_inputs,
    		.input_count = ARRAY_SIZE(hdvpss_inst1_inputs),
    	},
    	.inst_config[3] = {
    		.inputs = hdvpss_inst1_inputs,
    		.input_count = 0,
    	},
    
    };
    
    static u64 ti81xx_fb_dma_mask = ~(u32)0;
    static struct ti81xxfb_platform_data ti81xxfb_config;
    
    static struct resource ti81xx_hdvpss_resource[] = {
    	[0] = {
    		.start = HDVPSS_CAPTURE_INST0_BASE,
    		.end   = (HDVPSS_CAPTURE_INST0_BASE +
    				HDVPSS_CAPTURE_INST0_SIZE - 1),
    		.flags = IORESOURCE_MEM,
    	},
    	[1] = {
    		.start = HDVPSS_CAPTURE_INST2_BASE,
    		.end   = (HDVPSS_CAPTURE_INST2_BASE +
    				HDVPSS_CAPTURE_INST2_SIZE - 1),
    		.flags = IORESOURCE_MEM,
    	},
    };
    
    static struct platform_device ti81xx_fb_device = {
    	.name		= "ti81xxfb",
    	.id		= -1,
    	.dev = {
    		.dma_mask		= &ti81xx_fb_dma_mask,
    		.coherent_dma_mask	= ~(u32)0,
    		.platform_data		= &ti81xxfb_config,
    	},
    	.num_resources = 0,
    };
    static struct platform_device hdvpss_capture_dev = {
    	.name		= "ti81xxvin",
    	.id		= -1,
    	.dev		= {
    			.dma_mask		= &ti81xx_fb_dma_mask,
    			.coherent_dma_mask	= ~(u32)0,
    	},
    	.num_resources = 2,
    	.resource = ti81xx_hdvpss_resource,
    };
    
    void ti81xxfb_set_platform_data(struct ti81xxfb_platform_data *data)
    {
    	ti81xxfb_config = *data;
    }
    
    static inline int ti81xx_init_fb(void)
    {
    	int retval = 0;
    	retval =  platform_device_register(&ti81xx_fb_device);
    	hdvpss_capture_dev.dev.platform_data = &ti81xx_hsvpss_capture_cfg;
    	if (cpu_is_ti814x()) {
    		hdvpss_capture_sdev_info[0].ti81xxvin_select_decoder =
    			vps_ti814x_select_video_decoder;
    		hdvpss_capture_sdev_info[0].ti81xxvin_set_mode =
    			vps_ti814x_set_tvp7002_filter;
    		hdvpss_capture_sdev_info[0].decoder_id = 0;
    		hdvpss_capture_sdev_info[1].ti81xxvin_select_decoder =
    			NULL;
    		hdvpss_capture_sdev_info[1].ti81xxvin_set_mode =
    			NULL;
    		hdvpss_capture_sdev_info[1].decoder_id = 0;
    	} else {
    		hdvpss_capture_sdev_info[0].ti81xxvin_select_decoder =
    			vps_ti816x_select_video_decoder;
    		hdvpss_capture_sdev_info[0].ti81xxvin_set_mode =
    			vps_ti816x_set_tvp7002_filter;
    		hdvpss_capture_sdev_info[0].decoder_id = 0;
    		hdvpss_capture_sdev_info[1].ti81xxvin_select_decoder =
    			NULL;
    		hdvpss_capture_sdev_info[1].ti81xxvin_set_mode =
    			NULL;
    		hdvpss_capture_sdev_info[1].decoder_id = 0;
    	}
    	retval += platform_device_register(&hdvpss_capture_dev);
    	return retval;
    }
    
    arch_initcall(ti81xx_init_fb);
    
    #endif
    
    It is a c file. But this site doesn't allow to upload c type file.

    Jpeg image is made from captdump for your convenience.

  • And more information. I use PSP 04.01.00.07. M3 binary file is from  HDVPSS-01.00.01.33 for 512M board.

    Best regards,

    Alexander Vasiljev.

  • Hi,

    I had been waiting for new ezsdk, but now i still cannot get right synchronization capturing rgb24 from tvp7002. I have tried different polarities in the ti81xx_vpss.c file, but the image is shifted with any polarities.

    Best regards,

    Alexander Vasiljev.