User avatar
gagle
Posts: 82
Joined: Fri Feb 14, 2014 6:54 pm
Contact: Website

[OpenMAX] ISO and shutter speed values max limits

Sat Jun 28, 2014 3:11 pm

The accepted ISO values are: 0, 100, 160, 200, 250, 320, 400, 500, 640 and 800. Values higher than 800 are automatically set to 800.

The range of the shutter speed is from 1μs to 66ms. Values higher than 66 are automatically set to 66.

These are the results from my tests

The struct and index that I'm using are: OMX_CONFIG_EXPOSUREVALUETYPE, OMX_IndexConfigCommonExposureValue.

However, with raspistill the sports exposure mode sets the ISO to a value higher than 800 (I've seen 1250 and 1600) and the night mode sets the shutter speed to values greater than 33ms (139ms).

Furthermore, if I set the sports exposure using the struct OMX_CONFIG_EXPOSURECONTROLTYPE and the index OMX_IndexConfigCommonExposure, the ISO value is not the same than with raspistill, it is never higher than 800.

So I'm sure that I'm missing something...
Last edited by gagle on Sat Jun 28, 2014 3:52 pm, edited 1 time in total.

ethanol100
Posts: 652
Joined: Wed Oct 02, 2013 12:28 pm

Re: [OpenMAX] ISO and shutter speed values max limits

Sat Jun 28, 2014 3:49 pm

Shutterspeed limit:
Full sensor mode 15fps -> 66ms max shutterspeed. If framerate is specified exposure time is limited to fulfil framerate. Can you set the fps to 0? To allow dynamic frame rate? (In raspistill framerate is set to 0)

Iso limit:
Iso sets limits to the analog and digital gains. i.e. iso 100 is something similar to analog gain =1 and digital gain=1 and iso=800 is something similar to analog gain=8 and digital gain=1. (I do not know exactly which values are assumed, just guessing here.)

You can read out the gains and 6by9 has just exposed these trough mmal(you can get them directly with IL):
See http://www.raspberrypi.org/forums/viewt ... 45#p570045

The iso is always calculated using the "auto" exposure mode, which only allow up to 8x analog gain, and therefore only support a max value of 800.
If you set the iso to 0, do you get the 1600 iso value in mode night?

User avatar
gagle
Posts: 82
Joined: Fri Feb 14, 2014 6:54 pm
Contact: Website

Re: [OpenMAX] ISO and shutter speed values max limits

Sat Jun 28, 2014 6:41 pm

- I'm trying to configure the struct OMX_CONFIG_CAMERASETTINGSTYPE which I guess is the struct used with MMAL_PARAMETER_CAMERA_SETTINGS_T. I get an unsupported index error with the index OMX_IndexConfigCameraSettings.

- I've set the framerate of the preview port to 0 and now I can set the shutter speed up to 772ms! :D Is this the 1s exposure that I've been reading? However, the night mode still uses shutter speeds of 66ms.

I still cannot set ISO values higher than 800 :(

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9939
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: [OpenMAX] ISO and shutter speed values max limits

Sat Jun 28, 2014 7:22 pm

- OMX_CONFIG_CAMERASETTINGSTYPE and MMAL_PARAMETER_CAMERA_SETTINGS_T.
They are the same thing, but in both cases they are read only. If you want to set particular values, then there are already parameters exposing almost all those settings (ISO sets up both analog and digital gain).
NB nLux that is in OMX_CONFIG_CAMERASETTINGSTYPE is no longer supported, hence missing it out of the MMAL parameter.

- 772ms
As has been put on other forum posts, setting the shutter speed on the sensor is done as a number of extra lines to read out as temporal padding. The register to set this is 16bit IIRC. The line length of the different sensor modes varies, and on the binned mode it maxes out at 772ms. For the full 5MPix mode it maxes out at something like 1.07s. The cropped 1080P mode was about 997ms.
If the AGC tuner is allowed free-reign, then on capture it will extend shutter speed beyond the value that preview was running in and decrease gain to get back to the same overall scene exposure. If a fixed shutter speed has been set, then the value has already been clipped and isn't rerequested.
We are trying to get the binned mode (and others) to support longer exposure times, but either you then have to compromise the max framerate, or end up having to reprogram PLLs and other things on the fly - not a task to be undertaken lightly. It's all down to time though, and that is in short supply at the moment.

- ISO 800+
I haven't got the tuner settings to hand, but each mode has a max combined gain that is allowed. Analog gain is limited by the sensor to x8 (ie ISO 800), and we don't recall any mode ever allowing the combined value to be above x16 due to excessive noise. Night mode normally allows everything to be cranked up as high as they can go, so it is normally the best bet as an automatic mode. I can't remember the detail of manually setting ISO modes and what that will allow.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27461
Joined: Sat Jul 30, 2011 7:41 pm

Re: [OpenMAX] ISO and shutter speed values max limits

Sun Jun 29, 2014 8:15 am

I did have a go at extending the framelength to get longer shutter times. It was unsuccessful...and I ran out of time to investigate further.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
gagle
Posts: 82
Joined: Fri Feb 14, 2014 6:54 pm
Contact: Website

Re: [OpenMAX] ISO and shutter speed values max limits

Sun Jun 29, 2014 9:45 am

Is there a possibility that the jpeg encoder doesn't set the exposure time metadata correctly? I'm trying to set a 1s shutter speed with raspistill with all the resolutions explained here but it is always 772ms.

Code: Select all

$ raspistill -ss 1000000 -w 1296 -h 972 -o pic.jpeg

ethanol100
Posts: 652
Joined: Wed Oct 02, 2013 12:28 pm

Re: [OpenMAX] ISO and shutter speed values max limits

Sun Jun 29, 2014 10:31 am

The still port of the camera is always using the full sensor mode(2592×1944).
The preview port has two possibilities in raspistill:
1) binned full field of view (1296x972) at 30fps.
2) full preview (switch -fp) taking full sensor resolution at 15fps.

If you now use your command, you are using the binned mode for preview and with this mode the max shutterspeed is limited to 772ms. (See post above from 6by9.)
If you add -fp as an option you will get up to 1.07s exposure time.
You can let the -ex night work on its own without specifying the shutterspeed, in this mode you can even get the full 1.07s with the binned full field of view mode. (See again post above from 6by9.)

User avatar
gagle
Posts: 82
Joined: Fri Feb 14, 2014 6:54 pm
Contact: Website

Re: [OpenMAX] ISO and shutter speed values max limits

Sun Jun 29, 2014 11:00 am

ethanol100 wrote:The still port of the camera is always using the full sensor mode(2592×1944).
The preview port has two possibilities in raspistill:
1) binned full field of view (1296x972) at 30fps.
2) full preview (switch -fp) taking full sensor resolution at 15fps.

If you now use your command, you are using the binned mode for preview and with this mode the max shutterspeed is limited to 772ms. (See post above from 6by9.)
If you add -fp as an option you will get up to 1.07s exposure time.
You can let the -ex night work on its own without specifying the shutterspeed, in this mode you can even get the full 1.07s with the binned full field of view mode. (See again post above from 6by9.)
Perfect. ;)

Code: Select all

raspistill -ss 2000000 -fp -o pic.jpeg
This sets a max exposure time of 1s.

Return to “Camera board”