Ask questionsExposure failure with ov9281_external_trigger.c
I am trying to run a handful of ArduCam's OV9281 modules with a synchronized external trigger, but I am running into issues when I run the ov9281_external_trigger.c code to change the trigger mode.
At the moment the write_regs() function is called (tested by changing the argument of the preceding usleep() function), the camera exposure seems to drop to nearly zero, outputting all black except when pointed at a bright light source. The below images are taken of my ceiling, before and after the change.
Reducing the clock pulse frequency (supplied via pigpio on a Raspberry Pi separate from the one controlling the camera) from 60Hz to 30Hz returns the camera to normal exposure but results in alternating frames of normal video and all black--presumably because the software is expecting twice as many frames as it is receiving.
My best guess is that at 60Hz, the camera's exposure isn't complete when the next trigger pulse comes in, leading to the described failure, but manually changing V4L2_CID_EXPOSURE and V4L2_CID_GAIN has no effect, regardless of the status of arducam_software_auto_exposure() and arducam_set_resolution(). Is there an undocumented loss of user control over exposure time associated with the register changes in write_regs()?
Other diagnostics notes:
Answer questions kpmoorse
With some help from Lee at ArduCam, I was able to find a two-step solution:
If you call arducam_set_resolution() a second time after calling write_regs(), you regain control of the V4L2 settings without undoing the switch to external trigger mode. Why this works is a mystery, but it does the job.
Fixing that problem introduced an irregular jitter where some frames had the rightmost few columns of pixels wrapped around to the left. It turns out that in my system, with an external raspberry pi supplying the clock pulse to the camera, I needed to have GND and FSIN connected (obviously), but I needed to disconnect VCC in order to get rid of the jitter.
The C code that I can now use to switch the camera to external trigger mode and dump the bitstream to stdout can be found here.
Related questionsNo questions were found.