Discussion:
[linux-uvc-devel] switching light on device Dino-Lite Premier
Manfred Baumgartl
2013-07-26 15:35:53 UTC
Permalink
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
Manfred Baumgartl
2013-07-26 15:38:27 UTC
Permalink
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
Márton Miklós
2013-07-26 16:02:24 UTC
Permalink
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.clktrk
>
>
> _______________________________________________
> Linux-uvc-devel mailing list
> Linux-uvc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
Manfred Baumgartl
2013-07-26 16:16:21 UTC
Permalink
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
<http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> &iu=/4140/ostg.clktrk
Manfred Baumgartl
2013-07-27 11:20:37 UTC
Permalink
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_use_usbsnoo
p.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.2080809%40
gmail.com
<http://sourceforge.net/mailarchive/forum.php?thread_name=51267F67.2080809%4
0gmail.com&forum_name=linux-uvc-devel> &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
<http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> &iu=/4140/ostg.clktrk
Márton Miklós
2013-07-28 12:32:38 UTC
Permalink
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-without-using-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_use_usbsnoop.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.2080809%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
> <mailto: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.clktrk
>
>
>
>
>
> _______________________________________________
>
> Linux-uvc-devel mailing list
>
> Linux-uvc-***@lists.sourceforge.net <mailto: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.clktrk
>
>
> _______________________________________________
> Linux-uvc-devel mailing list
> Linux-uvc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
Manfred Baumgartl
2013-07-28 12:50:08 UTC
Permalink
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-without-using-t
he-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_use_usbsnoo
p.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.2080809%40
gmail.com
<http://sourceforge.net/mailarchive/forum.php?thread_name=51267F67.2080809%4
0gmail.com&forum_name=linux-uvc-devel> &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
<http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> &iu=/4140/ostg.clktrk








_______________________________________________
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
<http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> &iu=/4140/ostg.clktrk
Márton Miklós
2013-07-28 15:44:05 UTC
Permalink
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/led_off_manfred.c
https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led_on_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-without-using-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_use_usbsnoop.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.2080809%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
> <mailto: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.clktrk
>
>
>
>
>
>
> _______________________________________________
>
> Linux-uvc-devel mailing list
>
> Linux-uvc-***@lists.sourceforge.net <mailto: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.clktrk
>
>
>
>
> _______________________________________________
>
> Linux-uvc-devel mailing list
>
> Linux-uvc-***@lists.sourceforge.net <mailto:Linux-uvc-***@lists.sourceforge.net>
>
> https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
>
Manfred Baumgartl
2013-07-28 18:28:57 UTC
Permalink
Hello Miklos.



I tested both programs. And I receive an error.



dino-lite # ./led_on 0xa168 0x0840

usb_get_driver_np returned -61

423 control msg returned 4



dino-lite # ./led_off 0xA168 0x0840

usb_get_driver_np returned -61

423 control msg returned 4



The device was listed:



./led_on

usage: ./led_on vendorID productID

ID numbers of currently attached devices:

0x05e3 0x0605

0x1d6b 0x0002

0xa168 0x0840

0x0403 0x6001

0x046d 0xc05b

0x1d6b 0x0001

0x1d6b 0x0002

0x1d6b 0x0001



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/led_off_man
fred.c
https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led_on_manf
red.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-without-using-t
he-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_use_usbsnoo
p.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.2080809%40
gmail.com
<http://sourceforge.net/mailarchive/forum.php?thread_name=51267F67.2080809%4
0gmail.com&forum_name=linux-uvc-devel> &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
<http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> &iu=/4140/ostg.clktrk









_______________________________________________
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
<http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> &iu=/4140/ostg.clktrk
Manfred Baumgartl
2013-08-05 09:14:45 UTC
Permalink
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/led_off_man
fred.c
https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led_on_manf
red.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-without-using-t
he-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_use_usbsnoo
p.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.2080809%40
gmail.com
<http://sourceforge.net/mailarchive/forum.php?thread_name=51267F67.2080809%4
0gmail.com&forum_name=linux-uvc-devel> &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
<http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> &iu=/4140/ostg.clktrk









_______________________________________________
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
<http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> &iu=/4140/ostg.clktrk
Paulo Assis
2013-08-05 09:48:28 UTC
Permalink
Manfred Baumgartl
2013-08-05 11:24:33 UTC
Permalink
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/led_o
> ff_manfred.c
> https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led_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-without-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_use_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.2080
> 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
>
Paulo Assis
2013-08-05 12:25:45 UTC
Permalink
Manfred Baumgartl
2013-08-05 12:43:14 UTC
Permalink
Hello Paulo,

I have build and installed libwebcam like you discriped it in your
README from your git sources.

The files look as theire are all replaced.

Any ideas?

Regards,

Manfred

Quoting Paulo Assis <***@gmail.com>:

> 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/led_o
>>> ff_manfred.c
>>> https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led_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-without-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_use_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.2080
>>> 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
>>>
>>
>
Manfred Baumgartl
2013-08-05 14:15:39 UTC
Permalink
Hello Paulo,

maybe I found something! While cmake is running the output says:

** Your V4L2 does not have V4L2_CTRL_TYPE_STRING support. Compiling without
raw control support.
** created libwebcam.pc

Here is the whole build process:

rasp:/usr/src/libwebcam-code/build #
rasp:/usr/src/libwebcam-code/build # cmake .. -DCMAKE_INSTALL_PREFIX=/usr
-- The C compiler identification is GNU 4.7.1
-- The CXX compiler identification is GNU 4.7.1
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found PKG_CONFIG: /usr/bin/pkg-config (found version "0.25")
-- checking for module 'libxml-2.0'
-- found libxml-2.0, version 2.7.8
** Your V4L2 does not have V4L2_CTRL_TYPE_STRING support. Compiling without
raw control support.
** created libwebcam.pc
** Installation directory for libwebcam: /usr/lib
** created man pages
** Installation directory for uvcdynctrl: /usr/bin
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/src/libwebcam-code/build
rasp:/usr/src/libwebcam-code/build # make
Scanning dependencies of target webcam
[ 14%] Building C object libwebcam/CMakeFiles/webcam.dir/libwebcam.c.o
[ 28%] Building C object libwebcam/CMakeFiles/webcam.dir/dynctrl.c.o
/usr/src/libwebcam-code/libwebcam/dynctrl.c:2033:1: warning:
‘create_xu_control’ defined but not used [-Wunused-function]
Linking C shared library libwebcam.so
[ 28%] Built target webcam
Scanning dependencies of target webcam_static
[ 42%] Building C object
libwebcam/CMakeFiles/webcam_static.dir/libwebcam.c.o
[ 57%] Building C object libwebcam/CMakeFiles/webcam_static.dir/dynctrl.c.o
/usr/src/libwebcam-code/libwebcam/dynctrl.c:2033:1: warning:
‘create_xu_control’ defined but not used [-Wunused-function]
Linking C static library libwebcam.a
[ 57%] Built target webcam_static
Scanning dependencies of target uvcdynctrl
[ 71%] Building C object uvcdynctrl/CMakeFiles/uvcdynctrl.dir/main.c.o
[ 85%] Building C object uvcdynctrl/CMakeFiles/uvcdynctrl.dir/controls.c.o
[100%] Building C object uvcdynctrl/CMakeFiles/uvcdynctrl.dir/cmdline.c.o
Linking C executable uvcdynctrl
[100%] Built target uvcdynctrl
rasp:/usr/src/libwebcam-code/build # make install
[ 28%] Built target webcam
[ 57%] Built target webcam_static
[100%] Built target uvcdynctrl
Linking C shared library CMakeFiles/CMakeRelink.dir/libwebcam.so
Linking C executable CMakeFiles/CMakeRelink.dir/uvcdynctrl
Install the project...
-- Install configuration: ""
-- Installing: /usr/lib/libwebcam.so.0.2.2
-- Up-to-date: /usr/lib/libwebcam.so.0
-- Up-to-date: /usr/lib/libwebcam.so
-- Installing: /usr/lib/libwebcam.a
-- Installing: /usr/lib/pkgconfig/libwebcam.pc
-- Up-to-date: /usr/include/webcam.h
-- Installing: /usr/bin/uvcdynctrl-0.2.2
-- Up-to-date: /usr/bin/uvcdynctrl
-- Up-to-date: /lib/udev/rules.d/80-uvcdynctrl.rules
-- Up-to-date: /lib/udev/uvcdynctrl
-- Installing: /usr/share/uvcdynctrl/data
-- Installing: /usr/share/uvcdynctrl/data/a0c8
-- Up-to-date: /usr/share/uvcdynctrl/data/a0c8/sisdop.xml
-- Installing: /usr/share/uvcdynctrl/data/046d
-- Up-to-date: /usr/share/uvcdynctrl/data/046d/logitech.xml
-- Installing: /usr/share/man/man1/uvcdynctrl.1.gz
-- Installing: /usr/share/man/man1/uvcdynctrl-0.2.2.1.gz
rasp:/usr/src/libwebcam-code/build #

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/led_
>> o
>> ff_manfred.c
>> https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led_
>> 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-without-
>> 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_use_
>> 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.208
>> 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
>>
>
Manfred Baumgartl
2013-08-05 14:57:10 UTC
Permalink
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 ?

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/led_
>> o
>> ff_manfred.c
>> https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led_
>> 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-without-
>> 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_use_
>> 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.208
>> 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
>>
>
Paulo Assis
2013-08-05 15:16:35 UTC
Permalink
Manfred Baumgartl
2013-08-05 15:33:32 UTC
Permalink
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/led
>>> _
>>> o
>>> ff_manfred.c
>>> https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led
>>> _
>>> 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-without
>>> -
>>> 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_use
>>> _
>>> 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.20
>>> 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
>>>
>>
>
Paulo Assis
2013-08-05 20:22:57 UTC
Permalink
Manfred Baumgartl
2013-08-06 06:49:30 UTC
Permalink
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
>>>>
>>>
>>
>
Manfred Baumgartl
2013-08-06 08:02:09 UTC
Permalink
Hello Paulo,

I captured the USBbus with wireshark while doing two things.

First I send the control messages with the c program there are two
URB_CONTROL out with their responses as I expected it.

Second I send it with uvcdynctrl. There are many URB_CONTROLs in and out in
between the two 4 Byte sequences which I will send.

Maybe it is not possible to send the two 4 Byte in a sequences with
uvcdynctrl in raw mode?

Regards,
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
>>>>
>>>
>>
>
Paulo Assis
2013-08-06 08:52:10 UTC
Permalink
Manfred Baumgartl
2013-08-06 09:12:10 UTC
Permalink
Hi,

it seems that the value was written into the default field. The current
value is (BE)0x00c00101.

rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
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)0x08100000 (BE)0x00001008
query step size of : (LE)0x01000000 (BE)0x00000001
set value of : (LE)0x00011000 (BE)0x00100100

rasp:/usr/src/dino-lite # 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


Regards,
Manfred

-----Ursprüngliche Nachricht-----
Von: Paulo Assis [mailto:***@gmail.com]
Gesendet: Dienstag, 06. August 2013 10:52
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,
uvcdynctrl sends the data through the uvc driver while the c program uses
libusb and sends the data directly to the device, so that's the diference in
URB_CONTROLs you are seeing. In any case the uvc driver follows the uvc
standard so that shouldn't be a problem (if the device is uvc compliant).

>
Paulo Assis
2013-08-06 09:31:31 UTC
Permalink
Manfred Baumgartl
2013-08-06 09:48:16 UTC
Permalink
Hello Paulo,

this is strange!

First read the value is the first 4 bytes and the default value is the
second 4 bytes.

Then it changes with every read.

rasp:/usr/src/dino-lite # 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)0x06100100 (BE)0x00011006
query step size of : (LE)0x01000000 (BE)0x00000001
query current value of: (LE)0x07102500 (BE)0x00251007
rasp:/usr/src/dino-lite # 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)0x08100000 (BE)0x00001008
query step size of : (LE)0x01000000 (BE)0x00000001
query current value of: (LE)0x09100000 (BE)0x00001009
rasp:/usr/src/dino-lite # 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)0x0a100000 (BE)0x0000100a
query step size of : (LE)0x01000000 (BE)0x00000001
query current value of: (LE)0x0b100000 (BE)0x0000100b
rasp:/usr/src/dino-lite # 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)0x0c100000 (BE)0x0000100c
query step size of : (LE)0x01000000 (BE)0x00000001
query current value of: (LE)0x0d100000 (BE)0x0000100d

Regards,
Manfred


-----Ursprüngliche Nachricht-----
Von: Paulo Assis [mailto:***@gmail.com]
Gesendet: Dienstag, 06. August 2013 11:32
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,
so this means that the value didn't get set, as the current value didn't
change.
can you set the leds on with the c program and then get the current value
with uvcdynctrl?

Regards,
Paulo


2013/8/6 Manfred Baumgartl <***@peony.at>:
> Hi,
>
> it seems that the value was written into the default field. The
> current value is (BE)0x00c00101.
>
> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
> 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)0x08100000 (BE)0x00001008
> query step size of : (LE)0x01000000 (BE)0x00000001
> set value of : (LE)0x00011000 (BE)0x00100100
>
> rasp:/usr/src/dino-lite # 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
>
>
> Regards,
> Manfred
>
> -----Ursprüngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Dienstag, 06. August 2013 10:52
> 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,
> uvcdynctrl sends the data through the uvc driver while the c program
> uses libusb and sends the data directly to the device, so that's the
> diference in URB_CONTROLs you are seeing. In any case the uvc driver
> follows the uvc standard so that shouldn't be a problem (if the device is
uvc compliant).
>
>
Paulo Assis
2013-08-06 10:21:02 UTC
Permalink
Manfred Baumgartl
2013-08-06 10:39:55 UTC
Permalink
Hello Paule,

It seems that the value is counting with a value of 2 and the default value
counts also with 2 but always one less.

rasp:/usr/src/dino-lite # 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)0xcc100000 (BE)0x000010cc
query step size of : (LE)0x01000000 (BE)0x00000001
query current value of: (LE)0xcd100000 (BE)0x000010cd
rasp:/usr/src/dino-lite # 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)0xce100000 (BE)0x000010ce
query step size of : (LE)0x01000000 (BE)0x00000001
query current value of: (LE)0xcf100000 (BE)0x000010cf
rasp:/usr/src/dino-lite # 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)0xd0108400 (BE)0x008410d0
query step size of : (LE)0x01000000 (BE)0x00000001
query current value of: (LE)0xd1100000 (BE)0x000010d1
rasp:/usr/src/dino-lite # 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)0xd210ff00 (BE)0x00ff10d2
query step size of : (LE)0x01000000 (BE)0x00000001
query current value of: (LE)0xd310ff00 (BE)0x00ff10d3


No the leds are not set on with (BE)0x00251007.

The correct sequence of the 2x4 bytes are here.

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

As you can see the second byte at the end does the trick.

Another thing. The light goes on when I send a command and goes off after a
view seconds.

Can you tell me why this happens?


Regards
Manfred


-----Ursprüngliche Nachricht-----
Von: Paulo Assis [mailto:***@gmail.com]
Gesendet: Dienstag, 06. August 2013 12:21
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,
Yes, some controls can change due to some automatic mechanism, like exposure
if auto-exposure is enabled.
It looks like the case here, you set the leds on with (BE)0x00251007 and the
control value goes down to an interval between (BE)0x00001009 and
(BE)0x0000100d. Could this be the LED brightness ? If you are on a dark room
is the end value higher ?

Regards,
Paulo

2013/8/6 Manfred Baumgartl <***@peony.at>:
> Hello Paulo,
>
> this is strange!
>
> First read the value is the first 4 bytes and the default value is the
> second 4 bytes.
>
> Then it changes with every read.
>
> rasp:/usr/src/dino-lite # 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)0x06100100 (BE)0x00011006
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0x07102500 (BE)0x00251007
> rasp:/usr/src/dino-lite # 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)0x08100000 (BE)0x00001008
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0x09100000 (BE)0x00001009
> rasp:/usr/src/dino-lite # 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)0x0a100000 (BE)0x0000100a
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0x0b100000 (BE)0x0000100b
> rasp:/usr/src/dino-lite # 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)0x0c100000 (BE)0x0000100c
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0x0d100000 (BE)0x0000100d
>
> Regards,
> Manfred
>
>
> -----Ursprüngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Dienstag, 06. August 2013 11:32
> 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,
> so this means that the value didn't get set, as the current value
> didn't change.
> can you set the leds on with the c program and then get the current
> value with uvcdynctrl?
>
> Regards,
> Paulo
>
>
> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>> Hi,
>>
>> it seems that the value was written into the default field. The
>> current value is (BE)0x00c00101.
>>
>> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
>> 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)0x08100000 (BE)0x00001008
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> set value of : (LE)0x00011000 (BE)0x00100100
>>
>> rasp:/usr/src/dino-lite # 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
>>
>>
>> Regards,
>> Manfred
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Dienstag, 06. August 2013 10:52
>> 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,
>> uvcdynctrl sends the data through the uvc driver while the c program
>> uses libusb and sends the data directly to the device, so that's the
>> diference in URB_CONTROLs you are seeing. In any case the uvc driver
>> follows the uvc standard so that shouldn't be a problem (if the
>> device is
> uvc compliant).
>>
>>
Márton Miklós
2013-08-06 10:58:45 UTC
Permalink
Paulo Assis
2013-08-06 11:01:58 UTC
Permalink
Manfred Baumgartl
2013-08-06 12:03:51 UTC
Permalink
Hello Paulo,

4:2 has not changed it looks like

rasp:/usr/src/dino-lite # 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)0x00004f4fffffffff (BE)0xffffffff4f4f0000
query step size of : (LE)0x0100000000000000 (BE)0x0000000000000001
query current value of: (LE)0x00004f4f00000000 (BE)0x000000004f4f0000

So, but here is another thing,

uvcdynctrl -S 4:1 0x00251007
uvcdynctrl -S 4:1 0x06100100

seems to enable the light. Every time when I communicate with the device
after I send the above command it is switch on and then switched off when I
do nothing.

uvcdynctrl -S 4:1 0x00251007
uvcdynctrl -S 4:1 0x06100400

disables the light. I can read as often I like the light does not come up
again.

So my next test is sending the LED-on command and then use motion or another
capture tool and look if the light stays.

Maybe it is only illuminated when the device is used for capture or
something else.

Regards,
Manfred


-----Ursprüngliche Nachricht-----
Von: Paulo Assis [mailto:***@gmail.com]
Gesendet: Dienstag, 06. August 2013 13:02
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/6 Manfred Baumgartl <***@peony.at>:
> Hello Paule,
>
> It seems that the value is counting with a value of 2 and the default
value
> counts also with 2 but always one less.
>

Yes the default value shouldn't change in a control, the device seems
to be returning garbage at this point.

> rasp:/usr/src/dino-lite # 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)0xcc100000 (BE)0x000010cc
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xcd100000 (BE)0x000010cd
> rasp:/usr/src/dino-lite # 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)0xce100000 (BE)0x000010ce
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xcf100000 (BE)0x000010cf
> rasp:/usr/src/dino-lite # 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)0xd0108400 (BE)0x008410d0
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xd1100000 (BE)0x000010d1
> rasp:/usr/src/dino-lite # 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)0xd210ff00 (BE)0x00ff10d2
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xd310ff00 (BE)0x00ff10d3
>
>
> No the leds are not set on with (BE)0x00251007.
>
> The correct sequence of the 2x4 bytes are here.
>
> 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
>

well when you query the control immediatly after setting the leds on,
the value is set to:
(LE)0x07102500 (BE)0x00251007

this is the first sequence you send:
memcpy(buf, "\x07\x10\x25\x00", 0x0000004);

but in fact you do need to send 8 bytes. Can you query selector 2
instead after switching the leds? This one reports 8 bytes.

Regards,
Paulo

> As you can see the second byte at the end does the trick.
>
> Another thing. The light goes on when I send a command and goes off after
a
> view seconds.
>
> Can you tell me why this happens?
>
>
> Regards
> Manfred
>
>
> -----Ursprüngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Dienstag, 06. August 2013 12:21
> 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,
> Yes, some controls can change due to some automatic mechanism, like
exposure
> if auto-exposure is enabled.
> It looks like the case here, you set the leds on with (BE)0x00251007 and
the
> control value goes down to an interval between (BE)0x00001009 and
> (BE)0x0000100d. Could this be the LED brightness ? If you are on a dark
room
> is the end value higher ?
>
> Regards,
> Paulo
>
> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>> Hello Paulo,
>>
>> this is strange!
>>
>> First read the value is the first 4 bytes and the default value is the
>> second 4 bytes.
>>
>> Then it changes with every read.
>>
>> rasp:/usr/src/dino-lite # 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)0x06100100 (BE)0x00011006
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x07102500 (BE)0x00251007
>> rasp:/usr/src/dino-lite # 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)0x08100000 (BE)0x00001008
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x09100000 (BE)0x00001009
>> rasp:/usr/src/dino-lite # 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)0x0a100000 (BE)0x0000100a
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x0b100000 (BE)0x0000100b
>> rasp:/usr/src/dino-lite # 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)0x0c100000 (BE)0x0000100c
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x0d100000 (BE)0x0000100d
>>
>> Regards,
>> Manfred
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Dienstag, 06. August 2013 11:32
>> 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,
>> so this means that the value didn't get set, as the current value
>> didn't change.
>> can you set the leds on with the c program and then get the current
>> value with uvcdynctrl?
>>
>> Regards,
>> Paulo
>>
>>
>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>> Hi,
>>>
>>> it seems that the value was written into the default field. The
>>> current value is (BE)0x00c00101.
>>>
>>> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
>>> 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)0x08100000 (BE)0x00001008
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> set value of : (LE)0x00011000 (BE)0x00100100
>>>
>>> rasp:/usr/src/dino-lite # 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
>>>
>>>
>>> Regards,
>>> Manfred
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Paulo Assis [mailto:***@gmail.com]
>>> Gesendet: Dienstag, 06. August 2013 10:52
>>> 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,
>>> uvcdynctrl sends the data through the uvc driver while the c program
>>> uses libusb and sends the data directly to the device, so that's the
>>> diference in URB_CONTROLs you are seeing. In any case the uvc driver
>>> follows the uvc standard so that shouldn't be a problem (if the
>>> device is
>> uvc compliant).
>>>
>>>
Paulo Assis
2013-08-06 12:35:12 UTC
Permalink
Manfred Baumgartl
2013-08-06 12:54:05 UTC
Permalink
Hello Paulo,

have you ever seen the device? It is a microscope camera with a ring of
led-lights around the lens.

http://www.dino-lite.eu/index.php/en/digital-microscopes/dino-lite

You need the light to illuminate the samples in front of the camera and the
default behaviour is that the light is not automatically switch on. It is
very bright. Blinking is not required.

I tested it now with motion to capture some pictures. Everything works fine
for me. If I use

uvcdynctrl -S 4:1 0x00251007
uvcdynctrl -S 4:1 0x06100100

Before starting motion the light is on. So it works for me for the moment.

Regards,
Manfred



-----Ursprüngliche Nachricht-----
Von: Paulo Assis [mailto:***@gmail.com]
Gesendet: Dienstag, 06. August 2013 14:35
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/6 Manfred Baumgartl <***@peony.at>:
> Hello Paulo,
>
> 4:2 has not changed it looks like
>
> rasp:/usr/src/dino-lite # 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)0x00004f4fffffffff (BE)0xffffffff4f4f0000
> query step size of : (LE)0x0100000000000000 (BE)0x0000000000000001
> query current value of: (LE)0x00004f4f00000000 (BE)0x000000004f4f0000
>
> So, but here is another thing,
>
> uvcdynctrl -S 4:1 0x00251007
> uvcdynctrl -S 4:1 0x06100100
>
> seems to enable the light. Every time when I communicate with the device
> after I send the above command it is switch on and then switched off when
I
> do nothing.
>

I can't understand why you would need to change the control value
twice to enable/disable the LEDs
for other cameras you just set a value for on and another for off.
I'm not sure how to map this behavior into a v4l2 control.

LEDs in regular cameras usually have at least three modes:
always on - always on even if not streaming
always off -always off even if streaming
auto - on only when streaming

logitech also provides a blink frequency control

it could be the case that this device as a sort of auto LED control so
that when you set it, it will only turn on when streaming.

Regards,
Paulo


> uvcdynctrl -S 4:1 0x00251007
> uvcdynctrl -S 4:1 0x06100400
>
> disables the light. I can read as often I like the light does not come up
> again.
>
> So my next test is sending the LED-on command and then use motion or
another
> capture tool and look if the light stays.
>
> Maybe it is only illuminated when the device is used for capture or
> something else.
>
> Regards,
> Manfred
>
>
> -----Ursprüngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Dienstag, 06. August 2013 13:02
> 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/6 Manfred Baumgartl <***@peony.at>:
>> Hello Paule,
>>
>> It seems that the value is counting with a value of 2 and the default
> value
>> counts also with 2 but always one less.
>>
>
> Yes the default value shouldn't change in a control, the device seems
> to be returning garbage at this point.
>
>> rasp:/usr/src/dino-lite # 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)0xcc100000 (BE)0x000010cc
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0xcd100000 (BE)0x000010cd
>> rasp:/usr/src/dino-lite # 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)0xce100000 (BE)0x000010ce
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0xcf100000 (BE)0x000010cf
>> rasp:/usr/src/dino-lite # 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)0xd0108400 (BE)0x008410d0
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0xd1100000 (BE)0x000010d1
>> rasp:/usr/src/dino-lite # 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)0xd210ff00 (BE)0x00ff10d2
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0xd310ff00 (BE)0x00ff10d3
>>
>>
>> No the leds are not set on with (BE)0x00251007.
>>
>> The correct sequence of the 2x4 bytes are here.
>>
>> 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
>>
>
> well when you query the control immediatly after setting the leds on,
> the value is set to:
> (LE)0x07102500 (BE)0x00251007
>
> this is the first sequence you send:
> memcpy(buf, "\x07\x10\x25\x00", 0x0000004);
>
> but in fact you do need to send 8 bytes. Can you query selector 2
> instead after switching the leds? This one reports 8 bytes.
>
> Regards,
> Paulo
>
>> As you can see the second byte at the end does the trick.
>>
>> Another thing. The light goes on when I send a command and goes off after
> a
>> view seconds.
>>
>> Can you tell me why this happens?
>>
>>
>> Regards
>> Manfred
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Dienstag, 06. August 2013 12:21
>> 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,
>> Yes, some controls can change due to some automatic mechanism, like
> exposure
>> if auto-exposure is enabled.
>> It looks like the case here, you set the leds on with (BE)0x00251007 and
> the
>> control value goes down to an interval between (BE)0x00001009 and
>> (BE)0x0000100d. Could this be the LED brightness ? If you are on a dark
> room
>> is the end value higher ?
>>
>> Regards,
>> Paulo
>>
>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>> Hello Paulo,
>>>
>>> this is strange!
>>>
>>> First read the value is the first 4 bytes and the default value is the
>>> second 4 bytes.
>>>
>>> Then it changes with every read.
>>>
>>> rasp:/usr/src/dino-lite # 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)0x06100100 (BE)0x00011006
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> query current value of: (LE)0x07102500 (BE)0x00251007
>>> rasp:/usr/src/dino-lite # 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)0x08100000 (BE)0x00001008
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> query current value of: (LE)0x09100000 (BE)0x00001009
>>> rasp:/usr/src/dino-lite # 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)0x0a100000 (BE)0x0000100a
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> query current value of: (LE)0x0b100000 (BE)0x0000100b
>>> rasp:/usr/src/dino-lite # 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)0x0c100000 (BE)0x0000100c
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> query current value of: (LE)0x0d100000 (BE)0x0000100d
>>>
>>> Regards,
>>> Manfred
>>>
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Paulo Assis [mailto:***@gmail.com]
>>> Gesendet: Dienstag, 06. August 2013 11:32
>>> 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,
>>> so this means that the value didn't get set, as the current value
>>> didn't change.
>>> can you set the leds on with the c program and then get the current
>>> value with uvcdynctrl?
>>>
>>> Regards,
>>> Paulo
>>>
>>>
>>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>>> Hi,
>>>>
>>>> it seems that the value was written into the default field. The
>>>> current value is (BE)0x00c00101.
>>>>
>>>> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
>>>> 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)0x08100000 (BE)0x00001008
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> set value of : (LE)0x00011000 (BE)0x00100100
>>>>
>>>> rasp:/usr/src/dino-lite # 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
>>>>
>>>>
>>>> Regards,
>>>> Manfred
>>>>
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: Paulo Assis [mailto:***@gmail.com]
>>>> Gesendet: Dienstag, 06. August 2013 10:52
>>>> 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,
>>>> uvcdynctrl sends the data through the uvc driver while the c program
>>>> uses libusb and sends the data directly to the device, so that's the
>>>> diference in URB_CONTROLs you are seeing. In any case the uvc driver
>>>> follows the uvc standard so that shouldn't be a problem (if the
>>>> device is
>>> uvc compliant).
>>>>
>>>>
Paulo Assis
2013-08-06 13:31:44 UTC
Permalink
Márton Miklós
2013-08-06 13:46:00 UTC
Permalink
Manfred Baumgartl
2013-08-06 14:03:15 UTC
Permalink
Hi all,

yes I also think that it is standard camera which is in different casing
with led-light-ring and other lenses and so on. Maybe it is auto light
setting on when streaming like Miklos said and Paulo described beneath.

At the moment it works well for us, but for the future I will try to create
a xml file for uvcdynctrl to control the other things.

Many thanks to both of you for your help and the time you spend with me in
investigating the problem.

Regards,
Manfred

-----Ursprüngliche Nachricht-----
Von: Márton Miklós [mailto:***@gmail.com]
Gesendet: Dienstag, 06. August 2013 15:46
An: Paulo Assis
Cc: Manfred Baumgartl; linux-uvc-***@lists.sourceforge.net
Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite Premier

Hey,

Just to clarify that there is a command line utility for Windows which
can be used to control the LED.
Manfred did some capturing using that, and the logs contained a lot of
isochronous transfers (I bet the camera had streamed).

Regards,
Miklos

2013-08-06 15:31 keltezéssel, Paulo Assis írta:
> Ok,
> I have a regular microscope where the led is connected through a
> switch, it also has a uvc camera that I fit in the microscope tube
> (the camera itself has no leds), this camera although with a different
> casing and with costum firmware is simply a mass production webcam
> that the microscope vendor (Bresser) tweaked for it's needs.
> In fact in my case the camera reports several resolutions and fps when
> in through, fps is fixed for all of these resolutions since exposure
> is always at the maximum value, unlike the original device.
> I wouldn't be surprised if this was the case for many of such devices
> out there, the vendor just picks a standard comercial camera and fits
> it to it's needs.
>
>
> Regards,
> Paulo
>
> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>> Hello Paulo,
>>
>> have you ever seen the device? It is a microscope camera with a ring of
>> led-lights around the lens.
>>
>> http://www.dino-lite.eu/index.php/en/digital-microscopes/dino-lite
>>
>> You need the light to illuminate the samples in front of the camera and
the
>> default behaviour is that the light is not automatically switch on. It is
>> very bright. Blinking is not required.
>>
>> I tested it now with motion to capture some pictures. Everything works
fine
>> for me. If I use
>>
>> uvcdynctrl -S 4:1 0x00251007
>> uvcdynctrl -S 4:1 0x06100100
>>
>> Before starting motion the light is on. So it works for me for the
moment.
>>
>> Regards,
>> Manfred
>>
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Dienstag, 06. August 2013 14:35
>> 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/6 Manfred Baumgartl <***@peony.at>:
>>> Hello Paulo,
>>>
>>> 4:2 has not changed it looks like
>>>
>>> rasp:/usr/src/dino-lite # 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)0x00004f4fffffffff (BE)0xffffffff4f4f0000
>>> query step size of : (LE)0x0100000000000000 (BE)0x0000000000000001
>>> query current value of: (LE)0x00004f4f00000000 (BE)0x000000004f4f0000
>>>
>>> So, but here is another thing,
>>>
>>> uvcdynctrl -S 4:1 0x00251007
>>> uvcdynctrl -S 4:1 0x06100100
>>>
>>> seems to enable the light. Every time when I communicate with the device
>>> after I send the above command it is switch on and then switched off
when
>> I
>>> do nothing.
>>>
>> I can't understand why you would need to change the control value
>> twice to enable/disable the LEDs
>> for other cameras you just set a value for on and another for off.
>> I'm not sure how to map this behavior into a v4l2 control.
>>
>> LEDs in regular cameras usually have at least three modes:
>> always on - always on even if not streaming
>> always off -always off even if streaming
>> auto - on only when streaming
>>
>> logitech also provides a blink frequency control
>>
>> it could be the case that this device as a sort of auto LED control so
>> that when you set it, it will only turn on when streaming.
>>
>> Regards,
>> Paulo
>>
>>
>>> uvcdynctrl -S 4:1 0x00251007
>>> uvcdynctrl -S 4:1 0x06100400
>>>
>>> disables the light. I can read as often I like the light does not come
up
>>> again.
>>>
>>> So my next test is sending the LED-on command and then use motion or
>> another
>>> capture tool and look if the light stays.
>>>
>>> Maybe it is only illuminated when the device is used for capture or
>>> something else.
>>>
>>> Regards,
>>> Manfred
>>>
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Paulo Assis [mailto:***@gmail.com]
>>> Gesendet: Dienstag, 06. August 2013 13:02
>>> 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/6 Manfred Baumgartl <***@peony.at>:
>>>> Hello Paule,
>>>>
>>>> It seems that the value is counting with a value of 2 and the default
>>> value
>>>> counts also with 2 but always one less.
>>>>
>>> Yes the default value shouldn't change in a control, the device seems
>>> to be returning garbage at this point.
>>>
>>>> rasp:/usr/src/dino-lite # 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)0xcc100000 (BE)0x000010cc
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> query current value of: (LE)0xcd100000 (BE)0x000010cd
>>>> rasp:/usr/src/dino-lite # 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)0xce100000 (BE)0x000010ce
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> query current value of: (LE)0xcf100000 (BE)0x000010cf
>>>> rasp:/usr/src/dino-lite # 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)0xd0108400 (BE)0x008410d0
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> query current value of: (LE)0xd1100000 (BE)0x000010d1
>>>> rasp:/usr/src/dino-lite # 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)0xd210ff00 (BE)0x00ff10d2
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> query current value of: (LE)0xd310ff00 (BE)0x00ff10d3
>>>>
>>>>
>>>> No the leds are not set on with (BE)0x00251007.
>>>>
>>>> The correct sequence of the 2x4 bytes are here.
>>>>
>>>> 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
>>>>
>>> well when you query the control immediatly after setting the leds on,
>>> the value is set to:
>>> (LE)0x07102500 (BE)0x00251007
>>>
>>> this is the first sequence you send:
>>> memcpy(buf, "\x07\x10\x25\x00", 0x0000004);
>>>
>>> but in fact you do need to send 8 bytes. Can you query selector 2
>>> instead after switching the leds? This one reports 8 bytes.
>>>
>>> Regards,
>>> Paulo
>>>
>>>> As you can see the second byte at the end does the trick.
>>>>
>>>> Another thing. The light goes on when I send a command and goes off
after
>>> a
>>>> view seconds.
>>>>
>>>> Can you tell me why this happens?
>>>>
>>>>
>>>> Regards
>>>> Manfred
>>>>
>>>>
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: Paulo Assis [mailto:***@gmail.com]
>>>> Gesendet: Dienstag, 06. August 2013 12:21
>>>> 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,
>>>> Yes, some controls can change due to some automatic mechanism, like
>>> exposure
>>>> if auto-exposure is enabled.
>>>> It looks like the case here, you set the leds on with (BE)0x00251007
and
>>> the
>>>> control value goes down to an interval between (BE)0x00001009 and
>>>> (BE)0x0000100d. Could this be the LED brightness ? If you are on a dark
>>> room
>>>> is the end value higher ?
>>>>
>>>> Regards,
>>>> Paulo
>>>>
>>>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>>>> Hello Paulo,
>>>>>
>>>>> this is strange!
>>>>>
>>>>> First read the value is the first 4 bytes and the default value is the
>>>>> second 4 bytes.
>>>>>
>>>>> Then it changes with every read.
>>>>>
>>>>> rasp:/usr/src/dino-lite # 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)0x06100100 (BE)0x00011006
>>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>>> query current value of: (LE)0x07102500 (BE)0x00251007
>>>>> rasp:/usr/src/dino-lite # 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)0x08100000 (BE)0x00001008
>>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>>> query current value of: (LE)0x09100000 (BE)0x00001009
>>>>> rasp:/usr/src/dino-lite # 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)0x0a100000 (BE)0x0000100a
>>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>>> query current value of: (LE)0x0b100000 (BE)0x0000100b
>>>>> rasp:/usr/src/dino-lite # 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)0x0c100000 (BE)0x0000100c
>>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>>> query current value of: (LE)0x0d100000 (BE)0x0000100d
>>>>>
>>>>> Regards,
>>>>> Manfred
>>>>>
>>>>>
>>>>> -----Ursprüngliche Nachricht-----
>>>>> Von: Paulo Assis [mailto:***@gmail.com]
>>>>> Gesendet: Dienstag, 06. August 2013 11:32
>>>>> 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,
>>>>> so this means that the value didn't get set, as the current value
>>>>> didn't change.
>>>>> can you set the leds on with the c program and then get the current
>>>>> value with uvcdynctrl?
>>>>>
>>>>> Regards,
>>>>> Paulo
>>>>>
>>>>>
>>>>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>>>>> Hi,
>>>>>>
>>>>>> it seems that the value was written into the default field. The
>>>>>> current value is (BE)0x00c00101.
>>>>>>
>>>>>> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
>>>>>> 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)0x08100000 (BE)0x00001008
>>>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>>>> set value of : (LE)0x00011000 (BE)0x00100100
>>>>>>
>>>>>> rasp:/usr/src/dino-lite # 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
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>> Manfred
>>>>>>
>>>>>> -----Ursprüngliche Nachricht-----
>>>>>> Von: Paulo Assis [mailto:***@gmail.com]
>>>>>> Gesendet: Dienstag, 06. August 2013 10:52
>>>>>> 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,
>>>>>> uvcdynctrl sends the data through the uvc driver while the c program
>>>>>> uses libusb and sends the data directly to the device, so that's the
>>>>>> diference in URB_CONTROLs you are seeing. In any case the uvc driver
>>>>>> follows the uvc standard so that shouldn't be a problem (if the
>>>>>> device is
>>>>> uvc compliant).
>>>>>>
Manfred Baumgartl
2013-08-06 11:47:06 UTC
Permalink
Hello,

yes it is immediately after I run it.

Regards
Manfred


-----Ursprüngliche Nachricht-----
Von: Márton Miklós [mailto:***@gmail.com]
Gesendet: Dienstag, 06. August 2013 12:59
An: Manfred Baumgartl
Cc: 'Paulo Assis'; linux-uvc-***@lists.sourceforge.net
Betreff: Re: AW: [linux-uvc-devel] switching light on device Dino-Lite
Premier

Hello,

> Another thing. The light goes on when I send a command and goes off after
a
> view seconds.
I have seen the similar behaviour on my Logitech, when I have closed and
released the usb interface immediatelly.
Is your example quits immediatelly after you run it?

Regards,
Miklos


2013-08-06 12:39 keltezéssel, Manfred Baumgartl írta:
> Hello Paule,
>
> It seems that the value is counting with a value of 2 and the default
value
> counts also with 2 but always one less.
>
> rasp:/usr/src/dino-lite # 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)0xcc100000 (BE)0x000010cc
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xcd100000 (BE)0x000010cd
> rasp:/usr/src/dino-lite # 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)0xce100000 (BE)0x000010ce
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xcf100000 (BE)0x000010cf
> rasp:/usr/src/dino-lite # 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)0xd0108400 (BE)0x008410d0
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xd1100000 (BE)0x000010d1
> rasp:/usr/src/dino-lite # 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)0xd210ff00 (BE)0x00ff10d2
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xd310ff00 (BE)0x00ff10d3
>
>
> No the leds are not set on with (BE)0x00251007.
>
> The correct sequence of the 2x4 bytes are here.
>
> 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
>
> As you can see the second byte at the end does the trick.
>
> Another thing. The light goes on when I send a command and goes off after
a
> view seconds.
>
> Can you tell me why this happens?
>
>
> Regards
> Manfred
>
>
> -----Ursprüngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Dienstag, 06. August 2013 12:21
> 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,
> Yes, some controls can change due to some automatic mechanism, like
exposure
> if auto-exposure is enabled.
> It looks like the case here, you set the leds on with (BE)0x00251007 and
the
> control value goes down to an interval between (BE)0x00001009 and
> (BE)0x0000100d. Could this be the LED brightness ? If you are on a dark
room
> is the end value higher ?
>
> Regards,
> Paulo
>
> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>> Hello Paulo,
>>
>> this is strange!
>>
>> First read the value is the first 4 bytes and the default value is the
>> second 4 bytes.
>>
>> Then it changes with every read.
>>
>> rasp:/usr/src/dino-lite # 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)0x06100100 (BE)0x00011006
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x07102500 (BE)0x00251007
>> rasp:/usr/src/dino-lite # 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)0x08100000 (BE)0x00001008
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x09100000 (BE)0x00001009
>> rasp:/usr/src/dino-lite # 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)0x0a100000 (BE)0x0000100a
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x0b100000 (BE)0x0000100b
>> rasp:/usr/src/dino-lite # 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)0x0c100000 (BE)0x0000100c
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x0d100000 (BE)0x0000100d
>>
>> Regards,
>> Manfred
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Dienstag, 06. August 2013 11:32
>> 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,
>> so this means that the value didn't get set, as the current value
>> didn't change.
>> can you set the leds on with the c program and then get the current
>> value with uvcdynctrl?
>>
>> Regards,
>> Paulo
>>
>>
>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>> Hi,
>>>
>>> it seems that the value was written into the default field. The
>>> current value is (BE)0x00c00101.
>>>
>>> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
>>> 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)0x08100000 (BE)0x00001008
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> set value of : (LE)0x00011000 (BE)0x00100100
>>>
>>> rasp:/usr/src/dino-lite # 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
>>>
>>>
>>> Regards,
>>> Manfred
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Paulo Assis [mailto:***@gmail.com]
>>> Gesendet: Dienstag, 06. August 2013 10:52
>>> 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,
>>> uvcdynctrl sends the data through the uvc driver while the c program
>>> uses libusb and sends the data directly to the device, so that's the
>>> diference in URB_CONTROLs you are seeing. In any case the uvc driver
>>> follows the uvc standard so that shouldn't be a problem (if the
>>> device is
>> uvc compliant).
>>>
unknown
1970-01-01 00:00:00 UTC
Permalink
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 control=
s.

--//--
-S, --set_raw=3Dunit_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 Marti=
jn
> 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 =3D usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE,
> 0x0000001, 0x0000100, 0x0000400, buf, 0x0000004, 1000);
>
> memcpy(buf, "\x06\x10\x01\x00", 0x0000004);
>
> ret =3D 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 =3D usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE,
> 0x0000001, 0x0000100, 0x0000400, buf, 0x0000004, 1000);
>
> memcpy(buf, "\x06\x10\x04\x00", 0x0000004);
>
> ret =3D 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=E1rton Mikl=F3s [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 =3D 00000001 (USBD_TRANSFER_DIRECTION_IN,
> ~USBD_SHORT_TRANSFER_OK)
> TransferBufferLength =3D 00000004
> TransferBuffer =3D 09fce7d0
> TransferBufferMDL =3D 00000000
> UrbLink =3D 00000000
> RequestTypeReservedBits =3D 00000000
> Request =3D 00000081
> Value =3D 00000100
> Index =3D 00000400
> [208153 ms] UsbSnoop - MyInternalIOCTLCompletion(08de0ddc) : fido=3D00000=
000,
> Irp=3D0a823c10, Context=3D09a836c0, IRQL=3D2
> [208153 ms] <<< URB 880 coming back <<<
> -- URB_FUNCTION_CONTROL_TRANSFER:
> PipeHandle =3D 0a9a7220
> TransferFlags =3D 0000000b (USBD_TRANSFER_DIRECTION_IN,
> USBD_SHORT_TRANSFER_OK)
> TransferBufferLength =3D 00000004
> TransferBuffer =3D 09fce7d0
> TransferBufferMDL =3D 0951cf40
> 00000000: 06 10 04 00
> UrbLink =3D 00000000
> SetupPacket =3D
> 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 =3D 00000000 (USBD_TRANSFER_DIRECTION_OUT,
> ~USBD_SHORT_TRANSFER_OK)
> TransferBufferLength =3D 00000004
> TransferBuffer =3D 09fce7d0
> TransferBufferMDL =3D 00000000
> 00000000: 06 10 05 00
> UrbLink =3D 00000000
> RequestTypeReservedBits =3D 00000000
> Request =3D 00000001
> Value =3D 00000100
> Index =3D 00000400
> [208154 ms] UsbSnoop - MyInternalIOCTLCompletion(08de0ddc) : fido=3D00000=
000,
> Irp=3D0902bac0, Context=3D09a836c0, IRQL=3D2
> [208154 ms] <<< URB 882 coming back <<<
> -- URB_FUNCTION_CONTROL_TRANSFER:
> PipeHandle =3D 0a9a7220
> TransferFlags =3D 0000000a (USBD_TRANSFER_DIRECTION_OUT,
> USBD_SHORT_TRANSFER_OK)
> TransferBufferLength =3D 00000004
> TransferBuffer =3D 09fce7d0
> TransferBufferMDL =3D 0a98e1a0
> UrbLink =3D 00000000
> SetupPacket =3D
> 00000000: 21 01 00 01 00 04 04 00
>
> The next difference is a UVC_SET_CUR to the same extension control with t=
he
> data 06 10 05 00
>
> At the end it reads it back, and do a UVC_SET_CUR with 06 10 01 00 back t=
o
> 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 wri=
tes
> 1 at the end.
> In the OFF log: read 1 from it, then write 0, then write back 4 at the en=
d.
>
> 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 l=
ike
> 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 guidExtensionCo=
de.
>
> I propose to test my beliefs with a small piece of C code using libusb, a=
nd
> then start to implement the XML files for the uvcdynctrl.
>
> https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led_off_=
manfred.c
> https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led_on_m=
anfred.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 wil=
l
> have to unload the uvcvideo kernelmodule before you are doing it.
>
> Ps. playing with XU controls is not a life assurance, it has the possibil=
ity
> (even if in our case is minimal) to brick your device! You have been warn=
ed!
> :)
>
> Regards,
> Miklos
>
>
>
>
>
> 2013-07-28 14:50 keltez=E9ssel, Manfred Baumgartl =EDrta:
>
> 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=E1rton Mikl=F3s [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 Premie=
r
>
>
>
> 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-without-usin=
g-the-dinocapture-software/
>
> If possible please give it a try, and post the results.
>
> Cheers,
> Miklos
>
> 2013-07-27 13:20 keltez=E9ssel, Manfred Baumgartl =EDrta:
>
> 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 =96v 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 t=
he
> necessary changes in the code and how.
>
>
>
> Regards
>
> Manfred
>
>
>
>
>
> Von: M=E1rton Mikl=F3s [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 bu=
s,
> and post the results.
>
> I would recommend you to use the USBSnoop:
> http://www.linuxtv.org/wiki/index.php/Usbsnoop#A_brief_.22How_to_use_usbs=
noop.22_v1.8
>
> If possible please capture when the image capturing is paused and only th=
e
> LED switching is done.
>
> If I bet well the LED control is done the through the UVC exension contro=
ls
> like in my Logitech C920 case:
> http://sourceforge.net/mailarchive/forum.php?thread_name=3D51267F67.20808=
09%40gmail.com&forum_name=3Dlinux-uvc-devel
>
> I will be on holiday next week, and it has the chance that I will not hav=
e
> internet access, but post your logs to the UVC devel, and they will help
> possibility.
>
> Regards,
> Miklos
>
> 2013-07-26 18:16 keltez=E9ssel, Manfred Baumgartl =EDrta:
>
> 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=E1rton Mikl=F3s [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 Premie=
r
>
>
>
> 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=E9ssel, Manfred Baumgartl =EDrta:
>
> 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 et=
c.
> 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=3D48808831&iu=3D/4140/ostg.=
clktrk
>
>
>
>
>
>
>
> _______________________________________________
>
> 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=3D48808831&iu=3D/4140/ostg.=
clktrk
>
>
>
>
>
> _______________________________________________
>
> 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=3D49501711&iu=3D/4140/ostg.=
clktrk
> _______________________________________________
> Linux-uvc-devel mailing list
> Linux-uvc-***@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
>
unknown
1970-01-01 00:00:00 UTC
Permalink
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=FCngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Montag, 05. August 2013 11:48
> An: Manfred Baumgartl
> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite Premie=
r
>
> 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=3Dunit_id:selector Set the current raw control value, valu=
e is
> a hex string of control size, default is little endian- use '(BE)' prefi=
x
> 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 logitec=
h
> 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 =3D usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE,
>> 0x0000001, 0x0000100, 0x0000400, buf, 0x0000004, 1000);
>>
>> memcpy(buf, "\x06\x10\x01\x00", 0x0000004);
>>
>> ret =3D 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 =3D usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE,
>> 0x0000001, 0x0000100, 0x0000400, buf, 0x0000004, 1000);
>>
>> memcpy(buf, "\x06\x10\x04\x00", 0x0000004);
>>
>> ret =3D 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=E1rton Mikl=F3s [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 =3D 00000001 (USBD_TRANSFER_DIRECTION_IN,
>> ~USBD_SHORT_TRANSFER_OK)
>> TransferBufferLength =3D 00000004
>> TransferBuffer =3D 09fce7d0
>> TransferBufferMDL =3D 00000000
>> UrbLink =3D 00000000
>> RequestTypeReservedBits =3D 00000000
>> Request =3D 00000081
>> Value =3D 00000100
>> Index =3D 00000400
>> [208153 ms] UsbSnoop - MyInternalIOCTLCompletion(08de0ddc) :
>> fido=3D00000000, Irp=3D0a823c10, Context=3D09a836c0, IRQL=3D2
>> [208153 ms] <<< URB 880 coming back <<<
>> -- URB_FUNCTION_CONTROL_TRANSFER:
>> PipeHandle =3D 0a9a7220
>> TransferFlags =3D 0000000b (USBD_TRANSFER_DIRECTION_IN,
>> USBD_SHORT_TRANSFER_OK)
>> TransferBufferLength =3D 00000004
>> TransferBuffer =3D 09fce7d0
>> TransferBufferMDL =3D 0951cf40
>> 00000000: 06 10 04 00
>> UrbLink =3D 00000000
>> SetupPacket =3D
>> 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 =3D 00000000 (USBD_TRANSFER_DIRECTION_OUT,
>> ~USBD_SHORT_TRANSFER_OK)
>> TransferBufferLength =3D 00000004
>> TransferBuffer =3D 09fce7d0
>> TransferBufferMDL =3D 00000000
>> 00000000: 06 10 05 00
>> UrbLink =3D 00000000
>> RequestTypeReservedBits =3D 00000000
>> Request =3D 00000001
>> Value =3D 00000100
>> Index =3D 00000400
>> [208154 ms] UsbSnoop - MyInternalIOCTLCompletion(08de0ddc) :
>> fido=3D00000000, Irp=3D0902bac0, Context=3D09a836c0, IRQL=3D2
>> [208154 ms] <<< URB 882 coming back <<<
>> -- URB_FUNCTION_CONTROL_TRANSFER:
>> PipeHandle =3D 0a9a7220
>> TransferFlags =3D 0000000a (USBD_TRANSFER_DIRECTION_OUT,
>> USBD_SHORT_TRANSFER_OK)
>> TransferBufferLength =3D 00000004
>> TransferBuffer =3D 09fce7d0
>> TransferBufferMDL =3D 0a98e1a0
>> UrbLink =3D 00000000
>> SetupPacket =3D
>> 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/led_o
>> ff_manfred.c
>> https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led_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=E9ssel, Manfred Baumgartl =EDrta:
>>
>> 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=E1rton Mikl=F3s [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-without-u
>> sing-the-dinocapture-software/
>>
>> If possible please give it a try, and post the results.
>>
>> Cheers,
>> Miklos
>>
>> 2013-07-27 13:20 keltez=E9ssel, Manfred Baumgartl =EDrta:
>>
>> 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 =96v 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=E1rton Mikl=F3s [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_use_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=3D51267F67.2080
>> 809%40gmail.com&forum_name=3Dlinux-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=E9ssel, Manfred Baumgartl =EDrta:
>>
>> 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=E1rton Mikl=F3s [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=E9ssel, Manfred Baumgartl =EDrta:
>>
>> 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=3D48808831&iu=3D/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=3D48808831&iu=3D/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=3D49501711&iu=3D/4140/ostg=
.c
>> lktrk _______________________________________________
>> Linux-uvc-devel mailing list
>> Linux-uvc-***@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
>>
>
unknown
1970-01-01 00:00:00 UTC
Permalink
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=FCngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Montag, 05. August 2013 14:26
> An: Manfred Baumgartl
> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite Premie=
r
>
> 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 comman=
d
> 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=FCngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Montag, 05. August 2013 11:48
>> An: Manfred Baumgartl
>> Cc: M=E1rton Mikl=F3s; 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=3Dunit_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 =3D usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE,
>>> 0x0000001, 0x0000100, 0x0000400, buf, 0x0000004, 1000);
>>>
>>> memcpy(buf, "\x06\x10\x01\x00", 0x0000004);
>>>
>>> ret =3D 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 =3D usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE,
>>> 0x0000001, 0x0000100, 0x0000400, buf, 0x0000004, 1000);
>>>
>>> memcpy(buf, "\x06\x10\x04\x00", 0x0000004);
>>>
>>> ret =3D 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=E1rton Mikl=F3s [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 =3D 00000001 (USBD_TRANSFER_DIRECTION_IN,
>>> ~USBD_SHORT_TRANSFER_OK)
>>> TransferBufferLength =3D 00000004
>>> TransferBuffer =3D 09fce7d0
>>> TransferBufferMDL =3D 00000000
>>> UrbLink =3D 00000000
>>> RequestTypeReservedBits =3D 00000000
>>> Request =3D 00000081
>>> Value =3D 00000100
>>> Index =3D 00000400
>>> [208153 ms] UsbSnoop - MyInternalIOCTLCompletion(08de0ddc) :
>>> fido=3D00000000, Irp=3D0a823c10, Context=3D09a836c0, IRQL=3D2
>>> [208153 ms] <<< URB 880 coming back <<<
>>> -- URB_FUNCTION_CONTROL_TRANSFER:
>>> PipeHandle =3D 0a9a7220
>>> TransferFlags =3D 0000000b (USBD_TRANSFER_DIRECTION_IN,
>>> USBD_SHORT_TRANSFER_OK)
>>> TransferBufferLength =3D 00000004
>>> TransferBuffer =3D 09fce7d0
>>> TransferBufferMDL =3D 0951cf40
>>> 00000000: 06 10 04 00
>>> UrbLink =3D 00000000
>>> SetupPacket =3D
>>> 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 =3D 00000000 (USBD_TRANSFER_DIRECTION_OUT,
>>> ~USBD_SHORT_TRANSFER_OK)
>>> TransferBufferLength =3D 00000004
>>> TransferBuffer =3D 09fce7d0
>>> TransferBufferMDL =3D 00000000
>>> 00000000: 06 10 05 00
>>> UrbLink =3D 00000000
>>> RequestTypeReservedBits =3D 00000000
>>> Request =3D 00000001
>>> Value =3D 00000100
>>> Index =3D 00000400
>>> [208154 ms] UsbSnoop - MyInternalIOCTLCompletion(08de0ddc) :
>>> fido=3D00000000, Irp=3D0902bac0, Context=3D09a836c0, IRQL=3D2
>>> [208154 ms] <<< URB 882 coming back <<<
>>> -- URB_FUNCTION_CONTROL_TRANSFER:
>>> PipeHandle =3D 0a9a7220
>>> TransferFlags =3D 0000000a (USBD_TRANSFER_DIRECTION_OUT,
>>> USBD_SHORT_TRANSFER_OK)
>>> TransferBufferLength =3D 00000004
>>> TransferBuffer =3D 09fce7d0
>>> TransferBufferMDL =3D 0a98e1a0
>>> UrbLink =3D 00000000
>>> SetupPacket =3D
>>> 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/led_
>>> o
>>> ff_manfred.c
>>> https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led_
>>> 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=E9ssel, Manfred Baumgartl =EDrta:
>>>
>>> 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=E1rton Mikl=F3s [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-without-
>>> u
>>> sing-the-dinocapture-software/
>>>
>>> If possible please give it a try, and post the results.
>>>
>>> Cheers,
>>> Miklos
>>>
>>> 2013-07-27 13:20 keltez=E9ssel, Manfred Baumgartl =EDrta:
>>>
>>> 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 =96v 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=E1rton Mikl=F3s [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_use_
>>> 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=3D51267F67.208
>>> 0 809%40gmail.com&forum_name=3Dlinux-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=E9ssel, Manfred Baumgartl =EDrta:
>>>
>>> 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=E1rton Mikl=F3s [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=E9ssel, Manfred Baumgartl =EDrta:
>>>
>>> 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=3D48808831&iu=3D/4140/ost=
g.
>>> 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=3D48808831&iu=3D/4140/ost=
g.
>>> 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 mo=
re
> to find out.
>>> http://pubads.g.doubleclick.net/gampad/clk?id=3D49501711&iu=3D/4140/ost=
g.
>>> c lktrk _______________________________________________
>>> Linux-uvc-devel mailing list
>>> Linux-uvc-***@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
>>>
>>
>
unknown
1970-01-01 00:00:00 UTC
Permalink
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 val=
ues.

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=FCngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Montag, 05. August 2013 17:17
> An: Manfred Baumgartl
> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite Premie=
r
>
> 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 som=
e
> 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=FCngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Montag, 05. August 2013 14:26
>> An: Manfred Baumgartl
>> Cc: M=E1rton Mikl=F3s; 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=FCngliche Nachricht-----
>>> Von: Paulo Assis [mailto:***@gmail.com]
>>> Gesendet: Montag, 05. August 2013 11:48
>>> An: Manfred Baumgartl
>>> Cc: M=E1rton Mikl=F3s; 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=3Dunit_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 =3D usb_control_msg(devh, USB_TYPE_CLASS +
>>>> USB_RECIP_INTERFACE, 0x0000001, 0x0000100, 0x0000400, buf,
>>>> 0x0000004, 1000);
>>>>
>>>> memcpy(buf, "\x06\x10\x01\x00", 0x0000004);
>>>>
>>>> ret =3D 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 =3D usb_control_msg(devh, USB_TYPE_CLASS +
>>>> USB_RECIP_INTERFACE, 0x0000001, 0x0000100, 0x0000400, buf,
>>>> 0x0000004, 1000);
>>>>
>>>> memcpy(buf, "\x06\x10\x04\x00", 0x0000004);
>>>>
>>>> ret =3D 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=E1rton Mikl=F3s [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 =3D 00000001 (USBD_TRANSFER_DIRECTION_IN,
>>>> ~USBD_SHORT_TRANSFER_OK)
>>>> TransferBufferLength =3D 00000004
>>>> TransferBuffer =3D 09fce7d0
>>>> TransferBufferMDL =3D 00000000
>>>> UrbLink =3D 00000000
>>>> RequestTypeReservedBits =3D 00000000
>>>> Request =3D 00000081
>>>> Value =3D 00000100
>>>> Index =3D 00000400
>>>> [208153 ms] UsbSnoop - MyInternalIOCTLCompletion(08de0ddc) :
>>>> fido=3D00000000, Irp=3D0a823c10, Context=3D09a836c0, IRQL=3D2
>>>> [208153 ms] <<< URB 880 coming back <<<
>>>> -- URB_FUNCTION_CONTROL_TRANSFER:
>>>> PipeHandle =3D 0a9a7220
>>>> TransferFlags =3D 0000000b (USBD_TRANSFER_DIRECTION_IN,
>>>> USBD_SHORT_TRANSFER_OK)
>>>> TransferBufferLength =3D 00000004
>>>> TransferBuffer =3D 09fce7d0
>>>> TransferBufferMDL =3D 0951cf40
>>>> 00000000: 06 10 04 00
>>>> UrbLink =3D 00000000
>>>> SetupPacket =3D
>>>> 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 =3D 00000000 (USBD_TRANSFER_DIRECTION_OUT,
>>>> ~USBD_SHORT_TRANSFER_OK)
>>>> TransferBufferLength =3D 00000004
>>>> TransferBuffer =3D 09fce7d0
>>>> TransferBufferMDL =3D 00000000
>>>> 00000000: 06 10 05 00
>>>> UrbLink =3D 00000000
>>>> RequestTypeReservedBits =3D 00000000
>>>> Request =3D 00000001
>>>> Value =3D 00000100
>>>> Index =3D 00000400
>>>> [208154 ms] UsbSnoop - MyInternalIOCTLCompletion(08de0ddc) :
>>>> fido=3D00000000, Irp=3D0902bac0, Context=3D09a836c0, IRQL=3D2
>>>> [208154 ms] <<< URB 882 coming back <<<
>>>> -- URB_FUNCTION_CONTROL_TRANSFER:
>>>> PipeHandle =3D 0a9a7220
>>>> TransferFlags =3D 0000000a (USBD_TRANSFER_DIRECTION_OUT,
>>>> USBD_SHORT_TRANSFER_OK)
>>>> TransferBufferLength =3D 00000004
>>>> TransferBuffer =3D 09fce7d0
>>>> TransferBufferMDL =3D 0a98e1a0
>>>> UrbLink =3D 00000000
>>>> SetupPacket =3D
>>>> 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-f587d00540b=
d}
>>>> 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/led
>>>> _
>>>> o
>>>> ff_manfred.c
>>>> https://dl.dropboxusercontent.com/u/4295670/logitech%20C510/C510/led
>>>> _
>>>> 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=E9ssel, Manfred Baumgartl =EDrta:
>>>>
>>>> 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=E1rton Mikl=F3s [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-without
>>>> -
>>>> u
>>>> sing-the-dinocapture-software/
>>>>
>>>> If possible please give it a try, and post the results.
>>>>
>>>> Cheers,
>>>> Miklos
>>>>
>>>> 2013-07-27 13:20 keltez=E9ssel, Manfred Baumgartl =EDrta:
>>>>
>>>> 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 =96v 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=E1rton Mikl=F3s [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_use
>>>> _
>>>> 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=3D51267F67.20
>>>> 8
>>>> 0 809%40gmail.com&forum_name=3Dlinux-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=E9ssel, Manfred Baumgartl =EDrta:
>>>>
>>>> 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=E1rton Mikl=F3s [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=E9ssel, Manfred Baumgartl =EDrta:
>>>>
>>>> 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 show=
n?
>>>>
>>>>
>>>>
>>>> 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=3D48808831&iu=3D/4140/os=
tg.
>>>> 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=3D48808831&iu=3D/4140/os=
tg.
>>>> 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=3D49501711&iu=3D/4140/os=
tg.
>>>> c lktrk _______________________________________________
>>>> Linux-uvc-devel mailing list
>>>> Linux-uvc-***@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/linux-uvc-devel
>>>>
>>>
>>
>
unknown
1970-01-01 00:00:00 UTC
Permalink
Hi,
uvcdynctrl sends the data through the uvc driver while the c program
uses libusb and sends the data directly to the device, so that's the
diference in URB_CONTROLs you are seeing. In any case the uvc driver
follows the uvc standard so that shouldn't be a problem (if the device
is uvc compliant).

>
unknown
1970-01-01 00:00:00 UTC
Permalink
Ok,
so this means that the value didn't get set, as the current value didn't ch=
ange.
can you set the leds on with the c program and then get the current
value with uvcdynctrl?

Regards,
Paulo


2013/8/6 Manfred Baumgartl <***@peony.at>:
> Hi,
>
> it seems that the value was written into the default field. The current
> value is (BE)0x00c00101.
>
> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
> 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)0x08100000 (BE)0x00001008
> query step size of : (LE)0x01000000 (BE)0x00000001
> set value of : (LE)0x00011000 (BE)0x00100100
>
> rasp:/usr/src/dino-lite # 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
>
>
> Regards,
> Manfred
>
> -----Urspr=FCngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Dienstag, 06. August 2013 10:52
> An: Manfred Baumgartl
> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite Premie=
r
>
> Hi,
> uvcdynctrl sends the data through the uvc driver while the c program uses
> libusb and sends the data directly to the device, so that's the diference=
in
> URB_CONTROLs you are seeing. In any case the uvc driver follows the uvc
> standard so that shouldn't be a problem (if the device is uvc compliant).
>
>
unknown
1970-01-01 00:00:00 UTC
Permalink
Hi,
Yes, some controls can change due to some automatic mechanism, like
exposure if auto-exposure is enabled.
It looks like the case here, you set the leds on with (BE)0x00251007
and the control value goes down to an interval between (BE)0x00001009
and (BE)0x0000100d. Could this be the LED brightness ? If you are on a
dark room is the end value higher ?

Regards,
Paulo

2013/8/6 Manfred Baumgartl <***@peony.at>:
> Hello Paulo,
>
> this is strange!
>
> First read the value is the first 4 bytes and the default value is the
> second 4 bytes.
>
> Then it changes with every read.
>
> rasp:/usr/src/dino-lite # 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)0x06100100 (BE)0x00011006
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0x07102500 (BE)0x00251007
> rasp:/usr/src/dino-lite # 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)0x08100000 (BE)0x00001008
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0x09100000 (BE)0x00001009
> rasp:/usr/src/dino-lite # 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)0x0a100000 (BE)0x0000100a
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0x0b100000 (BE)0x0000100b
> rasp:/usr/src/dino-lite # 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)0x0c100000 (BE)0x0000100c
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0x0d100000 (BE)0x0000100d
>
> Regards,
> Manfred
>
>
> -----Urspr=FCngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Dienstag, 06. August 2013 11:32
> An: Manfred Baumgartl
> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite Premie=
r
>
> Ok,
> so this means that the value didn't get set, as the current value didn't
> change.
> can you set the leds on with the c program and then get the current value
> with uvcdynctrl?
>
> Regards,
> Paulo
>
>
> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>> Hi,
>>
>> it seems that the value was written into the default field. The
>> current value is (BE)0x00c00101.
>>
>> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
>> 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)0x08100000 (BE)0x00001008
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> set value of : (LE)0x00011000 (BE)0x00100100
>>
>> rasp:/usr/src/dino-lite # 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
>>
>>
>> Regards,
>> Manfred
>>
>> -----Urspr=FCngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Dienstag, 06. August 2013 10:52
>> An: Manfred Baumgartl
>> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
>> Premier
>>
>> Hi,
>> uvcdynctrl sends the data through the uvc driver while the c program
>> uses libusb and sends the data directly to the device, so that's the
>> diference in URB_CONTROLs you are seeing. In any case the uvc driver
>> follows the uvc standard so that shouldn't be a problem (if the device i=
s
> uvc compliant).
>>
>>
unknown
1970-01-01 00:00:00 UTC
Permalink
Hello,

> Another thing. The light goes on when I send a command and goes off after a
> view seconds.
I have seen the similar behaviour on my Logitech, when I have closed and
released the usb interface immediatelly.
Is your example quits immediatelly after you run it?

Regards,
Miklos


2013-08-06 12:39 keltezéssel, Manfred Baumgartl írta:
> Hello Paule,
>
> It seems that the value is counting with a value of 2 and the default value
> counts also with 2 but always one less.
>
> rasp:/usr/src/dino-lite # 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)0xcc100000 (BE)0x000010cc
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xcd100000 (BE)0x000010cd
> rasp:/usr/src/dino-lite # 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)0xce100000 (BE)0x000010ce
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xcf100000 (BE)0x000010cf
> rasp:/usr/src/dino-lite # 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)0xd0108400 (BE)0x008410d0
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xd1100000 (BE)0x000010d1
> rasp:/usr/src/dino-lite # 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)0xd210ff00 (BE)0x00ff10d2
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xd310ff00 (BE)0x00ff10d3
>
>
> No the leds are not set on with (BE)0x00251007.
>
> The correct sequence of the 2x4 bytes are here.
>
> 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
>
> As you can see the second byte at the end does the trick.
>
> Another thing. The light goes on when I send a command and goes off after a
> view seconds.
>
> Can you tell me why this happens?
>
>
> Regards
> Manfred
>
>
> -----Ursprüngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Dienstag, 06. August 2013 12:21
> 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,
> Yes, some controls can change due to some automatic mechanism, like exposure
> if auto-exposure is enabled.
> It looks like the case here, you set the leds on with (BE)0x00251007 and the
> control value goes down to an interval between (BE)0x00001009 and
> (BE)0x0000100d. Could this be the LED brightness ? If you are on a dark room
> is the end value higher ?
>
> Regards,
> Paulo
>
> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>> Hello Paulo,
>>
>> this is strange!
>>
>> First read the value is the first 4 bytes and the default value is the
>> second 4 bytes.
>>
>> Then it changes with every read.
>>
>> rasp:/usr/src/dino-lite # 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)0x06100100 (BE)0x00011006
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x07102500 (BE)0x00251007
>> rasp:/usr/src/dino-lite # 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)0x08100000 (BE)0x00001008
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x09100000 (BE)0x00001009
>> rasp:/usr/src/dino-lite # 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)0x0a100000 (BE)0x0000100a
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x0b100000 (BE)0x0000100b
>> rasp:/usr/src/dino-lite # 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)0x0c100000 (BE)0x0000100c
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x0d100000 (BE)0x0000100d
>>
>> Regards,
>> Manfred
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Dienstag, 06. August 2013 11:32
>> 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,
>> so this means that the value didn't get set, as the current value
>> didn't change.
>> can you set the leds on with the c program and then get the current
>> value with uvcdynctrl?
>>
>> Regards,
>> Paulo
>>
>>
>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>> Hi,
>>>
>>> it seems that the value was written into the default field. The
>>> current value is (BE)0x00c00101.
>>>
>>> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
>>> 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)0x08100000 (BE)0x00001008
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> set value of : (LE)0x00011000 (BE)0x00100100
>>>
>>> rasp:/usr/src/dino-lite # 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
>>>
>>>
>>> Regards,
>>> Manfred
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Paulo Assis [mailto:***@gmail.com]
>>> Gesendet: Dienstag, 06. August 2013 10:52
>>> 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,
>>> uvcdynctrl sends the data through the uvc driver while the c program
>>> uses libusb and sends the data directly to the device, so that's the
>>> diference in URB_CONTROLs you are seeing. In any case the uvc driver
>>> follows the uvc standard so that shouldn't be a problem (if the
>>> device is
>> uvc compliant).
>>>
unknown
1970-01-01 00:00:00 UTC
Permalink
2013/8/6 Manfred Baumgartl <***@peony.at>:
> Hello Paule,
>
> It seems that the value is counting with a value of 2 and the default val=
ue
> counts also with 2 but always one less.
>

Yes the default value shouldn't change in a control, the device seems
to be returning garbage at this point.

> rasp:/usr/src/dino-lite # 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)0xcc100000 (BE)0x000010cc
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xcd100000 (BE)0x000010cd
> rasp:/usr/src/dino-lite # 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)0xce100000 (BE)0x000010ce
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xcf100000 (BE)0x000010cf
> rasp:/usr/src/dino-lite # 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)0xd0108400 (BE)0x008410d0
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xd1100000 (BE)0x000010d1
> rasp:/usr/src/dino-lite # 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)0xd210ff00 (BE)0x00ff10d2
> query step size of : (LE)0x01000000 (BE)0x00000001
> query current value of: (LE)0xd310ff00 (BE)0x00ff10d3
>
>
> No the leds are not set on with (BE)0x00251007.
>
> The correct sequence of the 2x4 bytes are here.
>
> Switching the LED-light on:
>
> memcpy(buf, "\x07\x10\x25\x00", 0x0000004);
> ret =3D usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE,
> 0x0000001, 0x0000100, 0x0000400, buf, 0x0000004, 1000);
> memcpy(buf, "\x06\x10\x01\x00", 0x0000004);
> ret =3D 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 =3D usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE,
> 0x0000001, 0x0000100, 0x0000400, buf, 0x0000004, 1000);
> memcpy(buf, "\x06\x10\x04\x00", 0x0000004);
> ret =3D 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
>

well when you query the control immediatly after setting the leds on,
the value is set to:
(LE)0x07102500 (BE)0x00251007

this is the first sequence you send:
memcpy(buf, "\x07\x10\x25\x00", 0x0000004);

but in fact you do need to send 8 bytes. Can you query selector 2
instead after switching the leds? This one reports 8 bytes.

Regards,
Paulo

> As you can see the second byte at the end does the trick.
>
> Another thing. The light goes on when I send a command and goes off after=
a
> view seconds.
>
> Can you tell me why this happens?
>
>
> Regards
> Manfred
>
>
> -----Urspr=FCngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Dienstag, 06. August 2013 12:21
> An: Manfred Baumgartl
> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite Premie=
r
>
> Hi,
> Yes, some controls can change due to some automatic mechanism, like expos=
ure
> if auto-exposure is enabled.
> It looks like the case here, you set the leds on with (BE)0x00251007 and =
the
> control value goes down to an interval between (BE)0x00001009 and
> (BE)0x0000100d. Could this be the LED brightness ? If you are on a dark r=
oom
> is the end value higher ?
>
> Regards,
> Paulo
>
> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>> Hello Paulo,
>>
>> this is strange!
>>
>> First read the value is the first 4 bytes and the default value is the
>> second 4 bytes.
>>
>> Then it changes with every read.
>>
>> rasp:/usr/src/dino-lite # 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)0x06100100 (BE)0x00011006
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x07102500 (BE)0x00251007
>> rasp:/usr/src/dino-lite # 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)0x08100000 (BE)0x00001008
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x09100000 (BE)0x00001009
>> rasp:/usr/src/dino-lite # 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)0x0a100000 (BE)0x0000100a
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x0b100000 (BE)0x0000100b
>> rasp:/usr/src/dino-lite # 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)0x0c100000 (BE)0x0000100c
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0x0d100000 (BE)0x0000100d
>>
>> Regards,
>> Manfred
>>
>>
>> -----Urspr=FCngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Dienstag, 06. August 2013 11:32
>> An: Manfred Baumgartl
>> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
>> Premier
>>
>> Ok,
>> so this means that the value didn't get set, as the current value
>> didn't change.
>> can you set the leds on with the c program and then get the current
>> value with uvcdynctrl?
>>
>> Regards,
>> Paulo
>>
>>
>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>> Hi,
>>>
>>> it seems that the value was written into the default field. The
>>> current value is (BE)0x00c00101.
>>>
>>> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
>>> 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)0x08100000 (BE)0x00001008
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> set value of : (LE)0x00011000 (BE)0x00100100
>>>
>>> rasp:/usr/src/dino-lite # 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
>>>
>>>
>>> Regards,
>>> Manfred
>>>
>>> -----Urspr=FCngliche Nachricht-----
>>> Von: Paulo Assis [mailto:***@gmail.com]
>>> Gesendet: Dienstag, 06. August 2013 10:52
>>> An: Manfred Baumgartl
>>> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
>>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
>>> Premier
>>>
>>> Hi,
>>> uvcdynctrl sends the data through the uvc driver while the c program
>>> uses libusb and sends the data directly to the device, so that's the
>>> diference in URB_CONTROLs you are seeing. In any case the uvc driver
>>> follows the uvc standard so that shouldn't be a problem (if the
>>> device is
>> uvc compliant).
>>>
>>>
unknown
1970-01-01 00:00:00 UTC
Permalink
2013/8/6 Manfred Baumgartl <***@peony.at>:
> Hello Paulo,
>
> 4:2 has not changed it looks like
>
> rasp:/usr/src/dino-lite # 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)0x00004f4fffffffff (BE)0xffffffff4f4f0000
> query step size of : (LE)0x0100000000000000 (BE)0x0000000000000001
> query current value of: (LE)0x00004f4f00000000 (BE)0x000000004f4f0000
>
> So, but here is another thing,
>
> uvcdynctrl -S 4:1 0x00251007
> uvcdynctrl -S 4:1 0x06100100
>
> seems to enable the light. Every time when I communicate with the device
> after I send the above command it is switch on and then switched off when=
I
> do nothing.
>

I can't understand why you would need to change the control value
twice to enable/disable the LEDs
for other cameras you just set a value for on and another for off.
I'm not sure how to map this behavior into a v4l2 control.

LEDs in regular cameras usually have at least three modes:
always on - always on even if not streaming
always off -always off even if streaming
auto - on only when streaming

logitech also provides a blink frequency control

it could be the case that this device as a sort of auto LED control so
that when you set it, it will only turn on when streaming.

Regards,
Paulo


> uvcdynctrl -S 4:1 0x00251007
> uvcdynctrl -S 4:1 0x06100400
>
> disables the light. I can read as often I like the light does not come up
> again.
>
> So my next test is sending the LED-on command and then use motion or anot=
her
> capture tool and look if the light stays.
>
> Maybe it is only illuminated when the device is used for capture or
> something else.
>
> Regards,
> Manfred
>
>
> -----Urspr=FCngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Dienstag, 06. August 2013 13:02
> An: Manfred Baumgartl
> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite Premie=
r
>
> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>> Hello Paule,
>>
>> It seems that the value is counting with a value of 2 and the default
> value
>> counts also with 2 but always one less.
>>
>
> Yes the default value shouldn't change in a control, the device seems
> to be returning garbage at this point.
>
>> rasp:/usr/src/dino-lite # 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)0xcc100000 (BE)0x000010cc
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0xcd100000 (BE)0x000010cd
>> rasp:/usr/src/dino-lite # 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)0xce100000 (BE)0x000010ce
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0xcf100000 (BE)0x000010cf
>> rasp:/usr/src/dino-lite # 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)0xd0108400 (BE)0x008410d0
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0xd1100000 (BE)0x000010d1
>> rasp:/usr/src/dino-lite # 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)0xd210ff00 (BE)0x00ff10d2
>> query step size of : (LE)0x01000000 (BE)0x00000001
>> query current value of: (LE)0xd310ff00 (BE)0x00ff10d3
>>
>>
>> No the leds are not set on with (BE)0x00251007.
>>
>> The correct sequence of the 2x4 bytes are here.
>>
>> Switching the LED-light on:
>>
>> memcpy(buf, "\x07\x10\x25\x00", 0x0000004);
>> ret =3D usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE,
>> 0x0000001, 0x0000100, 0x0000400, buf, 0x0000004, 1000);
>> memcpy(buf, "\x06\x10\x01\x00", 0x0000004);
>> ret =3D 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 =3D usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE,
>> 0x0000001, 0x0000100, 0x0000400, buf, 0x0000004, 1000);
>> memcpy(buf, "\x06\x10\x04\x00", 0x0000004);
>> ret =3D 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
>>
>
> well when you query the control immediatly after setting the leds on,
> the value is set to:
> (LE)0x07102500 (BE)0x00251007
>
> this is the first sequence you send:
> memcpy(buf, "\x07\x10\x25\x00", 0x0000004);
>
> but in fact you do need to send 8 bytes. Can you query selector 2
> instead after switching the leds? This one reports 8 bytes.
>
> Regards,
> Paulo
>
>> As you can see the second byte at the end does the trick.
>>
>> Another thing. The light goes on when I send a command and goes off afte=
r
> a
>> view seconds.
>>
>> Can you tell me why this happens?
>>
>>
>> Regards
>> Manfred
>>
>>
>> -----Urspr=FCngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Dienstag, 06. August 2013 12:21
>> An: Manfred Baumgartl
>> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite Premi=
er
>>
>> Hi,
>> Yes, some controls can change due to some automatic mechanism, like
> exposure
>> if auto-exposure is enabled.
>> It looks like the case here, you set the leds on with (BE)0x00251007 and
> the
>> control value goes down to an interval between (BE)0x00001009 and
>> (BE)0x0000100d. Could this be the LED brightness ? If you are on a dark
> room
>> is the end value higher ?
>>
>> Regards,
>> Paulo
>>
>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>> Hello Paulo,
>>>
>>> this is strange!
>>>
>>> First read the value is the first 4 bytes and the default value is the
>>> second 4 bytes.
>>>
>>> Then it changes with every read.
>>>
>>> rasp:/usr/src/dino-lite # 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)0x06100100 (BE)0x00011006
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> query current value of: (LE)0x07102500 (BE)0x00251007
>>> rasp:/usr/src/dino-lite # 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)0x08100000 (BE)0x00001008
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> query current value of: (LE)0x09100000 (BE)0x00001009
>>> rasp:/usr/src/dino-lite # 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)0x0a100000 (BE)0x0000100a
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> query current value of: (LE)0x0b100000 (BE)0x0000100b
>>> rasp:/usr/src/dino-lite # 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)0x0c100000 (BE)0x0000100c
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> query current value of: (LE)0x0d100000 (BE)0x0000100d
>>>
>>> Regards,
>>> Manfred
>>>
>>>
>>> -----Urspr=FCngliche Nachricht-----
>>> Von: Paulo Assis [mailto:***@gmail.com]
>>> Gesendet: Dienstag, 06. August 2013 11:32
>>> An: Manfred Baumgartl
>>> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
>>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
>>> Premier
>>>
>>> Ok,
>>> so this means that the value didn't get set, as the current value
>>> didn't change.
>>> can you set the leds on with the c program and then get the current
>>> value with uvcdynctrl?
>>>
>>> Regards,
>>> Paulo
>>>
>>>
>>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>>> Hi,
>>>>
>>>> it seems that the value was written into the default field. The
>>>> current value is (BE)0x00c00101.
>>>>
>>>> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
>>>> 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)0x08100000 (BE)0x00001008
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> set value of : (LE)0x00011000 (BE)0x00100100
>>>>
>>>> rasp:/usr/src/dino-lite # 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
>>>>
>>>>
>>>> Regards,
>>>> Manfred
>>>>
>>>> -----Urspr=FCngliche Nachricht-----
>>>> Von: Paulo Assis [mailto:***@gmail.com]
>>>> Gesendet: Dienstag, 06. August 2013 10:52
>>>> An: Manfred Baumgartl
>>>> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
>>>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
>>>> Premier
>>>>
>>>> Hi,
>>>> uvcdynctrl sends the data through the uvc driver while the c program
>>>> uses libusb and sends the data directly to the device, so that's the
>>>> diference in URB_CONTROLs you are seeing. In any case the uvc driver
>>>> follows the uvc standard so that shouldn't be a problem (if the
>>>> device is
>>> uvc compliant).
>>>>
>>>>
unknown
1970-01-01 00:00:00 UTC
Permalink
Ok,
I have a regular microscope where the led is connected through a
switch, it also has a uvc camera that I fit in the microscope tube
(the camera itself has no leds), this camera although with a different
casing and with costum firmware is simply a mass production webcam
that the microscope vendor (Bresser) tweaked for it's needs.
In fact in my case the camera reports several resolutions and fps when
in through, fps is fixed for all of these resolutions since exposure
is always at the maximum value, unlike the original device.
I wouldn't be surprised if this was the case for many of such devices
out there, the vendor just picks a standard comercial camera and fits
it to it's needs.


Regards,
Paulo

2013/8/6 Manfred Baumgartl <***@peony.at>:
> Hello Paulo,
>
> have you ever seen the device? It is a microscope camera with a ring of
> led-lights around the lens.
>
> http://www.dino-lite.eu/index.php/en/digital-microscopes/dino-lite
>
> You need the light to illuminate the samples in front of the camera and t=
he
> default behaviour is that the light is not automatically switch on. It is
> very bright. Blinking is not required.
>
> I tested it now with motion to capture some pictures. Everything works fi=
ne
> for me. If I use
>
> uvcdynctrl -S 4:1 0x00251007
> uvcdynctrl -S 4:1 0x06100100
>
> Before starting motion the light is on. So it works for me for the moment=
.
>
> Regards,
> Manfred
>
>
>
> -----Urspr=FCngliche Nachricht-----
> Von: Paulo Assis [mailto:***@gmail.com]
> Gesendet: Dienstag, 06. August 2013 14:35
> An: Manfred Baumgartl
> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite Premie=
r
>
> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>> Hello Paulo,
>>
>> 4:2 has not changed it looks like
>>
>> rasp:/usr/src/dino-lite # 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)0x00004f4fffffffff (BE)0xffffffff4f4f0000
>> query step size of : (LE)0x0100000000000000 (BE)0x0000000000000001
>> query current value of: (LE)0x00004f4f00000000 (BE)0x000000004f4f0000
>>
>> So, but here is another thing,
>>
>> uvcdynctrl -S 4:1 0x00251007
>> uvcdynctrl -S 4:1 0x06100100
>>
>> seems to enable the light. Every time when I communicate with the device
>> after I send the above command it is switch on and then switched off whe=
n
> I
>> do nothing.
>>
>
> I can't understand why you would need to change the control value
> twice to enable/disable the LEDs
> for other cameras you just set a value for on and another for off.
> I'm not sure how to map this behavior into a v4l2 control.
>
> LEDs in regular cameras usually have at least three modes:
> always on - always on even if not streaming
> always off -always off even if streaming
> auto - on only when streaming
>
> logitech also provides a blink frequency control
>
> it could be the case that this device as a sort of auto LED control so
> that when you set it, it will only turn on when streaming.
>
> Regards,
> Paulo
>
>
>> uvcdynctrl -S 4:1 0x00251007
>> uvcdynctrl -S 4:1 0x06100400
>>
>> disables the light. I can read as often I like the light does not come u=
p
>> again.
>>
>> So my next test is sending the LED-on command and then use motion or
> another
>> capture tool and look if the light stays.
>>
>> Maybe it is only illuminated when the device is used for capture or
>> something else.
>>
>> Regards,
>> Manfred
>>
>>
>> -----Urspr=FCngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Dienstag, 06. August 2013 13:02
>> An: Manfred Baumgartl
>> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite Premi=
er
>>
>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>> Hello Paule,
>>>
>>> It seems that the value is counting with a value of 2 and the default
>> value
>>> counts also with 2 but always one less.
>>>
>>
>> Yes the default value shouldn't change in a control, the device seems
>> to be returning garbage at this point.
>>
>>> rasp:/usr/src/dino-lite # 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)0xcc100000 (BE)0x000010cc
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> query current value of: (LE)0xcd100000 (BE)0x000010cd
>>> rasp:/usr/src/dino-lite # 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)0xce100000 (BE)0x000010ce
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> query current value of: (LE)0xcf100000 (BE)0x000010cf
>>> rasp:/usr/src/dino-lite # 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)0xd0108400 (BE)0x008410d0
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> query current value of: (LE)0xd1100000 (BE)0x000010d1
>>> rasp:/usr/src/dino-lite # 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)0xd210ff00 (BE)0x00ff10d2
>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>> query current value of: (LE)0xd310ff00 (BE)0x00ff10d3
>>>
>>>
>>> No the leds are not set on with (BE)0x00251007.
>>>
>>> The correct sequence of the 2x4 bytes are here.
>>>
>>> Switching the LED-light on:
>>>
>>> memcpy(buf, "\x07\x10\x25\x00", 0x0000004);
>>> ret =3D usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE,
>>> 0x0000001, 0x0000100, 0x0000400, buf, 0x0000004, 1000);
>>> memcpy(buf, "\x06\x10\x01\x00", 0x0000004);
>>> ret =3D 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 =3D usb_control_msg(devh, USB_TYPE_CLASS + USB_RECIP_INTERFACE,
>>> 0x0000001, 0x0000100, 0x0000400, buf, 0x0000004, 1000);
>>> memcpy(buf, "\x06\x10\x04\x00", 0x0000004);
>>> ret =3D 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
>>>
>>
>> well when you query the control immediatly after setting the leds on,
>> the value is set to:
>> (LE)0x07102500 (BE)0x00251007
>>
>> this is the first sequence you send:
>> memcpy(buf, "\x07\x10\x25\x00", 0x0000004);
>>
>> but in fact you do need to send 8 bytes. Can you query selector 2
>> instead after switching the leds? This one reports 8 bytes.
>>
>> Regards,
>> Paulo
>>
>>> As you can see the second byte at the end does the trick.
>>>
>>> Another thing. The light goes on when I send a command and goes off aft=
er
>> a
>>> view seconds.
>>>
>>> Can you tell me why this happens?
>>>
>>>
>>> Regards
>>> Manfred
>>>
>>>
>>> -----Urspr=FCngliche Nachricht-----
>>> Von: Paulo Assis [mailto:***@gmail.com]
>>> Gesendet: Dienstag, 06. August 2013 12:21
>>> An: Manfred Baumgartl
>>> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
>>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
> Premier
>>>
>>> Hi,
>>> Yes, some controls can change due to some automatic mechanism, like
>> exposure
>>> if auto-exposure is enabled.
>>> It looks like the case here, you set the leds on with (BE)0x00251007 an=
d
>> the
>>> control value goes down to an interval between (BE)0x00001009 and
>>> (BE)0x0000100d. Could this be the LED brightness ? If you are on a dark
>> room
>>> is the end value higher ?
>>>
>>> Regards,
>>> Paulo
>>>
>>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>>> Hello Paulo,
>>>>
>>>> this is strange!
>>>>
>>>> First read the value is the first 4 bytes and the default value is the
>>>> second 4 bytes.
>>>>
>>>> Then it changes with every read.
>>>>
>>>> rasp:/usr/src/dino-lite # 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)0x06100100 (BE)0x00011006
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> query current value of: (LE)0x07102500 (BE)0x00251007
>>>> rasp:/usr/src/dino-lite # 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)0x08100000 (BE)0x00001008
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> query current value of: (LE)0x09100000 (BE)0x00001009
>>>> rasp:/usr/src/dino-lite # 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)0x0a100000 (BE)0x0000100a
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> query current value of: (LE)0x0b100000 (BE)0x0000100b
>>>> rasp:/usr/src/dino-lite # 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)0x0c100000 (BE)0x0000100c
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> query current value of: (LE)0x0d100000 (BE)0x0000100d
>>>>
>>>> Regards,
>>>> Manfred
>>>>
>>>>
>>>> -----Urspr=FCngliche Nachricht-----
>>>> Von: Paulo Assis [mailto:***@gmail.com]
>>>> Gesendet: Dienstag, 06. August 2013 11:32
>>>> An: Manfred Baumgartl
>>>> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
>>>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
>>>> Premier
>>>>
>>>> Ok,
>>>> so this means that the value didn't get set, as the current value
>>>> didn't change.
>>>> can you set the leds on with the c program and then get the current
>>>> value with uvcdynctrl?
>>>>
>>>> Regards,
>>>> Paulo
>>>>
>>>>
>>>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>>>> Hi,
>>>>>
>>>>> it seems that the value was written into the default field. The
>>>>> current value is (BE)0x00c00101.
>>>>>
>>>>> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
>>>>> 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)0x08100000 (BE)0x00001008
>>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>>> set value of : (LE)0x00011000 (BE)0x00100100
>>>>>
>>>>> rasp:/usr/src/dino-lite # 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
>>>>>
>>>>>
>>>>> Regards,
>>>>> Manfred
>>>>>
>>>>> -----Urspr=FCngliche Nachricht-----
>>>>> Von: Paulo Assis [mailto:***@gmail.com]
>>>>> Gesendet: Dienstag, 06. August 2013 10:52
>>>>> An: Manfred Baumgartl
>>>>> Cc: M=E1rton Mikl=F3s; linux-uvc-***@lists.sourceforge.net
>>>>> Betreff: Re: [linux-uvc-devel] switching light on device Dino-Lite
>>>>> Premier
>>>>>
>>>>> Hi,
>>>>> uvcdynctrl sends the data through the uvc driver while the c program
>>>>> uses libusb and sends the data directly to the device, so that's the
>>>>> diference in URB_CONTROLs you are seeing. In any case the uvc driver
>>>>> follows the uvc standard so that shouldn't be a problem (if the
>>>>> device is
>>>> uvc compliant).
>>>>>
>>>>>
unknown
1970-01-01 00:00:00 UTC
Permalink
Hey,

Just to clarify that there is a command line utility for Windows which
can be used to control the LED.
Manfred did some capturing using that, and the logs contained a lot of
isochronous transfers (I bet the camera had streamed).

Regards,
Miklos

2013-08-06 15:31 keltezéssel, Paulo Assis írta:
> Ok,
> I have a regular microscope where the led is connected through a
> switch, it also has a uvc camera that I fit in the microscope tube
> (the camera itself has no leds), this camera although with a different
> casing and with costum firmware is simply a mass production webcam
> that the microscope vendor (Bresser) tweaked for it's needs.
> In fact in my case the camera reports several resolutions and fps when
> in through, fps is fixed for all of these resolutions since exposure
> is always at the maximum value, unlike the original device.
> I wouldn't be surprised if this was the case for many of such devices
> out there, the vendor just picks a standard comercial camera and fits
> it to it's needs.
>
>
> Regards,
> Paulo
>
> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>> Hello Paulo,
>>
>> have you ever seen the device? It is a microscope camera with a ring of
>> led-lights around the lens.
>>
>> http://www.dino-lite.eu/index.php/en/digital-microscopes/dino-lite
>>
>> You need the light to illuminate the samples in front of the camera and the
>> default behaviour is that the light is not automatically switch on. It is
>> very bright. Blinking is not required.
>>
>> I tested it now with motion to capture some pictures. Everything works fine
>> for me. If I use
>>
>> uvcdynctrl -S 4:1 0x00251007
>> uvcdynctrl -S 4:1 0x06100100
>>
>> Before starting motion the light is on. So it works for me for the moment.
>>
>> Regards,
>> Manfred
>>
>>
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Paulo Assis [mailto:***@gmail.com]
>> Gesendet: Dienstag, 06. August 2013 14:35
>> 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/6 Manfred Baumgartl <***@peony.at>:
>>> Hello Paulo,
>>>
>>> 4:2 has not changed it looks like
>>>
>>> rasp:/usr/src/dino-lite # 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)0x00004f4fffffffff (BE)0xffffffff4f4f0000
>>> query step size of : (LE)0x0100000000000000 (BE)0x0000000000000001
>>> query current value of: (LE)0x00004f4f00000000 (BE)0x000000004f4f0000
>>>
>>> So, but here is another thing,
>>>
>>> uvcdynctrl -S 4:1 0x00251007
>>> uvcdynctrl -S 4:1 0x06100100
>>>
>>> seems to enable the light. Every time when I communicate with the device
>>> after I send the above command it is switch on and then switched off when
>> I
>>> do nothing.
>>>
>> I can't understand why you would need to change the control value
>> twice to enable/disable the LEDs
>> for other cameras you just set a value for on and another for off.
>> I'm not sure how to map this behavior into a v4l2 control.
>>
>> LEDs in regular cameras usually have at least three modes:
>> always on - always on even if not streaming
>> always off -always off even if streaming
>> auto - on only when streaming
>>
>> logitech also provides a blink frequency control
>>
>> it could be the case that this device as a sort of auto LED control so
>> that when you set it, it will only turn on when streaming.
>>
>> Regards,
>> Paulo
>>
>>
>>> uvcdynctrl -S 4:1 0x00251007
>>> uvcdynctrl -S 4:1 0x06100400
>>>
>>> disables the light. I can read as often I like the light does not come up
>>> again.
>>>
>>> So my next test is sending the LED-on command and then use motion or
>> another
>>> capture tool and look if the light stays.
>>>
>>> Maybe it is only illuminated when the device is used for capture or
>>> something else.
>>>
>>> Regards,
>>> Manfred
>>>
>>>
>>> -----Ursprüngliche Nachricht-----
>>> Von: Paulo Assis [mailto:***@gmail.com]
>>> Gesendet: Dienstag, 06. August 2013 13:02
>>> 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/6 Manfred Baumgartl <***@peony.at>:
>>>> Hello Paule,
>>>>
>>>> It seems that the value is counting with a value of 2 and the default
>>> value
>>>> counts also with 2 but always one less.
>>>>
>>> Yes the default value shouldn't change in a control, the device seems
>>> to be returning garbage at this point.
>>>
>>>> rasp:/usr/src/dino-lite # 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)0xcc100000 (BE)0x000010cc
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> query current value of: (LE)0xcd100000 (BE)0x000010cd
>>>> rasp:/usr/src/dino-lite # 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)0xce100000 (BE)0x000010ce
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> query current value of: (LE)0xcf100000 (BE)0x000010cf
>>>> rasp:/usr/src/dino-lite # 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)0xd0108400 (BE)0x008410d0
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> query current value of: (LE)0xd1100000 (BE)0x000010d1
>>>> rasp:/usr/src/dino-lite # 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)0xd210ff00 (BE)0x00ff10d2
>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>> query current value of: (LE)0xd310ff00 (BE)0x00ff10d3
>>>>
>>>>
>>>> No the leds are not set on with (BE)0x00251007.
>>>>
>>>> The correct sequence of the 2x4 bytes are here.
>>>>
>>>> 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
>>>>
>>> well when you query the control immediatly after setting the leds on,
>>> the value is set to:
>>> (LE)0x07102500 (BE)0x00251007
>>>
>>> this is the first sequence you send:
>>> memcpy(buf, "\x07\x10\x25\x00", 0x0000004);
>>>
>>> but in fact you do need to send 8 bytes. Can you query selector 2
>>> instead after switching the leds? This one reports 8 bytes.
>>>
>>> Regards,
>>> Paulo
>>>
>>>> As you can see the second byte at the end does the trick.
>>>>
>>>> Another thing. The light goes on when I send a command and goes off after
>>> a
>>>> view seconds.
>>>>
>>>> Can you tell me why this happens?
>>>>
>>>>
>>>> Regards
>>>> Manfred
>>>>
>>>>
>>>> -----Ursprüngliche Nachricht-----
>>>> Von: Paulo Assis [mailto:***@gmail.com]
>>>> Gesendet: Dienstag, 06. August 2013 12:21
>>>> 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,
>>>> Yes, some controls can change due to some automatic mechanism, like
>>> exposure
>>>> if auto-exposure is enabled.
>>>> It looks like the case here, you set the leds on with (BE)0x00251007 and
>>> the
>>>> control value goes down to an interval between (BE)0x00001009 and
>>>> (BE)0x0000100d. Could this be the LED brightness ? If you are on a dark
>>> room
>>>> is the end value higher ?
>>>>
>>>> Regards,
>>>> Paulo
>>>>
>>>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>>>> Hello Paulo,
>>>>>
>>>>> this is strange!
>>>>>
>>>>> First read the value is the first 4 bytes and the default value is the
>>>>> second 4 bytes.
>>>>>
>>>>> Then it changes with every read.
>>>>>
>>>>> rasp:/usr/src/dino-lite # 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)0x06100100 (BE)0x00011006
>>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>>> query current value of: (LE)0x07102500 (BE)0x00251007
>>>>> rasp:/usr/src/dino-lite # 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)0x08100000 (BE)0x00001008
>>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>>> query current value of: (LE)0x09100000 (BE)0x00001009
>>>>> rasp:/usr/src/dino-lite # 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)0x0a100000 (BE)0x0000100a
>>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>>> query current value of: (LE)0x0b100000 (BE)0x0000100b
>>>>> rasp:/usr/src/dino-lite # 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)0x0c100000 (BE)0x0000100c
>>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>>> query current value of: (LE)0x0d100000 (BE)0x0000100d
>>>>>
>>>>> Regards,
>>>>> Manfred
>>>>>
>>>>>
>>>>> -----Ursprüngliche Nachricht-----
>>>>> Von: Paulo Assis [mailto:***@gmail.com]
>>>>> Gesendet: Dienstag, 06. August 2013 11:32
>>>>> 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,
>>>>> so this means that the value didn't get set, as the current value
>>>>> didn't change.
>>>>> can you set the leds on with the c program and then get the current
>>>>> value with uvcdynctrl?
>>>>>
>>>>> Regards,
>>>>> Paulo
>>>>>
>>>>>
>>>>> 2013/8/6 Manfred Baumgartl <***@peony.at>:
>>>>>> Hi,
>>>>>>
>>>>>> it seems that the value was written into the default field. The
>>>>>> current value is (BE)0x00c00101.
>>>>>>
>>>>>> rasp:/usr/src/dino-lite # uvcdynctrl -S 4:1 '(BE)0x00100100'
>>>>>> 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)0x08100000 (BE)0x00001008
>>>>>> query step size of : (LE)0x01000000 (BE)0x00000001
>>>>>> set value of : (LE)0x00011000 (BE)0x00100100
>>>>>>
>>>>>> rasp:/usr/src/dino-lite # 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
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>> Manfred
>>>>>>
>>>>>> -----Ursprüngliche Nachricht-----
>>>>>> Von: Paulo Assis [mailto:***@gmail.com]
>>>>>> Gesendet: Dienstag, 06. August 2013 10:52
>>>>>> 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,
>>>>>> uvcdynctrl sends the data through the uvc driver while the c program
>>>>>> uses libusb and sends the data directly to the device, so that's the
>>>>>> diference in URB_CONTROLs you are seeing. In any case the uvc driver
>>>>>> follows the uvc standard so that shouldn't be a problem (if the
>>>>>> device is
>>>>> uvc compliant).
>>>>>>
Loading...