📄 readme
字号:
Notes for use with 2.4 kernels.****************************************************IMPORTANT: For users of RedHat 7.x/8.x 2.4.18 kernels (and other 2.4.18 kernels patched to provide the new Video4Linux interface - e.g., 2.4.18-ac* kernels)Changes (in the Linux-2.4.19 kernel) are patched into these 2.4.18kernels. If you have such a kernel, and you disconnect your CPiAcamera while it is working, a deadlock that can eventually crash yoursystem will occur. To fix this, apply the patch redhat-2.4.18-kernel-videodev.patchto drivers/media/video/videodev.c(No action is necessary for standard 2.4.18 kernels, or any otherkernel release, though if you also use non-cpia Video4Linux drivers in2.4.19 or 2.4.20 kernels, it's a good idea to apply this patch...)**************************************************** The cpia driver included in the 2.4.x series Linux kernels (x <=20) is an older version that does not yet include all the features and improvementsfound in this driver available at http://webcam.sourceforge.net.Some earlier 2.4.x. kernels have a cpia driver with disabled cameracontrol so cpia-control cannot be used, or do not support featuresof the Intel Play QX3 microscope, and do not support DMA access by fastECP parallel ports.[The support for DMA access for parallel port cpia cameras is now available here, thanks to Blaise Gassend.]To use with 2.4.x kernels:(a) compile the kernel with cpia support. Activate this in themultimedia devices/video for linux section, select CPiA Video for Linux (CONFIG_VIDEO_CPIA)and, as appropriate, CPiA Parallel Port lowlevel support (CONFIG_VIDEO_CPIA_PP) CPiA USB lowlevel support (CONFIG_VIDEO_CPIA_USB)(b) replace the files cpia.c cpia_usb.c cpia_pp.c cpia.h in thekernel source subdirectory drivers/media/video/with the ones from here (in the subdirectory "module"), and recompile.If the kernel source is in /usr/src/linux-2.4/....go to .../drivers/media/video/rename the kernel cpia files to cpia.c.orig, cpia.h.orig, etc. and copy the new versions into this directory. Then cd to /usr/src/linux-2.4, andmake modulesYou can now do make modules_install or (to avoid messing with your system too much) cp drivers/media/video/cpia*o /lib/modules/`uname -r`/kernel/drivers/media/videodepmod -aeThis should replace the old drivers with the new ones. ---Using the CPiA camera: (see also the appended file below ("cpia.txt"))If you compiled the drivers as modules, load them:modprobe cpia_usb or modprobe cpia_pp as appropriate for your camera. start a v4l viewer, like gqcam (see below)If the camera is at /dev/video0, cat /proc/cpia/video0 to see what you can control:e.g.,echo color_balance_mode: manual > /proc/cpia/video0echo toplight: on > /proc/cpia/video0 (this is for the QX3 microscope only)The program cpia-control by Peter Prengler, available at the sourceforge site, is a graphical interface to (most) of these features,using /proc/cpia/video[n]. It is now at a cpia-control-0.4 release.I found gqcam-0.9 works well with the cpia drivers(get it at http://cse.unl.edu/~cluening/gqcam/ ), but it needs the following patch===========begin patch===============================diff -uNr gqcam-0.9/gqcam.c gqcam-0.9-patched/gqcam.c--- gqcam-0.9/gqcam.c Tue Nov 7 11:52:06 2000+++ gqcam-0.9-patched/gqcam.c Tue Dec 17 04:03:34 2002@@ -55,7 +55,7 @@ camera->savetype = PNG; camera->capture = 1; camera->dev = 0;- strcpy(camera->devname, "/dev/video");+ strcpy(camera->devname, "/dev/video0"); camera->docked = 1; camera->dump=0; camera->speed_fastest = 0;@@ -96,13 +96,16 @@ ioctl(camera->dev, VIDIOCGWIN, &camera->vid_win); ioctl(camera->dev, VIDIOCGPICT, &camera->vid_pic);- for (i = 0; i < 32; i++) {- vid_clips[i].x = 0;- vid_clips[i].y = 0;- vid_clips[i].width = 0;- vid_clips[i].height = 0;- }+ camera->vid_win.clips = NULL;+ if (camera->vid_caps.type & VID_TYPE_CLIPPING) {+ for (i = 0; i < 32; i++) {+ vid_clips[i].x = 0;+ vid_clips[i].y = 0;+ vid_clips[i].width = 0;+ vid_clips[i].height = 0;+ } camera->vid_win.clips = vid_clips;+ } camera->vid_win.clipcount = 0; if (camera->vid_caps.type & VID_TYPE_MONOCHROME) {@@ -188,13 +191,16 @@ void open_cam(struct Camera *camera) {+ char devname[80]; if((camera->dev<=0)){ camera->dev = open(camera->devname, O_RDWR);- // printf("Opening: %d\n", camera->dev);+ printf("Opening: %s %d\n", camera->devname,camera->dev);+ snprintf(devname,80,"%s",camera->devname); if (camera->dev < 0) {- perror("/dev/video");+ perror(devname); exit(1); }+ print_cam_info(camera); } pthread_mutex_unlock( &camera->iscam_mutex ); }=============end gqcam patch==============================duncan_haldane@users.sourceforge.net2002-05-11--------------------cpia.txt--------------------------------------------This is a video4linux (v4l1) driver for cameras that use the (now obsolete)CPiA PPC2 chipset. Both parallel port and USB-connected cameras are supported.The website for this driver is:http://webcam.sourceforge.nethttp://sourceforge.net/projects/webcamAuthor: [1]Peter Pregler, Linz 2000, published under the [2]GNU GPLThis driver is no longer in active development but is is "low-maintenance"mode[5]: contact the cpia mailing list for maintenance issues. (see http://webcam.sourceforge.net for mailing list details) Recent work on improving USB and parallel port transfer modes has beendone, though. (December 2002).---------------------------------------------------Devices know to be supported by this driver are:(a) Parallel port webcams: Creative Video Blaster WebCam IICVideo-Mail ExpressCU-SeeMe Cam KitDigicom Galileo PlusZoomCamThe driver supports High-speed ECP parallel ports, and will use DMAif available. It now will also support standard IEEE1284 parallel ports,using software emulation of ECP on "BiDirectional" (TRISTATE) ports, or a special enhanced "Nibble" mode on non-Bidirectional PCSPP ports; but these mode have a low transfer rate of about 60KB/s (about onecompressed frame every one or two seconds). The CPiA firmware does notsupport EPP parallel port modes.The source code for the Windows(TM) 9x parallel port driver has been released by the CPiA chip maker STM under the GPL as: http://webcam.sourceforge.net/docs/ppc2.zipand the CPiA Developer's Guide is also available there.(b) USB devices:Intel Play QX3 and QX3+ MicroscopesUSB webcams:Aiptek HyperVcam Fun USB (some use the OV511 chip instead of CPiA!)Creative Video Blaster WebCam IIDigicom Galileo USBDynalink Digital CameraEzonics EZCam (Not Pro or Plus)Microtek EyeStarPace Colour Video CameraSuperCam WonderEyeTCE Netcam 310 USBTerracam USB(Not Pro) Trust SpaceC@m LiteUtobia USB CameraZoomCam---------------------------------------------------------------------------USAGE:General:========1) Make sure you have created the video devices (/dev/video*):- if you have a recent MAKEDEV do a 'cd /dev;./MAKEDEV video'- otherwise do a:cd /devmknod video0 c 81 0Repeat for /dev/video1, /dev/video2 etc as needed.2) Compile the kernel (see below for the list of options to use). If applicable, configure your parport. Reboot.3) If all worked well you should get messages similar to the following (your versions may be different) on the console:V4L-Driver for Vision CPiA based cameras v1.2.2parport0: read2 timeout.parport0: Multimedia device, VLSI Vision Ltd PPC2Parallel port driver for Vision CPiA based camera CPIA Version: 1.20 (2.0) CPIA PnP-ID: 0553:0002:0100 VP-Version: 1.0 0100 1 camera(s) foundBuilding the Driver as modules:============================Make sure you have selected the following kernel options (you canselect all stuff as modules):parallel port:CONFIG_PARPORT=mCONFIG_PARPORT_PC=mCONFIG_PARPORT_1284=yCONFIG_PARPORT_PC_FIFO=y (needed for high-speed ECP modes, if available)usb:CONFIG_USB=mCONFIG_USB_[OHCI/UHCI/UHCI_ALT/EHCI_HCD]=m (as appropiate for your usb)The cpia-stuff is in the section 'Character devices -> Video For Linux'.CONFIG_VIDEO_DEV=mCONFIG_VIDEO_CPIA=malso, depending on whether you have parport or USB cameras (or both):CONFIG_VIDEO_CPIA_PP=mCONFIG_VIDEO_CPIA_USB=mFinally for controlling the camera using the /proc/cpia/video<n> interface you needCONFIG_PROC_FS=yThe cpia module supports the module parameter option:options cpia usb_alt=[1,2,3] (initial "usb alt interface" setting <usb_alt>)The usb_alt parameter only affects usb cameras, and selects the "alternate usb interface setting " that is assigned when the camera is first registered (i.e., when it is initially plugged in to the USBhub, and registered as /dev/video<n>). (see below)The cpia_pp module supports module options for selecting parallel ports:options cpia_pp parport=[none,auto,0,1,2,...] (just like lp)If your parallel port has ECP hardware, it will not get used unless you:(a) Build the kernel with CONFIG_PARPORT_PC_FIFO=y (b) You may have to select ECP mode for the parallel port in the computer's BIOS setup.(c) load the parport_pc module with options specifying the interrupt (and dma channel, if available) For (c), add the following lines to your modutils config-file(e.g. /etc/modules.conf or wherever your distribution does store thatstuff):options parport_pc io=0x378 irq=7 dma=3alias char-major-81 cpia_ppThe first line tells the dma/irq channels to use. Those _must_ matchthe settings of your BIOS. Do NOT simply use the values above. SeeDocumentation/parport.txt for more information about this. The secondline associates the video-device file with the driver. Of cause youcan also load the modules once upon boot (usually done in /etc/modules).Building the Driver linked into the kernel:============================================Make sure you have selected the following kernel options. Note thatyou cannot compile the parport-stuff/usb-stuff as modules and the cpia-driverstatically (the other way round is okay though).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -