media: i2c: ov5647: Add 90fps support for VGA mode - #7582
Conversation
The OV5647 sensor supports 90fps operation in hardware, but the existing VGA mode is configured for 60fps and does not make use of this capability. Increase the PLL multiplier for the VGA mode from 0x46 to 0x69 to allow the sensor to operate at 90fps. Update the reported pixel rate from 58.333 MHz to 87.5 MHz to match the new PLL configuration. Signed-off-by: Arun Cheriyan <aruncherian02@gmail.com>
8d61493 to
a1b10f3
Compare
|
Whilst the patch is valid to achieve a max of 90fps, increasing the pixel rate will reduce the maximum frame time that can be achieved. If my calculations are correct it reduces it from 4.54secs to 3.03secs. (0x69=105, 0x46=70. 105/70 is x1.5) I'd be surprised if many folks are doing low rate captures using the VGA mode, but changing this behaviour may be considered a regression by other upstream maintainers. (I am the joint maintainer for OV5647) |
|
I think this is a reasonable trade-off. In my understanding the VGA mode exists specifically for high frame rate, low-res capture (fast motion, tracking, etc.). It's not really the mode anyone would reach for if they wanted long exposures. We had a discussion some time back here: Modifications were based on that discussion. I did try to keep the pixel clock same and vary HTS. But this was not working. So I think this is the only way to achieve 90fps. Earlier I was testing with an OV5647 motorized focus module from arducam. I think there seems to be some kind of minor clock difference between the normal ov5647 camera from raspberry pi and the module I was using. I was not getting the exact fps values as per the calculations in the discussion. Took some time for me to figure out. I was able to get my hands on a normal ov5647 module and test now. |
|
It's nice to provide a link to any previous thread on a subject. We get so many support issues through that there was no way I'd remember a forum thread from 9 months ago. Raspberry Pi haven't made an OV5647 since 2015. The drivers are written to work with those original modules that used a 25MHz oscillator. I believe all the values are correct under those conditions. There are datasheets in the wild for OV5647, so it's possible for anyone to analyse the registers and timings being used. If any of the numbers are actually wrong then they can be amended. I see I do have a pile of other patches for OV5647 to upstream. I'll try and check that this PR does work next week, and then look to upstream the lot. Things that are rejected upstream are likely to get dropped downstream as they become a cumulative maintenance burden. |
The OV5647 sensor supports 90fps operation in hardware, but the existing VGA mode is configured for 60fps and does not make use of this capability.
Increase the PLL multiplier for the VGA mode from 0x46 to 0x69 to allow the sensor to operate at 90fps. Update the reported pixel rate from 58.333 MHz to 87.5 MHz to match the new PLL configuration.