[mac, uvc-ctrl] new version of the uvc-controller

new version out
gui available

since people actually seemed to like this and i won’t have time to fix a gui for the new version for some time i’ll publish it without gui.
the new beta fixes some bugs (especially the white balance one) and adds some feats.. no changelog available but here’s what you can get/set if your camera supports it: auto-focus, absolute focus, relative focus, auto-exposure, absolute exposure, absolute iris, relative iris, auto-white balance temperature, absolute white balance temperature, brightness, contrast, gain, saturation and sharpness.
note that the argument order has changed since the last version, think “get/set <value> of <function> on <cam>”. also included the source this time!

the binary included is “universal” (i386/x86_64) and have been tested on both os x 10.6 and 10.7 (thanks to Arvid). the source has also been compiled on freebsd9. it does not require python as that was only the gui. it does however require libusb.

known bugs (thank you Matthew and F-red for the reports)

  • interactive session can’t take negative values
  • auto-exposure value description in wrong order
  • show configuration segfaults

update thanks to Klaus’ report it seems possible to fix the problem with programs resetting settings made by uvc-ctrl. if you have this trouble: try starting the program that resets your settings, from within it switch to your iSight, update the settings you want with uvc-ctrl on your other cam and then switch back. your settings should now still be in place.

 uvc-ctrl-v0.12b.zip (20.0 KiB, 1,516 downloads)

// sluggo

  1. Matthew Says:

    Thanks! Downloading to try it out now!

    ----------

  2. F-red Says:

    Hi,

    First of all, let me say that i think it is really great someone tries the get control of these logitech cams on mac. Thank u for that!

    I stumbled upon this website searching for control of my Logitech C615. I’m not really used to use terminal but i think i’ve managed to download everything needed. I’ve installed the libusb, tried the uvcc guy (but that didn’t work), now i was fooling around with this new version. I can communicate with my cam but i get the strangest answers. Is it possible there are other commands for the c615 or am i doing things wrong?

    i am so free to copy some things out of my terminal window…

    Last login: Tue Mar 13 12:04:57 on ttys001
    iMac-van-****** /Users/*****/Downloads/uvc-ctrl-v0/uvc-ctrl -i 11
    > g 0 11
    32
    > g 1 11
    0
    > g 2 11
    255
    > g 3 11
    32
    > g 4 11
    invalid request
    > g 5 11
    invalid request
    > g 6 11
    invalid request
    > g 7 11
    invalid request
    > g 8 11
    invalid request
    > g 9 11
    invalid request
    > g 10 11
    invalid request
    > g 11 11
    invalid request
    > g 12 11
    invalid request
    > g 13 11
    invalid request
    > g 14 11
    invalid request

    i can set things for the first 4 parameters, but my cam is not changing things – at least noting i can see…
    some commands fail :

    /Users/*****/Downloads/uvc-ctrl-v0/uvc-ctrl -s150 1 11
    request failed: pipe error
    request failed

    Am i doing things totally wrong?
    I’ll be glad to help you test things out…

    ----------

  3. sluggo Says:

    @Matthew
    great! any and all reports are more than welcome!

    ----------

  4. sluggo Says:

    Hello F-red!
    im sorry for the lacking documentation, especially when it comes to the interactive session.
    the basic syntax on the command line is
    ./uvc-ctrl -[g/s] [value that you want to set] [function you want to get/set the value of] [cam]
    this means that if you want to to turn off (set value to 0) auto-white balance on cam 4 you would write
    ./uvc-ctrl -s 0 8 4
    1
    (where 0 is the value you want to set function 8 to on camera 4, the returned 1 is the number of bytes sent to the cam).
    when you’re in an interactive session you just skip the cam number since that is set when the session is started. this means that the above command would translate to
    ./uvc-ctrl -i 4
    > s 0 8
    1
    >
    To get a more verbose output i would recommend setting debug mode to 1 (stupid name of me, will probably rename it in the next version). the white balance command again:
    ./uvc-ctrl -d1 -s0 8 4
    Bytes sent: 1

    When sending get-commands the returned value is ofcourse the value you’re “getting”.

    hope this clears it up a bit!

    ----------

  5. Matthew Says:

    It seems to be working! Here’s the switching off of auto-focus on a Microsoft HD-5000: http://www.youtube.com/watch?v=ePL-7MTDd2Q

    I’ll be testing other features as I have time!

    Thanks!

    ----------

  6. sluggo Says:

    super! and really like your hat!

    ----------

  7. Matthew Says:

    It seems in my testing that Auto Exposure is 1/2/4/8 Manual/Pipe Error/Pipe Error/Auto.

    Also, I’m getting Pipe Error for everything except auto-focus, absolute focus and absolute exposure. Does that simply mean that my cameras don’t support those values, or is there something else I’m missing? Also noticing that the Manual exposure only works with certain values, ie, 5, 10, 20, 156, 10002, 20000. Any other values blow the exposure wide open, making me look quite angelic :)

    Is there a way to discover all of the acceptable values, or are they camera specific, meaning that I’ll just have to discover which specific values work with my camera?

    ----------

  8. sluggo Says:

    im so sorry! i mixed up the different values’ meaning on auto-exposure, it should indeed be 1/2/4/8 Manual/Manual exposure/Manual Iris/Auto.
    It may very well be that your camera does not support the middle ones, they’re quite “exotic” and i actually haven’t tested uvcc on any camera that supports them yet..
    to get the min/max/default value of a certain function on your cam you change the first argument to get to 1/2/3 (see second “table” when running uvc-ctrl without any args).. ie. to get the lowest value of exposure supported by your cam run
    ./uvc-ctr -g1 4 N
    where N is your cam’s index. max:
    ./uvc-ctr -g2 4 N
    and so on..

    ----------

  9. F-red Says:

    Hi sluggo,

    Thx for your answers! very useful – as this thing you wrote: it is wonderful!
    I should have taken more time to understand what i was doing, before sending you all that stupid commands i tried. RTFM @ F-red!
    I am trying it right now and focus works with no problem at all. I can perfectly control my cam now – the values seem the be the other way around: s255 1 n sets the focus very close by the cam (at about 40 mm from the cam – can’t get anything closer sharp) s190 1 n sets the focus between /-50 mm and /-70 mm, s130 1 n gives shaprness between 90 and 130 mm… and so on…
    Probably this settings get influenced by manipulating other settings (exposure, iris, …) but i haven’t gotten to those settings yet. Anyhow: it is great that this works! I really need to control my webcam to shoot some stop motion-video and i don’t have the money to pay for an expensive camcorder or nikon… so: great thing you wrote, man. Logitec support: eat your heart out! ;-)

    ----------

  10. sluggo Says:

    Im glad it’s working for you! and it’s always good with questions covering some starter stuff, especially when TFM isn’t all that good!
    and thanks for reporting the focus values, i’ve also noticed that higher/lower focus values can have different meanings on different cams.. i’ll reformulate the value description in the next version.

    ----------

  11. F-red Says:

    It is really working great – autofocus control is perfect : i am using it with the iStopMotion (mac) right now and it works perfect. Man, u made my day!

    Other things i noticed (on iMac, os x 10.7.3, cam Logitech C615)

    in -i mode :
    op 2 (relative focus): i get no response (maybe this cam just cannot do that)

    > g0 2
    request failed: pipe error
    request failed
    > s-1 2
    invalid request
    > s0 2
    request failed: pipe error
    request failed
    > s1 2
    request failed: pipe error
    request failed

    op 3
    i can change only to values 1 and 8, on values 2 and 4 i get request failed: pipe error

    but with exposure on manual (s1 3) i can control op 4
    s50 4
    s100 4
    s400 4
    etc…
    works perfect too

    op 5: no reaction
    > g0 5
    request failed: pipe error
    request failed
    > s-1 5
    invalid request
    > s1 5
    request failed: pipe error
    request failed
    > s0 5
    request failed: pipe error
    request failed

    op 6 and 7 are the same (no reaction), but since i cannot set iris to manual (s4 3), that is no surprise…

    op 8 works – can control it with op 9 when 8 is set to manual… ‘temperatures’ between 2800 and 6500 (from cool blue too hot red, indeed)

    op 10 : values between 0 and 255 – total control
    op 11 : same values – total control
    op 12 : same values – total control
    op 13 : same values – total control

    op 14 : same values, but i see nog change on my cam image…

    so, thanks to you i can now control focus, exposure, white bal, brightness, contrast, gain and saturation. Only iris control is not working – but that has to do with op 3, i guess…

    ----------

  12. sluggo Says:

    dude!
    thank you so much for the report! i’ve been having troubles with the relative settings aswell.. im not sure if they’re just not supported by most cameras or if i’ve messed something up.

    ----------

  13. F-red Says:

    hehe – actually i had much fun testing your code. It made me feel ‘in control’ ;-) You are a hero!

    And I was thinking about all these people that are trying to control their webcams (plenty of fora like this one: http://forums.logitech.com/t5/Webcams/HD-Pro-Webcam-C910-sofware-for-Mac/td-p/523187/page/4) – someone should tell them there is a solution that works perfectly!

    I’ll do some more testing and if I find something interesting, I will let you know.

    one thing: -c N does not work
    on: -c N
    i always get: Segmentation fault: N

    In interactive mode ( -i N)
    i get: invalid request

    (always tried -d0 to -d3, got the same return everytime)

    ----------

  14. sluggo Says:

    Oops, sorry again.. that’s biggy!
    showing config isn’t supported in interactive mode yet (only h, g and s).

    ----------

  15. Matthew Says:

    again, a huge thanks for your work on this, sluggo! Used it yesterday for our podcast and was able to get all four cameras set up, auto-focus turned off, exposure adjusted and we were off and running! Cannot describe how helpful it is to me!

    ----------

  16. klaus Says:

    hello! thanks a lot for this work!
    i can contact my logitech c910 with it and set values.
    i have one crucial problem though:
    once i open the video device in another app (max in my case) the values are set back to default.
    is there a way to store the values permanently?
    maybe i am missing something essential…

    to clarify:
    when i leave the cam open in my app i get:
    request failed! could not claim interface: access denied
    from uvc-ctrl on any request.
    so clear enough, i have to close the connection in the other app to access the cam with uvc-ctrl.
    eg: i set autofocus to 0 and verify with -g0 0 8
    i get 0
    i open the cam in the other app and close it again, back in uvc-ctrl with -g0 0 8
    i get 1 again.
    any help?

    ----------

  17. sluggo Says:

    Hello Klaus!
    I have noticed the same thing with skype and a few other apps. when i tried starting an interactive session (-i N) and then starting skype my cam (also a c910) was not listed as an option in skype settings. i’m not sure what’s causing this (could be quite a few different things) and i’m sorry to say that i do not have a solution to it yet.. It is one of the things i will try to solve in the next version.

    // sluggo

    ----------

  18. klaus Says:

    hi sluggo, thanks for the fast answer!
    just a little clarification report:
    the command -e still lists my cam, when i have it open in my app.
    all other requests result in
    request failed! could not claim interface: access denied

    this is app depended. when i have photobooth open all works fine. i cannot do too many cool thins in photobooth though;)

    ----------

  19. sluggo Says:

    [Drunk and pissed as my team lost a game]
    Hi again Klaus!
    It is indeed app-dependent, dunno if max/skype/some other apps use some lib to claim the camera (including all the interfaces). uvc-ctrl tries to claim the cam when sending ctrl-requests, when listing it only looks for devices that has an interface with the right classes.
    ill get back to you tomorrow when i’ve sobered up!
    // sluggo0

    ----------

  20. klaus Says:

    …just a quick note:
    i found a workaround right before a performance tonite:
    when i switch to built-in iSight without deconnecting, i can
    set values on the other cam. when i just switch back again the settings are kept !!!
    very nice!
    (ps: working on a GUI right now…)

    ----------

  21. sluggo Says:

    thank you, that’s great news!

    ----------

  22. klaus Says:

    here is a GUI for uvc-ctrl:
    http://ppooll.klingt.org/images/4/40/Uvc-ctrl-GUI.zip
    it is a standalone app written in max,
    and needs to be put into the same folder as uvc-ctrl.
    thanks sluggo for your great tool!

    ----------

  23. sluggo Says:

    Thats awesome!
    sorry bout not responding until now, been in bed for a few days spaced out with fever. The gui works perfectly!

    ----------

  24. Alex Says:

    I seem to be getting “pipe error” whenever I try and change any camera settings. Toggling auto balance works perfectly, but when I try to disable auto white balance (using ./uvc-ctrl -s 0 8 5) it gives me a pipe error. Do you know what might be causing this? Also, would it be possible to change ISO settings in a similar fashion? Thank you for the excellent tool, it has been a lifesaver :)

    ----------

  25. sluggo Says:

    Hello Alex!
    Pipe errors are a bit tricky, it could be a bug but could also mean that your camera does not support changing that setting.
    What camera are you using? could you also try running the command with a higher debug level (-d 1 or -d 2) to get more info about the error?

    i haven’t found any information on iso-settings in the uvc-standard docs. from what i understand they are basically exposure settings calculated using the luminance.. i’ll definitely look into to it more as the current version gets more stable.

    i’m glad you liked it!

    // sluggo

    ----------

  26. Alex Says:

    Thanks for the fast reply. I am using a Microsoft LifeCam cinema (OSX Lion).

    Setting auto white balance with -d2 returns this response:
    >> ./uvc-ctrl -d2 -s 1 8 7
    libusb:warning [process_new_device] could not retrieve device descriptor: device not responding. skipping device
    libusb:warning [process_new_device] could not retrieve device descriptor: device not responding. skipping device
    libusb:warning [darwin_transfer_status] transfer error: pipe is stalled
    request failed: pipe error
    request failed

    However, setting auto-focus with -d2 also returns warnings (but executes successfully without error):
    >> ./uvc-ctrl -d2 -s 1 0 7
    libusb:warning [process_new_device] could not retrieve device descriptor: device not responding. skipping device
    libusb:warning [process_new_device] could not retrieve device descriptor: device not responding. skipping device
    Bytes sent: 1

    Thanks again!

    ----------

  27. sluggo Says:

    that’s weird, from what i’ve read lifecam cinema should support manual white balance. can you get the status of awb (-g 0 8 7)?

    ----------

  28. Zach Says:

    Amazing work sluggo and klaus. I do a lot of video work in max, and manual exposure is a big deal. (The Sony PS3Eye is popular because the MACAM drivers allow manual settings.) Uvc-ctrl works great with my Logitech Quickcam pro 9000, using the Klaus trick of switching to iSight while adjusting. NOTE: I tried to use non-UVC cameras (DV, IIDC, PS3Eye) as “decoys” while I adjusted uvc-ctrl but the klaus method doesn’t work with them. So FYI the “decoy” camera must be a UVC-compliant.

    ----------

Comment