Skip to content
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

Enable Exposure and White Balance controls #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

friissoren
Copy link

@friissoren friissoren commented Nov 3, 2021

Correctly handle Exposure mode control. The value definition for the V4L2 interface for exposure mode control does not map directly to the UVC control interface. Add some conversion and configuration fixes.

Also enable AWB control. This is a bit of a hack. The RaspberryPi V4L2 driver exposes only a menu of pre-defined color temperatures and two of those are manual and auto. This control definition does not have any corresponding equivalent in the UVC specification.

Override the UVC color temperature control interface to map directly to the V4L2 AWB interface. This will allow controlling
the AWB modes from the host but will only show number values with no explanation of what the numbers refer to.

I don't have any other HW than the RPi 4B + v2 camera so I don't know if these changes are completely valid on other HW combinations.

NOTE: In order to make the exposure and white balance controls visible to the host, changes are needed also for the configuration values for the f_uvc.c kernel driver, as defined by the patch included in the showmewebcam project.
showmewebcam/showmewebcam#167

@friissoren
Copy link
Author

Hmmm... update. This is working fine when using the camera with an Ubuntu PC and viewing the camera stream and controls using the qv4l2 program.

However, I tried now also on Windows with the e-CAMView application, which allows you to access the UVC controls (Options -> Video Capture Filter menu).
The AWB control worked as expected but the exposure control appeared to be stuck in auto mode. I need to check a bit further what is wrong.

@friissoren
Copy link
Author

I updated the code. It now works on both Linux and Windows. At least with the qv4l2 and e-CAMView programs that I have tested with.

The value definition for the V4L2 interface for exposure
mode control does not map directly to the UVC control
interface. Add some conversion and configuration fixes.

This has been tested only on RaspberryPi 4B HW with the
8 Mpixel v2 camera.

Signed-off-by: Soren Friis <soren.friis@intel.com>
This is a bit of a hack.

The RaspberryPi V4L2 driver exposes only a menu of pre-defined
color temperatures and two of those are manual and auto.

This control definition does not have any corresponding equivalent
in the UVC specification.

Override the UVC color temperature control interface to map
directly to the V4L2 AWB interface. This will allow controlling
the AWB modes from the host but will only show number values with
no explanation of what the numbers refer to.

0: Manual
1: Auto
2: Incandescent
3: Fluorescent
4: Fluorescent H
5: Horizon
6: Daylight
7: Flash
8: Cloudy
9: Shade

This has been tested only on RaspberryPi 4B HW with the
8 Mpixel v2 camera.

Signed-off-by: Soren Friis <soren.friis@intel.com>
@friissoren
Copy link
Author

I found a RaspberryPi camera v1.3 (the 5 Mpixel one, I guess) and tried the SW with that one. Appears to work just fine. All the same controls were there and were working.

@peterbay : Could you maybe review this PR and PR #24 and merge those if you are happy with the changes?
The changes to showmewebcam were already merged in a while ago but those will not work completely unless this PR gets merged as well (and the showmewebcam project updated to point to the merged uvc-gadget changes).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant