v4l2 subdev format and interval

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

v4l2 subdev format and interval

Jump to solution
1,464 Views
MicMoba
Contributor V

Hi I have a question to the v4l2 experts.

I have a chip that converts analog video to BT601/BT656. This chip has two modes

1) PAL with 768x576@25fps (progressive)
2) NTSC with 640x480@30fps (progressive)

The chip is configurable by I2C. So I create a v4l2 subdevice driver based on the ov5640 driver. Now I am a bit confused because of the formats and intervals.

In my understanding the 4vl2_subdev_pad_ops are for getting information and setting formats of the subdevice. I implemented the enum_frame_size and enum_frame_interval functions and I can list the formats with:
v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
       Type: Video Capture Multiplanar

       [0]: 'GREY' (8-bit Greyscale)
               Size: Discrete 768x576
                       Interval: Discrete 0.040s (25.000 fps)
               Size: Discrete 640x480
                       Interval: Discrete 0.033s (30.000 fps)

I am not sure if this is correct. The format (with, height and fps) depends on the video standard I set up (PAL/NTSC). Because of that I think maybe it is better to list only the format that is choosen by the video standard, isn't it?
And how is the right way to set the video standard? By VIDIOC_S_STD or VIDIOC_SUBDEV_S_FMT?

Another miracle is the line  [0]: 'GREY' (8-bit Greyscale)? I set the colorspace to  V4L2_COLORSPACE_SRGB and the media bus format to MEDIA_BUS_FMT_UYVY8_2X8. I don't know where the 'GREY' is comming from.

 

Thanks

 

[Edit 2021-06-14]

I found out why the formats-list always show 'GREY'. The Media-Bus color code have to match with a color code of imx-isi-cap module. Now I take MEDIA_BUS_FMT_YUYV8_1X16 and the format-list-ext show: [0]: 'YUYV' (YUYV 4:2:2)


Labels (2)
0 Kudos
1 Solution
1,416 Views
MicMoba
Contributor V

I solved my issue with setting the format over a v4l2-control.

View solution in original post

0 Kudos
3 Replies
1,417 Views
MicMoba
Contributor V

I solved my issue with setting the format over a v4l2-control.

0 Kudos
1,428 Views
joanxie
NXP TechSupport
NXP TechSupport

pls add your board and bsp information here, otherwise I don't know how to give you any suggestion

0 Kudos
1,423 Views
MicMoba
Contributor V

Hi joanxie,

I use a phyBOARD pollux i.MX 8M Plus with a Linux kernel 5.4.70.

0 Kudos