README file for Winnov Videum Linux Driver for Linux Kernel Version 2.4.0 or later February 22, 2001 1. About the driver: The driver is written for kernel version 2.4. It won't compile on 2.0 or 2.2 kernels. I have written this driver myself as a volunteer effort and a fun project. Winnov is aware that the driver exists, but besides that they don't know anything about it. The driver is released under the terms of the GNU General Public License. There are many variations of Videum cards, and the driver doesn't work with them all. It should work with: * Any PCI Videum VO or AV card * Any ISA Videum VO or AV card that uses the Philips SAA7110, Philips SAA7111A, or ITT VPX video decoder, or any Philips EasyVideo card, except for some very early Videum AV cards It definately does not work with: * Videum Traveler digital cameras, but there is a PCMCIA Traveler driver, see the link on the Winnov Linux web site http://www.thedirks.org/winnov/ 2. Video for Linux Two This driver uses the Video for Linux Two API, a new video capture interface that is not in the standard kernel yet. To run this driver you will need to get the V4L2 module videodevX. VideodevX enables your Linux kernel to load V4L2 drivers such as the Winnov driver. To get videodevX, follow the link on the V4L2 web page http://www.thedirks.org/v4l2/ Follow the installation instructions in the videodevX package. If you were using other Video for Linux drivers and the videodev module is loaded (use lsmod command), then unload the videodev module with rmmod. 3. Winnov Drivers Get the latest videum-??????.tgz package from http://www.thedirks.org/winnov/ and put it in your home directory or other convenient place. To unpack and compile the driver do: # tar zxvf videum-20010222.tgz # cd videum # make # make install The driver has three parts, the core module wnv, the video capture driver wnvvid, and the audio capture driver wnvaud. 4. Automatically Loading the Driver If your kernel has the Kernel Module Loader option enabled you can make the driver load automatically. Edit /etc/modules.conf and add the lines alias char-major-81 videodevX options wnvvid unit_video=0 alias char-major-81-0 wnvvid The unit_video= parameter must match the second number in the "alias char-major-81-* wnv" line. Also you must use the same number to make the device node, see below. The driver will then load automatically when any application attempts to access the Videum. 5. Making a Device Node for Video Capture Before the Videum can be used, you have to add a device node for it. Applications access Videum by opening the device node as a file. To make the device node: # mknod /dev/video0 c 81 0 The last parameter is the device minor number. It needs to match the device number you chose in the /etc/modules.conf file. Some applications may use /dev/video, in which case just make a symbolic link: # ln -s /dev/video0 /dev/video For example, the xawtv program requires this link. 7. Possible problems loading the driver: Look in your /var/log/messages file for error messages from the wnv or wnvvid modules. If the driver says it can't find the Videum you may have an IO conflict. ISA cards: If you have an non-Plug-and-Play ISA card, you can override the automatic IO port setting. For a non-PnP card the parameter is isa0_iobase, and the possible values are 0x160,0x150,0x140,0x8160,0x8150,0x8140. For example, in your /etc/modules.conf add: options wnv isa0_iobase=0x150 If you can't find an IO port that works and you have a soldering iron, you can solder a jumper on W1. In which case the parameter is isa1_iobase, and the possible ports are 0x120,0x110,0x100,0x8120,0x8110, 0x8100. Note that the board may still function correctly even if the driver reports a conflict because not all the addresses are used by the driver, so just try it to find out for sure. (Incidentally, it's possible to have two non-PnP ISA cards in one system if one has W1 open and the other has W1 closed.) If you have a PnP ISA card the parameter is pnp0_iobase, and the value can be any multiple of 0x80 greater than 0x400. For example options wnv pnp0_iobase=0x580 It is not possible to have two PnP ISA Videum cards in the same system because all PnP Videums unfortunately have the same PnP device ID code. I have occasionally gotten a "PnP checksum error" when installing the driver on PnP ISA cards. I don't know what this is yet. For me it goes away if I unload the driver and load it again. PCI cards: There are no command line overrides for the PCI cards. The IRQ and IO ports used by the PCI card are determined by the BIOS. 8. Testing video capture with the xcaptest and vidpanel programs: The Videum driver supports all the capture features of the xcaptest and vidpanel programs available on the V4L2 website. Run xcaptest and give the device node name on the command line: # ./xcaptest /dev/video0& If your X Windows screen is 32 bits per pixel, you will probably need the -b option to get it work. # ./xcaptest -b /dev/video0 & In the xcaptest window, select the Standard as NTSC or PAL as appropriate. With xcaptest running, also run vidpanel, also with the device node name on the command line: # ./vidpanel /dev/video0 & In vidpanel select the video input. You should now see the video image on the screen! If you have more than one Videum, you can run more instances of xcaptest and vidpanel. 9. Using the video capture driver in your own program Look at xcaptest.c for the include files you need. The capture parameters are set up through ioctl() calls. Capturing is done through the read() function. Each call to read() gets a new frame. The buffer must be big enough to hold the entire frame or else read() will fail. See the Video for Linux Two draft video capture specification for more details: http://www.thedirks.org/v4l2/v4l2cap.htm The driver supports all the video related ioctls, excluding frame buffer capture and TV tuning. Both blocking and non-blocking reads are supported, as are the select() call, and streaming capture through memory-mapped driver buffers. The driver only supports capturing one field, so images sizes are limited to 240 pixel vertically for NTSC, or 288 pixels for PAL. The driver supports the following pixel formats: V4L2_PIX_FMT_YUYV V4L2_PIX_FMT_GREY V4L2_PIX_FMT_YUV420 V4L2_PIX_FMT_RGB555 V4L2_PIX_FMT_RGB565 V4L2_PIX_FMT_BGR24 V4L2_PIX_FMT_BGR32 You may want to subscribe to the video4linux mailing list. Go to https://listman.redhat.com/mailman/listinfo/video4linux-list 10. More notes: The driver will autodetect an ISA Videum and select an IO port based on the ioport table of Linux. For a PCI Videum, the driver will always use the pre-assigned IO port and IRQ. There is currently no way to override automatic settings from the command line for PCI devices. The driver supports multiple Videums in a sytem. You can use multiple PCI cards, and/or a single PnP ISA card and/or a non-PnP ISA with jumper W1 open, and/or a non-PnP ISA card with jumper W1 closed. To use multiple Videums in a system, you just have to do a mknod for each one, and add lines to /etc/modules.conf for them. For example: options wnvvid unit_video=0,1,2 alias char-major-81-0 wnvvid alias char-major-81-1 wnvvid alias char-major-81-2 wnvvid 11. The Audio Driver The audio driver supports all the audio features of the Videum card, including recording, playing, and all volume control and mixer functions. It follows the OSS sound API. It implements "/dev/dsp" and "/dev/mixer" device types. For more information about OSS and the device types see http://www.opensound.com/pguide/intro.html The driver can record or play audio at 8kHz, 11.025kHz, 12kHz, 16kHz, 22.05kHz, 24kHz, 32kHz, 44.1kHz, and 48kHz. It always uses 16-bit samples. It can use mono or stereo formats. The Videum hardware can support full duplex (simultaneously recording and playing) with some limitations, but the driver was not designed or tested for full duplex. Of course, you can use the audio features of the card simultaneously with video capture, including audio recording or playback. The mixer device supports the following channels: Channel Volume Control Record source? ------- -------------- -------------- Vol Speaker output volume Pcm Digital audio play volume CD CD play volume yes Mix Record source monitor volume Rec Record input gain control Line -none- (LINE input mini-jack) yes Mic -none- (MIC input mini-jack) yes Video -none- (MXC camera microphone) yes All channels are stereo except the camera mic. The record gain control and speaker volume have independent left and right controls, others have a single control that sets both left and right channels the same. 12. Loading the Audio Driver To load the driver do: # modprobe wnvaud You will have to do that each time after you boot up before you can use the Videum audio. You might want to put that command in your /etc/rc.d/rc.local file. Or, if you are not using another audio card, add this line to /etc/modules.conf: alias char-major-14 wnvaud 13. Hardware Compatibility of the Audio Driver The driver does not work with all Videums. It requires the WAVI-97 and CS4218 chips for recording and playback. Therefore it will only work with PCI AV, PnP ISA AV and maybe some legacy ISA cards. For other AV cards, you will have the mixer functions, but you will not be able to record audio or play audio files (for example mp3 or wav files). You will be able to play CDs and hear audio from an input jack. On some older ISA cards, you might not even have the mixer, or it might not work right. It is not tested. Obviously it won't work with VO (video only) cards. If you have a problem check your /var/log/messages file or /proc/kmsg file for error messages. 14. Other Issues with the Audio Driver I have only tested it on a PCI AV card. I don't really know how well it works on ISA cards. The driver makes a noticable pop sound through the speakers when loading. I don't know what causes that. Maybe one of these days I'll track it down.... The driver does not support full duplex operation. Full duplex means capturing and playing audio at the same time. That may cause an incompatibility with some applications. You might hear some slight popping or crackling sounds when playing audio while simultaneously capturing video at high rates. This is a minor hardware bug. Thankfully, it only affects playing, not recording. RealProducer does not work properly with Videum when encoding audio below 8kbps. Always encode audio at 8kbps or more. Have fun with your Videum on Linux! Bill.