|
knet's haven » Writing » Articles » Using A Logitech QuickCam Express Web Camera With Linux |
|||||||||||||||||||||||||
|
Using A Logitech QuickCam Express Web Camera With Linux
ConfigurationkernelEnsure you are running a kernel with USB support, either compiled into the kernel or loaded as separate modules. For USB support, I have the following in /etc/modules.conf: alias usbdevfs usbcore alias usb-controller usb-uhci There are different USB controllers available. You may require usb-ohci. For Video4Linux and the QuickCam, I have the following in /etc/modules.conf: alias char-major-81 videodev alias char-major-81-0 mod_quickcam usbdevfsWe will now create the USB devices filesystem (usbdevfs). Add the following line to /etc/fstab: none /proc/bus/usb usbdevfs defaults 0 0 Assuming you have the correct USB support configured for use with the kernel you should be able to mount the filesystem: [root@joshua /root]# mount /proc/bus/usb [root@joshua /root]# You can now view USB device information in /proc/bus/usb/devices. The following is what I see in /proc/bus/usb/devices when my camera is plugged in: [root@joshua /root]# cat /proc/bus/usb/devices . . . . . T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 2 Spd=12 MxCh= 0 D: Ver= 1.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS= 8 #Cfgs= 1 P: Vendor=046d ProdID=0840 Rev= 1.00 S: Product=Camera C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=quickcam E: Ad=81(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=16ms I: If#= 0 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=quickcam E: Ad=81(I) Atr=01(Isoc) MxPS=1023 Ivl=1ms E: Ad=82(I) Atr=03(Int.) MxPS= 1 Ivl=16ms . . . . . [root@joshua /root]# Among many other things, the output of dmesg should show something similar to the following: [root@joshua /root]# dmesg . . . . . Linux video capture interface: v1.00 usb.c: registered new driver quickcam USB Quickcam Class ff SubClass ff idVendor 46d idProduct 840 USB Quickcam camera found using: $Id: quickcam.c,v 1.111 2003/01/27 09:41:03 tuukkat Exp $ quickcam: probe of HDCS1000 sensor = 08 5a id: 08 quickcam: HDCS1000 sensor detected . . . . . [root@joshua /root]# ProblemsBrightnessI have experienced problems with brightness and contrast. Here is an e-mail excerpt showing Tuukka Toivonen responding to my questions regarding brightness: Date: Mon, 12 May 2003 12:15:46 +0300 (EEST) From: Tuukka Toivonen <tuukkat@ee.oulu.fi> To: David Taylor <knet@mailandnews.com> Subject: Re: [Qce-ga-devel] brightness problem On Mon, 12 May 2003, David Taylor wrote: >My problem is that the snapshots are always too dark. >Can someone give me some insight as to: >* the cause of the problem The driver adapts automatically to the environment brightness, but this takes a few seconds and the first frames may be too dark. There's little you can do with qce-ga... you may want to try qc-usb, with it you can disable the automatic exposure control (insmod quickcam.o keepsettings=1 adaptive=0) and set manually good initial conditions (qcset -b xx -c yy). It also has option to wait in the beginning until the brightness has settled (settle=1) but this likely isn't working very well. Or you could try some other snapshot program (I know there is some which first try to adjust brightness and only after that takes the snapshot). http://www.ee.oulu.fi/~tuukkat/quickcam/qc-usb-cvs.tar.gz >* what xawtv does to correct it Reads many frames >* how to correct it without running xawtv Read continuous video instead of just a single frame. And another e-mail with further clarification:
Date: Mon, 12 May 2003 20:56:24 +0300 (EEST)
From: Tuukka Toivonen <tuukkat@ee.oulu.fi>
To: David Taylor <knet@mailandnews.com>
Subject: Re: [Qce-ga-devel] brightness problem
On Mon, 12 May 2003, David Taylor wrote:
>realise it was the driver. Now I'm confused. I was taking
>a snapshot every minute and had monitored the results for at
>least ten minutes. They didn't seem to be getting brighter.
The program probably does
(1) open camera
(2) take snapshot
(3) close camera
(4) wait a minute
(5) loop to (1)
But in this case, because the program always closes the
camera, automatic exposure control doesn't have time to
adapt into brightness (it can adapt only when the device is
opened... otherwise it would waste CPU time for adaptation even
if no program would be using the camera)
If you aren't using "keepsettings=1", the brightness is reset
to default value at (1) anyway.
There are some programs that do
(1) open camera
(2) take snapshot
(3) wait a minute
(4) loop to (2)
this should work better (but technically the first way is better
so the driver should be fixed instead... but it's not very easy)
>> you can disable the automatic exposure control (insmod quickcam.o
>> keepsettings=1 adaptive=0) and set manually good initial conditions
>> (qcset -b xx -c yy).
>
>I guess this is useful in an environment that is artificially
>lit. Is it possible to load the module with automatic exposure
>control *and* set the initial exposure manually?
Hmm... i think not. Maybe that could be added. But if you use
"keepsettings=1", you could first run for a few seconds a video
capture program and throw the video away. This would set a good
brightness level. Then you could run your snapshot program,
and the good brightness level should still be in effect.
>> It also has option to wait in the beginning until the
>> brightness has settled (settle=1) but this likely isn't
>> working very well.
>By "wait" do you mean the driver will not stream data until
>the brightness has settled?
Yes, in theory. Some applications (xawtv) may get confused if the
camera doesn't deliver data for a long time. But the option even
then doesn't seem to work very well. It needs to be fixed.
|