Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8082

Camera board • Re: Proposal to add 640×480@90 FPS mode to OV5647 driver

$
0
0
Sorry for the very late reply. I got busy with work and was also trying to understand the timing behaviour properly before responding.

I made the exact changes you suggested:
Set 0x3036 = 0x69
Set pixel_rate = 87500000
I also tweaked the HTS and VTS to get exactly 90fps.

Code:

{.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= 87500000,.link_freq_index = FREQ_INDEX_VGA,.hts= 1869,.vts= 0x208,.reg_list= ov5647_640x480_10bpp,.num_regs= ARRAY_SIZE(ov5647_640x480_10bpp)}
I added debug prints in "ov5647_stream_on()" to verify that the HTS and VTS were still the values I programmed into "ov5647_modes". They looked correct. No other driver modifications were made.

Code:

pi@raspberry:~/ov5647 $ v4l2-ctl --list-ctrls-menu -d /dev/v4l-subdev0<...>Camera Controls                  auto_exposure 0x009a0901 (menu)   : min=0 max=1 default=1 value=1 (Manual Mode)0: Auto Mode1: Manual Mode<...>Image Source Controls              vertical_blanking 0x009e0901 (int)    : min=24 max=32287 step=1 default=40 value=40            horizontal_blanking 0x009e0902 (int)    : min=1229 max=7551 step=1 default=1229 value=1229                  analogue_gain 0x009e0903 (int)    : min=16 max=1023 step=1 default=32 value=66Image Processing Controls                 link_frequency 0x009f0901 (intmenu): min=0 max=1 default=0 value=1 (208333000 0xc6ae8c8) flags=read-only0: 218500000 (0xd060ba0)1: 208333000 (0xc6ae8c8)                     pixel_rate 0x009f0902 (int64)  : min=87500000 max=87500000 step=1 default=87500000 value=87500000 flags=read-only                   test_pattern 0x009f0903 (menu)   : min=0 max=3 default=0 value=0 (Disabled)<...>
rpicam-hello --list-cameras now reports the VGA mode with a maximum frame rate of about 92.89 fps

Code:

pi@raspberry:~/ov5647 $ rpicam-vid --list-camerasAvailable cameras-----------------0 : ov5647 [2592x1944 10-bit GBRG] (/base/soc/i2c0mux/i2c@1/ov5647@36)    Modes: 'SGBRG10_CSI2P' : 640x480 [92.89 fps - (16, 0)/2560x1920 crop]                             1296x972 [46.34 fps - (0, 0)/2592x1944 crop]                             1920x1080 [32.81 fps - (348, 434)/1928x1080 crop]                             2592x1944 [15.63 fps - (0, 0)/2592x1944 crop]
However, when I actually measure the frame rate during streaming, I still consistently see around 97 fps, not ~90 fps.

For example:

Code:

gst-launch-1.0 libcamerasrc ! capsfilter caps=video/x-raw,width=640,height=480,format=NV12,framerate=90/1 ! v4l2convert ! fpsdisplaysink video-sink=autovideosink text-overlay=false sync=false -v 2>&1<...>/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 1417, dropped: 0, current: 97.70, average: 96.98/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 1466, dropped: 0, current: 97.32, average: 96.99/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 1515, dropped: 0, current: 96.81, average: 96.99/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 1564, dropped: 0, current: 97.59, average: 97.00

Code:

pi@raspberry:~/ov5647 $ rpicam-hello -t 0 --viewfinder-mode 640:480:10 --framerate 90<...>Mode selection for 640:480:10:P(90)    SGBRG10_CSI2P,640x480/92.8936 - Score: 0    SGBRG10_CSI2P,1296x972/46.3371 - Score: 87612.9    SGBRG10_CSI2P,1920x1080/32.8052 - Score: 115026    SGBRG10_CSI2P,2592x1944/15.6335 - Score: 149587Stream configuration adjusted[0:35:31.438720188] [926]  INFO Camera camera.cpp:1215 configuring streams: (0) 1296x972-YUV420/sYCC (1) 640x480-SGBRG10_CSI2P/RAW[0:35:31.439412873] [929]  INFO RPI vc4.cpp:620 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 640x480-SGBRG10_1X10/RAW - Selected unicam format: 640x480-pGAA/RAW[0:35:31.469254967] [933]  WARN IPARPI ipa_base.cpp:800 Could not set AF_MODE - no AF algorithm[0:35:31.469538447] [933]  WARN IPARPI ipa_base.cpp:1342 Could not set AF_SPEED - no focus algorithm[0:35:31.469704119] [933]  WARN IPARPI ipa_base.cpp:1324 Could not set AF_RANGE - no focus algorithm#10 (0.00 fps) exp 11021.00 ag 3.88 dg 1.01#11 (97.29 fps) exp 11021.00 ag 3.88 dg 1.01#12 (97.27 fps) exp 11021.00 ag 3.88 dg 1.00#13 (97.29 fps) exp 11021.00 ag 3.81 dg 1.00#14 (97.31 fps) exp 11021.00 ag 3.81 dg 1.00#15 (97.30 fps) exp 11021.00 ag 3.81 dg 1.00
Because of this, I’m trying to understand what’s happening:
Is it possible that the sensor is dynamically shortening VTS during streaming?
Or is this small difference (90 requested vs ~97 measured) actually not a real issue in practice?
I'm doing all these tests without a display. Could this be an issue?

The reason I’m concerned is that 97 fps is quite a bit higher than the theoretical ~90 fps calculated from (HTS × VTS) / pixel_rate, so I’m wondering whether I’m misunderstanding something fundamental.
Would you consider this behaviour normal/acceptable, or does it indicate that something is still inconsistent in the timing configuration?

Thanks again for the guidance earlier and apologies again for the delayed follow-up.

Statistics: Posted by pi_chef — Sat Feb 21, 2026 12:18 pm



Viewing all articles
Browse latest Browse all 8082

Trending Articles