-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Draft PR for exploring fixes to camera sync issues #6863
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
To avoid lost frame start in a subsequent session, avoid setting the number of lanes back to 1 or putting CSI-2 Host into reset. It's not clear if this is a watertight fix -- what if the camera itself produced a truncated or garbled packet, or continued to send until the next start? -- but it does seem to fix the issue. Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
6b6df36
to
c8c70b6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Largely looks fine. Two very minor comments.
@@ -112,6 +112,9 @@ MODULE_PARM_DESC(trigger_mode, "Set vsync trigger mode: 1=source, 2=sink"); | |||
#define IMX477_REG_XVS_IO_CTRL 0x3040 | |||
#define IMX477_REG_EXTOUT_EN 0x4b81 | |||
|
|||
/* Temperature sensor */ | |||
#define IMX477_REG_TEMP_SEN_CTL 0x0138 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you've defined this, it'd be nice to use that define in mode_common_regs
so all instances of 0x0138 are by name.
My comments are largely in regard to the imx477 change. I know very little of the CFE DPHY side. |
797a90a
to
96379b5
Compare
On IMX477 it appears that the on-chip temperature sensor causes XVS (external sync out) to pulse every ~2ms when not streaming. So now we do a little dance: Temperature sensor is enabled during common register setup, giving it time to warm up (almost literally; otherwise the first frame's reading might be 0C), disabled before enabling sync out, then enabled again once the camera is streaming. We already took care to disable XVS output in stop_streaming() (though previously it wasn't understood why this was needed). Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
96379b5
to
f1b9630
Compare
Two issues currently, one is #5821 and is specific to Raspberry Pi 5.
There is also an IMX477 issue, where there are very rarely extra XVS pulses, causing receiving cameras to record a blank frame.