gl860, a driver for webcams based on the Genesys Logic GL860 chipset

Index

Introduction
Code
Instructions
How To Help
Sample Images
Useful Links
Disclaimer

Introduction

This project wants to build a free v4l/v4l2 driver for the class of webcams based on the chipset Genesys Logic GL860. Specifications for this chipset can be found here.
Until now two USBIDs have been found for this webcam:

05e3:f191 (full support)
05e3:0503 (see below)

but the :0503 version seems to be the most problematic, as different webcams mounted in different laptops seem to behave differently. Actually :
Full support for Asus Z37E / 640x480 support for Medion's laptops / no informations for others.

Please note that the webcam models based on the Genesys Logic GL860A chipset are actually UVC compliant devices, therefore your best bet is the linux-uvc project.
The driver is work in progress. The support for the :f191 model is complete as the hardware is in direct possession of the author, whereas support for the :0503 model is still depending on the laptop.

Back to the top

Code

The code for the project is offered on Sourceforge.net. Please visit the project page to download the latest version of the code.

Back to the top

Instructions

Here are some instructions on how to build and test the driver on your system.
First, make sure you own a gl860 device:

$ lsusb
Bus 007 Device 003: ID 05e3:0503 Genesys Logic, Inc. # Webcam
Bus 007 Device 001: ID 0000:0000
Bus 006 Device 001: ID 0000:0000
Bus 005 Device 004: ID 0b05:1712 ASUSTek Computer, Inc. # Bluetooth Module
Bus 005 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 001 Device 003: ID 147e:2016 # Fingerprint reader
Bus 001 Device 001: ID 0000:0000
Bus 002 Device 003: ID 0000:0000
Bus 002 Device 001: ID 0000:0000


Download the latest driver version and unpack it on your hard drive. Make sure you have the kernel headers and a compiler installed. On Debian/Ubuntu systems, it should be enough that you do:

$ sudo apt-get install linux-headers-`uname -r` build-essential

If you have a :f191 device, it should be enough to simply build and install the driver as it is:

$ cd nvgl
$ make -f Makefile.standalone clean
$ make -f Makefile.standalone
$ sudo cp gl860.ko /lib/modules/`uname -r`/kernel/drivers/media/video
$ sudo depmod -a /lib/modules/`uname -r`/kernel/drivers/media/video/gl860.ko
$ sudo modprobe gl860


If you own a :0503 device, things are a bit messier. Right now there are three versions of the driver included in the package ("a", "sim", "ms").
IT IS POSSIBLE THAT MORE DRIVER ARE NEEDED FOR ALL 503 TO WORK. Probably the easiest thing to do is to simply execute the script contained in the driver tarball:

$ ./pregen503

If you don't trust it, you just have to copy one of the versions to gl860-dev-0503.c and then compile the driver as above. For example, for version "ms" you should:

$ cd nvgl
$ make -f Makefile.standalone clean
$ cp gl860-dev-0503ms.c gl860-dev-0503.c
To match the Windows drivers, you must set the last line of gl860.h to :
#define LE_ALT 1 if you use the "sim" version
#define LE_ALT 3 for other versions
$ make -f Makefile.standalone
$ sudo cp gl860.ko /lib/modules/`uname -r`/kernel/drivers/media/video
$ sudo depmod -a /lib/modules/`uname -r`/kernel/drivers/media/video/gl860.ko
$ sudo modprobe gl860


Repeat for different versions of the driver. Between versions it is strongly suggested that you shut down the computer for a few seconds (NOT rebooting, a clean shut down).
To test the driver you can install your favourite webcam viewing software, such as Camorama, Cheese, Xawtv, Mplayer...
The driver has been tested also with Ekiga and Skype and works brilliantly.

Please refer to the README file included with the driver for additional information.

If none of the 3 driver works, you need a new driver. The way you can help is explained below.

Back to the top

How To Help

If you can code, lend a hand.
If you can't code, you can still help a great deal by testing and providing logs. In particular, logs acquired under Windows are of great value for the reverse engineering of the original driver. Here are a few instructions on how to obtain good and useful logs: it is a tedious process but if everything goes well you will need to do it only once.
Investing one hour of your day for a lifetime of video chatting sounds like a sweet deal to me!
Anyway, to obtain the logs you need a couple of things:

a. A Windows installation. This is painful, but unfortunately there does not seem to be a way of getting the logs in a virtual machine. This was tested with Virtualbox: feedback from people who tried in VMWare or qemu is welcome!

b. A USB sniffer. You can use USBSnoop. Please note that you will need the .NET framework to use this software.

c. The relog program included in the driver package

Here's the best way to obtain logs:

1. Disable the webcam in Control Panel --> System --> Hardware --> Device Manager --> Double click on the webcam --> Select "Disable" in the drop-down menu at the bottom of the tab.

2. Shut down the machine. Wait a few seconds. Power up the machine again and boot windows.

3. Start USBSnoop, install the filter for the webcam (it's all in the interface, don't worry) and start the log capturing. Go back to the hardware settings and reenable the camera. Capture for a few more seconds then stop the log. Click on "View log" and save it somewhere with a recognizable name.

4. Clear the log, start the capture again and start the webcam viewing software. Let it run for a few seconds (about 5" or the log will be HUGE), close the program, stop the capture. Save the log with another well recognizable name.

5. Repeat this procedure for a few more times, each time changing one (and ONLY one!) parameter of the image. For example, change the brightness by 20 points. Save the log and write down the minimum value for that parameter, the maximum, the default value, the value you started from and the value you ended up with. Again, it's tedious but it's worth it.

6. Do the same thing with the resolutions your camera is capable of. Write down the default resolution and the resolution you switch to.

7. At this point you'll have a nice selection of logs, each of which is probably about 300MB. Don't worry.

8. Move these logs to your linux installation. In the driver package there is a file called relog.c. This is a neat software that will clean up the logs leaving only the relevant information. Compile relog.c

$ g++ relog.c -o relog

and you'll obtain an executable named relog. Assuming that all logs you took have the extension .log, just type this to have them all automagically processed

$ cd /directory/with/logs/and/relog
$ for i in $(ls | grep .log); do ./relog $i cap; done


9. You'll end up with a bunch of .bmp images, a bunch of $i.loglog files and the most important ones, $i.c files. These are the files that are *really* needed to create the driver. Pack them up (make sure they have representative names and include a README file with some additional explanation if needed) and make them available along with the model of the laptop you have. If it's an external webcam, include the model of that too.
You can use the Support Requests of this project to post your logs.

Back to the top

Sample Images

Don't take our word for it. See for yourself:
sample_image
Back to the top

Useful Links

Here are some useful links to this project:
The original work on this driver made by Daniel Drake
The original ubuntu-fr discussion
0503 Device page on qbik.ch
F191 Device page on qbik.ch

Back to the top

Disclaimer

This driver is a work in progress and it's definitely not ready for prime time use or kernel tree inclusion.
It seems to be working fine for some, but not at all for others. Guess what, YMMV.
It should not fry your webcam, but in case it does don't say you were not warned.
No wooden puppets have been harmed in making this driver.

Back to the top