xref: /linux/Documentation/admin-guide/media/philips.rst (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
1*32e2eae2SMauro Carvalho Chehab.. SPDX-License-Identifier: GPL-2.0
2*32e2eae2SMauro Carvalho Chehab
3*32e2eae2SMauro Carvalho ChehabPhilips webcams (pwc driver)
4*32e2eae2SMauro Carvalho Chehab============================
5*32e2eae2SMauro Carvalho Chehab
6*32e2eae2SMauro Carvalho ChehabThis file contains some additional information for the Philips and OEM webcams.
7*32e2eae2SMauro Carvalho ChehabE-mail: webcam@smcc.demon.nl                        Last updated: 2004-01-19
8*32e2eae2SMauro Carvalho ChehabSite: http://www.smcc.demon.nl/webcam/
9*32e2eae2SMauro Carvalho Chehab
10*32e2eae2SMauro Carvalho ChehabAs of this moment, the following cameras are supported:
11*32e2eae2SMauro Carvalho Chehab
12*32e2eae2SMauro Carvalho Chehab * Philips PCA645
13*32e2eae2SMauro Carvalho Chehab * Philips PCA646
14*32e2eae2SMauro Carvalho Chehab * Philips PCVC675
15*32e2eae2SMauro Carvalho Chehab * Philips PCVC680
16*32e2eae2SMauro Carvalho Chehab * Philips PCVC690
17*32e2eae2SMauro Carvalho Chehab * Philips PCVC720/40
18*32e2eae2SMauro Carvalho Chehab * Philips PCVC730
19*32e2eae2SMauro Carvalho Chehab * Philips PCVC740
20*32e2eae2SMauro Carvalho Chehab * Philips PCVC750
21*32e2eae2SMauro Carvalho Chehab * Askey VC010
22*32e2eae2SMauro Carvalho Chehab * Creative Labs Webcam 5
23*32e2eae2SMauro Carvalho Chehab * Creative Labs Webcam Pro Ex
24*32e2eae2SMauro Carvalho Chehab * Logitech QuickCam 3000 Pro
25*32e2eae2SMauro Carvalho Chehab * Logitech QuickCam 4000 Pro
26*32e2eae2SMauro Carvalho Chehab * Logitech QuickCam Notebook Pro
27*32e2eae2SMauro Carvalho Chehab * Logitech QuickCam Zoom
28*32e2eae2SMauro Carvalho Chehab * Logitech QuickCam Orbit
29*32e2eae2SMauro Carvalho Chehab * Logitech QuickCam Sphere
30*32e2eae2SMauro Carvalho Chehab * Samsung MPC-C10
31*32e2eae2SMauro Carvalho Chehab * Samsung MPC-C30
32*32e2eae2SMauro Carvalho Chehab * Sotec Afina Eye
33*32e2eae2SMauro Carvalho Chehab * AME CU-001
34*32e2eae2SMauro Carvalho Chehab * Visionite VCS-UM100
35*32e2eae2SMauro Carvalho Chehab * Visionite VCS-UC300
36*32e2eae2SMauro Carvalho Chehab
37*32e2eae2SMauro Carvalho ChehabThe main webpage for the Philips driver is at the address above. It contains
38*32e2eae2SMauro Carvalho Chehaba lot of extra information, a FAQ, and the binary plugin 'PWCX'. This plugin
39*32e2eae2SMauro Carvalho Chehabcontains decompression routines that allow you to use higher image sizes and
40*32e2eae2SMauro Carvalho Chehabframerates; in addition the webcam uses less bandwidth on the USB bus (handy
41*32e2eae2SMauro Carvalho Chehabif you want to run more than 1 camera simultaneously). These routines fall
42*32e2eae2SMauro Carvalho Chehabunder a NDA, and may therefore not be distributed as source; however, its use
43*32e2eae2SMauro Carvalho Chehabis completely optional.
44*32e2eae2SMauro Carvalho Chehab
45*32e2eae2SMauro Carvalho ChehabYou can build this code either into your kernel, or as a module. I recommend
46*32e2eae2SMauro Carvalho Chehabthe latter, since it makes troubleshooting a lot easier. The built-in
47*32e2eae2SMauro Carvalho Chehabmicrophone is supported through the USB Audio class.
48*32e2eae2SMauro Carvalho Chehab
49*32e2eae2SMauro Carvalho ChehabWhen you load the module you can set some default settings for the
50*32e2eae2SMauro Carvalho Chehabcamera; some programs depend on a particular image-size or -format and
51*32e2eae2SMauro Carvalho Chehabdon't know how to set it properly in the driver. The options are:
52*32e2eae2SMauro Carvalho Chehab
53*32e2eae2SMauro Carvalho Chehabsize
54*32e2eae2SMauro Carvalho Chehab   Can be one of 'sqcif', 'qsif', 'qcif', 'sif', 'cif' or
55*32e2eae2SMauro Carvalho Chehab   'vga', for an image size of resp. 128x96, 160x120, 176x144,
56*32e2eae2SMauro Carvalho Chehab   320x240, 352x288 and 640x480 (of course, only for those cameras that
57*32e2eae2SMauro Carvalho Chehab   support these resolutions).
58*32e2eae2SMauro Carvalho Chehab
59*32e2eae2SMauro Carvalho Chehabfps
60*32e2eae2SMauro Carvalho Chehab   Specifies the desired framerate. Is an integer in the range of 4-30.
61*32e2eae2SMauro Carvalho Chehab
62*32e2eae2SMauro Carvalho Chehabfbufs
63*32e2eae2SMauro Carvalho Chehab   This parameter specifies the number of internal buffers to use for storing
64*32e2eae2SMauro Carvalho Chehab   frames from the cam. This will help if the process that reads images from
65*32e2eae2SMauro Carvalho Chehab   the cam is a bit slow or momentarily busy. However, on slow machines it
66*32e2eae2SMauro Carvalho Chehab   only introduces lag, so choose carefully. The default is 3, which is
67*32e2eae2SMauro Carvalho Chehab   reasonable. You can set it between 2 and 5.
68*32e2eae2SMauro Carvalho Chehab
69*32e2eae2SMauro Carvalho Chehabmbufs
70*32e2eae2SMauro Carvalho Chehab   This is an integer between 1 and 10. It will tell the module the number of
71*32e2eae2SMauro Carvalho Chehab   buffers to reserve for mmap(), VIDIOCCGMBUF, VIDIOCMCAPTURE and friends.
72*32e2eae2SMauro Carvalho Chehab   The default is 2, which is adequate for most applications (double
73*32e2eae2SMauro Carvalho Chehab   buffering).
74*32e2eae2SMauro Carvalho Chehab
75*32e2eae2SMauro Carvalho Chehab   Should you experience a lot of 'Dumping frame...' messages during
76*32e2eae2SMauro Carvalho Chehab   grabbing with a tool that uses mmap(), you might want to increase if.
77*32e2eae2SMauro Carvalho Chehab   However, it doesn't really buffer images, it just gives you a bit more
78*32e2eae2SMauro Carvalho Chehab   slack when your program is behind. But you need a multi-threaded or
79*32e2eae2SMauro Carvalho Chehab   forked program to really take advantage of these buffers.
80*32e2eae2SMauro Carvalho Chehab
81*32e2eae2SMauro Carvalho Chehab   The absolute maximum is 10, but don't set it too high!  Every buffer takes
82*32e2eae2SMauro Carvalho Chehab   up 460 KB of RAM, so unless you have a lot of memory setting this to
83*32e2eae2SMauro Carvalho Chehab   something more than 4 is an absolute waste.  This memory is only
84*32e2eae2SMauro Carvalho Chehab   allocated during open(), so nothing is wasted when the camera is not in
85*32e2eae2SMauro Carvalho Chehab   use.
86*32e2eae2SMauro Carvalho Chehab
87*32e2eae2SMauro Carvalho Chehabpower_save
88*32e2eae2SMauro Carvalho Chehab   When power_save is enabled (set to 1), the module will try to shut down
89*32e2eae2SMauro Carvalho Chehab   the cam on close() and re-activate on open(). This will save power and
90*32e2eae2SMauro Carvalho Chehab   turn off the LED. Not all cameras support this though (the 645 and 646
91*32e2eae2SMauro Carvalho Chehab   don't have power saving at all), and some models don't work either (they
92*32e2eae2SMauro Carvalho Chehab   will shut down, but never wake up). Consider this experimental. By
93*32e2eae2SMauro Carvalho Chehab   default this option is disabled.
94*32e2eae2SMauro Carvalho Chehab
95*32e2eae2SMauro Carvalho Chehabcompression (only useful with the plugin)
96*32e2eae2SMauro Carvalho Chehab   With this option you can control the compression factor that the camera
97*32e2eae2SMauro Carvalho Chehab   uses to squeeze the image through the USB bus. You can set the
98*32e2eae2SMauro Carvalho Chehab   parameter between 0 and 3::
99*32e2eae2SMauro Carvalho Chehab
100*32e2eae2SMauro Carvalho Chehab     0 = prefer uncompressed images; if the requested mode is not available
101*32e2eae2SMauro Carvalho Chehab	 in an uncompressed format, the driver will silently switch to low
102*32e2eae2SMauro Carvalho Chehab	 compression.
103*32e2eae2SMauro Carvalho Chehab     1 = low compression.
104*32e2eae2SMauro Carvalho Chehab     2 = medium compression.
105*32e2eae2SMauro Carvalho Chehab     3 = high compression.
106*32e2eae2SMauro Carvalho Chehab
107*32e2eae2SMauro Carvalho Chehab   High compression takes less bandwidth of course, but it could also
108*32e2eae2SMauro Carvalho Chehab   introduce some unwanted artefacts. The default is 2, medium compression.
109*32e2eae2SMauro Carvalho Chehab   See the FAQ on the website for an overview of which modes require
110*32e2eae2SMauro Carvalho Chehab   compression.
111*32e2eae2SMauro Carvalho Chehab
112*32e2eae2SMauro Carvalho Chehab   The compression parameter does not apply to the 645 and 646 cameras
113*32e2eae2SMauro Carvalho Chehab   and OEM models derived from those (only a few). Most cams honour this
114*32e2eae2SMauro Carvalho Chehab   parameter.
115*32e2eae2SMauro Carvalho Chehab
116*32e2eae2SMauro Carvalho Chehableds
117*32e2eae2SMauro Carvalho Chehab   This settings takes 2 integers, that define the on/off time for the LED
118*32e2eae2SMauro Carvalho Chehab   (in milliseconds). One of the interesting things that you can do with
119*32e2eae2SMauro Carvalho Chehab   this is let the LED blink while the camera is in use. This::
120*32e2eae2SMauro Carvalho Chehab
121*32e2eae2SMauro Carvalho Chehab     leds=500,500
122*32e2eae2SMauro Carvalho Chehab
123*32e2eae2SMauro Carvalho Chehab   will blink the LED once every second. But with::
124*32e2eae2SMauro Carvalho Chehab
125*32e2eae2SMauro Carvalho Chehab     leds=0,0
126*32e2eae2SMauro Carvalho Chehab
127*32e2eae2SMauro Carvalho Chehab   the LED never goes on, making it suitable for silent surveillance.
128*32e2eae2SMauro Carvalho Chehab
129*32e2eae2SMauro Carvalho Chehab   By default the camera's LED is on solid while in use, and turned off
130*32e2eae2SMauro Carvalho Chehab   when the camera is not used anymore.
131*32e2eae2SMauro Carvalho Chehab
132*32e2eae2SMauro Carvalho Chehab   This parameter works only with the ToUCam range of cameras (720, 730, 740,
133*32e2eae2SMauro Carvalho Chehab   750) and OEMs. For other cameras this command is silently ignored, and
134*32e2eae2SMauro Carvalho Chehab   the LED cannot be controlled.
135*32e2eae2SMauro Carvalho Chehab
136*32e2eae2SMauro Carvalho Chehab   Finally: this parameters does not take effect UNTIL the first time you
137*32e2eae2SMauro Carvalho Chehab   open the camera device. Until then, the LED remains on.
138*32e2eae2SMauro Carvalho Chehab
139*32e2eae2SMauro Carvalho Chehabdev_hint
140*32e2eae2SMauro Carvalho Chehab   A long standing problem with USB devices is their dynamic nature: you
141*32e2eae2SMauro Carvalho Chehab   never know what device a camera gets assigned; it depends on module load
142*32e2eae2SMauro Carvalho Chehab   order, the hub configuration, the order in which devices are plugged in,
143*32e2eae2SMauro Carvalho Chehab   and the phase of the moon (i.e. it can be random). With this option you
144*32e2eae2SMauro Carvalho Chehab   can give the driver a hint as to what video device node (/dev/videoX) it
145*32e2eae2SMauro Carvalho Chehab   should use with a specific camera. This is also handy if you have two
146*32e2eae2SMauro Carvalho Chehab   cameras of the same model.
147*32e2eae2SMauro Carvalho Chehab
148*32e2eae2SMauro Carvalho Chehab   A camera is specified by its type (the number from the camera model,
149*32e2eae2SMauro Carvalho Chehab   like PCA645, PCVC750VC, etc) and optionally the serial number (visible
150*32e2eae2SMauro Carvalho Chehab   in /sys/kernel/debug/usb/devices). A hint consists of a string with the
151*32e2eae2SMauro Carvalho Chehab   following format::
152*32e2eae2SMauro Carvalho Chehab
153*32e2eae2SMauro Carvalho Chehab      [type[.serialnumber]:]node
154*32e2eae2SMauro Carvalho Chehab
155*32e2eae2SMauro Carvalho Chehab   The square brackets mean that both the type and the serialnumber are
156*32e2eae2SMauro Carvalho Chehab   optional, but a serialnumber cannot be specified without a type (which
157*32e2eae2SMauro Carvalho Chehab   would be rather pointless). The serialnumber is separated from the type
158*32e2eae2SMauro Carvalho Chehab   by a '.'; the node number by a ':'.
159*32e2eae2SMauro Carvalho Chehab
160*32e2eae2SMauro Carvalho Chehab   This somewhat cryptic syntax is best explained by a few examples::
161*32e2eae2SMauro Carvalho Chehab
162*32e2eae2SMauro Carvalho Chehab     dev_hint=3,5              The first detected cam gets assigned
163*32e2eae2SMauro Carvalho Chehab			       /dev/video3, the second /dev/video5. Any
164*32e2eae2SMauro Carvalho Chehab			       other cameras will get the first free
165*32e2eae2SMauro Carvalho Chehab			       available slot (see below).
166*32e2eae2SMauro Carvalho Chehab
167*32e2eae2SMauro Carvalho Chehab     dev_hint=645:1,680:2      The PCA645 camera will get /dev/video1,
168*32e2eae2SMauro Carvalho Chehab			       and a PCVC680 /dev/video2.
169*32e2eae2SMauro Carvalho Chehab
170*32e2eae2SMauro Carvalho Chehab     dev_hint=645.0123:3,645.4567:0	The PCA645 camera with serialnumber
171*32e2eae2SMauro Carvalho Chehab					0123 goes to /dev/video3, the same
172*32e2eae2SMauro Carvalho Chehab					camera model with the 4567 serial
173*32e2eae2SMauro Carvalho Chehab					gets /dev/video0.
174*32e2eae2SMauro Carvalho Chehab
175*32e2eae2SMauro Carvalho Chehab     dev_hint=750:1,4,5,6       The PCVC750 camera will get /dev/video1, the
176*32e2eae2SMauro Carvalho Chehab				next 3 Philips cams will use /dev/video4
177*32e2eae2SMauro Carvalho Chehab				through /dev/video6.
178*32e2eae2SMauro Carvalho Chehab
179*32e2eae2SMauro Carvalho Chehab   Some points worth knowing:
180*32e2eae2SMauro Carvalho Chehab
181*32e2eae2SMauro Carvalho Chehab   - Serialnumbers are case sensitive and must be written full, including
182*32e2eae2SMauro Carvalho Chehab     leading zeroes (it's treated as a string).
183*32e2eae2SMauro Carvalho Chehab   - If a device node is already occupied, registration will fail and
184*32e2eae2SMauro Carvalho Chehab     the webcam is not available.
185*32e2eae2SMauro Carvalho Chehab   - You can have up to 64 video devices; be sure to make enough device
186*32e2eae2SMauro Carvalho Chehab     nodes in /dev if you want to spread the numbers.
187*32e2eae2SMauro Carvalho Chehab     After /dev/video9 comes /dev/video10 (not /dev/videoA).
188*32e2eae2SMauro Carvalho Chehab   - If a camera does not match any dev_hint, it will simply get assigned
189*32e2eae2SMauro Carvalho Chehab     the first available device node, just as it used to be.
190*32e2eae2SMauro Carvalho Chehab
191*32e2eae2SMauro Carvalho Chehabtrace
192*32e2eae2SMauro Carvalho Chehab   In order to better detect problems, it is now possible to turn on a
193*32e2eae2SMauro Carvalho Chehab   'trace' of some of the calls the module makes; it logs all items in your
194*32e2eae2SMauro Carvalho Chehab   kernel log at debug level.
195*32e2eae2SMauro Carvalho Chehab
196*32e2eae2SMauro Carvalho Chehab   The trace variable is a bitmask; each bit represents a certain feature.
197*32e2eae2SMauro Carvalho Chehab   If you want to trace something, look up the bit value(s) in the table
198*32e2eae2SMauro Carvalho Chehab   below, add the values together and supply that to the trace variable.
199*32e2eae2SMauro Carvalho Chehab
200*32e2eae2SMauro Carvalho Chehab   ====== ======= ================================================ =======
201*32e2eae2SMauro Carvalho Chehab   Value  Value   Description					   Default
202*32e2eae2SMauro Carvalho Chehab   (dec)  (hex)
203*32e2eae2SMauro Carvalho Chehab   ====== ======= ================================================ =======
204*32e2eae2SMauro Carvalho Chehab       1    0x1   Module initialization; this will log messages       On
205*32e2eae2SMauro Carvalho Chehab		  while loading and unloading the module
206*32e2eae2SMauro Carvalho Chehab
207*32e2eae2SMauro Carvalho Chehab       2    0x2   probe() and disconnect() traces                     On
208*32e2eae2SMauro Carvalho Chehab
209*32e2eae2SMauro Carvalho Chehab       4    0x4   Trace open() and close() calls                      Off
210*32e2eae2SMauro Carvalho Chehab
211*32e2eae2SMauro Carvalho Chehab       8    0x8   read(), mmap() and associated ioctl() calls         Off
212*32e2eae2SMauro Carvalho Chehab
213*32e2eae2SMauro Carvalho Chehab      16   0x10   Memory allocation of buffers, etc.                  Off
214*32e2eae2SMauro Carvalho Chehab
215*32e2eae2SMauro Carvalho Chehab      32   0x20   Showing underflow, overflow and Dumping frame       On
216*32e2eae2SMauro Carvalho Chehab		  messages
217*32e2eae2SMauro Carvalho Chehab
218*32e2eae2SMauro Carvalho Chehab      64   0x40   Show viewport and image sizes                       Off
219*32e2eae2SMauro Carvalho Chehab
220*32e2eae2SMauro Carvalho Chehab     128   0x80   PWCX debugging                                      Off
221*32e2eae2SMauro Carvalho Chehab   ====== ======= ================================================ =======
222*32e2eae2SMauro Carvalho Chehab
223*32e2eae2SMauro Carvalho Chehab   For example, to trace the open() & read() functions, sum 8 + 4 = 12,
224*32e2eae2SMauro Carvalho Chehab   so you would supply trace=12 during insmod or modprobe. If
225*32e2eae2SMauro Carvalho Chehab   you want to turn the initialization and probing tracing off, set trace=0.
226*32e2eae2SMauro Carvalho Chehab   The default value for trace is 35 (0x23).
227*32e2eae2SMauro Carvalho Chehab
228*32e2eae2SMauro Carvalho Chehab
229*32e2eae2SMauro Carvalho Chehab
230*32e2eae2SMauro Carvalho ChehabExample::
231*32e2eae2SMauro Carvalho Chehab
232*32e2eae2SMauro Carvalho Chehab     # modprobe pwc size=cif fps=15 power_save=1
233*32e2eae2SMauro Carvalho Chehab
234*32e2eae2SMauro Carvalho ChehabThe fbufs, mbufs and trace parameters are global and apply to all connected
235*32e2eae2SMauro Carvalho Chehabcameras. Each camera has its own set of buffers.
236*32e2eae2SMauro Carvalho Chehab
237*32e2eae2SMauro Carvalho Chehabsize and fps only specify defaults when you open() the device; this is to
238*32e2eae2SMauro Carvalho Chehabaccommodate some tools that don't set the size. You can change these
239*32e2eae2SMauro Carvalho Chehabsettings after open() with the Video4Linux ioctl() calls. The default of
240*32e2eae2SMauro Carvalho Chehabdefaults is QCIF size at 10 fps.
241*32e2eae2SMauro Carvalho Chehab
242*32e2eae2SMauro Carvalho ChehabThe compression parameter is semiglobal; it sets the initial compression
243*32e2eae2SMauro Carvalho Chehabpreference for all camera's, but this parameter can be set per camera with
244*32e2eae2SMauro Carvalho Chehabthe VIDIOCPWCSCQUAL ioctl() call.
245*32e2eae2SMauro Carvalho Chehab
246*32e2eae2SMauro Carvalho ChehabAll parameters are optional.
247*32e2eae2SMauro Carvalho Chehab
248