📄 readme
字号:
CONFIG_PARPORT=yCONFIG_PARPORT_PC=yCONFIG_PARPORT_PC_FIFO=yCONFIG_PARPORT_1284=yand/orCONFIG_USB=yCONFIG_USB_[OHCI/UHCI/UHCI_ALT/EHCI_HCD]=yThe cpia-stuff is in the section 'Character devices -> Video For Linux'.CONFIG_VIDEO_DEV=yCONFIG_VIDEO_CPIA=yand (as needed):CONFIG_VIDEO_CPIA_PP=yCONFIG_VIDEO_CPIA_USB=yFor camera control using /proc/cpia/video<n>,CONFIG_PROC_FS=yThe kernel-linked cpia_pp driver supports boot-parameter options for selecting parallel ports: You can give these at the LILO-prompt,or specify them in lilo.conf, with an append-line: append="cpia_pp=<...>",where <...> is one of: [ none, auto, parport <n>], where<n> is the desired parport number.To use fast DMA/irq ECP parallel port modes, you will need to tell the kernel upon boot time the hardware configuration of the parport. You can give the boot-parameter at the LILO-prompt or specify it in lilo.conf. I use the followingappend-line in lilo.conf: append="parport=0x378,7,3"See Documentation/parport.txt for more information about theconfiguration of the parport and the values given above. Do not simplyuse the values given above.Sharing the port with lp.================================.By default, the driver lp will register itself for all availableparallel ports. Presumably, no printer is sharing a port with theCPiA camera. (The CPiA does have provision for a "pass-through" mode,but none of the parallel-port CPiA webcams appear to have a pass-throughport, so the driver does not implement this feature; if it is infact needed, the CPiA datasheet and the GPL'd Windows driver availableat the website have the information on how to do it.) In principleit doesn't matter that lp also is registered on the port, but if itis causing difficulties, or stopping the cpia_pp driver fromclaiming the port, use lp's boot-time or module-load-timeoptions to prevent it from using the same port as the CPiA.(For example, "options lp parport=auto" in the modules.conf file)Using/controlling CPiA cameras.=================================The camera is mainly controlled by a V4L applicationusing the Video4Linux interface, but extra driver settingsnot accessible this way can be set by writing to /proc/cpia/video*.A camera attached as /dev/video0 is controlled by /proc/cpia/video0,which also gives information about the camera state:Only the user owning the V4L process that "owns" the cameracan write to the corresponding /proc/cpia/video* file.The variables listed as "read-only" are informational and cannot bechanged by the user. The "read-write" variables can be changed:For example "compression_mode" has an entryread-write----------------------- current min max default commentcompression_mode: auto none,auto,manual autoThis means the current setting is the default (startup) value of"auto", but the ranges of possible values is "none,auto,manual".In "auto" mode, the camera adjusts the compression automatically,in "none" mode it is disabled. In "manual" mode the user can setthe compression parameters using the /proc/cpia/video* interface. To change the compression mode of a camera attached to /dev/video0,mode, type at a command line:"echo compression_mode: manual > /proc/cpia/video0"A convenient gtk-python-based graphical application for controllingthe camera in this way is "cpia-control", by Peter Pregler, availableat http://sourveforge.net/projects/webcam.The camera parameters controllable via the /proc interface,and their ranges, are given below. Only a limited subset of these arecontrollable by the latest cpia-control (v0.41) at this time; these aremarked by "X" in the last column. Other parameters are unlikely to bechanged by regular users. See the cpia Developer's Guide [4] for moredetails.----------------------- min max default comment cpia-control?usb_alt_setting: 1 3 3 (usb only) Xecp_timing slow normal normal (parport only*) Xbrightness: 0 100 50 Xcontrast: 0 96 48 steps of 8 Xsaturation: 0 100 50 Xsensor_fps: 3 30 15 Xstream_start_line: 0 288 240sub_sample: 420 422 422 Xyuv_order: YUYV UYVY YUYV Xcolor_balance_mode: manual auto auto Xred_gain: 0 212 32 Xgreen_gain: 0 212 6 Xblue_gain: 0 212 92 Xmax_gain: 1 8 2 1,2,4 or 8 ** Xexposure_mode: manual auto auto Xcentre_weight: off on on Xgain: 1 max_gain 1 1,2,4,8 possible Xfine_exp: 0 510 0 Xcoarse_exp: 0 302 185 Xred_comp: 220 255 220green1_comp: 214 255 214green2_comp: 214 255 214blue_comp: 230 255 230apcor_gain1: 0x0 0xff 0x1capcor_gain2: 0x0 0xff 0x1aapcor_gain4: 0x0 0xff 0x2dapcor_gain8: 0x0 0xff 0x2avl_offset_gain1: 0 255 24vl_offset_gain2: 0 255 28vl_offset_gain4: 0 255 30vl_offset_gain8: 0 255 30flicker_control: off on off Xmains_frequency: 50 60 50 only 50/60 Xallowable_overexposure: auto 255 autocompression_mode: none,auto,manual auto Xdecimation_enable: off off on off Xcompression_target: framerate quality quality Xtarget_framerate: 1 30 15 Xtarget_quality: 1 64 5 Xy_threshold: 0 31 6 Xuv_threshold: 0 31 6 Xhysteresis: 0 255 3threshold_max: 0 255 11small_step: 0 255 1large_step: 0 255 3decimation_hysteresis: 0 255 2fr_diff_step_thresh: 0 255 5q_diff_step_thresh: 0 255 3decimation_thresh_mod: 0 255 2toplight: off on off (QX3 microscope only) Xbottomlight: off on off (QX3 microscope only) X* The "ecp timing" setting switches between a "normal" and a "slow" mode forECP image streams from the camera. Use the slow mode if too many framesare being lost. This setting will not appear unless either hardwareECP or software ECP (TRISTATE) parallel port modes are available.** An early version of the CPiA chip (v1.02) has a bug in its firmware; the driver works around this by imposing lower limits on max_gain and other settings when this version of the CPiA chip is detected. Multiple USB cameras on the same hub, and the "usb_alt_setting".===============================================================The "usb_alt setting" controls USB bandwidth use by USB cameras by settingthe maximum USB Packet Size for transmission of streamed images. Thethree "alternate interface settings" and the corresponding Max PacketSize arealt 1: 448alt 2: 704alt 3: 960 (default)If two or more cameras are attached to the _same_ USB hub, they can onlywork if both are running with reduced USB PacketSize. There is no problemif they are on different hubs, but if a camera is started at alt setting 3,the hub interference will cause another cpia device attached to the same hub to get unregistered, as if its cable had been brutally yanked out! Until this problem is fixed, here are three possible workarounds:(1) If you are using the module form of the driver, load the cpiamodule with module option "usb_alt=2" or "usb_alt=1". (see above).(2) If you compile the module into the kernel, edit cpia.h, andchange the line "#define DEFAULT_USB_ALT_SETTING 3" to a lower value,and rebuild the kernel.(3) If you can't use either of these strategies, don't despair! Just open the first camera (say, on /dev/video0) with a Video4Linux application, so you become the temporary owner of /proc/cpia/video0. Now change the alt setting with cpia-control v0.4.1 orlater, or by typing "echo usb_alt_setting: 2 > /proc/cpia/video0". Now close the V4L application; you will no longer be able to write to /proc/cpia/video0 until you restart the application, but the new alt=2 setting will be remembered as long as the camera remains attached. Now start the second camera (which will correspond to a different video device, say /dev/video1). Next reduce its alt setting to alt=2. Now you can safely reopen the first camera (/dev/video0) which will now start with the remembered alt=2 setting. Two USB cameras coexist happilywhen both are using alt=2. More than two on the same hub may requirealt=1 settings. Non-cpia webcams may have similar ways to reduce theUSB Packet size: e.g., the ov511 driver has a "cams=n" module parameterwhich selects among the possible "alt" settings of those USB devices.The usb alt setting has no effect on parallel-port cameras.---------------------------------------------------------------------DRIVER FEATURES:- mmap/read v4l-interface (but no overlay)- image formats: CIF/QCIF, SIF/QSIF, various others used by isabel; note: all sizes except CIF/QCIF are implemented by clipping, i.e. pixels are not uploaded from the camera- palettes: VIDEO_PALETTE_GRAY, VIDEO_PALETTE_RGB565, VIDEO_PALETTE_RGB555, VIDEO_PALETTE_RGB24, VIDEO_PALETTE_RGB32, VIDEO_PALETTE_YUYV, VIDEO_PALETTE_UYVY, VIDEO_PALETTE_YUV422- state information (color balance, exposure, ...) is preserved between device opens- complete control over camera via proc-interface (_all_ camera settings are supported), there is also a python-gtk application available for this [3]- works under SMP (but the driver is completely serialized and synchronous) so you get no benefit from SMP, but at least it does not crash your box- might work for non-Intel architecture, let us know about this---------------------------------------------------------------------------TESTED APPLICATIONS: (TODO: versions referred to here need updating) - a simple test application based on Xt is available at [3]- another test-application based on gqcam-0.4 (uses GTK)- gqcam-0.6 should work (also gqcam-0.9, with a patch available from http://sourceforge.net/projects/webcam.)- xawtv-3.x (also the webcam software)- xawtv-2.46- w3cam (cgi-interface and vidcat, e.g. you may try out 'vidcat |xv -maxpect -root -quit +noresetroot -rmode 5 -')- vic, the MBONE video conferencing tool (version 2.8ucl4-1)- isabel 3R4beta (barely working, but AFAICT all the problems are on their side)- camserv-0.40See [3] for pointers to v4l-applications.---------------------------------------------------------------------------KNOWN PROBLEMS:- some applications do not handle the image format correctly, you will see strange horizontal stripes instead of a nice picture -> make sure your application does use a supported image size or queries the driver for the actually used size (reason behind this: the camera cannot provide any image format, so if size NxM is requested the driver will use a format to the closest fitting N1xM1, the application should now query for this granted size, most applications do not).- all the todo ;)- if there is not enough light and the picture is too dark try to adjust the SetSensorFPS setting, automatic frame rate adjustment has its price- do not try out isabel 3R4beta (built 135), you will be disappointed---------------------------------------------------------------------------TODO: (but driver development is not currently active...). - multiple camera support (struct camera or something) - This should work, but hasn't been tested yet (OK, it works, but if a USB camera is streaming video, and another USB camera is attached to the same hub and run at alt=3, it causes the first camera to get deregistered.....) (Now done).- architecture independence?- SMP-safe asynchronous mmap interface (Done ?)- nibble mode for old parport interfaces (Done)- streaming capture, this should give a performance gain- DMA parport access in 2.4 and later kernels (Done)- conversion to video4linux-2 ---------------------------------------------------------------------------IMPLEMENTATION NOTES:The camera can act in two modes, streaming or grabbing. Right now apolling grab-scheme is used. Maybe interrupt driven streaming will beused for a asynchronous mmap interface in the next major release of thedriver. This might give a better frame rate.---------------------------------------------------------------------------THANKS (in no particular order):- Scott J. Bertin <sbertin@mindspring.com> for cleanups, the proc-filesystem and much more- Henry Bruce <whb@vvl.co.uk> for providing developers information about the CPiA chip, I wish all companies would treat Linux as seriously- Karoly Erdei <Karoly.Erdei@risc.uni-linz.ac.at> and RISC-Linz for being my boss ;) resp. my employer and for providing me the hardware and allow me to devote some working time to this project- Manuel J. Petit de Gabriel <mpetit@dit.upm.es> for providing help with Isabel (http://isabel.dit.upm.es/)- Bas Huisman <bhuism@cs.utwente.nl> for writing the initial parport code- Jarl Totland <Jarl.Totland@bdc.no> for setting up the mailing list and maintaining the web-server[3]- Chris Whiteford <Chris@informinteractive.com> for fixes related to the 1.02 firmware- special kudos to all the tester whose machines crashed and/or will crash. :)---------------------------------------------------------------------------REFERENCES 1. http://www.risc.uni-linz.ac.at/people/ppregler mailto:Peter_Pregler@email.com 2. see the file COPYING in the top directory of the kernel tree 3. http://webcam.sourceforge.net/ 4. CPiA documentation is avaliable at [3]. 5. In December 2002 duncan_haldane@users.sourceforge.net was maintaining the driver. The original authors do not appear to be active.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -