I explored to possibility to write the camera registers during video capture. After setting the exposure mode to off, MMAL does not touch the i2c bus anymore, so it can be taken over. Starting the capture with exposure mode off results in a black image, and I haven't figured out which register writes are needed to fix this, so capturing still needs to start with a normal exposure setting.
This patch is working on a raspi B+, with bcm2835 compiled for V1 pinmapping.
Changing the exposure register 3501 clearly works.
http://pastebin.com/h2mz4fSd
This is proof-of-concept code, only intended for hacking around!
-
- Posts: 4
- Joined: Thu Aug 02, 2012 12:43 pm
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 13850
- Joined: Wed Dec 04, 2013 11:27 am
- Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
Re: Camera register fiddling
As our datasheets are under NDA, I can't say too much. What I will say is that there are other registers that interact with exposure.
The sensor only sees commands for analogue gain and exposure time. Digital gain (and AWB etc) is done within the GPU, so setting the exposure mode to off before allowing any frames through will result in digital gain still being at x0.0 and hence black images.
The sensor only sees commands for analogue gain and exposure time. Digital gain (and AWB etc) is done within the GPU, so setting the exposure mode to off before allowing any frames through will result in digital gain still being at x0.0 and hence black images.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
-
- Posts: 4
- Joined: Thu Aug 02, 2012 12:43 pm
Re: Camera register fiddling
Any workaround to force this digital gain to unity? Any particular exposure mode that sets it to unity?
thanks!
thanks!
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 13850
- Joined: Wed Dec 04, 2013 11:27 am
- Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
Re: Camera register fiddling
Not currently. As I currently understand it, the first frame has to go through to actually set the digital gain, and if AGC is OFF at that point then it will not get set.JohannesTaelman wrote:Any workaround to force this digital gain to unity? Any particular exposure mode that sets it to unity?
I will look into it though.
Software Engineer at Raspberry Pi Ltd. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.