Hi
Here is my environment
HW platform: imx8-qm, tw9992
OS: android9
I would like to use tw9992 video decoder from imx6 to imx-8qm, and found the difference between imx6 and imx8 as below
| i.mx6 | i.mx8 |
Image Processing | IPU | ISI |
V4L2 slave device (different v4l2 ioctl) | int-device | subdevice |
Media Controller Framework | no | yes |
Here is my settings
static struct reg_value tw9992_init_default[] = {
{0x02,0x40}, /* YSEL[3:0]=0,YIN0 */
{0x04,0x00},{0x05,0x09},
{0x06,0x00}, /*R06[7],Softreset */
{0x07,0x02},{0x08,0x12},
{0x09,0xF0},{0x0A,0x09},{0x0B,0xD1},{0x0C,0xCC},{0x0D,0x00},
{0x10,0x00},{0x11,0x64},{0x12,0x11},{0x13,0x80},{0x14,0x80},{0x15,0x00},{0x17,0x80},
{0x18,0x44},{0x19,0x06},{0x1A,0x00},{0x1C,0x0F},{0x1D,0x7F},{0x1F,0x00},
{0x20,0x50},{0x21,0x22},{0x22,0xF0},{0x23,0xD8},{0x24,0xBC},{0x25,0xB8},{0x26,0x44},{0x27,0x38},
{0x28,0x00},{0x29,0x00},{0x2A,0x78},{0x2B,0x44},{0x2C,0x30},{0x2D,0x14},{0x2E,0xA5},{0x2F,0xE2},
{0x33,0x05},{0x34,0x1A},{0x35,0x00},{0x36,0x5A},{0x37,0x18},{0x38,0xDD},
{0x39,0x00},{0x3A,0x30},{0x3B,0x00},{0x3C,0x00},{0x3D,0x00},{0x3F,0x1A},
{0x40,0x80},{0x41,0x00},{0x42,0x00},
{0x48,0x02},{0x49,0x00},{0x4A,0x81},{0x4B,0x0A},{0x4C,0x00},{0x4D,0x01},{0x4E,0x01},
{0x50,0x00},{0x51,0x00},{0x52,0x00},{0x56,0x00},{0x57,0x00},
{0x58,0x00},
{0x60,0x00},{0x61,0x00},{0x62,0x00},
{0x70,0x81}, /*R70[7]=1:PowerDown,You have to clear!. R70[4]=0,NTSC, 1Lane */
{0x71,0xA5}, /*R71[5]=1,FrameMode*/
{0x72,0xA0},
{0x73,0x20}, /*R73[5]=1, FS_SPECIAL=1. You have to clear later! */
{0x74,0xF0},{0x75,0x00},{0x76,0x17},{0x77,0x05},
{0x78,0x88},{0x79,0x06},{0x7A,0x28},{0x7B,0x46},{0x7C,0xB3},{0x7D,0x06},{0x7E,0x13},
{0x7F,0x10}, /*R7F[1:0]=00,VC0*/
{0x80,0x05},{0x81,0xA0},{0x82,0x13},{0x83,0x11},{0x84,0x02},{0x85,0x0E},{0x86,0x08},{0x87,0x37},
{0x88,0x00},{0x89,0x00},{0x8A,0x02},{0x8B,0x33},{0x8C,0x22},{0x8D,0x03},{0x8E,0x22},{0x8F,0x01},
{0x90,0x00},{0x91,0x0C},{0x92,0x00},{0x93,0x0E},{0x94,0x07},{0x95,0xFF},{0x96,0x1A},
{0x9B,0x02},
{0xA0,0x00},{0xA1,0x00},{0xA2,0x30},{0xA3,0xC0},{0xA4,0x00},
{0xC0,0x06},{0xC1,0x20},{0xC2,0x30},{0xC3,0x00},
{0xC8,0x58},{0xCA,0x1E},{0xCB,0x1A},
{0xD1,0x0E},{0xD2,0x0C},
{0xCF,0x0E},
{0xD3,0x0A},{0xD4,0x0E},{0xD0,0x0E}
};
struct reg_value tw9992_Decoder_NTSC[] = {
{0x07,0x02},{0x08,0x15},{0x09,0xf0},{0x0a,0x12},{0x0b,0xd0}
};
struct reg_value tw9992_Decoder_PAL[] = {
{0x07,0x12},{0x08,0x19},{0x09,0x20},{0x0a,0x0f},{0x0b,0xd0}
};
sensor->pix.width = 720;
sensor->pix.height = 480;
sensor->pix.field = V4L2_FIELD_INTERLACED;
sensor->pix.pixelformat = V4L2_PIX_FMT_YUYV;
sensor->pix.bytesperline = 720 * 2;
sensor->pix.sizeimage = 720 * 2 * 480;
sensor->pix.priv = 1; /* NOTE: 1:TV_in, 0:Camera */
sensor->streamcap.capturemode = 0; /* for Camera type */
sensor->streamcap.timeperframe.denominator = 30;
sensor->streamcap.timeperframe.numerator = 1;
sensor->streamcap.capability = V4L2_MODE_HIGHQUALITY | V4L2_CAP_TIMEPERFRAME;
sensor->is_mipi = 1; /*fixed*/
sensor->lanes = 1; /*fixed*/
sensor->bclock = 216; /*fixed*/
sensor->on = false; /* _dev_init() will assign true*/
sensor->std_id = V4L2_STD_NTSC; /*unlock*/
sensor->input_source = 0; /*CVBS1*/
Get raw data by below command, raw data as attachment
v4l2-ctl -d /dev/video1 --set-standard=ntsc --set-fmt-video=width=720,height=480,pixelformat=YUYV --stream-mmap=3 --stream-skip=0 --stream-to=/sdcard/tw9992.raw --stream-count=1 --stream-poll
But the use XnView check raw data is incorrect
Does anyone have the similar experience?