-
Notifications
You must be signed in to change notification settings - Fork 5.3k
IMX477 Improvements - 6.12 #6798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: rpi-6.12.y
Are you sure you want to change the base?
Conversation
Hi, after fixing my noob setup i can confirm its working, meanwhile are we expecting to merge this soon? |
Rebased which will retrigger the CI builds. My comment from #6208 (comment) that 2028x1080 and 2028x1520 modes with 10 bit readout give totally white frames needs to be resolved before contemplating merging. |
I have done some testing with this, yes the 10bit 2K modes are white frames |
Register line_length_pix was being written by both the tables of registers and the control handler for V4L2_CID_HBLANK. Remove the duplication in the tables. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
line_length_pix is a value that the developer wants to know, so write the values in decimal. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
The frame length default value doesn't change dynamically, and neither does any of the other parameters that configure it, so precompute it instead of working from a frame duration to get to the value. The minimum value was also computed, when actually the sensor will take any value down to 4 lines. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This removes a load of boilerplate code around how registers are grouped into multiple word values. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
There are a fair number of registers duplicated in all the mode tables, so move those into the common table. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
For 4k30 recording we want 16:9 output, so add a cropped mode to achieve this. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Rather than the hard coded PLL settings for fixed frequencies, compute the PLL settings based on device tree, validating that the specified rate can be achieved. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
As we now support variable link frequency, compute the minimum line_length value that the sensor will work with, and set V4L2_CID_HBLANK based on that number. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
576c474
to
579b122
Compare
I've finally had a few minutes to relook at this one. I've dropped the patch that added 10 and 12 bit readout to all modes. That can be reintroduced in due course. What I have done is reworked setting the link frequency so that it will accept any value that can be achieved (basically a multiple of 3MHz). At 750MHz we get
It's not quite right as the base 450MHz drops performance on the 1332x990 mode. My 500usecs for LP<>HS is probably too generous, and I'm not accounting for it only being a 10bit mode.
I haven't seen any image corruption issues, but it hasn't had masses of testing. It would be appreciated if those interested would test it and feed back any issues. |
Some testing ** (well beyond the suggested max of 750 MHz) showed only occasional frame dropping in any of the modes up to the point where I stopped at 996 Mhz. At that frequency the full frame mode was exceeding 25 fps. However somewhere between 924 and 948 MHz both of the 2x2 binned modes started outputting solid colour frames. Magenta this time rather than white as in the previous 10 bit issue. |
Thanks for testing. As this is a sensor driver, I'm not that interested in anything above 750MHz as then you're exceeding the Pi's capabilities rather than the sensor's. Pi5's libcamera pipeline handler already knows that RP1 CFE has a limit on pixel rate (250MPix/s IIRC), so I'm expecting that will be automatically extending the HBLANK control value once you get to a point where the link frequency can exceed the limit, but you won't get any increase in output framerate from libcamera on Pi5. |
There should be more headroom than 250Mpix/s, ~380Mpix/s is the standard / supported pixel rate. Even at the higher link frequencies tested by @sandyol55, I never saw any frame size/frame rate combo that exceeds 300Mpix/s. Here is 945Mhz
So there must be something else at play that is causing those white frames? It's just so strange that it would be isolated to the 2x2 binned modes, even at low frame rates, because the full readout/4k modes operate just fine from what I've seen; and those ones do in fact operate at pixel rates in many cases approaching 300Mpix/s, which are still well below the 380Mpix/s limit. |
@schoolpost Are you managing to record ok the uncropped 4056x3040/24 modes? Curious how you're managing that if so. Testing with Cinemate, the preview looks good but as soon as I record the preview drops frames making these modes unusable for me, it isn't dropping frames on the disk but at the camera. |
6.12 version of #6208
Only compile tested.