raspberrypi / linux

Kernel source tree for Raspberry Pi-provided kernel builds. Issues unrelated to the linux kernel should be posted on the community forum at https://forums.raspberrypi.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Camera Module V1 (OV5647) 640×480 @ 90 FPS mode not available

christianrauch opened this issue · comments

Describe the bug

The Camera Module V1 (OV5647) is advertised with video modes "1080p30, 720p60 and 640 × 480p60/90" but the video mode with 640 × 480 @ 90 FPS is not available when using the libcamera stack.

This was originally reported to libcamera-apps as raspberrypi/rpicam-apps#427 but it turns out that this is an issue with the ov5647 kernel module, which only defines 4 10bpp-modes

static const struct ov5647_mode ov5647_modes[] = {
/* 2592x1944 full resolution full FOV 10-bit mode. */
{
.format = {
.code = MEDIA_BUS_FMT_SBGGR10_1X10,
.colorspace = V4L2_COLORSPACE_RAW,
.field = V4L2_FIELD_NONE,
.width = 2592,
.height = 1944
},
.crop = {
.left = OV5647_PIXEL_ARRAY_LEFT,
.top = OV5647_PIXEL_ARRAY_TOP,
.width = 2592,
.height = 1944
},
.pixel_rate = 87500000,
.hts = 2844,
.vts = 0x7b0,
.reg_list = ov5647_2592x1944_10bpp,
.num_regs = ARRAY_SIZE(ov5647_2592x1944_10bpp)
},
/* 1080p30 10-bit mode. Full resolution centre-cropped down to 1080p. */
{
.format = {
.code = MEDIA_BUS_FMT_SBGGR10_1X10,
.colorspace = V4L2_COLORSPACE_RAW,
.field = V4L2_FIELD_NONE,
.width = 1920,
.height = 1080
},
.crop = {
.left = 348 + OV5647_PIXEL_ARRAY_LEFT,
.top = 434 + OV5647_PIXEL_ARRAY_TOP,
.width = 1928,
.height = 1080,
},
.pixel_rate = 81666700,
.hts = 2416,
.vts = 0x450,
.reg_list = ov5647_1080p30_10bpp,
.num_regs = ARRAY_SIZE(ov5647_1080p30_10bpp)
},
/* 2x2 binned full FOV 10-bit mode. */
{
.format = {
.code = MEDIA_BUS_FMT_SBGGR10_1X10,
.colorspace = V4L2_COLORSPACE_RAW,
.field = V4L2_FIELD_NONE,
.width = 1296,
.height = 972
},
.crop = {
.left = OV5647_PIXEL_ARRAY_LEFT,
.top = OV5647_PIXEL_ARRAY_TOP,
.width = 2592,
.height = 1944,
},
.pixel_rate = 81666700,
.hts = 1896,
.vts = 0x59b,
.reg_list = ov5647_2x2binned_10bpp,
.num_regs = ARRAY_SIZE(ov5647_2x2binned_10bpp)
},
/* 10-bit VGA full FOV 60fps. 2x2 binned and subsampled down to VGA. */
{
.format = {
.code = MEDIA_BUS_FMT_SBGGR10_1X10,
.colorspace = V4L2_COLORSPACE_RAW,
.field = V4L2_FIELD_NONE,
.width = 640,
.height = 480
},
.crop = {
.left = 16 + OV5647_PIXEL_ARRAY_LEFT,
.top = OV5647_PIXEL_ARRAY_TOP,
.width = 2560,
.height = 1920,
},
.pixel_rate = 55000000,
.hts = 1852,
.vts = 0x1f8,
.reg_list = ov5647_640x480_10bpp,
.num_regs = ARRAY_SIZE(ov5647_640x480_10bpp)
},
};
and is missing the 90 FPS mode.

Hence the new libcamera stack cannot be used with all advertised modes. Since the old "mmal" stack is deprecated, I expect that all features will be available on the new libcamera stack

Steps to reproduce the behaviour

libcamera-vid --list-cameras will list modes between 15 and 60 FPS:

0 : ov5647 [2592x1944] (/base/soc/i2c0mux/i2c@1/ov5647@36)
    Modes: 'SGBRG10_CSI2P' : 640x480 [58.92 fps - (16, 0)/2560x1920 crop]
                             1296x972 [43.25 fps - (0, 0)/2592x1944 crop]
                             1920x1080 [30.62 fps - (348, 434)/1928x1080 crop]
                             2592x1944 [15.63 fps - (0, 0)/2592x1944 crop]

The 90 FPS mode is missing.

Device (s)

Raspberry Pi Zero 2 W, Raspberry Pi 2 Mod. B

System

  • Raspberry Pi OS 11 (bullseye)
  • kernel 5.15

Logs

No response

Additional context

No response