Frequently Asked Questions

This page attempts to summarize some of the more popular questions that have been posted to the qce-ga-discussion mailing list. Proceed with caution! Some of this information is out of date. We are in the process of updating this FAQ.

Questions

Answers

How do I compile the qc-usb driver directly into the kernel rather than as a standalone module?

At the moment, it is not possible without a lot of work to build the qc-usb driver into the kernel. We recommend building qc-usb driver as a separate module rather than directly into the kernel.

When I load quickcam.ko, I get lots of messages similar to mod_quickcam.o: unresolved symbol xxx

The qc-usb driver must be loaded after the usbcore, usb-uhci/uhci/ohci and videodev (V4L) drivers. If any one of these is missing then the module loader emits "unresolved symbol" errors. You must load these drivers first using insmod or modprobe. The easiest way to launch the driver is to run the quickcam.sh script included in each release.

What additional parameters does quickcam.ko accept?

The behaviour of the qc-usb driver can be modified using a series of options passed when the module is being loaded using insmod. The current options are documented below:

debug={ 1 | 2 | 4 | 8 | 16 | 32 }

Sets the debug output (1,2,4,8,16,32). Setting this high will cause the driver to slow down as it generates lots of useful output for developers.

interpolation={ 0 | 1 }

Changes the way in which the Bayer-RGB array within the sensor is interpolated to give the final output image. The default value is 0, which is standard interpolation, 1 results in bilinear interpolation, yielding better results in return for operating slightly slower.

mode={ 0 | 1 }

Sets the image size between full-size (352x288) and half-size (176x144). A smaller image has less detail but gives a correspondingly higher frame rate. The default value is 0, which is full size.

keepexposure={ 0 | 1 }

Default 0. Setting this option to 1 causes the driver to remember the last exposure settings. Useful when being used as a webcam since the camera normally takes several seconds to adjust after the video device has been opened.

tobgr={ 0 | 1 }

Automatic RGB -> BGR conversion. Defaults to 0 where the driver automatically attempts to determine the correct RGB/BGR order of the graphics card.

rgain={ 0..255 }

Overrides the automatic red gain control on the sensor. Useful for applications where the default gain control gives poor results.

bgain={ 0..255 }

Overrides the automatic blue gain control on the sensor. Useful for applications where the default gain control gives poor results.

ggain={ 0..255 }

Overrides the automatic green gain control on the sensor. Useful for applications where the default gain control gives poor results.

bright={ 0..65535 }

Overrides the automatic brightness control on the sensor. Useful for applications where the default brightness control gives poor results.

video_nr N

Set the video device number to /dev/videoN. Useful when more than one V4L device exists on a system. Defaults to 0.

For example, to configure the driver to use /dev/video1 with half-size frames you would use:

# insmod ./quickcam.ko video_nr=1 mode=1
  
How do I get the qc-usb driver to load automatically upon boot?

The easiest method is to execute the quickcam.sh script from /etc/rc.d/rc.local. As soon as I load mod_quickcam.o or open the video device using my SMP kernel, I get a kernel oops It has been reported that the qc-usb driver does not work correctly on SMP machines. If you have an SMP machine and are interested in helping in this area, please contact the qce-ga-devel mailing list.

I've managed to compile and install the driver but I get no pictures from the camera and lots of USB errors in /var/log/messages.

When the qc-usb driver was first developed, differences were found between the uhci and usb-uhci modules. In particular, usb-uhci was found to perform better than uhci. If your computer has a UHCI controller, try using the other UHCI module to see if this fixes the problem.

I get the message mod_quickcam.o: unresolved symbol kmap_pagetable while compiling.

This is fixed in newer versions. Please download the latest release or, in a pinch, try the CVS version.

Can I use more than one camera on just one computer?

It is possible to use more than one camera on one computer, but it is necessary to ensure that they are connected to different USB controllers, not just separate USB ports. This is because most USB controllers share the available 11Mbps bandwidth across both ports. For example, at a maximum resolution of 352*288, an uncompressed data stream can give a maximum frame rate of roughly 11*106 / (352*288*8) = 13fps. By plugging in two cameras into the same controller, this is immediately halved to about 6fps. Hence for performance reasons it is recommended that a camera is the only device plugged into the USB port.

I get errors trying to compile the module

Such errors include:

qc-driver.c:51: linux/version.h: No such file or directory
qc-driver.c:52: parse error
  
or
.../include/linux/config.h:4: linux/autoconf.h: No such file or directory
  
or
sed: can't read /usr/src/linux/Makefile: No such file or directory
  
or
Makefile:26: /usr/src/linux/.config: No such file or directory
  

You must install Linux kernel source code corresponding to the kernel you will be running with the camera driver. The source must be configured and depencies must have been created. Typically you can just install the kernel source package that comes with your distribution. If you're instead using virgin kernel in /usr/src/linux-x.y.zz, you must first copy kernel configuration file to /usr/src/linux-x.y.zz/.config, then go to the directory and run "make oldconfig" and "make dep".

You may also need to type

# cd /usr/src/linux-x.y.zz
# make include/linux/version.h
  

This should create the missing linux/version.h file.

Specific help for Red Hat/Mandrake users:

If you get a lot of errors on Mandrake or Red Hat when you do a make, it may be because you didn't install a full development version, meaning your kernel sources are not there. This worked for one user:
# urpmi kernel-source 
# urpmi kernel-headers 
# urpmi kernel-doc 
  

urpmi is your friend, it will find the CD that it needs to get this. Some RPMs may be installed already, big deal, do this then do a make, it worked on mandrake 8.2!

I look for /dev/video* (to set the videodev on gnomemeeting) and I haven't any videodevice.

Try this:

# mknod /dev/video0 c 81 0
# chmod a+r /dev/video0
# ln -s /dev/video0 /dev/video
  
I don't have permissions for /dev/video*

Easiest way to add permissions is to do chmod a+rw /dev/video? as root. Altenatively, especially on Debian, users belonging to the "video" group can access video devices. In this case, you might instead prefer issuing addgroup yourlogin video as root and then login as normal user. Check in which groups you are in with id -a.

My log files keep filling up (but the driver works fine)!

use qcset debug=0 to disable all possible messages. If it doesn't help, send e-mail to mailing lists showing the exact error message that fills your logs. (especially "frame lost" message is uninteresting, it is known to happen with some programs and will be fixed later.

quickcam.o: kernel-module version mismatch quickcam.o was compiled for kernel version 2.4.18 while this kernel is version 2.4.18-686-smp.

Then edit "Makefile" in the kernel source directory and change the line 4 from

EXTRAVERSION =
  
to
EXTRAVERSION = -686-smp
  

If this doesn't help, Go to /usr/src/linux-2.4/include/linux/version.h and change the UTS_RELEASE to match the output of "uname -r" on the command line (should be 2.4.18-686-smp). Then recompile the module and then the insmod will work perfectly :) [from Mark]

I want to reverse engineer an USB camera. How?

Run *ugh* Windoze *cough* drivers with a USB stream capture program, like usbsnoop Then send the same commands to the camera from Linux.

I added IEEE1394 card and now QuickCam doesn't work?

The card driver overwrites /dev/video0..2, use insmod ./quickcam.o video_nr=3 and then /dev/video3 with QuickCam. Create /dev/video3 with mknod if necessary. [from Makarand]

I get a kernel oops after the call path video_open -> qc_v4l_open -> qc_v4l_init -> qc_capt_init -> qc_frame_init -> qc_sensor_init -> hdcs_init because the qc->sensor pointer was poisoned with 0x5B.

Some of the driver objects were compiled with debugging and some without. If you change any options (LINUX_DIR or USER_OPT) you must always do first make clean.

Can I use more than one camera simultaneously?

Yes, if you have enough bandwidth in USB bus. A single USB 1.0 bus can drive generally only one camera (there is a report that with using qcset subsample=y even two cameras might work in one bus, in theory it shouldn't). If you have just two USB ports in your computer, it typically means that you have just one USB bus. You can attach the camera into the ports and do cat /proc/video/quickcam/* to see whether the USB bus number is different or the same in the two ports. A single USB 2.0 bus may or may not work with multiple cameras. It appears to depend on the vendor.

Do I need to patch my kernel with linux-xxx-quickcam.patch?

No. To be more precise, only if you want to compile the driver statically into the kernel which would be useful usually only if you want to boot Linux from the camera ;) or if you otherwise want to include the camera driver into the kernel source. If you really want to do this, use make patch, but it will work only with some kernel versions.