Hello Paulo,
5:1 and 5:2 cannot be read,
rasp:~ # uvcdynctrl -G 5:1
[libwebcam] ERROR: Unable to query size of XU control
00000000-0000-0000-0000-000000000000/1: Extension unit or control not found.
(System code: 2).
query control size of : 0
ERROR: Unable to retrieve control value: A Video4Linux2 API call returned an
unexpected error 0. (Code: 12)
rasp:~ # uvcdynctrl -G 5:2
[libwebcam] ERROR: Unable to query size of XU control
00000000-0000-0000-0000-000000000000/2: Extension unit or control not found.
(System code: 2).
query control size of : 0
ERROR: Unable to retrieve control value: A Video4Linux2 API call returned an
unexpected error 0. (Code: 12)
And 4:2 is 8 Byte long!
rasp:~ # uvcdynctrl -G 4:1
query control size of : 4
query control flags of: 0x3
query minimum value of: (LE)0x00000000 (BE)0x00000000
query maximum value of: (LE)0xffffffff (BE)0xffffffff
query default value of: (LE)0x00011000 (BE)0x00100100
query step size of : (LE)0x01000000 (BE)0x00000001
query current value of: (LE)0x0101c000 (BE)0x00c00101
rasp:~ # uvcdynctrl -G 4:2
query control size of : 8
query control flags of: 0x3
query minimum value of: (LE)0x0000000000000000 (BE)0x0000000000000000
query maximum value of: (LE)0xffffffffffffffff (BE)0xffffffffffffffff
query default value of: (LE)0x000110ddffffffff (BE)0xffffffffdd100100
query step size of : (LE)0x0100000000000000 (BE)0x0000000000000001
query current value of: (LE)0x000110dd00000000 (BE)0x00000000dd100100
What should I try?
Manfred
-----Ursprüngliche Nachricht-----
Von: Paulo Assis [mailto:***@gmail.com]
Gesendet: Montag, 05. August 2013 22:23
An: Manfred Baumgartl
Cc: Márton Miklós; linux-uvc-***@lists.sourceforge.net
Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite Premier
Ok,
lsusb output indicates 2 extension units:
bUnitID 4
guidExtensionCode {7033f028-1163-2e4a-ba2c-6890eb334016}
and
bUnitID 5
guidExtensionCode {3fae1228-d7bc-114e-a357-6f1edef7d61d}
so you should try to get the settings for both these controls
uvcdynctrl -G 4:1 and uvcdynctrl -G 5:1
and maybe with selector 2 also (although only one control is reported for
each extension unit)
uvcdynctrl -G 4:2 and uvcdynctrl -G 5:2
then set the values according to the reported minimum, maximum and step
values.
Regards,
Paulo
2013/8/5 Manfred Baumgartl <***@peony.at>:
> Hello Paulo,
>
> here ist he output:
>
>
> Bus 002 Device 011: ID a168:0840 AnMo Electronics Corporation Device
> Descriptor:
> bLength 18
> bDescriptorType 1
> bcdUSB 2.00
> bDeviceClass 239 Miscellaneous Device
> bDeviceSubClass 2 ?
> bDeviceProtocol 1 Interface Association
> bMaxPacketSize0 64
> idVendor 0xa168 AnMo Electronics Corporation
> idProduct 0x0840
> bcdDevice 1.00
> iManufacturer 2 AnMo Electronics Corporation
> iProduct 1 Dino-Lite Premier
> iSerial 0
> bNumConfigurations 1
> Configuration Descriptor:
> bLength 9
> bDescriptorType 2
> wTotalLength 645
> bNumInterfaces 2
> bConfigurationValue 1
> iConfiguration 0
> bmAttributes 0x80
> (Bus Powered)
> MaxPower 168mA
> Interface Association:
> bLength 8
> bDescriptorType 11
> bFirstInterface 0
> bInterfaceCount 2
> bFunctionClass 14 Video
> bFunctionSubClass 3 Video Interface Collection
> bFunctionProtocol 0
> iFunction 5 Dino-Lite Premier
> Interface Descriptor:
> bLength 9
> bDescriptorType 4
> bInterfaceNumber 0
> bAlternateSetting 0
> bNumEndpoints 1
> bInterfaceClass 14 Video
> bInterfaceSubClass 1 Video Control
> bInterfaceProtocol 0
> iInterface 5 Dino-Lite Premier
> VideoControl Interface Descriptor:
> bLength 13
> bDescriptorType 36
> bDescriptorSubtype 1 (HEADER)
> bcdUVC 1.00
> wTotalLength 103
> dwClockFrequency 15.000000MHz
> bInCollection 1
> baInterfaceNr( 0) 1
> VideoControl Interface Descriptor:
> bLength 9
> bDescriptorType 36
> bDescriptorSubtype 3 (OUTPUT_TERMINAL)
> bTerminalID 2
> wTerminalType 0x0101 USB Streaming
> bAssocTerminal 0
> bSourceID 5
> iTerminal 0
> VideoControl Interface Descriptor:
> bLength 26
> bDescriptorType 36
> bDescriptorSubtype 6 (EXTENSION_UNIT)
> bUnitID 4
> guidExtensionCode {7033f028-1163-2e4a-ba2c-6890eb334016}
> bNumControl 8
> bNrPins 1
> baSourceID( 0) 3
> bControlSize 1
> bmControls( 0) 0x0f
> iExtension 0
> VideoControl Interface Descriptor:
> bLength 26
> bDescriptorType 36
> bDescriptorSubtype 6 (EXTENSION_UNIT)
> bUnitID 5
> guidExtensionCode {3fae1228-d7bc-114e-a357-6f1edef7d61d}
> bNumControl 8
> bNrPins 1
> baSourceID( 0) 4
> bControlSize 1
> bmControls( 0) 0xff
> iExtension 0
> VideoControl Interface Descriptor:
> bLength 18
> bDescriptorType 36
> bDescriptorSubtype 2 (INPUT_TERMINAL)
> bTerminalID 1
> wTerminalType 0x0201 Camera Sensor
> bAssocTerminal 0
> iTerminal 0
> wObjectiveFocalLengthMin 0
> wObjectiveFocalLengthMax 0
> wOcularFocalLength 0
> bControlSize 3
> bmControls 0x00000000
> VideoControl Interface Descriptor:
> bLength 11
> bDescriptorType 36
> bDescriptorSubtype 5 (PROCESSING_UNIT)
> Warning: Descriptor too short
> bUnitID 3
> bSourceID 1
> wMaxMultiplier 0
> bControlSize 2
> bmControls 0x0000062f
> Brightness
> Contrast
> Hue
> Saturation
> Gamma
> Gain
> Power Line Frequency
> iProcessing 0
> bmVideoStandards 0x 0
> Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x83 EP 3 IN
> bmAttributes 3
> Transfer Type Interrupt
> Synch Type None
> Usage Type Data
> wMaxPacketSize 0x0010 1x 16 bytes
> bInterval 6
> Interface Descriptor:
> bLength 9
> bDescriptorType 4
> bInterfaceNumber 1
> bAlternateSetting 0
> bNumEndpoints 0
> bInterfaceClass 14 Video
> bInterfaceSubClass 2 Video Streaming
> bInterfaceProtocol 0
> iInterface 0
> VideoStreaming Interface Descriptor:
> bLength 14
> bDescriptorType 36
> bDescriptorSubtype 1 (INPUT_HEADER)
> bNumFormats 1
> wTotalLength 399
> bEndPointAddress 129
> bmInfo 0
> bTerminalLink 2
> bStillCaptureMethod 2
> bTriggerSupport 0
> bTriggerUsage 0
> bControlSize 1
> bmaControls( 0) 27
> VideoStreaming Interface Descriptor:
> bLength 27
> bDescriptorType 36
> bDescriptorSubtype 4 (FORMAT_UNCOMPRESSED)
> bFormatIndex 1
> bNumFrameDescriptors 7
> guidFormat
> {59555932-0000-1000-8000-00aa00389b71}
> bBitsPerPixel 16
> bDefaultFrameIndex 1
> bAspectRatioX 0
> bAspectRatioY 0
> bmInterlaceFlags 0x00
> Interlaced stream or variable: No
> Fields per frame: 2 fields
> Field 1 first: No
> Field pattern: Field 1 only
> bCopyProtect 0
> VideoStreaming Interface Descriptor:
> bLength 50
> bDescriptorType 36
> bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
> bFrameIndex 1
> bmCapabilities 0x00
> Still image unsupported
> wWidth 640
> wHeight 480
> dwMinBitRate 3072000
> dwMaxBitRate 18432000
> dwMaxVideoFrameBufferSize 614400
> dwDefaultFrameInterval 333333
> bFrameIntervalType 6
> dwFrameInterval( 0) 333333
> dwFrameInterval( 1) 400000
> dwFrameInterval( 2) 500000
> dwFrameInterval( 3) 666666
> dwFrameInterval( 4) 1000000
> dwFrameInterval( 5) 2000000
> VideoStreaming Interface Descriptor:
> bLength 50
> bDescriptorType 36
> bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
> bFrameIndex 2
> bmCapabilities 0x00
> Still image unsupported
> wWidth 352
> wHeight 288
> dwMinBitRate 1013760
> dwMaxBitRate 6082560
> dwMaxVideoFrameBufferSize 202752
> dwDefaultFrameInterval 333333
> bFrameIntervalType 6
> dwFrameInterval( 0) 333333
> dwFrameInterval( 1) 400000
> dwFrameInterval( 2) 500000
> dwFrameInterval( 3) 666666
> dwFrameInterval( 4) 1000000
> dwFrameInterval( 5) 2000000
> VideoStreaming Interface Descriptor:
> bLength 50
> bDescriptorType 36
> bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
> bFrameIndex 3
> bmCapabilities 0x00
> Still image unsupported
> wWidth 320
> wHeight 240
> dwMinBitRate 768000
> dwMaxBitRate 4608000
> dwMaxVideoFrameBufferSize 153600
> dwDefaultFrameInterval 333333
> bFrameIntervalType 6
> dwFrameInterval( 0) 333333
> dwFrameInterval( 1) 400000
> dwFrameInterval( 2) 500000
> dwFrameInterval( 3) 666666
> dwFrameInterval( 4) 1000000
> dwFrameInterval( 5) 2000000
> VideoStreaming Interface Descriptor:
> bLength 50
> bDescriptorType 36
> bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
> bFrameIndex 4
> bmCapabilities 0x00
> Still image unsupported
> wWidth 176
> wHeight 144
> dwMinBitRate 253440
> dwMaxBitRate 1520640
> dwMaxVideoFrameBufferSize 50688
> dwDefaultFrameInterval 333333
> bFrameIntervalType 6
> dwFrameInterval( 0) 333333
> dwFrameInterval( 1) 400000
> dwFrameInterval( 2) 500000
> dwFrameInterval( 3) 666666
> dwFrameInterval( 4) 1000000
> dwFrameInterval( 5) 2000000
> VideoStreaming Interface Descriptor:
> bLength 50
> bDescriptorType 36
> bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
> bFrameIndex 5
> bmCapabilities 0x00
> Still image unsupported
> wWidth 160
> wHeight 120
> dwMinBitRate 192000
> dwMaxBitRate 1152000
> dwMaxVideoFrameBufferSize 38400
> dwDefaultFrameInterval 333333
> bFrameIntervalType 6
> dwFrameInterval( 0) 333333
> dwFrameInterval( 1) 400000
> dwFrameInterval( 2) 500000
> dwFrameInterval( 3) 666666
> dwFrameInterval( 4) 1000000
> dwFrameInterval( 5) 2000000
> VideoStreaming Interface Descriptor:
> bLength 34
> bDescriptorType 36
> bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
> bFrameIndex 6
> bmCapabilities 0x00
> Still image unsupported
> wWidth 1280
> wHeight 960
> dwMinBitRate 12288000
> dwMaxBitRate 22118400
> dwMaxVideoFrameBufferSize 2457600
> dwDefaultFrameInterval 1111111
> bFrameIntervalType 2
> dwFrameInterval( 0) 1111111
> dwFrameInterval( 1) 2000000
> VideoStreaming Interface Descriptor:
> bLength 34
> bDescriptorType 36
> bDescriptorSubtype 5 (FRAME_UNCOMPRESSED)
> bFrameIndex 7
> bmCapabilities 0x00
> Still image unsupported
> wWidth 1280
> wHeight 1024
> dwMinBitRate 13107200
> dwMaxBitRate 23592960
> dwMaxVideoFrameBufferSize 2621440
> dwDefaultFrameInterval 1111111
> bFrameIntervalType 2
> dwFrameInterval( 0) 1111111
> dwFrameInterval( 1) 2000000
> VideoStreaming Interface Descriptor:
> bLength 34
> bDescriptorType 36
> bDescriptorSubtype 3 (STILL_IMAGE_FRAME)
> bEndpointAddress 0
> bNumImageSizePatterns 7
> wWidth( 0) 1280
> wHeight( 0) 1024
> wWidth( 1) 1280
> wHeight( 1) 960
> wWidth( 2) 640
> wHeight( 2) 480
> wWidth( 3) 352
> wHeight( 3) 288
> wWidth( 4) 320
> wHeight( 4) 240
> wWidth( 5) 176
> wHeight( 5) 144
> wWidth( 6) 160
> wHeight( 6) 120
> bNumCompressionPatterns 7
> VideoStreaming Interface Descriptor:
> bLength 6
> bDescriptorType 36
> bDescriptorSubtype 13 (COLORFORMAT)
> bColorPrimaries 1 (BT.709,sRGB)
> bTransferCharacteristics 1 (BT.709)
> bMatrixCoefficients 4 (SMPTE 170M (BT.601))
> Interface Descriptor:
> bLength 9
> bDescriptorType 4
> bInterfaceNumber 1
> bAlternateSetting 1
> bNumEndpoints 1
> bInterfaceClass 14 Video
> bInterfaceSubClass 2 Video Streaming
> bInterfaceProtocol 0
> iInterface 0
> Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x81 EP 1 IN
> bmAttributes 5
> Transfer Type Isochronous
> Synch Type Asynchronous
> Usage Type Data
> wMaxPacketSize 0x0080 1x 128 bytes
> bInterval 1
> Interface Descriptor:
> bLength 9
> bDescriptorType 4
> bInterfaceNumber 1
> bAlternateSetting 2
> bNumEndpoints 1
> bInterfaceClass 14 Video
> bInterfaceSubClass 2 Video Streaming
> bInterfaceProtocol 0
> iInterface 0
> Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x81 EP 1 IN
> bmAttributes 5
> Transfer Type Isochronous
> Synch Type Asynchronous
> Usage Type Data
> wMaxPacketSize 0x0100 1x 256 bytes
> bInterval 1
> Interface Descriptor:
> bLength 9
> bDescriptorType 4
> bInterfaceNumber 1
> bAlternateSetting 3
> bNumEndpoints 1
> bInterfaceClass 14 Video
> bInterfaceSubClass 2 Video Streaming
> bInterfaceProtocol 0
> iInterface 0
> Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x81 EP 1 IN
> bmAttributes 5
> Transfer Type Isochronous
> Synch Type Asynchronous
> Usage Type Data
> wMaxPacketSize 0x0320 1x 800 bytes
> bInterval 1
> Interface Descriptor:
> bLength 9
> bDescriptorType 4
> bInterfaceNumber 1
> bAlternateSetting 4
> bNumEndpoints 1
> bInterfaceClass 14 Video
> bInterfaceSubClass 2 Video Streaming
> bInterfaceProtocol 0
> iInterface 0
> Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x81 EP 1 IN
> bmAttributes 5
> Transfer Type Isochronous
> Synch Type Asynchronous
> Usage Type Data
> wMaxPacketSize 0x0b20 2x 800 bytes
> bInterval 1
> Interface Descriptor:
> bLength 9
> bDescriptorType 4
> bInterfaceNumber 1
> bAlternateSetting 5
> bNumEndpoints 1
> bInterfaceClass 14 Video
> bInterfaceSubClass 2 Video Streaming
> bInterfaceProtocol 0
> iInterface 0
> Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x81 EP 1 IN
> bmAttributes 5
> Transfer Type Isochronous
> Synch Type Asynchronous
> Usage Type Data
> wMaxPacketSize 0x1320 3x 800 bytes
> bInterval 1
> Interface Descriptor:
> bLength 9
> bDescriptorType 4
> bInterfaceNumber 1
> bAlternateSetting 6
> bNumEndpoints 1
> bInterfaceClass 14 Video
> bInterfaceSubClass 2 Video Streaming
> bInterfaceProtocol 0
> iInterface 0
> Endpoint Descriptor:
> bLength 7
> bDescriptorType 5
> bEndpointAddress 0x81 EP 1 IN
> bmAttributes 5
> Transfer Type Isochronous
> Synch Type Asynchronous
> Usage Type Data
> wMaxPacketSize 0x1400 3x 1024 bytes
> bInterval 1
> Device Qualifier (for other device speed):
> bLength 10
> bDescriptorType 6
> bcdUSB 2.00
> bDeviceClass 239 Miscellaneous Device
> bDeviceSubClass 2 ?
> bDeviceProtocol 1 Interface Association
> bMaxPacketSize0 64
> bNumConfigurations 1
> Device Status: 0x0002
> (Bus Powered)
> Remote Wakeup Enabled
>
>
> Regards
> Manfred
>
>
> -----Ursprüngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Montag, 05. August 2013 17:17
> An: Manfred Baumgartl
> Cc: Márton Miklós; linux-uvc-***@lists.sourceforge.net
> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
> Premier
>
> 2013/8/5 Manfred Baumgartl <***@peony.at>:
>> Hello Paulo,
>>
>> I found the problem. I didn't have the v4l2 development tools
>> installed ;-)
>>
>> rasp:/usr/src/libwebcam-code/build # uvcdynctrl -G 4:1 query control
>> size of : 4 query control flags of: 0x3 query minimum value of:
>> (LE)0x00000000 (BE)0x00000000 query maximum value of: (LE)0xffffffff
>> (BE)0xffffffff query default value of: (LE)0x00000100 (BE)0x00010000
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x01000000 (BE)0x00000001
>>
>>
>> But sending:
>>
>> rasp:/usr/src/libwebcam-code/build # uvcdynctrl -S 4:1 '0x07102500'
>> query control size of : 4
>> query control flags of: 0x3
>> query minimum value of: (LE)0x00000000 (BE)0x00000000 query maximum
>> value of: (LE)0xffffffff (BE)0xffffffff query default value of:
>> (LE)0x00000100 (BE)0x00010000
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> set value of : (LE)0x07102500 (BE)0x00251007
>> rasp:/usr/src/libwebcam-code/build # uvcdynctrl -S 4:1 '0x06100100'
>> query control size of : 4
>> query control flags of: 0x3
>> query minimum value of: (LE)0x00000000 (BE)0x00000000 query maximum
>> value of: (LE)0xffffffff (BE)0xffffffff query default value of:
>> (LE)0x07102500 (BE)0x00251007
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> set value of : (LE)0x06100100 (BE)0x00011006
>>
>>
>> Doesn't do anything. Is 4:1 the correct unit_id:selector ?
>>
>
> Can you run the following command as root(sudo) lsusb -v -d a168:0840
>
> this should list some detailed information about the device including
> some control information.
>
> I'm not really sure because of the the control value, as you can see
> the default is 0x00000100
>
> not even close to any of the ones you are trying to set.
>
> Regards,
> Paulo
>
> Regards,
> Paulo
>
>> Regards
>> Manfred
>>
>>
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Montag, 05. August 2013 14:26
>> An: Manfred Baumgartl
>> Cc: Márton Miklós; linux-uvc-***@lists.sourceforge.net
>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
>> Premier
>>
>> Hi,
>> you need to update libwebcam, please use the git version.
>> you must install both uvcdynctrl and libwebcam shared library, all
>> functionality is in the shared library, uvcdynctrl just parses the
>> command line and calls the appropriate functions from libwebcam.
>>
>> Regards,
>> Paulo
>>
>> 2013/8/5 Manfred Baumgartl <***@peony.at>:
>>> Hello Paulo,
>>>
>>> I tried to use --get_raw and --set_raw but I get an symbol lookup error.
>>>
>>> uvcdynctrl: symbol lookup error: uvcdynctrl: undefined symbol:
>>> c_read_xu_control
>>>
>>> uvcdynctrl: symbol lookup error: uvcdynctrl: undefined symbol:
>>> c_write_xu_control
>>>
>>> Regards,
>>>
>>> Manfred
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Paulo Assis [mailto:***@gmail.com]
>>> Gesendet: Montag, 05. August 2013 11:48
>>> An: Manfred Baumgartl
>>> Cc: Márton Miklós; linux-uvc-***@lists.sourceforge.net
>>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
>>> Premier
>>>
>>> Hi,
>>> you should be able to use uvcdynctrl as is to switch the led light.
>>>
>>> make sure to use the git version.
>>>
>>> you then use the --get_raw and --set_raw options to get and set raw
>>> controls.
>>>
>>> --//--
>>> -S, --set_raw=unit_id:selector Set the current raw control value,
>>> value is a hex string of control size, default is little endian-
>>> use '(BE)' prefix to change to big endian - e.g:
>>> uvcdynctrl -S 4:1 0x01100c or uvcdynctrl -S 4:1 '(BE)0x0c1001' )
>>>
>>> just replace the control string for your particular case.
>>>
>>> If you wish you can post a patch for uvcdynctrl xml mapping file,
>>> this should allow mapping the LED control into a v4l2 control, so
>>> that it can be used from any v4l2 app. there are examples there
>>> already for some logitech models.
>>>
>>> regards,
>>> Paulo
>>>
>>>
>>> 2013/8/5 Manfred Baumgartl <***@peony.at>:
>>>> Hello Miklas,
>>>>
>>>>
>>>>
>>>> in the end we now have the correct control messages (Many thanks to
>>>> Martijn Valkenburg from Dino-Lite Europe) . It is a sequence off
>>>> two control messages each.
>>>>
>>>>
>>>>
>>>> Switching the LED-light on:
>>>>
>>>>
>>>>
>>>> memcpy(buf, "\x07\x10\x25\x00", 0x0000004);
>>>>
>>>> ret = usb_control_msg(devh, USB_TYPE_CLASS +
>>>> USB_RECIP_INTERFACE, 0x0000001, 0x0000100, 0x0000400, buf,
>>>> 0x0000004, 1000);
>>>>
>>>> memcpy(buf, "\x06\x10\x01\x00", 0x0000004);
>>>>
>>>> ret = usb_control_msg(devh, USB_TYPE_CLASS +
>>>> USB_RECIP_INTERFACE, 0x0000001, 0x0000100, 0x0000400, buf,
>>>> 0x0000004, 1000);
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Switching the LED-light off:
>>>>
>>>>
>>>>
>>>> memcpy(buf, "\x07\x10\x25\x00", 0x0000004);
>>>>
>>>> ret = usb_control_msg(devh, USB_TYPE_CLASS +
>>>> USB_RECIP_INTERFACE, 0x0000001, 0x0000100, 0x0000400, buf,
>>>> 0x0000004, 1000);
>>>>
>>>> memcpy(buf, "\x06\x10\x04\x00", 0x0000004);
>>>>
>>>> ret = usb_control_msg(devh, USB_TYPE_CLASS +
>>>> USB_RECIP_INTERFACE, 0x0000001, 0x0000100, 0x0000400, buf,
>>>> 0x0000004, 1000);
>>>>
>>>>
>>>>
>>>> We have now:
>>>>
>>>>
>>>>
>>>> LED ON : 21 01 00 01 00 04 04 00 07 10 25 00 06 10 01 00 LED OFF :
>>>> 21
>>>> 01 00 01 00 04 04 00 07 10 25 00 06 10 04 00
>>>>
>>>> So I am looking forward at the libwebcam project to add the support
>>>> for dino-lite to the uvcdynctrl.
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>> Manfred
>>>>
>>>>
>>>>
>>>> Von: Márton Miklós [mailto:***@gmail.com]
>>>> Gesendet: Sonntag, 28. Juli 2013 17:44
>>>> An: Manfred Baumgartl; linux-uvc-***@lists.sourceforge.net
>>>>
>>>>
>>>> Betreff: Re: AW: [linux-uvc-devel] switching light on device
>>>> Dino-Lite Premier
>>>>
>>>>
>>>>
>>>> Hello Manfred,
>>>>
>>>> It is better now, I have filtered out the isochonous transfers with
>>>> a PHP script. (Results attached.) Basically I have stripped out
>>>> everything between the lines starting with "--
>>>> URB_FUNCTION_ISOCH_TRANSFER:" and the "--".
>>>>
>>>> If I bet well the LED on and off command differences should be in
>>>> the transferred data.
>>>>
>>>> cat out_on.txt | grep "00000000:" > on.txt cat out_off.txt | grep
>>>> "00000000:" > off.txt diff -u on.txt off.txt
>>>>
>>>> You can see 4 differences in the transferred data on writing and
>>>> reading the same extension unit:
>>>>
>>>> -- URB_FUNCTION_CLASS_INTERFACE:
>>>> TransferFlags = 00000001 (USBD_TRANSFER_DIRECTION_IN,
>>>> ~USBD_SHORT_TRANSFER_OK)
>>>> TransferBufferLength = 00000004
>>>> TransferBuffer = 09fce7d0
>>>> TransferBufferMDL = 00000000
>>>> UrbLink = 00000000
>>>> RequestTypeReservedBits = 00000000
>>>> Request = 00000081
>>>> Value = 00000100
>>>> Index = 00000400
>>>> [208153 ms] UsbSnoop - MyInternalIOCTLCompletion(08de0ddc) :
>>>> fido=00000000, Irp=0a823c10, Context=09a836c0, IRQL=2
>>>> [208153 ms] <<< URB 880 coming back <<<
>>>> -- URB_FUNCTION_CONTROL_TRANSFER:
>>>> PipeHandle = 0a9a7220
>>>> TransferFlags = 0000000b (USBD_TRANSFER_DIRECTION_IN,
>>>> USBD_SHORT_TRANSFER_OK)
>>>> TransferBufferLength = 00000004
>>>> TransferBuffer = 09fce7d0
>>>> TransferBufferMDL = 0951cf40
>>>> 00000000: 06 10 04 00
>>>> UrbLink = 00000000
>>>> SetupPacket =
>>>> 00000000: a1 81 00 01 00 04 04 00
>>>>
>>>> This piece of the capture shows a UVC_GET_CUR (request 0x81) on
>>>> unit
>>>> 4 (wIndex >> 8) control selector 1 (wValue >> 8).
>>>>
>>>> -- URB_FUNCTION_CLASS_INTERFACE:
>>>> TransferFlags = 00000000 (USBD_TRANSFER_DIRECTION_OUT,
>>>> ~USBD_SHORT_TRANSFER_OK)
>>>> TransferBufferLength = 00000004
>>>> TransferBuffer = 09fce7d0
>>>> TransferBufferMDL = 00000000
>>>> 00000000: 06 10 05 00
>>>> UrbLink = 00000000
>>>> RequestTypeReservedBits = 00000000
>>>> Request = 00000001
>>>> Value = 00000100
>>>> Index = 00000400
>>>> [208154 ms] UsbSnoop - MyInternalIOCTLCompletion(08de0ddc) :
>>>> fido=00000000, Irp=0902bac0, Context=09a836c0, IRQL=2
>>>> [208154 ms] <<< URB 882 coming back <<<
>>>> -- URB_FUNCTION_CONTROL_TRANSFER:
>>>> PipeHandle = 0a9a7220
>>>> TransferFlags = 0000000a (USBD_TRANSFER_DIRECTION_OUT,
>>>> USBD_SHORT_TRANSFER_OK)
>>>> TransferBufferLength = 00000004
>>>> TransferBuffer = 09fce7d0
>>>> TransferBufferMDL = 0a98e1a0
>>>> UrbLink = 00000000
>>>> SetupPacket =
>>>> 00000000: 21 01 00 01 00 04 04 00
>>>>
>>>> The next difference is a UVC_SET_CUR to the same extension control
>>>> with the data 06 10 05 00
>>>>
>>>> At the end it reads it back, and do a UVC_SET_CUR with 06 10 01 00
>>>> back to it.
>>>>
>>>> So to summarize:
>>>> The third byte seems to have some connection with the LED state.
>>>>
>>>> In the ON log: read 4 first (maybe auto), then it write 5 to it.
>>>> Then writes
>>>> 1 at the end.
>>>> In the OFF log: read 1 from it, then write 0, then write back 4 at
>>>> the
>>> end.
>>>>
>>>> Does this behaviour aligns somehow with your experiments?
>>>>
>>>> What will we need to go further:
>>>> - uvcdynctrl (now parts of the libwebcam:
>>>> http://sourceforge.net/projects/libwebcam/)
>>>> - lsusb -vv a168:0840
>>>>
>>>> In the lsusb output you will see a section with the UVC extension
>>>> units like
>>>> this:
>>>> VideoControl Interface Descriptor:
>>>> bLength 27
>>>> bDescriptorType 36
>>>> bDescriptorSubtype 6 (EXTENSION_UNIT)
>>>> bUnitID 8
>>>> guidExtensionCode
{212de5ff-3080-2c4e-82d9-f587d00540bd}
>>>> bNumControl 10
>>>> bNrPins 1
>>>> baSourceID( 0) 1
>>>> bControlSize 2
>>>> bmControls( 0) 0x00
>>>> bmControls( 1) 0x03
>>>> iExtension 0
>>>>
>>>> You should find one which bUnitID is 4. Please note it's
>>> guidExtensionCode.
>>>>
>>>> I propose to test my beliefs with a small piece of C code using
>>>> libusb, and then start to implement the XML files for the uvcdynctrl.
>>>>
>>>> https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/le
>>>> d
>>>> _
>>>> o
>>>> ff_manfred.c
>>>> https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/le
>>>> d
>>>> _
>>>> o
>>>> n_manfred.c
>>>>
>>>> gcc led_on_manfred.c -lusb -o led_on should compile them, then
>>>> ./led_on
>>>> 0xA168 0x0840 should turn on the led. It has the possibility that
>>>> you will have to unload the uvcvideo kernelmodule before you are
>>>> doing
> it.
>>>>
>>>> Ps. playing with XU controls is not a life assurance, it has the
>>>> possibility (even if in our case is minimal) to brick your device!
>>>> You
>>> have been warned!
>>>> :)
>>>>
>>>> Regards,
>>>> Miklos
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> 2013-07-28 14:50 keltezéssel, Manfred Baumgartl írta:
>>>>
>>>> Hello Miklos,
>>>>
>>>>
>>>>
>>>> Here are again the two logs. But they are still 10MB and 8MB.
>>>>
>>>>
>>>>
>>>> Switching on:
>>>>
>>>>
>>>>
>>>> http://www.peony.at/dino-lite/Dino_Lite_on.log
>>>>
>>>>
>>>>
>>>> Switching off:
>>>>
>>>>
>>>>
>>>> http://www.peony.at/dino-lite/Dino_Lite_off.log
>>>>
>>>>
>>>>
>>>> I hope this will help to figure out the right commands.
>>>>
>>>>
>>>>
>>>> Many thanks for your help.
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>> Manfred
>>>>
>>>>
>>>>
>>>> Von: Márton Miklós [mailto:***@gmail.com]
>>>> Gesendet: Sonntag, 28. Juli 2013 14:33
>>>> An: Manfred Baumgartl; linux-uvc-***@lists.sourceforge.net
>>>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
>>>> Premier
>>>>
>>>>
>>>>
>>>> Hello Manfed,
>>>>
>>>> We will need to figure out a way how can we find the proper transfers.
>>>>
>>>> I have removed the isochronous packets from your dump (these packet
>>>> used to transfer frames), but we still have a large amount of other
>>> transfers.
>>>>
>>>> I have found this utility which might help you to turn the LED on
>>>> and off without streaming:
>>>> http://www.bigc.com/question/how-do-i-control-the-led-lights-withou
>>>> t
>>>> -
>>>> u
>>>> sing-the-dinocapture-software/
>>>>
>>>> If possible please give it a try, and post the results.
>>>>
>>>> Cheers,
>>>> Miklos
>>>>
>>>> 2013-07-27 13:20 keltezéssel, Manfred Baumgartl írta:
>>>>
>>>> Hello Miklos,
>>>>
>>>>
>>>>
>>>> I was able to capture the USB Bus but it was not possible to
>>>> disable the image transfer. So I knew that there is a switch on and
>>>> off inside the captured USB Data (50MB), but I do not know where it
>>>> is J
>>>>
>>>>
>>>>
>>>> http://www.peony.at/dino-lite/UsbSnoop_2.log
>>>>
>>>>
>>>>
>>>> Also here is the lsusb v on the device.
>>>>
>>>>
>>>>
>>>> http://www.peony.at/dino-lite/lsusb_a168_0840.txt
>>>>
>>>>
>>>>
>>>> Can you please give me small introduction what we are looking for
>>>> in the captured data and can you please tell me where I can start
>>>> to implement the necessary changes in the code and how.
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>> Manfred
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Von: Márton Miklós [mailto:***@gmail.com]
>>>> Gesendet: Samstag, 27. Juli 2013 09:37
>>>> An: Manfred Baumgartl
>>>> Betreff: Re: AW: [linux-uvc-devel] switching light on device
>>>> Dino-Lite Premier
>>>>
>>>>
>>>>
>>>> Hello Manfred,
>>>>
>>>> If you have access to a Windows box please do some sniffing on the
>>>> USB bus, and post the results.
>>>>
>>>> I would recommend you to use the USBSnoop:
>>>> http://www.linuxtv.org/wiki/index.php/Usbsnoop#A_brief_.22How_to_us
>>>> e
>>>> _
>>>> u
>>>> sbsnoop.22_v1.8
>>>>
>>>> If possible please capture when the image capturing is paused and
>>>> only the LED switching is done.
>>>>
>>>> If I bet well the LED control is done the through the UVC exension
>>>> controls like in my Logitech C920 case:
>>>> http://sourceforge.net/mailarchive/forum.php?thread_name=51267F67.2
>>>> 0
>>>> 8
>>>> 0 809%40gmail.com&forum_name=linux-uvc-devel
>>>>
>>>> I will be on holiday next week, and it has the chance that I will
>>>> not have internet access, but post your logs to the UVC devel, and
>>>> they will help possibility.
>>>>
>>>> Regards,
>>>> Miklos
>>>>
>>>> 2013-07-26 18:16 keltezéssel, Manfred Baumgartl írta:
>>>>
>>>> Hello,
>>>>
>>>>
>>>>
>>>> yes with the software from the manufacture under windows the light
>>>> could be switched on and off.
>>>>
>>>>
>>>>
>>>> The PID:VID of my device is a168:0840.
>>>>
>>>>
>>>>
>>>> uvcvideo: Found UVC 1.00 device Dino-Lite Premier (a168:0840)
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>> Manfred
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Von: Márton Miklós [mailto:***@gmail.com]
>>>> Gesendet: Freitag, 26. Juli 2013 18:02
>>>> An: linux-uvc-***@lists.sourceforge.net
>>>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
>>>> Premier
>>>>
>>>>
>>>>
>>>> Hello,
>>>>
>>>> - Are you able to control the LEDs under Windows?
>>>> - What is the PID:VID id of your device? (lsusb will tell it)
>>>>
>>>> Regards,
>>>> Miklos Marton
>>>>
>>>> 2013-07-26 17:38 keltezéssel, Manfred Baumgartl írta:
>>>>
>>>> Hello
>>>>
>>>>
>>>>
>>>> I am using a Dino-Lite Premier Microscope camera on a raspberry pi
>>>> with uvcvideo. I am able to set some capabilities like Brightness,
>>> Contrast etc.
>>>> with uvcdynctrl but what I really need is to switch on the
>>>> LED-light ring which is used to illuminate the samples.
>>>>
>>>>
>>>>
>>>> Is there a way to switch the light on while the capability is not
shown?
>>>>
>>>>
>>>>
>>>> Regards
>>>>
>>>> Manfred
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> -
>>>> -
>>>> -
>>>> --------
>>>>
>>>> See everything from the browser to the database with AppDynamics
>>>>
>>>> Get end-to-end visibility with application monitoring from
>>>> AppDynamics
>>>>
>>>> Isolate bottlenecks and diagnose root cause in seconds.
>>>>
>>>> Start your free trial of AppDynamics Pro today!
>>>>
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.
>>>> c
>>>> lktrk
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>>
>>>> Linux-uvc-devel mailing list
>>>>
>>>> Linux-uvc-***@lists.sourceforge.net
>>>>
>>>> https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> -
>>>> -
>>>> -
>>>> --------
>>>>
>>>> See everything from the browser to the database with AppDynamics
>>>>
>>>> Get end-to-end visibility with application monitoring from
>>>> AppDynamics
>>>>
>>>> Isolate bottlenecks and diagnose root cause in seconds.
>>>>
>>>> Start your free trial of AppDynamics Pro today!
>>>>
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.
>>>> c
>>>> lktrk
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>>
>>>> Linux-uvc-devel mailing list
>>>>
>>>> Linux-uvc-***@lists.sourceforge.net
>>>>
>>>> https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> -------------------------------------------------------------------
>>>> -
>>>> -
>>>> -
>>>> -------- Get your SQL database under version control now!
>>>> Version control is standard for application code, but databases
>>>> havent caught up. So what steps can you take to put your SQL
>>>> databases under version control? Why should you start doing it?
>>>> Read more
>> to find out.
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.
>>>> c lktrk _______________________________________________
>>>> Linux-uvc-devel mailing list
>>>> Linux-uvc-***@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
>>>>
>>>
>>
>