How to control focus point of webcam on TX2

I’m trying to control Logitech BRIO focus point
but I realized that v4l2 on TX2 is different to the one on Ubuntu 16.04
it does not have the code to control focus

the v4l2 code on Ubuntu look like this
v4l2-ctl -d /dev/video1 -c exposure_auto=1
focus_absolute (int) : min=0 max=250 step=5 default=0 value=0

Besides I also tried to use Open CV to control it but also don’t work well.
Is there any other way to control the focus point?

My English is not every well
sorry about that

thanks ford your help

Hi,

Since it is a USB camera it should be UVC compliant. You can try using uvcdynctrl utility to access and set the camera controls. For example, assuming you camera is on /dev/video1, you can change its brightness as follows:

sudo uvcdynctrl -d /dev/video1 -s 'Brightness' 128

You can also list all the available controls with:

sudo uvcdynctrl -d /dev/video1 -c

Hope this helps!

Best Regards,

Thanks for your reply

but it seem that uvcdynctrl do not support controlling my Logitech BRIO
when i typed sudo uvcdynctrl -d /dev/video1 -c
i got this

[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009A0001, name = ‘Camera Controls’, type = 6
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A0001, name = ‘Camera Controls’
[libwebcam] Unknown V4L2 camera class (UVC) control ID encountered: 0x009A2000 (V4L2_CID_CAMERA_CLASS_BASE + 5888)
[libwebcam] Unknown V4L2 camera class (UVC) control ID encountered: 0x009A2001 (V4L2_CID_CAMERA_CLASS_BASE + 5889)
[libwebcam] Unknown V4L2 camera class (UVC) control ID encountered: 0x009A2002 (V4L2_CID_CAMERA_CLASS_BASE + 5890)
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009A2003, name = ‘Group Hold’, type = 9
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A2003, name = ‘Group Hold’
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009A2004, name = ‘HDR enable’, type = 9
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A2004, name = ‘HDR enable’
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009A2006, name = ‘OTP Data’, type = 7
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A2006, name = ‘OTP Data’
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009A2007, name = ‘Fuse ID’, type = 7
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A2007, name = ‘Fuse ID’
[libwebcam] Unknown V4L2 camera class (UVC) control ID encountered: 0x009A2009 (V4L2_CID_CAMERA_CLASS_BASE + 5897)
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009A2064, name = ‘Bypass Mode’, type = 9
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A2064, name = ‘Bypass Mode’
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009A2065, name = ‘Override Enable’, type = 9
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A2065, name = ‘Override Enable’
[libwebcam] Unknown V4L2 camera class (UVC) control ID encountered: 0x009A2066 (V4L2_CID_CAMERA_CLASS_BASE + 5990)
[libwebcam] Invalid V4L2 control type encountered: ctrl_id = 0x009A2067, name = ‘Size Align’, type = 9
[libwebcam] Invalid or unsupported V4L2 control encountered: ctrl_id = 0x009A2067, name = ‘Size Align’
[libwebcam] Unknown V4L2 camera class (UVC) control ID encountered: 0x009A2068 (V4L2_CID_CAMERA_CLASS_BASE + 5992)
[libwebcam] Unknown V4L2 camera class (UVC) control ID encountered: 0x009A2082 (V4L2_CID_CAMERA_CLASS_BASE + 6018)
Listing available controls for device /dev/video1:
Brightness
Contrast
Saturation
White Balance Temperature, Auto
Gain
Power Line Frequency
White Balance Temperature
Sharpness
Backlight Compensation
Exposure, Auto
Exposure (Absolute)
Exposure, Auto Priority
Pan (Absolute)
Tilt (Absolute)
Focus (absolute)
Focus, Auto
Zoom, Absolute

Hi,

It looks like it recognized the standard controls but not others (they looks to be very specific). Did you try setting the Focus, Auto, and Focus(absolute)?

The first set of controls look like some sort of extension unit descriptor or similar that provides some more manufacturer specific controls.

Can you provide the output for:

sudo lsusb -v -d <VID:PID>

were VID and PID are the vendor and product ID of the camera. You can get this information from the dmesg output, for instance:

[ 2390.462222] usb 1-1.3: New USB device found, idVendor=046d, idProduct=082d
[ 2390.462228] usb 1-1.3: New USB device strings: Mfr=0, Product=2, SerialNumber=1
[ 2390.462232] usb 1-1.3: Product: HD Pro Webcam C920
[ 2390.462236] usb 1-1.3: SerialNumber: 7C9FD6AF
[ 2390.463530] uvcvideo: Found UVC 1.00 device HD Pro Webcam C920 (046d:082d)

In the example above I should run:

sudo lsusb -v -d 046d:082d

This should dump the descriptors for the camera and provide some information about the controls setup.

Best Regards,