Lorin Olivier’s GL860 driver

Lorin Olivier has created a kernel driver for his GL860 webcam. Lorin’s device is the 05e3:f191 variant, whereas mine is the more common 05e3:0503. There are differences between the devices that we don’t have much of a grasp on. The code we’ve written for each device is incompatible with the other, even though there are some protocol similarities.

Lorin reports that his driver works reasonably well with his device – it works with camorama, xawtv, ekiga, amsn, mplayer and xsane. He has also determined how to adjust various camera settings (luminosity, saturation, hue, sharpness, retrolighting, mirror effects, light source, AC power frequency).

Although Lorin doesn’t actually own an 0503 device, he’s attempted to implement support for it based on my earlier efforts. Given that I didn’t get very far, it probably doesn’t work that well. I haven’t had a chance to try it, but there’s no point me sitting on this any longer.

It’s in my git repository in the nvgl subdirectory:
git://projects.reactivated.net/~dsd/gl860.git (gitweb).

All credit goes to Lorin here – thanks! He’s done a great job, but do remember that its experimental code based on a reverse-engineered protocol, so don’t expect it to be flawless.

112 Responses to “Lorin Olivier’s GL860 driver”

  1. Sur3 Says:

    heyhoo, sounds nice, but your repo just says: “403 – Forbidden” or “fatal: Not a git repository Failed to find a valid git directory.” :-/

  2. Sur3 Says:

    ahh, sry seems to work now, just the webinterface witch is down ;-)

  3. Nol Says:

    Hi Sur3!
    Could you try the driver at https://sourceforge.net/project/showfiles.php?group_id=229562 with gl860-dev-0503b.c renamed to gl860-dev-0503.c ? From the three logs of the 05e3:0503 I have, each one shows differences in the traffic between webcam and driver. the “b” version is based upon your logs. This is fully experimental.

  4. Sur3 Says:

    thx, but the gl860-dev-0503b.c dosn’t work, i get really ugly pix with it:
    http://131.234.130.200/neuron/gentoo/usb_05e3_0503/0503b%40640×480.png (this swaps with blankscreen at 15 fps)

    with gl860-dev-0503.c and gl860-dev-0503a.c i get 1/16 of the viewport at 10 fps

    the best result is with the f131-driver at 1280×960, but even with this i just see half of the viewport of the camera, i should be in the middle of the pic (and its only 2 fps :-( ):
    http://131.234.130.200/neuron/gentoo/usb_05e3_0503/F191%401280×960.png

    anyway i will have to rewrite the gl860-bayer.c, but that is not the problem.

    greets
    Simon

  5. Nol Says:

    OK, thanks for the try. I’ll study one more times your log and submit you a new version. Could you make a capture log with Windows and run “relog yourlog.log sim” to send me ypurlog.log.c ? (relog.c is in the tarball on SourceForge) ?

  6. Sur3 Says:

    thank, so here you are:

    k, this was in the log at the beginning, dont know what it is, probably unimportant:
    http://131.234.130.200/neuron/gentoo/usb_05e3_0503/irgendwas.log.c

    this is the log from just capturing, but i didnt see a picture in windows, and relog produced only damaged pics:
    http://131.234.130.200/neuron/gentoo/usb_05e3_0503/capturing.log.c

    me trying different image sizes and formats (and finding out, that i can see pics while sniffing, when i make the pics small enough):
    http://131.234.130.200/neuron/gentoo/usb_05e3_0503/resize_format.log.c

    just starting cap and changing to 320×240 and diff formats:
    http://131.234.130.200/neuron/gentoo/usb_05e3_0503/320x240_format.log.c

    hf
    greets Simon

  7. Sur3 Says:

    @myself: hm, wieso wird mein vorheriger kommentar nicht angezeigt…? *grübel*

  8. Nol Says:

    I forget : what is your laptop Sur3?

  9. Sur3 Says:

    well, it’s a medion laptop:

    :: MD96384 Data ::
    Processor: Intel® Core 2 Duo (“Merom”) T7300 , 2,00 GHz
    Soundcard: Azalia 5.1ch, High Definition Audio (onBoard)
    Main Memory:2x 1024 MB Hynix DDR2 SO-DIMM (667 MHz) (no free banks, 2GB max.)
    Turbo Memory: 1GB Intel® Robson-Modul (NAND-Flash-Memory), PCIe Minicard
    Graphics:nVidia ® GeForce® 8600M GS (256 MB GDDRII-Memory, MS DirectX 10 Support)
    BIOS/Chipset:Phoenix BIOS, Intel i945PM / ICH8M Chipset
    Display:17″ TFT WXGA-Display (Resolution: 1440 x 900 Pixel, 16:10, glare)
    Input/Output:
    * 4x USB 2.0
    * 1x DVI-I Out
    * 1x HDMI Out
    * 1x RJ 45 (LAN)
    * 1x RJ 11 (Modem)
    * 1x PCI Express Card/54
    * 1x Mikrofon In
    * 1x Line In
    * 1x Line Out
    * 1x S/P-DIF out
    * 1x 4-in-1 Cardreader (SD, MMC, MS & MS Pro)
    Modem/ISDN: no
    Network:10/100Mbit Fast Ethernet (onBoard) Intel® PRO / Wireless 4965 (802.11 a/g/Draft-N up to 300Mbi t/s)
    DVD/CD-RW:Toshiba TS-L802A Slim (HD DVD)
    Akku:Li-Ion 4500 mAH, 10.8V
    PowerTransformator:19.0V / max 4.74A, 100-240V (50/60 Hz), 90 W
    Floppy-LW:no
    FastStartKeys:no
    HDD:WD Scorpio WD 1600 BEVS (160 GB, SATA, 5400 RPM)
    weight:ca. 3500 g (incl. Akku)
    more:Integrated 1.3 MP Webcam (USB: ID 05e3:0503 Genesys Logic, Inc.)
    Messure:393 x 280 x 22/33 mm (B x H x T)

    ps:
    i wrote a comment about the log.c-files, but it is not shown, here, strange…

  10. Sur3 Says:

    ok, because my comment is still not there here again a link to the log.c files:
    http://homepages.uni-paderborn.de/neuron/gentoo/gl860/logc.htm

    greets&thanks
    Simon

  11. Nol Says:

    I uploaded gl860-dev-0503sim.c on https://sourceforge.net/project/showfiles.php?group_id=229562 .
    Copy it to gl860-dev-0503.c before compiling. I hope it works.

  12. almighurt Says:

    I also got a medion laptop with 05e3:0503 Genesys Logic Webcam, but its a MD 96420. I tried 0.1b-d with all possible gl860-dev-0503*.c. nvgl0.1d with gl860-dev-0503a.c gives the best result but I can’t see a lot: http://michael-gerhaeuser.de/dump/gl860-a.png

    Anyway, thanks a lot for your great work.

  13. nol Says:

    Ok, thanks for the try. If you have Windows, you can help both of us by providing logs. Your picture is different from all what I have already seen, so there would be no connexion with other drivers. Have you shutdown your computer between each try? Maybe with that shutdown you’ll get something OK. It’s the case of Malmostoso who had something bad with the eventually good driver. But after restart it was OK. Let me know if the help you.

  14. almighurt Says:

    After a reboot the driver gives the same picture as seen on the screenshot posted above. i still have installed the preinstalled vista home premium, how can i generate these logs?

  15. almighurt Says:

    Ok, i foudn the USB logs from Windows section in your README file, i’ll try it and upload some logs as soon as possible :)

  16. Sur3 Says:

    @nol: I’m sorry, but i can’t see any improvement compared to the b-Version. :-(

    @almighurt: hm, one recognises something on your picture, could you make a picture with this gl860-bayer.c as replacement, it will/should be greyscale without detroying decoding information, so one could try to decode your picture-format: http://homepages.uni-paderborn.de/neuron/gentoo/gl860/gl860-bayer.c

    thanks&greets
    Simon

  17. Sur3 Says:

    i just recognised some dmesg errors with the gl860-dev-0505sim.c . . .
    after insmod:
    “gl860: ctrl transfer failed -32 [p40 r11 v0000 i0000 lg0]”

    while capturing there are lots of:
    “gl860: Iso frame 0 of USB has error -71″
    with all framenumbers from 0 to 15,
    i think this could be the major problem.

    And when stopping the capturing:
    “gl860: Error (-2) re-submitting urb in gl860_isoc_handler:1.
    gl860: Error (-2) re-submitting urb in gl860_isoc_handler:1.”

    any idea about this?

    thanks&greets
    Simon

  18. nol Says:

    @ Sur3
    It seems to be quite common that something in [p40 r11 ... ] failed but i include it because it is in the logs.
    The -71 is something i’ve already seen with Malmostoso but i have no idea what it means.
    The -2 is also something you share with Malmostoso and it surprise me because I have another error ID when stopping the cam. I also don’t know what it means. My error ID seems normal but -2 is quite strange.
    I will restudy your logs.

  19. Nol Says:

    I made a little modification in the tarball, I hope this will resolve the -71.
    Now you have to use “pregen503″ in command line. After that you choose which
    version you want to and it will compile and load the module.

  20. Sur3 Says:

    lmao, now it’s error -75 instead :-/
    btw, i have no videodev module, because it’s compiled into the kernel is there a reason for compiling it as module?

    greets
    Simon

  21. almighurt Says:

    @Sur3
    Thanks for your bayer.c, it first gave me the same result as the original bayer.c, but invoking camorama with -D -R –width=640 –height=480 looked like that
    http://www.michael-gerhaeuser.de/dump/cam_ubuntu.png
    But it seems like it’s only a small area of the real picture, the webcam sends.

  22. Sur3 Says:

    @almighurt:
    it gave you the same result as the first picture and wasn’t greyscale? thats weired, are you sure you used the my bayer.c there?
    your pic seemes to be similar to mine, it’s probably YUY2, but i did’nt test it.
    also i get only a small size of the viewport of the camera.
    do you manage to get some usb-log-files?

    i’m also trying to understand the language of the controller, but the protocol is quite strange.. :-/

    greets
    Simon

  23. almighurt Says:

    @sur3:
    i compiled it with your bayer.c, i’m pretty sure. i first called camorama without any parameters. the second time i called camorama with these parameters:
    -D -R –width=640 –height=480
    and it looked like seen on the last screenshot i posted.

    @Nol:
    ok, here are three logs from my webcam using SniffUSB and Windows Vista

    This is a replug by using the replug-button in sniffusb (the webcam is built-in, i can’t really unplug it, as far as i know)
    http://michael-gerhaeuser.de/gl860/replug.log.c

    The start and stop log:
    http://michael-gerhaeuser.de/gl860/start_stop.log.c

    Finally, a log taken while resizing the image from 160×120 to 320×240:
    http://michael-gerhaeuser.de/gl860/double_size_160x120to320x240.log.c

    The log.c files were created by
    ./relog .log almi

    hope i did it the right way and it helps :)

  24. Nol Says:

    Almighurt, your logs are certainly the most magnificent thing I saw about the 0503, maiden images of Malmostoso apart. Your logs are similar to the ones of Simon, so 2 Medion’s, one driver. I’ll compare the logs with those of Simon just to see if they are really identical.
    Your picture is different from the first one you post (which has a repeating pattern), is it different at each new launch of camorama ?

  25. almighurt Says:

    No, it’s not different each time i launch camorama. I just tested both gl860-bayer.c i got, first the original one. Calling camorama without any parameters gives the picture i first posted here. Calling camorama with parameters “-D -R –width=640 –height=480″ it gives a picture like in my second screenshot, but softly blue colored like the first screenshot.

    Using the bayer.c from Sur3 i get the same results, but in grey, without this blue shine on it.

  26. Nol Says:

    Grey images are normal with the Sur3′s bayer.c. Indeed, a webcam sends only one color information by pixel instead of three (red, green, blue). Depending on the webcam chip, the rule to convert one color to three colors varies. The purpose of Sur3′s bayer.c is to keep the raw data instead of trying to obtain some color. Grom these raw data you cas infer the conversion rule.
    Important : have you change parameters during the log ? (eg. luminosity, hue, …)
    There’s some unknown traffic in your log while video streaming compared to Sur3, otherwise, you have the same logs.
    In such case, could you make logs while changing ONE parameter only and tell me the name, the min/max value and from which value you go to which value (eg 0-128, from 32 to 45). It helps me to differentiate between instructions sent to webcam and settings.

  27. almighurt Says:

    No, the only setting i changed was the resolution in the third log. But i could make some more logs, changing some settings, maybe i won’t find any time for today but i’ll do this tomorrow then.

  28. Nol Says:

    @ Almighurt and Sur3 : a new version of the driver is online at SF. I made a change in the way to communicate with the webcam, I hope that was the problem. Use “./pregen503″ and choose “sim” before compiling.

  29. Sur3 Says:

    hm, that looks interresting, the screen is jittering and very dark so one could think there is nothing but on some starts of camorama and when paying much attention i can see me as a repeating pattern and it seemes to be the full viewport this time, also i saw lots of bufferowerflows in dmesg and messeges a la “gl860: VIDIOCMCAPTURE format=4 (r3_5 r2_4 u_9 y_8)”
    i will have to do more research.

    thanks&greets
    Simon

  30. Nol Says:

    An image please !
    I will suppress the VIDIOCMCAPTURE messages, they are no more useful. I need to know if your image is the same after several camorama stops. In this case it is not once the image is like this, another times like that.

  31. almighurt Says:

    @Sur3:

    Try
    camorama -D -R –width=640 –height=480

    It’s too dark, but it’s the whole viewport greyscaled :) screenshot:
    http://www.michael-gerhaeuser.de/gl860/newsim.png

    Thank you Nol, great work!

  32. Nol Says:

    I think the driver is now working, but I have not send some commands to modify luminosity of something like this.
    I did not included in the driver all commands sent to the webcam because I received a lot of images before these commands and this may be some useful settings. I include them. It will not be necessary to restart the computer.

    @ Sur3 : have you shutdown your computer between the two tries you did today ? This could explain that the driver is not working properly for you.

  33. Nol Says:

    New release taking into account the modification of the “sim” version for all other versions.
    Also I added the last commands sent by the “sim” to the webcam, I hope you will have a clearer image.
    In this case, if the color is abnormal, please post a picture.

    So Almighurt and Sur3 (Medion) : version “sim”.
    Daniel, version “a”.

  34. almighurt Says:

    Woah, great work Nol, here’s a screenshot:

    http://www.michael-gerhaeuser.de/gl860/works.png

  35. Nol Says:

    Great, the colorspace issue is not resolved, there is a pattern on the image. One line out of two is OK. It is the same for Jack Malmostoso with the already working device.
    I also need logs to take control over the settings of the webcam and the size change.

  36. Sur3 Says:

    well, i corrected the colors and also developed some fancy algorithms :-D
    also i shortened the dev-0503sim.c
    but there are still framebuf overflows.. :-/

    greets simon

    http://homepages.uni-paderborn.de/neuron/gentoo/gl860/gl860-bayer.c
    http://homepages.uni-paderborn.de/neuron/gentoo/gl860/gl860-dev-0503sim.c
    http://homepages.uni-paderborn.de/neuron/gentoo/gl860/fancy.png

  37. Sur3 Says:

    well, i thought i also show you an unfancy-image: ;-)
    http://homepages.uni-paderborn.de/neuron/gentoo/gl860/true.png

  38. Sur3 Says:

    ohh, i’m sorry, i recognised, that the modified dev-0503sim doesn’t work after reboot.
    also the color-channels will probably need some coefficient, cause the red looks a bit orange, but thats not this important at this developing-stage.

    greets simon

  39. Sur3 Says:

    so, i improved the dev-0503sim, now it even works after reboot, but i dont if if i better put the init_dev code to the init_cam code, i think one should split it, but thats an oher topic.. :-P

  40. Nol Says:

    I included your bayer function in the gl860-bayer.h but it is not used because I don’t know how to use it.
    AMsn, Ekiga, xawtv, camorama, mplayer, ask for a different format and it is easy to make a rgb/bgr 24/32 of your function, for bayer->YUYV/UYUV it’s another story. But the most important thing is that I don’t know who needs exactly your function. The f191 don’t need it, the 0503 of Malmostoso and Almighurt have a pattern but it is not as of your “fancy” picture.
    I also include a raw data output which can be called from mplayer with the “outfmt=y8″ instead of “outfmt=rgb24″.

    About the corrections in dev-0503sim, I can’t include it because I have no explanation about what you are doing. Have you pictures like that of Almighurt (http://www.michael-gerhaeuser.de/gl860/works.png) or not ? If with the same “sim” you don’t have this, you need a different driver from that of Almighurt and we need a “sim” version and a “almi” version.
    Moreover if you have logs with setting changes and size changes, please put them online so I can include. Also i made change in “a”, “ms” and “sim” part while you are changing yourself.

    So, please tell me if we have to split “almi” and “sim” version and please give me your logs.
    On SF, there’s a new release with a new version of relog.c which give more informations.

    I really like what you want to help but as i don’t know what you do, i don’t know what to do with your work.

  41. Sur3 Says:

    I’m sorry for so much confusion, the true.png is already the result of the new bayer and sim i referenced.
    the fancy pic was just a joke which rusults from experimenting, just forget it. ;-)

    the sim file results from studying logs and your old sim and experimenting,
    it’s just a shortened version of your file with the same result, almi will have to test it, if it doesn’t work for him, then we will have to split, but i hope it also works for him.

    i always start now with “camorama –width=640 –height=480″ that has the right format.
    i have to go now, will check your later..

    greets Simon

  42. Sur3 Says:

    well, further explaination for the b2bgr24lattice:
    it has just the same purpose as your b2bgr24, but it works :-P
    it was easier for me to adapt my old algorithm then to correct yours.
    also mine need less reccources cause it calculates with less pixels…

    the major difference is that my algorithm interpolates the colors between 4 pixels and cuts just one line in width and one in height, while yours calculates the color of 5 or 9 pixels with one of it at the position of the old pixels, and cuts 2 lines of width and 2 lines of hights.
    so my algo calculates from pixels with distance sqrt(0.5) while your algo calculates from 1 pixel with distance 0 and 4 or 8 pixels with distance 1. (so with more wrong colors, don’t expect that the error negate each other)
    calculating from more pixels is not really better, it blures and costs more ressources..

    i hope that explains my b2bgr24lattice-Algo.

    thanks&greets Simon

  43. Nol Says:

    So of I understand well, your bgr24lattice and bgr24 convert from exactly a same bayered image into a bgr24 with just less computations ? It is not a version due to the fact that you think there’s a difference of the bayer pattern between the f191 and the 0503 ?

    The debayering functions are the ones of the Syntek driver with just a swap of the blue and red components.

  44. Nol Says:

    There is now a new release of the driver which fixes a color issue (but still not with your function Simon, I’ll try later) for all 0503′s.

    The F191 is full supported (if there is one driver for all laptops…).
    The 0503 is full supported for the Asus Z37E, supported in 640×480 without settings for Medion. I have no news about the third version.

  45. almighurt Says:

    my last 2 posts are missing… maybe there are too many links in it, i’ll try to split the post

  46. almighurt Says:

    Good morning,

    first: the last version 0.2 works great:
    http://www.michael-gerhaeuser.de/gl860/works_better.png

    i just logged some setting changes:
    * white balance: http://www.michael-gerhaeuser.de/gl860/white_balance_from_50_to_71.log.c
    * brightness: http://www.michael-gerhaeuser.de/gl860/brightness_from_50_to_80.log.c

  47. almighurt Says:

    * size from 160×120 to 320×240: http://www.michael-gerhaeuser.de/gl860/changed_size_from_160x120_to_320x240.log.c
    * size from 320×240 to 640×480: http://www.michael-gerhaeuser.de/gl860/changed_size_from_320x240_to_640x480.log.c
    after changing the resolution to 640×480 using windows vista i get a black screen…
    * contrast: http://www.michael-gerhaeuser.de/gl860/contrast_from_50_to_80.log.c

  48. almighurt Says:

    * flip: http://www.michael-gerhaeuser.de/gl860/flip_on_and_off.log.c
    * gamme: http://www.michael-gerhaeuser.de/gl860/gamma_from_50_to_80.log.c
    * hue: http://www.michael-gerhaeuser.de/gl860/hue_from_60_to_80.log.c

  49. almighurt Says:

    * mirror: http://www.michael-gerhaeuser.de/gl860/mirror_on_and_off.log.c
    * sharpness: http://www.michael-gerhaeuser.de/gl860/sharpness_from_3_to_7.log.c

    if you need some special setting changes logged, please let me know.

  50. nol Says:

    I will study that tonight.
    Try to make log in size greater than 640×480. My webcam and that of Malmostoso don’t have true sizes below 640×480. It’s the driver which undersamples a 640×480 image. If you have no images it could be because there is too data to log and your system does not cope with, anyway, the commands are problably sent to the webcam, it is just data which are missed. Make several logs (3 or 4) with the same size change to be sure there is no instructions to webcam lost.

  51. almighurt Says:

    ok, i’ll try that in the evening, but i couldn’t find any option to get sizes greater than 640×480 in my webcam viewer… maybe there is another webcam tool for vista that does that or maybe i just missed that option.

  52. Sur3 Says:

    well, the only logfile which seems to have important information excerpt for the resize-logs is the flip_on_and_off.log.c, but perhaps i’m blind and Nol has more luck :-)
    anyway, last night i reverse engineered a bit and found out how to set fps and a kind of brightness. but i don’t know how to implement it in the code yet, but i will post a sample file in a few minutes..

    greets
    Simon

  53. nol Says:

    How did you reverse ingeneered ? From logs ? in this case, put the logs online, If not from logs please explain me.

  54. Sur3 Says:

    so here is my file with fps and brightness settings (currently standard is 15fps and bright=0×60):
    http://homepages.uni-paderborn.de/neuron/gentoo/gl860/gl860-dev-0503sur0.c
    see the dev_0503_start_stream to change settings..

    @almi:
    could you please test if the driver works for you? just copy gl860-dev-0503sur0.c to gl860-dev-0503sim.c and use the script or copy it to gl860-dev-0503.c, make it and test the module…

    thanks&greets
    Simon

  55. nol Says:

    For example in the brightness log file the information is :

    ctrl_out(dev, 0×40, 1, 0×6032, 0x00ff, 0, NULL);

    ctrl_out(dev, 0×40, 1, 0×6050, 0x00ff, 0, NULL);

    As value vary from 50 (32h) to 80 (50h), we infer that to change the brightness you have to send the webcam :

    ctrl_out(dev, 0×40, 1, 0×6000+brightness, 0x00ff, 0, NULL);

    (This a record, just one instruction is not the case for me or Malmostoso !)

  56. Sur3 Says:

    yes, sry, i didnt see this
    ctrl_out(dev, 0×40, 1, 0×6000+brightness, 0×00ff, 0, NULL);
    cause i searched for an other kind of commands.
    but it seemes not to work for me, i can’t recognise any difference, but perhaps i did something wrong.
    about my variant, working for me, i got it with studying and comparing logs and delta-debuging.

    greets
    Simon

  57. nol Says:

    Me too, sorry.

    Gamma, brightness, hue, sharpness, white balance,contrast made exactly the same thing !
    The is no difference at all between all these commands !
    It is just crazy.

    Almighurt, does it work with your pictures ? when you change something, it happens. Or is the soft you use “crappy” ?
    as it does not propose you to make more than 640×480, it is very strange.

  58. Nol Says:

    @ Sur3 :

    Once again Sur3, could you share your logs ?
    And could you tell me if the last release allow you to have a picture as Almighurt.

  59. Nol Says:

    @ Almighurt : as expected you don’t have a real 320×240 or 160×120. It is just undersampled data from 640×480.
    You can see that in your log files as you will see all images decoded in your logs are 640×480. Not any one in 320×240 or 160×120.

  60. Sur3 Says:

    yes the 0.2 driver works for me, too.
    i dont know if the logs i made will help you, but i can upload them and updated the
    http://homepages.uni-paderborn.de/neuron/gentoo/gl860/logc.htm

    thanks&greets
    Simon

  61. Sur3 Says:

    hm, in the datasheet there is a 8052 mentioned, would be great if one could manipulate the pictures with 8052-Assembler…

  62. almighurt Says:

    well, i just made 5 another brightness-changing-logs, reviewing the images generated by relog.c. there is only one log, where the brightness of the generated pictures changes! i uploaded it here:

    http://michael-gerhaeuser.de/gl860/brightness1.log.c

    so i’m not sure about the logs posted this morning being useful. i’m pretty sure, they’re worthless. my cam soft is totally crappy, it’s called “Cyberlink YouCam”.

  63. nol Says:

    @ Almighurt : no useful data in the last log.

    @ Sur3 : thanks for the new logs. Could you make logs while changing from 640×480 to a greater size and while changing one settings as did Almighurt (as expected, no real size below). These are the most important logs now that we have a picture.

    If you can set the fps, please post logs with different fps set.
    Concerning YU… change, i don’t think it has an effect, i try with my webcam but it has no effect, restarting the webcam apart.

  64. Sur3 Says:

    i dont have logs with different fps set, i got the setting by delta-debug, also i just found an other brightness setting, and i think perhaps the old setting was the contrast, i updated my http://homepages.uni-paderborn.de/neuron/gentoo/gl860/gl860-dev-0503sur0.c
    did you already check it out? – for me it works.

    greets Simon

  65. Sur3 Says:

    addon: and yes, there was usefull data in the last log for me, cause it helped me to find the new brightness-setting mentioned ;-)

    almi, will you test my gl860-dev-0503sur0.c, please give me feedback

    thanks&greets
    Simon

  66. almighurt Says:

    @sur3: well, it works, but i can’t change any settings. i tried that by dragging the bars in the adjustment section of the camorama window, but no changes. when i start camorama i sometimes dmesg says something like this:

    kernel: [ 191.401177] gl860: ctrl transfer failed -110 [p40 r1 v6032 i00ff lg0]
    or
    kernel: [ 298.674248] gl860: short ctrl transfer -110/8

  67. Nol Says:

    So you change something in the driver and you see what happened ? OK.
    However as you have still made Windows logs, why do you do not new logs, we could progess quickier !

    If you to test the brightness and contrast, just just have to fill the empty “dev_0503_camera_settings” function with :

    int dev_0503_camera_settings(struct usb_gl860 *dev)
    {
    int lum =dev->vsettings.brightness/256;
    int cntr =dev->vsettings.contrast/256;

    hell[3]=lum;
    hell[7]=cntr;
    ctrl_out(dev, 0×40, 3, 0×6000, 0×0200, 8, (void*)hell); // light

    return 0;
    }

    With that you will be able to control the effect of both settings.
    NOTE : this is based on a range of 0-255 for both settings, which is not always reality.

  68. Nol Says:

    @ Almighurt : you can try the piece of code above. Can you also try to find another soft to see your webcam and make logs. Maybe at http://www.download.com/3120-20_4.html?tg=dl-20&qt=webcam&tag=srch you can find something interesting.

  69. almighurt Says:

    @Nol:

    That works for me, thank you. I tried some of the webcam viewers from your link, but most of them are even much more crap than mine and until now i didn’t find anything useful. What can i do to help you? Am i doing something wrong when i try to log setting changes?

  70. Nol Says:

    You don’t make something wrong, the data exchange between the viewer and the device is almost nothing, it ‘s the problem. Or there is something I don’t know which makes that an unlogged communication tell the webcam he is changing that setting and the logged exchange we have is just the new value. It will be very amazing.
    You saw that while changing brightness you have almost never changes in the images generated by relog, is it the case if you log with other viewer or with “Cyberlink YouCam” when you change other parameters than brightness ?

  71. Jack Malmostoso Says:

    Dear all,

    if you’re looking for a software on Windows do make captures, I used Amcap:

    http://www.noeld.com/programs.asp?cat=video

    it is included with the driver for my 05e3:0503 webcam, and it is what I used to capture the logs for Nol.
    Maybe it’ll help you.

  72. nol Says:

    If one can change settings with amcap, it is perfect !

  73. Sur3 Says:

    Nol: thanks for the code for on the fly changing, it works, and yes the brightness has a scale from 0 to 255.
    But one has to be carefull with the contrast setting, because perhaps it is not really the contrast, and it has a strange scale, perhaps there is one bit in the middle which has no effect, i’ll experiment with some bitshifting.
    with camorama everithing seem to work, but mplayer sets the cntr to 127 and the brightness to 0 which results a very dark screen.

    thanks&greets
    Simon

  74. Jack Malmostoso Says:

    Sur3: mplayer behaves funnily. I am not sure if it tries to access the webcam over v4l (instead of v4l2), but it’s the only application that does not seem to handle the webcam properly.

  75. Nol Says:

    You can define what of v4l or v4l2 to use in the command line for mplayer. An example is in the README file… and for mencoder “rgb24″ must be read instead of “bgr24″.
    The sole viewer which seems to use completly v4l2 is xawtv as we can set all parameters defined by the driver. The others seem to allow only for common settings to be set.

  76. almighurt Says:

    weird… amcap doesn’t wok at all. the captured pictures look all over the same (no brightness change). the settings dialog is the same as is in Cyberlink YouCam (maybe provided by the driver? or some user-space program coming with the driver?). whenever i try to get higher resolutions beyond 640×480, with the web version i get

    Unable to activate the high-resolution still capture. Unbekannter Fehler [0x80004005 / 11011]

    the amcap version coming with my webcam driver doesn’t have an option to get higher resolutions at all.

    maybe not youcam is crap, but the driver and the cam is?

    Here my two logs (i’m pretty sure, they’re worthless, but just to be sure, you don’t miss anything that might be useful):
    http://www.michael-gerhaeuser.de/gl860/brightness_amcap_web.log.c
    http://www.michael-gerhaeuser.de/gl860/brightness_amcap_driver.log.c

  77. almighurt Says:

    just saw after submitting my last comment: amcap of course works, but only for lower resolutions than 640×480 (only black screen with 640×480, just like youcam).

  78. Sur3 Says:

    @almi: yes the same for me, when the resolution is to great, then you see a black screen, because, it is not fast enough when you capture. but the logfiles are also usefull even if the screen is black.
    I can only change to higher resolution when i choose the YUY2 format, perhaps that is the same for you?

    greets
    Simon

  79. nol Says:

    I suppose your driver must be somewhat crappy, so you can’t do anything with it.
    Could you make logs while changing the size.
    I’ll include the brightness change in the next release.

  80. Sur3 Says:

    good news,
    i managed to get 1280×1024@10fps will upload the code ths evening after some more testing.

    greets
    Simon

    ps:
    the resoluton 1600×1200 of amcap seems to be just upsampled/nterpolated.

  81. nol Says:

    :)

    Try the modified relog.c in SF. Now it gives on the screen the size of images it spots in the logs. If you see that the images are 1600×1200, they are not interpolated. Malmostoso have a real 1600×1200 with its 0503.

  82. Sur3 Says:

    ok, i uploaded the new version ( http://homepages.uni-paderborn.de/neuron/gentoo/gl860/gl860-dev-0503sur0.c ),
    but i’m sorry it’s not 1280×1024 but 1280×960.
    one can test it with
    “camorama -x1280 -y960″
    or
    “camorama -x640 -y480″
    1600×1200 would be strage because my datasheet says the webcam has just 1.3M Pixels.

    greets Simon

  83. Nol Says:

    Could you share your logs and explain me how do you do ?
    I cannot think that you achieve the 1280×960 by delta-debuging.
    So I think you use logs as you have still shared logs in the early days.
    If you can make logs, what don’t you make logs as Almighurt tried with all settings ?

  84. Sur3 Says:

    well the code was already in the logs i uploaded,
    furthermore my driver seemes to be same as crapy as Almighurts
    and my keyboard is brocken, so it’s actually not that easy to do anything. :-(

    greets Simon

  85. Nol Says:

    OK, could you explain how you did to have a greater size than 640×480 as it seemed to be impossible to Almighurt.
    The process could be interesting to someone who would like to help with log.

  86. Sur3 Says:

    well i just used my logfiles and compared it to the code i alredy had, not easy to explain in one sentence ;-)
    how did you contact almi, kind of jabber?, i cant see any posts here,
    perhaps he has just to reduce the fps in the driver, if its to high he wont see anything… ?
    or his webcam doesnt support this res if he even cant use it in windows without usbsnoop installed…?
    anyway there are still buffer-overflows when starting the cam, and resizing for other sizes than 640×480 or 1280×960 doesnt work.

    greets Simon

    ps:
    i made myself a sourceforge account ( sur3 ), but i can’t find howto subscribe to a project, could you explain me?

  87. Sur3 Says:

    ah, perhaps i missunderstood your question, i good the high-res logs by using usbsnoop and amcap, but i had to change the picture-format from I420 to YUY2 to be ably to select an higher resolution, and yes i didnt see anything, but the code needed was in the logfiles afterwards, but i allready mentioned this in an earlier comment.

    greets Simon

  88. Nol Says:

    On SourceForge, you will find an updated “sim” version. It is not as light as the one of Sur3, but it should work. Only the brightness is included.
    I will change the management of the different 0503 version in order that you will be able to be naturally at 640×480 or 1280×960 with camorama as it should be at 800×600 et 1600×1200 for you if I make no mistake.

    @ Sur3 : sorry, I didn’t understood that the 1280×960 comes from the 1600×1200 log so that I thought you had new logs not shared.
    Are you sure for the setting of fps ? 38Hz, 60Hz and so on are really high value.
    Could you post images of the same field of view with different “contrast” settings and the value of the setting.

  89. Nol Says:

    When you change format to i420 or YUY2, do the images are really in these format (have you to change something in gl860-bayer.c to display properly the image) ?
    I don’t know how to contact Almighurt.
    I add you to the project but I don’t know what you allowed to do… SF is still new to me.

  90. nol Says:

    New release at SF with the respect of possible size. Now, you should run basically Camorama in 640×480 and in 1280×960 in the great size.

  91. almighurt Says:

    Sorry, i had to do some other work about genetic algorithms… no time last week, but i tested the new version and it works wonderful! thanks for your great work :)

    do you need more logs from me? if you do, just let me know. to contact me just mail to gl860 at michael-gerhaeser.de

  92. nol Says:

    :) So you have both size and brightness control ?
    I would like a log with a change to 800×600 and logs with changes of fps and the range of fps allowed by the driver. That information should be send to the webcam chip.

  93. Nol Says:

    Could you give the gl860.inf of your webcam. There is interesting informations about capabilities and data to send for the settings.

    Use “Submit new” of the “Request for supports” in SF (https://sourceforge.net/tracker/?group_id=229562&atid=1077409) to upload the file.

  94. almighurt Says:

    good morning :)

    1. i uploaded the gl860.inf from the driver for windows vista 32 bit to sourceforge
    2. i was able to make 2 logs, one with sizechange from 1600×1200 to 1280×800:
    http://michael-gerhaeuser.de/gl860/sizechange_from_1600x1200_to_1280x800.log.c
    and one with sizechange from 1600×1200 to 640×480:
    http://michael-gerhaeuser.de/gl860/sizechange_from_1600x1200_to_640x480.log.c
    because amcap doesn’t let me choose 800×600, so i took the resolutions around 800×600 that amcap let me choose.
    3. there is an option in amcap settings dialog about changing the fps, but i can’t change it to any other than 30.00. so i made no logs about that

  95. nol Says:

    Good Morning Almighurt

    Bad news for the settings, the driver sets brightness, contrast, etc as expected from the gl860.inf. Really stange, I will extend the supported settings by the mean of a post-processing step to have the v4l basis settings.

    From the gl860.inf it appears that the webcam can achieve 1600×1200 in YUYV.
    What I need is a log of 640×480 to 1600×1200. From 1600×1200 to 640×480, i get the informations to reveive 640×480 images, what is already known.

  96. almighurt Says:

    So here it is:
    http://michael-gerhaeuser.de/gl860/sizechange_from_640x480_to_1600x1200.log.c
    Hope it was recorded correctly, relog.c gave me only one picture with size 1600×1060…

    this morning i forgot the good news, the brightness and the contrast setting works fine with version 0.2d of your driver

  97. nol Says:

    If you have contrast, that means you use Sur3′s 0503, not the one in SF’s archive ! I have not included the contrast since it is not well understood.

  98. almighurt Says:

    sorry, i don’t have contrast, just brightness (and size invoking camorama with -x and -y parameters).

  99. Nol Says:

    The size has not really changed to 1600×1200, it is exactly the same instruction sequence as to change to 1280×960.

  100. almighurt Says:

    Maybe because there is no real 1280×960 but just 640×480 and 1600×1200?

  101. Nol Says:

    No, you have at least 640×480 and 1280×960. According to the gl860.inf, you can do 1600×1280. No 800×600 eventually.

  102. almighurt Says:

    that’s really weird, because the relog.c in version 0.2d’s tar.gz gives me only 640×480 and 1600×1080 pictures. i’ll try to capture some logs tomorrow, now it’s time for me to sleep. my neighbours finally calm down now after celebrating the victory of german soccer team over austria… :)

  103. almighurt Says:

    p.s.: yes, it’s really 1600×1080 and NOT 1600×1280 it’s not a typo.

  104. Nol Says:

    Could you show me a picture in 1600×1080.

  105. almighurt Says:

    Of course, but you won’t see much. Most of the image is white and black, just the upper part looks like there is something captured:
    http://michael-gerhaeuser.de/gl860/im003.png
    (converted to png, original bmp has about 5MB)

    And with sizes >= 640×480 there are only such pictures, nothing to see, mostly black, weird sizes (not only 1600×1080 but also 1600×1000, 1600×1002)

  106. Nol Says:

    Don’t take these images into account.
    Relog try to find the width and height of an image with the approximate number of bytes received and with Height=4/3*Width. Then it keeps as width the nearest of 320, 640, 800, 1024, 1280 or 1600 and infers a new height. When there is no prefered width near enough, it keeps the former width.
    You have weird sizes because while making logs, there is too many data to log and USBSniff misses data, so you have smaller pictures than expected because image data were lost or bigger pictures because “end of image marker” were lost and the number of bytes received is that of 2 images or less depending on the data loss.

    If you have clean images in 1280×960, that is the webcam send 1280×960 images.

  107. nol Says:

    @ Amighurt or Sur3

    Hello, I need to be sure about the settings of parameter which are not asked to the webcam by the driver. So could you make a log while changing the brightness from the minimum to the maximum after the brightness of the picture is steady (not during the start of the webcam when the lumonisity chnages). If in the images created by relog there is no change in brightness, no problem, if there is a
    change, i need the raw log (not processed with relog).
    Thanks

  108. almighurt Says:

    Sorry, had no time before to make this log:

    http://michael-gerhaeuser.de/gl860/brightness_min_max.log.c

    no brightness changes in the captured images, so only the log.c file.

  109. nol Says:

    OK thanks. There is no data in the logs I didn’t use and that was important for the driver.

  110. root_42 Says:

    I tried compiling the GIT version, as the released version on sf.net, but i get (with 2.6.27-rc4) the following error:

    ~/compile/nvgl$ ./install
    *****************************************************************************
    1/8) [Kernel headers for current kernel installed]

    2/8) [Make is present]
    *****************************************************************************
    3/8) [No old module...] Nothing to do

    4/8) [Clean up from previous compilations]
    $ make -f Makefile.standalone clean
    make -C /lib/modules/2.6.27-rc4-wl/build SUBDIRS=/home/schmitz/compile/nvgl clean
    make[1]: Entering directory `/root/compile/wireless-testing’
    CLEAN /home/schmitz/compile/nvgl/.tmp_versions
    make[1]: Leaving directory `/root/compile/wireless-testing’
    *****************************************************************************
    5/8) [Source code generation...]
    6/8) [Compiling driver...]
    $ make -f Makefile.standalone
    make -C /lib/modules/2.6.27-rc4-wl/build SUBDIRS=/home/schmitz/compile/nvgl modules
    make[1]: Entering directory `/root/compile/wireless-testing’
    CC [M] /home/schmitz/compile/nvgl/gl860-usb.o
    /home/schmitz/compile/nvgl/gl860-usb.c: In function ‘usb_gl860_probe’:
    /home/schmitz/compile/nvgl/gl860-usb.c:755: error: implicit declaration of function ‘PAGE_ALIGN’
    make[2]: *** [/home/schmitz/compile/nvgl/gl860-usb.o] Fehler 1
    make[1]: *** [_module_/home/schmitz/compile/nvgl] Fehler 2
    make[1]: Leaving directory `/root/compile/wireless-testing’
    make: *** [driver] Fehler 2

    What do you make of that?

  111. Nol Says:

    Hi ! you have a lot of chance because I do not look at this page often. Please go to http://ubuntuforums.org/showthread.php?t=869263 next times.
    After some google search, this error occured also with kernel 2.6.26something. Try what is in this post to solve the trouble : http://www.gossamer-threads.com/lists/linux/kernel/951452 and reports the result.

  112. Nol Says:

    Just a precision : report here please as you post here.

Leave a Reply

You must be logged in to post a comment.