576 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3The Zoran driver4================5 6unified zoran driver (zr360x7, zoran, buz, dc10(+), dc30(+), lml33)7 8website: http://mjpeg.sourceforge.net/driver-zoran/9 10 11Frequently Asked Questions12--------------------------13 14What cards are supported15------------------------16 17Iomega Buz, Linux Media Labs LML33/LML33R10, Pinnacle/Miro18DC10/DC10+/DC30/DC30+ and related boards (available under various names).19 20Iomega Buz21~~~~~~~~~~22 23* Zoran zr36067 PCI controller24* Zoran zr36060 MJPEG codec25* Philips saa7111 TV decoder26* Philips saa7185 TV encoder27 28Drivers to use: videodev, i2c-core, i2c-algo-bit,29videocodec, saa7111, saa7185, zr36060, zr3606730 31Inputs/outputs: Composite and S-video32 33Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)34 35Card number: 736 37AverMedia 6 Eyes AVS6EYES38~~~~~~~~~~~~~~~~~~~~~~~~~39 40* Zoran zr36067 PCI controller41* Zoran zr36060 MJPEG codec42* Samsung ks0127 TV decoder43* Conexant bt866 TV encoder44 45Drivers to use: videodev, i2c-core, i2c-algo-bit,46videocodec, ks0127, bt866, zr36060, zr3606747 48Inputs/outputs:49 Six physical inputs. 1-6 are composite,50 1-2, 3-4, 5-6 doubles as S-video,51 1-3 triples as component.52 One composite output.53 54Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)55 56Card number: 857 58.. note::59 60 Not autodetected, card=8 is necessary.61 62Linux Media Labs LML3363~~~~~~~~~~~~~~~~~~~~~~64 65* Zoran zr36067 PCI controller66* Zoran zr36060 MJPEG codec67* Brooktree bt819 TV decoder68* Brooktree bt856 TV encoder69 70Drivers to use: videodev, i2c-core, i2c-algo-bit,71videocodec, bt819, bt856, zr36060, zr3606772 73Inputs/outputs: Composite and S-video74 75Norms: PAL (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)76 77Card number: 578 79Linux Media Labs LML33R1080~~~~~~~~~~~~~~~~~~~~~~~~~81 82* Zoran zr36067 PCI controller83* Zoran zr36060 MJPEG codec84* Philips saa7114 TV decoder85* Analog Devices adv7170 TV encoder86 87Drivers to use: videodev, i2c-core, i2c-algo-bit,88videocodec, saa7114, adv7170, zr36060, zr3606789 90Inputs/outputs: Composite and S-video91 92Norms: PAL (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)93 94Card number: 695 96Pinnacle/Miro DC10(new)97~~~~~~~~~~~~~~~~~~~~~~~98 99* Zoran zr36057 PCI controller100* Zoran zr36060 MJPEG codec101* Philips saa7110a TV decoder102* Analog Devices adv7176 TV encoder103 104Drivers to use: videodev, i2c-core, i2c-algo-bit,105videocodec, saa7110, adv7175, zr36060, zr36067106 107Inputs/outputs: Composite, S-video and Internal108 109Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)110 111Card number: 1112 113Pinnacle/Miro DC10+114~~~~~~~~~~~~~~~~~~~115 116* Zoran zr36067 PCI controller117* Zoran zr36060 MJPEG codec118* Philips saa7110a TV decoder119* Analog Devices adv7176 TV encoder120 121Drivers to use: videodev, i2c-core, i2c-algo-bit,122videocodec, saa7110, adv7175, zr36060, zr36067123 124Inputs/outputs: Composite, S-video and Internal125 126Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)127 128Card number: 2129 130Pinnacle/Miro DC10(old)131~~~~~~~~~~~~~~~~~~~~~~~132 133* Zoran zr36057 PCI controller134* Zoran zr36050 MJPEG codec135* Zoran zr36016 Video Front End or Fuji md0211 Video Front End (clone?)136* Micronas vpx3220a TV decoder137* mse3000 TV encoder or Analog Devices adv7176 TV encoder138 139Drivers to use: videodev, i2c-core, i2c-algo-bit,140videocodec, vpx3220, mse3000/adv7175, zr36050, zr36016, zr36067141 142Inputs/outputs: Composite, S-video and Internal143 144Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)145 146Card number: 0147 148Pinnacle/Miro DC30149~~~~~~~~~~~~~~~~~~150 151* Zoran zr36057 PCI controller152* Zoran zr36050 MJPEG codec153* Zoran zr36016 Video Front End154* Micronas vpx3225d/vpx3220a/vpx3216b TV decoder155* Analog Devices adv7176 TV encoder156 157Drivers to use: videodev, i2c-core, i2c-algo-bit,158videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36016, zr36067159 160Inputs/outputs: Composite, S-video and Internal161 162Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)163 164Card number: 3165 166Pinnacle/Miro DC30+167~~~~~~~~~~~~~~~~~~~168 169* Zoran zr36067 PCI controller170* Zoran zr36050 MJPEG codec171* Zoran zr36016 Video Front End172* Micronas vpx3225d/vpx3220a/vpx3216b TV decoder173* Analog Devices adv7176 TV encoder174 175Drivers to use: videodev, i2c-core, i2c-algo-bit,176videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36015, zr36067177 178Inputs/outputs: Composite, S-video and Internal179 180Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)181 182Card number: 4183 184.. note::185 186 #) No module for the mse3000 is available yet187 #) No module for the vpx3224 is available yet188 1891.1 What the TV decoder can do an what not190------------------------------------------191 192The best know TV standards are NTSC/PAL/SECAM. but for decoding a frame that193information is not enough. There are several formats of the TV standards.194And not every TV decoder is able to handle every format. Also the every195combination is supported by the driver. There are currently 11 different196tv broadcast formats all aver the world.197 198The CCIR defines parameters needed for broadcasting the signal.199The CCIR has defined different standards: A,B,D,E,F,G,D,H,I,K,K1,L,M,N,...200The CCIR says not much about the colorsystem used !!!201And talking about a colorsystem says not to much about how it is broadcast.202 203The CCIR standards A,E,F are not used any more.204 205When you speak about NTSC, you usually mean the standard: CCIR - M using206the NTSC colorsystem which is used in the USA, Japan, Mexico, Canada207and a few others.208 209When you talk about PAL, you usually mean: CCIR - B/G using the PAL210colorsystem which is used in many Countries.211 212When you talk about SECAM, you mean: CCIR - L using the SECAM Colorsystem213which is used in France, and a few others.214 215There the other version of SECAM, CCIR - D/K is used in Bulgaria, China,216Slovakai, Hungary, Korea (Rep.), Poland, Rumania and a others.217 218The CCIR - H uses the PAL colorsystem (sometimes SECAM) and is used in219Egypt, Libya, Sri Lanka, Syrain Arab. Rep.220 221The CCIR - I uses the PAL colorsystem, and is used in Great Britain, Hong Kong,222Ireland, Nigeria, South Africa.223 224The CCIR - N uses the PAL colorsystem and PAL frame size but the NTSC framerate,225and is used in Argentinia, Uruguay, an a few others226 227We do not talk about how the audio is broadcast !228 229A rather good sites about the TV standards are:230http://www.sony.jp/support/231http://info.electronicwerkstatt.de/bereiche/fernsehtechnik/frequenzen_und_normen/Fernsehnormen/232and http://www.cabl.com/restaurant/channel.html233 234Other weird things around: NTSC 4.43 is a modificated NTSC, which is mainly235used in PAL VCR's that are able to play back NTSC. PAL 60 seems to be the same236as NTSC 4.43 . The Datasheets also talk about NTSC 44, It seems as if it would237be the same as NTSC 4.43.238NTSC Combs seems to be a decoder mode where the decoder uses a comb filter239to split coma and luma instead of a Delay line.240 241But I did not defiantly find out what NTSC Comb is.242 243Philips saa7111 TV decoder244~~~~~~~~~~~~~~~~~~~~~~~~~~245 246- was introduced in 1997, is used in the BUZ and247- can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC N, NTSC 4.43 and SECAM248 249Philips saa7110a TV decoder250~~~~~~~~~~~~~~~~~~~~~~~~~~~251 252- was introduced in 1995, is used in the Pinnacle/Miro DC10(new), DC10+ and253- can handle: PAL B/G, NTSC M and SECAM254 255Philips saa7114 TV decoder256~~~~~~~~~~~~~~~~~~~~~~~~~~257 258- was introduced in 2000, is used in the LML33R10 and259- can handle: PAL B/G/D/H/I/N, PAL N, PAL M, NTSC M, NTSC 4.43 and SECAM260 261Brooktree bt819 TV decoder262~~~~~~~~~~~~~~~~~~~~~~~~~~263 264- was introduced in 1996, and is used in the LML33 and265- can handle: PAL B/D/G/H/I, NTSC M266 267Micronas vpx3220a TV decoder268~~~~~~~~~~~~~~~~~~~~~~~~~~~~269 270- was introduced in 1996, is used in the DC30 and DC30+ and271- can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC 44, PAL 60, SECAM,NTSC Comb272 273Samsung ks0127 TV decoder274~~~~~~~~~~~~~~~~~~~~~~~~~275 276- is used in the AVS6EYES card and277- can handle: NTSC-M/N/44, PAL-M/N/B/G/H/I/D/K/L and SECAM278 279 280What the TV encoder can do an what not281--------------------------------------282 283The TV encoder is doing the "same" as the decoder, but in the other direction.284You feed them digital data and the generate a Composite or SVHS signal.285For information about the colorsystems and TV norm take a look in the286TV decoder section.287 288Philips saa7185 TV Encoder289~~~~~~~~~~~~~~~~~~~~~~~~~~290 291- was introduced in 1996, is used in the BUZ292- can generate: PAL B/G, NTSC M293 294Brooktree bt856 TV Encoder295~~~~~~~~~~~~~~~~~~~~~~~~~~296 297- was introduced in 1994, is used in the LML33298- can generate: PAL B/D/G/H/I/N, PAL M, NTSC M, PAL-N (Argentina)299 300Analog Devices adv7170 TV Encoder301~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~302 303- was introduced in 2000, is used in the LML300R10304- can generate: PAL B/D/G/H/I/N, PAL M, NTSC M, PAL 60305 306Analog Devices adv7175 TV Encoder307~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~308 309- was introduced in 1996, is used in the DC10, DC10+, DC10 old, DC30, DC30+310- can generate: PAL B/D/G/H/I/N, PAL M, NTSC M311 312ITT mse3000 TV encoder313~~~~~~~~~~~~~~~~~~~~~~314 315- was introduced in 1991, is used in the DC10 old316- can generate: PAL , NTSC , SECAM317 318Conexant bt866 TV encoder319~~~~~~~~~~~~~~~~~~~~~~~~~320 321- is used in AVS6EYES, and322- can generate: NTSC/PAL, PAL-M, PAL-N323 324The adv717x, should be able to produce PAL N. But you find nothing PAL N325specific in the registers. Seem that you have to reuse a other standard326to generate PAL N, maybe it would work if you use the PAL M settings.327 328How do I get this damn thing to work329------------------------------------330 331Load zr36067.o. If it can't autodetect your card, use the card=X insmod332option with X being the card number as given in the previous section.333To have more than one card, use card=X1[,X2[,X3,[X4[..]]]]334 335To automate this, add the following to your /etc/modprobe.d/zoran.conf:336 337options zr36067 card=X1[,X2[,X3[,X4[..]]]]338alias char-major-81-0 zr36067339 340One thing to keep in mind is that this doesn't load zr36067.o itself yet. It341just automates loading. If you start using xawtv, the device won't load on342some systems, since you're trying to load modules as a user, which is not343allowed ("permission denied"). A quick workaround is to add 'Load "v4l"' to344XF86Config-4 when you use X by default, or to run 'v4l-conf -c <device>' in345one of your startup scripts (normally rc.local) if you don't use X. Both346make sure that the modules are loaded on startup, under the root account.347 348What mainboard should I use (or why doesn't my card work)349---------------------------------------------------------350 351 352<insert lousy disclaimer here>. In short: good=SiS/Intel, bad=VIA.353 354Experience tells us that people with a Buz, on average, have more problems355than users with a DC10+/LML33. Also, it tells us that people owning a VIA-356based mainboard (ktXXX, MVP3) have more problems than users with a mainboard357based on a different chipset. Here's some notes from Andrew Stevens:358 359Here's my experience of using LML33 and Buz on various motherboards:360 361- VIA MVP3362 - Forget it. Pointless. Doesn't work.363- Intel 430FX (Pentium 200)364 - LML33 perfect, Buz tolerable (3 or 4 frames dropped per movie)365- Intel 440BX (early stepping)366 - LML33 tolerable. Buz starting to get annoying (6-10 frames/hour)367- Intel 440BX (late stepping)368 - Buz tolerable, LML3 almost perfect (occasional single frame drops)369- SiS735370 - LML33 perfect, Buz tolerable.371- VIA KT133(*)372 - LML33 starting to get annoying, Buz poor enough that I have up.373 374- Both 440BX boards were dual CPU versions.375 376Bernhard Praschinger later added:377 378- AMD 751379 - Buz perfect-tolerable380- AMD 760381 - Buz perfect-tolerable382 383In general, people on the user mailinglist won't give you much of a chance384if you have a VIA-based motherboard. They may be cheap, but sometimes, you'd385rather want to spend some more money on better boards. In general, VIA386mainboard's IDE/PCI performance will also suck badly compared to others.387You'll noticed the DC10+/DC30+ aren't mentioned anywhere in the overview.388Basically, you can assume that if the Buz works, the LML33 will work too. If389the LML33 works, the DC10+/DC30+ will work too. They're most tolerant to390different mainboard chipsets from all of the supported cards.391 392If you experience timeouts during capture, buy a better mainboard or lower393the quality/buffersize during capture (see 'Concerning buffer sizes, quality,394output size etc.'). If it hangs, there's little we can do as of now. Check395your IRQs and make sure the card has its own interrupts.396 397Programming interface398---------------------399 400This driver conforms to video4linux2. Support for V4L1 and for the custom401zoran ioctls has been removed in kernel 2.6.38.402 403For programming example, please, look at lavrec.c and lavplay.c code in404the MJPEG-tools (http://mjpeg.sf.net/).405 406Additional notes for software developers:407 408 The driver returns maxwidth and maxheight parameters according to409 the current TV standard (norm). Therefore, the software which410 communicates with the driver and "asks" for these parameters should411 first set the correct norm. Well, it seems logically correct: TV412 standard is "more constant" for current country than geometry413 settings of a variety of TV capture cards which may work in ITU or414 square pixel format.415 416Applications417------------418 419Applications known to work with this driver:420 421TV viewing:422 423* xawtv424* kwintv425* probably any TV application that supports video4linux or video4linux2.426 427MJPEG capture/playback:428 429* mjpegtools/lavtools (or Linux Video Studio)430* gstreamer431* mplayer432 433General raw capture:434 435* xawtv436* gstreamer437* probably any application that supports video4linux or video4linux2438 439Video editing:440 441* Cinelerra442* MainActor443* mjpegtools (or Linux Video Studio)444 445 446Concerning buffer sizes, quality, output size etc.447--------------------------------------------------448 449 450The zr36060 can do 1:2 JPEG compression. This is really the theoretical451maximum that the chipset can reach. The driver can, however, limit compression452to a maximum (size) of 1:4. The reason for this is that some cards (e.g. Buz)453can't handle 1:2 compression without stopping capture after only a few minutes.454With 1:4, it'll mostly work. If you have a Buz, use 'low_bitrate=1' to go into4551:4 max. compression mode.456 457100% JPEG quality is thus 1:2 compression in practice. So for a full PAL frame458(size 720x576). The JPEG fields are stored in YUY2 format, so the size of the459fields are 720x288x16/2 bits/field (2 fields/frame) = 207360 bytes/field x 2 =460414720 bytes/frame (add some more bytes for headers and DHT (huffman)/DQT461(quantization) tables, and you'll get to something like 512kB per frame for4621:2 compression. For 1:4 compression, you'd have frames of half this size.463 464Some additional explanation by Martin Samuelsson, which also explains the465importance of buffer sizes:466--467> Hmm, I do not think it is really that way. With the current (downloaded468> at 18:00 Monday) driver I get that output sizes for 10 sec:469> -q 50 -b 128 : 24.283.332 Bytes470> -q 50 -b 256 : 48.442.368471> -q 25 -b 128 : 24.655.992472> -q 25 -b 256 : 25.859.820473 474I woke up, and can't go to sleep again. I'll kill some time explaining why475this doesn't look strange to me.476 477Let's do some math using a width of 704 pixels. I'm not sure whether the Buz478actually use that number or not, but that's not too important right now.479 480704x288 pixels, one field, is 202752 pixels. Divided by 64 pixels per block;4813168 blocks per field. Each pixel consist of two bytes; 128 bytes per block;4821024 bits per block. 100% in the new driver mean 1:2 compression; the maximum483output becomes 512 bits per block. Actually 510, but 512 is simpler to use484for calculations.485 486Let's say that we specify d1q50. We thus want 256 bits per block; times 3168487becomes 811008 bits; 101376 bytes per field. We're talking raw bits and bytes488here, so we don't need to do any fancy corrections for bits-per-pixel or such489things. 101376 bytes per field.490 491d1 video contains two fields per frame. Those sum up to 202752 bytes per492frame, and one of those frames goes into each buffer.493 494But wait a second! -b128 gives 128kB buffers! It's not possible to cram495202752 bytes of JPEG data into 128kB!496 497This is what the driver notice and automatically compensate for in your498examples. Let's do some math using this information:499 500128kB is 131072 bytes. In this buffer, we want to store two fields, which501leaves 65536 bytes for each field. Using 3168 blocks per field, we get50220.68686868... available bytes per block; 165 bits. We can't allow the503request for 256 bits per block when there's only 165 bits available! The -q50504option is silently overridden, and the -b128 option takes precedence, leaving505us with the equivalence of -q32.506 507This gives us a data rate of 165 bits per block, which, times 3168, sums up508to 65340 bytes per field, out of the allowed 65536. The current driver has509another level of rate limiting; it won't accept -q values that fill more than5106/8 of the specified buffers. (I'm not sure why. "Playing it safe" seem to be511a safe bet. Personally, I think I would have lowered requested-bits-per-block512by one, or something like that.) We can't use 165 bits per block, but have to513lower it again, to 6/8 of the available buffer space: We end up with 124 bits514per block, the equivalence of -q24. With 128kB buffers, you can't use greater515than -q24 at -d1. (And PAL, and 704 pixels width...)516 517The third example is limited to -q24 through the same process. The second518example, using very similar calculations, is limited to -q48. The only519example that actually grab at the specified -q value is the last one, which520is clearly visible, looking at the file size.521--522 523Conclusion: the quality of the resulting movie depends on buffer size, quality,524whether or not you use 'low_bitrate=1' as insmod option for the zr36060.c525module to do 1:4 instead of 1:2 compression, etc.526 527If you experience timeouts, lowering the quality/buffersize or using528'low_bitrate=1 as insmod option for zr36060.o might actually help, as is529proven by the Buz.530 531It hangs/crashes/fails/whatevers! Help!532---------------------------------------533 534Make sure that the card has its own interrupts (see /proc/interrupts), check535the output of dmesg at high verbosity (load zr36067.o with debug=2,536load all other modules with debug=1). Check that your mainboard is favorable537(see question 2) and if not, test the card in another computer. Also see the538notes given in question 3 and try lowering quality/buffersize/capturesize539if recording fails after a period of time.540 541If all this doesn't help, give a clear description of the problem including542detailed hardware information (memory+brand, mainboard+chipset+brand, which543MJPEG card, processor, other PCI cards that might be of interest), give the544system PnP information (/proc/interrupts, /proc/dma, /proc/devices), and give545the kernel version, driver version, glibc version, gcc version and any other546information that might possibly be of interest. Also provide the dmesg output547at high verbosity. See 'Contacting' on how to contact the developers.548 549Maintainers/Contacting550----------------------551 552Previous maintainers/developers of this driver are553- Laurent Pinchart <laurent.pinchart@skynet.be>554- Ronald Bultje rbultje@ronald.bitfreak.net555- Serguei Miridonov <mirsev@cicese.mx>556- Wolfgang Scherr <scherr@net4you.net>557- Dave Perks <dperks@ibm.net>558- Rainer Johanni <Rainer@Johanni.de>559 560Driver's License561----------------562 563 This driver is distributed under the terms of the General Public License.564 565 This program is free software; you can redistribute it and/or modify566 it under the terms of the GNU General Public License as published by567 the Free Software Foundation; either version 2 of the License, or568 (at your option) any later version.569 570 This program is distributed in the hope that it will be useful,571 but WITHOUT ANY WARRANTY; without even the implied warranty of572 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the573 GNU General Public License for more details.574 575See http://www.gnu.org/ for more information.576