Documentation/driver-api/media/drivers/zoran.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API

The Zoran driver

Zoran MJPEG card hardware, TV norm, module loading, V4L2 application, JPEG buffer 산식과 troubleshooting을 다루는 전문 번역입니다.

Source pathDocumentation/driver-api/media/drivers/zoran.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

zoran.rst:1-575

이 문서는 여러 Zoran MJPEG capture board의 chip 조합과 card number를 식별하고, TV broadcast norm과 decoder·encoder capability를 맞춘 뒤 V4L2 application에서 안정적으로 capture하기 위한 오래된 hardware 운용 지식을 보존합니다.

실무적으로는 정확한 `card=X` 값과 단독 IRQ를 먼저 확인하고, TV norm을 geometry보다 먼저 설정해야 합니다. Capture timeout에는 buffer capacity가 요청 JPEG quality를 제한하는 계산을 이해하고 quality·buffer·capture size 또는 `low_bitrate=1`을 조정해야 합니다.

문서 구성
원문 줄내용
1-12통합 driver와 FAQ 범위
13-188지원 board 9종과 chip·card number
189-279TV broadcast format과 decoder
280-327TV encoder capability
328-396Module loading, chipset·IRQ 호환성
397-445V4L2 interface와 application
446-530JPEG compression·buffer·quality 산식
531-548Troubleshooting과 문제 보고
549-559이전 maintainer·developer
560-575GPL license

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 The Zoran driver
4 ================
5
6 unified zoran driver (zr360x7, zoran, buz, dc10(+), dc30(+), lml33)
7
8 website: http://mjpeg.sourceforge.net/driver-zoran/
9
10
11 Frequently Asked Questions
12 --------------------------
13
14 What cards are supported
15 ------------------------
16
17 Iomega Buz, Linux Media Labs LML33/LML33R10, Pinnacle/Miro
18 DC10/DC10+/DC30/DC30+ and related boards (available under various names).
19
20 Iomega Buz
21 ~~~~~~~~~~
22
23 * Zoran zr36067 PCI controller
24 * Zoran zr36060 MJPEG codec
25 * Philips saa7111 TV decoder
26 * Philips saa7185 TV encoder
27
28 Drivers to use: videodev, i2c-core, i2c-algo-bit,
29 videocodec, saa7111, saa7185, zr36060, zr36067
30
31 Inputs/outputs: Composite and S-video
32
33 Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
34
35 Card number: 7
36
37 AverMedia 6 Eyes AVS6EYES
38 ~~~~~~~~~~~~~~~~~~~~~~~~~
39
40 * Zoran zr36067 PCI controller
41 * Zoran zr36060 MJPEG codec
42 * Samsung ks0127 TV decoder
43 * Conexant bt866 TV encoder
44
45 Drivers to use: videodev, i2c-core, i2c-algo-bit,
46 videocodec, ks0127, bt866, zr36060, zr36067
47
48 Inputs/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
54 Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
55
56 Card number: 8
57
58 .. note::
59
60 Not autodetected, card=8 is necessary.
61
62 Linux Media Labs LML33
63 ~~~~~~~~~~~~~~~~~~~~~~
64
65 * Zoran zr36067 PCI controller
66 * Zoran zr36060 MJPEG codec
67 * Brooktree bt819 TV decoder
68 * Brooktree bt856 TV encoder
69
70 Drivers to use: videodev, i2c-core, i2c-algo-bit,
71 videocodec, bt819, bt856, zr36060, zr36067
72
73 Inputs/outputs: Composite and S-video
74
75 Norms: PAL (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
76
77 Card number: 5
78
79 Linux Media Labs LML33R10
80 ~~~~~~~~~~~~~~~~~~~~~~~~~
81
82 * Zoran zr36067 PCI controller
83 * Zoran zr36060 MJPEG codec
84 * Philips saa7114 TV decoder
85 * Analog Devices adv7170 TV encoder
86
87 Drivers to use: videodev, i2c-core, i2c-algo-bit,
88 videocodec, saa7114, adv7170, zr36060, zr36067
89
90 Inputs/outputs: Composite and S-video
91
92 Norms: PAL (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)
93
94 Card number: 6
95
96 Pinnacle/Miro DC10(new)
97 ~~~~~~~~~~~~~~~~~~~~~~~
98
99 * Zoran zr36057 PCI controller
100 * Zoran zr36060 MJPEG codec
101 * Philips saa7110a TV decoder
102 * Analog Devices adv7176 TV encoder
103
104 Drivers to use: videodev, i2c-core, i2c-algo-bit,
105 videocodec, saa7110, adv7175, zr36060, zr36067
106
107 Inputs/outputs: Composite, S-video and Internal
108
109 Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
110
111 Card number: 1
112
113 Pinnacle/Miro DC10+
114 ~~~~~~~~~~~~~~~~~~~
115
116 * Zoran zr36067 PCI controller
117 * Zoran zr36060 MJPEG codec
118 * Philips saa7110a TV decoder
119 * Analog Devices adv7176 TV encoder
120
121 Drivers to use: videodev, i2c-core, i2c-algo-bit,
122 videocodec, saa7110, adv7175, zr36060, zr36067
123
124 Inputs/outputs: Composite, S-video and Internal
125
126 Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
127
128 Card number: 2
129
130 Pinnacle/Miro DC10(old)
131 ~~~~~~~~~~~~~~~~~~~~~~~
132
133 * Zoran zr36057 PCI controller
134 * Zoran zr36050 MJPEG codec
135 * Zoran zr36016 Video Front End or Fuji md0211 Video Front End (clone?)
136 * Micronas vpx3220a TV decoder
137 * mse3000 TV encoder or Analog Devices adv7176 TV encoder
138
139 Drivers to use: videodev, i2c-core, i2c-algo-bit,
140 videocodec, vpx3220, mse3000/adv7175, zr36050, zr36016, zr36067
141
142 Inputs/outputs: Composite, S-video and Internal
143
144 Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
145
146 Card number: 0
147
148 Pinnacle/Miro DC30
149 ~~~~~~~~~~~~~~~~~~
150
151 * Zoran zr36057 PCI controller
152 * Zoran zr36050 MJPEG codec
153 * Zoran zr36016 Video Front End
154 * Micronas vpx3225d/vpx3220a/vpx3216b TV decoder
155 * Analog Devices adv7176 TV encoder
156
157 Drivers to use: videodev, i2c-core, i2c-algo-bit,
158 videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36016, zr36067
159
160 Inputs/outputs: Composite, S-video and Internal
161
162 Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
163
164 Card number: 3
165
166 Pinnacle/Miro DC30+
167 ~~~~~~~~~~~~~~~~~~~
168
169 * Zoran zr36067 PCI controller
170 * Zoran zr36050 MJPEG codec
171 * Zoran zr36016 Video Front End
172 * Micronas vpx3225d/vpx3220a/vpx3216b TV decoder
173 * Analog Devices adv7176 TV encoder
174
175 Drivers to use: videodev, i2c-core, i2c-algo-bit,
176 videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36015, zr36067
177
178 Inputs/outputs: Composite, S-video and Internal
179
180 Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)
181
182 Card number: 4
183
184 .. note::
185
186 #) No module for the mse3000 is available yet
187 #) No module for the vpx3224 is available yet
188
189 1.1 What the TV decoder can do an what not
190 ------------------------------------------
191
192 The best know TV standards are NTSC/PAL/SECAM. but for decoding a frame that
193 information is not enough. There are several formats of the TV standards.
194 And not every TV decoder is able to handle every format. Also the every
195 combination is supported by the driver. There are currently 11 different
196 tv broadcast formats all aver the world.
197
198 The CCIR defines parameters needed for broadcasting the signal.
199 The CCIR has defined different standards: A,B,D,E,F,G,D,H,I,K,K1,L,M,N,...
200 The CCIR says not much about the colorsystem used !!!
201 And talking about a colorsystem says not to much about how it is broadcast.
202
203 The CCIR standards A,E,F are not used any more.
204
205 When you speak about NTSC, you usually mean the standard: CCIR - M using
206 the NTSC colorsystem which is used in the USA, Japan, Mexico, Canada
207 and a few others.
208
209 When you talk about PAL, you usually mean: CCIR - B/G using the PAL
210 colorsystem which is used in many Countries.
211
212 When you talk about SECAM, you mean: CCIR - L using the SECAM Colorsystem
213 which is used in France, and a few others.
214
215 There the other version of SECAM, CCIR - D/K is used in Bulgaria, China,
216 Slovakai, Hungary, Korea (Rep.), Poland, Rumania and a others.
217
218 The CCIR - H uses the PAL colorsystem (sometimes SECAM) and is used in
219 Egypt, Libya, Sri Lanka, Syrain Arab. Rep.
220
221 The CCIR - I uses the PAL colorsystem, and is used in Great Britain, Hong Kong,
222 Ireland, Nigeria, South Africa.
223
224 The CCIR - N uses the PAL colorsystem and PAL frame size but the NTSC framerate,
225 and is used in Argentina, Uruguay, an a few others
226
227 We do not talk about how the audio is broadcast !
228
229 A rather good sites about the TV standards are:
230 http://www.sony.jp/support/
231 http://info.electronicwerkstatt.de/bereiche/fernsehtechnik/frequenzen_und_normen/Fernsehnormen/
232 and http://www.cabl.com/restaurant/channel.html
233
234 Other weird things around: NTSC 4.43 is a modificated NTSC, which is mainly
235 used in PAL VCR's that are able to play back NTSC. PAL 60 seems to be the same
236 as NTSC 4.43 . The Datasheets also talk about NTSC 44, It seems as if it would
237 be the same as NTSC 4.43.
238 NTSC Combs seems to be a decoder mode where the decoder uses a comb filter
239 to split coma and luma instead of a Delay line.
240
241 But I did not defiantly find out what NTSC Comb is.
242
243 Philips saa7111 TV decoder
244 ~~~~~~~~~~~~~~~~~~~~~~~~~~
245
246 - was introduced in 1997, is used in the BUZ and
247 - can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC N, NTSC 4.43 and SECAM
248
249 Philips saa7110a TV decoder
250 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
251
252 - was introduced in 1995, is used in the Pinnacle/Miro DC10(new), DC10+ and
253 - can handle: PAL B/G, NTSC M and SECAM
254
255 Philips saa7114 TV decoder
256 ~~~~~~~~~~~~~~~~~~~~~~~~~~
257
258 - was introduced in 2000, is used in the LML33R10 and
259 - can handle: PAL B/G/D/H/I/N, PAL N, PAL M, NTSC M, NTSC 4.43 and SECAM
260
261 Brooktree bt819 TV decoder
262 ~~~~~~~~~~~~~~~~~~~~~~~~~~
263
264 - was introduced in 1996, and is used in the LML33 and
265 - can handle: PAL B/D/G/H/I, NTSC M
266
267 Micronas vpx3220a TV decoder
268 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
269
270 - was introduced in 1996, is used in the DC30 and DC30+ and
271 - can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC 44, PAL 60, SECAM,NTSC Comb
272
273 Samsung ks0127 TV decoder
274 ~~~~~~~~~~~~~~~~~~~~~~~~~
275
276 - is used in the AVS6EYES card and
277 - can handle: NTSC-M/N/44, PAL-M/N/B/G/H/I/D/K/L and SECAM
278
279
280 What the TV encoder can do an what not
281 --------------------------------------
282
283 The TV encoder is doing the "same" as the decoder, but in the other direction.
284 You feed them digital data and the generate a Composite or SVHS signal.
285 For information about the colorsystems and TV norm take a look in the
286 TV decoder section.
287
288 Philips saa7185 TV Encoder
289 ~~~~~~~~~~~~~~~~~~~~~~~~~~
290
291 - was introduced in 1996, is used in the BUZ
292 - can generate: PAL B/G, NTSC M
293
294 Brooktree bt856 TV Encoder
295 ~~~~~~~~~~~~~~~~~~~~~~~~~~
296
297 - was introduced in 1994, is used in the LML33
298 - can generate: PAL B/D/G/H/I/N, PAL M, NTSC M, PAL-N (Argentina)
299
300 Analog Devices adv7170 TV Encoder
301 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
302
303 - was introduced in 2000, is used in the LML300R10
304 - can generate: PAL B/D/G/H/I/N, PAL M, NTSC M, PAL 60
305
306 Analog Devices adv7175 TV Encoder
307 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 M
311
312 ITT mse3000 TV encoder
313 ~~~~~~~~~~~~~~~~~~~~~~
314
315 - was introduced in 1991, is used in the DC10 old
316 - can generate: PAL , NTSC , SECAM
317
318 Conexant bt866 TV encoder
319 ~~~~~~~~~~~~~~~~~~~~~~~~~
320
321 - is used in AVS6EYES, and
322 - can generate: NTSC/PAL, PAL-M, PAL-N
323
324 The adv717x, should be able to produce PAL N. But you find nothing PAL N
325 specific in the registers. Seem that you have to reuse a other standard
326 to generate PAL N, maybe it would work if you use the PAL M settings.
327
328 How do I get this damn thing to work
329 ------------------------------------
330
331 Load zr36067.o. If it can't autodetect your card, use the card=X insmod
332 option with X being the card number as given in the previous section.
333 To have more than one card, use card=X1[,X2[,X3,[X4[..]]]]
334
335 To automate this, add the following to your /etc/modprobe.d/zoran.conf:
336
337 options zr36067 card=X1[,X2[,X3[,X4[..]]]]
338 alias char-major-81-0 zr36067
339
340 One thing to keep in mind is that this doesn't load zr36067.o itself yet. It
341 just automates loading. If you start using xawtv, the device won't load on
342 some systems, since you're trying to load modules as a user, which is not
343 allowed ("permission denied"). A quick workaround is to add 'Load "v4l"' to
344 XF86Config-4 when you use X by default, or to run 'v4l-conf -c <device>' in
345 one of your startup scripts (normally rc.local) if you don't use X. Both
346 make sure that the modules are loaded on startup, under the root account.
347
348 What 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
354 Experience tells us that people with a Buz, on average, have more problems
355 than users with a DC10+/LML33. Also, it tells us that people owning a VIA-
356 based mainboard (ktXXX, MVP3) have more problems than users with a mainboard
357 based on a different chipset. Here's some notes from Andrew Stevens:
358
359 Here's my experience of using LML33 and Buz on various motherboards:
360
361 - VIA MVP3
362 - 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 - SiS735
370 - 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
376 Bernhard Praschinger later added:
377
378 - AMD 751
379 - Buz perfect-tolerable
380 - AMD 760
381 - Buz perfect-tolerable
382
383 In general, people on the user mailinglist won't give you much of a chance
384 if you have a VIA-based motherboard. They may be cheap, but sometimes, you'd
385 rather want to spend some more money on better boards. In general, VIA
386 mainboard's IDE/PCI performance will also suck badly compared to others.
387 You'll noticed the DC10+/DC30+ aren't mentioned anywhere in the overview.
388 Basically, you can assume that if the Buz works, the LML33 will work too. If
389 the LML33 works, the DC10+/DC30+ will work too. They're most tolerant to
390 different mainboard chipsets from all of the supported cards.
391
392 If you experience timeouts during capture, buy a better mainboard or lower
393 the quality/buffersize during capture (see 'Concerning buffer sizes, quality,
394 output size etc.'). If it hangs, there's little we can do as of now. Check
395 your IRQs and make sure the card has its own interrupts.
396
397 Programming interface
398 ---------------------
399
400 This driver conforms to video4linux2. Support for V4L1 and for the custom
401 zoran ioctls has been removed in kernel 2.6.38.
402
403 For programming example, please, look at lavrec.c and lavplay.c code in
404 the MJPEG-tools (http://mjpeg.sf.net/).
405
406 Additional notes for software developers:
407
408 The driver returns maxwidth and maxheight parameters according to
409 the current TV standard (norm). Therefore, the software which
410 communicates with the driver and "asks" for these parameters should
411 first set the correct norm. Well, it seems logically correct: TV
412 standard is "more constant" for current country than geometry
413 settings of a variety of TV capture cards which may work in ITU or
414 square pixel format.
415
416 Applications
417 ------------
418
419 Applications known to work with this driver:
420
421 TV viewing:
422
423 * xawtv
424 * kwintv
425 * probably any TV application that supports video4linux or video4linux2.
426
427 MJPEG capture/playback:
428
429 * mjpegtools/lavtools (or Linux Video Studio)
430 * gstreamer
431 * mplayer
432
433 General raw capture:
434
435 * xawtv
436 * gstreamer
437 * probably any application that supports video4linux or video4linux2
438
439 Video editing:
440
441 * Cinelerra
442 * MainActor
443 * mjpegtools (or Linux Video Studio)
444
445
446 Concerning buffer sizes, quality, output size etc.
447 --------------------------------------------------
448
449
450 The zr36060 can do 1:2 JPEG compression. This is really the theoretical
451 maximum that the chipset can reach. The driver can, however, limit compression
452 to a maximum (size) of 1:4. The reason for this is that some cards (e.g. Buz)
453 can't handle 1:2 compression without stopping capture after only a few minutes.
454 With 1:4, it'll mostly work. If you have a Buz, use 'low_bitrate=1' to go into
455 1:4 max. compression mode.
456
457 100% JPEG quality is thus 1:2 compression in practice. So for a full PAL frame
458 (size 720x576). The JPEG fields are stored in YUY2 format, so the size of the
459 fields are 720x288x16/2 bits/field (2 fields/frame) = 207360 bytes/field x 2 =
460 414720 bytes/frame (add some more bytes for headers and DHT (huffman)/DQT
461 (quantization) tables, and you'll get to something like 512kB per frame for
462 1:2 compression. For 1:4 compression, you'd have frames of half this size.
463
464 Some additional explanation by Martin Samuelsson, which also explains the
465 importance of buffer sizes:
466 --
467 > Hmm, I do not think it is really that way. With the current (downloaded
468 > at 18:00 Monday) driver I get that output sizes for 10 sec:
469 > -q 50 -b 128 : 24.283.332 Bytes
470 > -q 50 -b 256 : 48.442.368
471 > -q 25 -b 128 : 24.655.992
472 > -q 25 -b 256 : 25.859.820
473
474 I woke up, and can't go to sleep again. I'll kill some time explaining why
475 this doesn't look strange to me.
476
477 Let's do some math using a width of 704 pixels. I'm not sure whether the Buz
478 actually use that number or not, but that's not too important right now.
479
480 704x288 pixels, one field, is 202752 pixels. Divided by 64 pixels per block;
481 3168 blocks per field. Each pixel consist of two bytes; 128 bytes per block;
482 1024 bits per block. 100% in the new driver mean 1:2 compression; the maximum
483 output becomes 512 bits per block. Actually 510, but 512 is simpler to use
484 for calculations.
485
486 Let's say that we specify d1q50. We thus want 256 bits per block; times 3168
487 becomes 811008 bits; 101376 bytes per field. We're talking raw bits and bytes
488 here, so we don't need to do any fancy corrections for bits-per-pixel or such
489 things. 101376 bytes per field.
490
491 d1 video contains two fields per frame. Those sum up to 202752 bytes per
492 frame, and one of those frames goes into each buffer.
493
494 But wait a second! -b128 gives 128kB buffers! It's not possible to cram
495 202752 bytes of JPEG data into 128kB!
496
497 This is what the driver notice and automatically compensate for in your
498 examples. Let's do some math using this information:
499
500 128kB is 131072 bytes. In this buffer, we want to store two fields, which
501 leaves 65536 bytes for each field. Using 3168 blocks per field, we get
502 20.68686868... available bytes per block; 165 bits. We can't allow the
503 request for 256 bits per block when there's only 165 bits available! The -q50
504 option is silently overridden, and the -b128 option takes precedence, leaving
505 us with the equivalence of -q32.
506
507 This gives us a data rate of 165 bits per block, which, times 3168, sums up
508 to 65340 bytes per field, out of the allowed 65536. The current driver has
509 another level of rate limiting; it won't accept -q values that fill more than
510 6/8 of the specified buffers. (I'm not sure why. "Playing it safe" seem to be
511 a safe bet. Personally, I think I would have lowered requested-bits-per-block
512 by one, or something like that.) We can't use 165 bits per block, but have to
513 lower it again, to 6/8 of the available buffer space: We end up with 124 bits
514 per block, the equivalence of -q24. With 128kB buffers, you can't use greater
515 than -q24 at -d1. (And PAL, and 704 pixels width...)
516
517 The third example is limited to -q24 through the same process. The second
518 example, using very similar calculations, is limited to -q48. The only
519 example that actually grab at the specified -q value is the last one, which
520 is clearly visible, looking at the file size.
521 --
522
523 Conclusion: the quality of the resulting movie depends on buffer size, quality,
524 whether or not you use 'low_bitrate=1' as insmod option for the zr36060.c
525 module to do 1:4 instead of 1:2 compression, etc.
526
527 If you experience timeouts, lowering the quality/buffersize or using
528 'low_bitrate=1 as insmod option for zr36060.o might actually help, as is
529 proven by the Buz.
530
531 It hangs/crashes/fails/whatevers! Help!
532 ---------------------------------------
533
534 Make sure that the card has its own interrupts (see /proc/interrupts), check
535 the output of dmesg at high verbosity (load zr36067.o with debug=2,
536 load all other modules with debug=1). Check that your mainboard is favorable
537 (see question 2) and if not, test the card in another computer. Also see the
538 notes given in question 3 and try lowering quality/buffersize/capturesize
539 if recording fails after a period of time.
540
541 If all this doesn't help, give a clear description of the problem including
542 detailed hardware information (memory+brand, mainboard+chipset+brand, which
543 MJPEG card, processor, other PCI cards that might be of interest), give the
544 system PnP information (/proc/interrupts, /proc/dma, /proc/devices), and give
545 the kernel version, driver version, glibc version, gcc version and any other
546 information that might possibly be of interest. Also provide the dmesg output
547 at high verbosity. See 'Contacting' on how to contact the developers.
548
549 Maintainers/Contacting
550 ----------------------
551
552 Previous maintainers/developers of this driver are
553 - Laurent Pinchart <laurent.pinchart@skynet.be>
554 - Ronald Bultje rbultje@ronald.bitfreak.net
555 - Serguei Miridonov <mirsev@cicese.mx>
556 - Wolfgang Scherr <scherr@net4you.net>
557 - Dave Perks <dperks@ibm.net>
558 - Rainer Johanni <Rainer@Johanni.de>
559
560 Driver's License
561 ----------------
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 modify
566 it under the terms of the GNU General Public License as published by
567 the Free Software Foundation; either version 2 of the License, or
568 (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 of
572 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
573 GNU General Public License for more details.
574
575 See http://www.gnu.org/ for more information.
576

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

통합 Zoran driver와 FAQ

1-12

이 `GPL-2.0` 문서는 `zr360x7`, `zoran`, Buz, DC10·DC10+, DC30·DC30+, LML33 계열을 하나로 지원하는 통합 Zoran driver의 FAQ입니다.

원문 project website는 `http://mjpeg.sourceforge.net/driver-zoran/`입니다. 이어지는 절은 지원 card, TV decoder·encoder capability, module loading, mainboard 호환성, programming interface, application, JPEG buffer 계산과 문제 보고 절차를 설명합니다.

Zoran 문서 범위
영역대상
HardwareIomega Buz, LML33/R10, DC10/30 계열, AVS6EYES
Video chipsZoran controller·MJPEG codec, TV decoder·encoder
OperationModule option, chipset·IRQ, V4L2 application
CaptureJPEG quality, buffer size, compression rate
SupportTroubleshooting, 이전 maintainer, license

.. SPDX-License-Identifier: GPL-2.0

The Zoran driver
================

unified zoran driver (zr360x7, zoran, buz, dc10(+), dc30(+), lml33)

website: http://mjpeg.sourceforge.net/driver-zoran/


Frequently Asked Questions
--------------------------

지원 card와 chip 구성

13-188

지원 대상은 Iomega Buz, Linux Media Labs `LML33`·`LML33R10`, Pinnacle/Miro `DC10`·`DC10+`·`DC30`·`DC30+`와 여러 이름으로 판매된 관련 board입니다.

Iomega Buz는 `zr36067` PCI controller, `zr36060` MJPEG codec, `saa7111` TV decoder, `saa7185` TV encoder를 사용합니다. Composite와 S-video 입출력, PAL·SECAM 720x576 25 fps와 NTSC 720x480 29.97 fps를 지원하며 card number는 `7`입니다.

AverMedia 6 Eyes `AVS6EYES`는 `zr36067`, `zr36060`, `ks0127`, `bt866` 조합입니다. Physical input 6개 중 1-6은 composite, 1-2·3-4·5-6 쌍은 S-video, 1-3은 component로도 동작하며 composite output 하나가 있습니다. Norm과 frame size는 Buz와 같고 card number는 `8`입니다. 자동 검출되지 않으므로 `card=8`이 필요합니다.

`LML33`은 `zr36067`, `zr36060`, `bt819`, `bt856` 조합이고 card number `5`입니다. `LML33R10`은 `zr36067`, `zr36060`, `saa7114`, `adv7170` 조합이고 card number `6`입니다. 둘 다 composite와 S-video를 제공하며 PAL 720x576 25 fps와 NTSC 720x480 29.97 fps를 지원합니다.

Pinnacle/Miro `DC10(new)`은 `zr36057`, `zr36060`, `saa7110a`, `adv7176` 조합이고 card number `1`입니다. `DC10+`는 PCI controller가 `zr36067`인 같은 계열이며 card number `2`입니다. 두 card 모두 composite, S-video, internal 입출력을 제공하고 PAL·SECAM 768x576 25 fps와 NTSC 640x480 29.97 fps를 지원합니다.

`DC10(old)`은 `zr36057`, `zr36050`, `zr36016` 또는 Fuji `md0211` Video Front End, `vpx3220a`, `mse3000` 또는 `adv7176` 조합이고 card number `0`입니다. 입출력과 norm·geometry는 새 DC10 계열과 같습니다.

`DC30`은 `zr36057`, `zr36050`, `zr36016`, `vpx3225d/vpx3220a/vpx3216b`, `adv7176` 조합이고 card number `3`입니다. `DC30+`는 controller가 `zr36067`인 유사 조합이며 card number `4`입니다. 원문 driver 목록의 `zr36015` 표기를 포함해 각 module 이름은 source block에서 보존합니다.

각 board는 공통으로 `videodev`, `i2c-core`, `i2c-algo-bit`, `videocodec`와 board별 decoder·encoder·codec module을 사용합니다. 현재 `mse3000`과 `vpx3224` module은 제공되지 않는다고 문서가 명시합니다.

지원 board 요약
Card주요 chip입출력·norm번호
Iomega Buz`zr36067`, `zr36060`, `saa7111`, `saa7185`Composite/S-video; PAL·SECAM 720x576, NTSC 720x480`7`
AverMedia AVS6EYES`zr36067`, `zr36060`, `ks0127`, `bt866`6 composite, paired S-video, component, composite out`8`, 수동 지정
LML33`zr36067`, `zr36060`, `bt819`, `bt856`Composite/S-video; PAL 720x576, NTSC 720x480`5`
LML33R10`zr36067`, `zr36060`, `saa7114`, `adv7170`Composite/S-video; PAL 720x576, NTSC 720x480`6`
DC10(new)`zr36057`, `zr36060`, `saa7110a`, `adv7176`Composite/S-video/internal; PAL·SECAM 768x576, NTSC 640x480`1`
DC10+`zr36067`, `zr36060`, `saa7110a`, `adv7176`DC10(new)과 같은 입출력·norm`2`
DC10(old)`zr36057`, `zr36050`, `zr36016/md0211`, `vpx3220a`, `mse3000/adv7176`Composite/S-video/internal`0`
DC30`zr36057`, `zr36050`, `zr36016`, `vpx322x`, `adv7176`Composite/S-video/internal`3`
DC30+`zr36067`, `zr36050`, `zr36016`, `vpx322x`, `adv7176`Composite/S-video/internal`4`

PAL·SECAM frame rate는 25 fps, NTSC는 29.97 fps입니다.


What cards are supported
------------------------

Iomega Buz, Linux Media Labs LML33/LML33R10, Pinnacle/Miro
DC10/DC10+/DC30/DC30+ and related boards (available under various names).

Iomega Buz
~~~~~~~~~~

* Zoran zr36067 PCI controller
* Zoran zr36060 MJPEG codec
* Philips saa7111 TV decoder
* Philips saa7185 TV encoder

Drivers to use: videodev, i2c-core, i2c-algo-bit,
videocodec, saa7111, saa7185, zr36060, zr36067

Inputs/outputs: Composite and S-video

Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)

Card number: 7

AverMedia 6 Eyes AVS6EYES
~~~~~~~~~~~~~~~~~~~~~~~~~

* Zoran zr36067 PCI controller
* Zoran zr36060 MJPEG codec
* Samsung ks0127 TV decoder
* Conexant bt866  TV encoder

Drivers to use: videodev, i2c-core, i2c-algo-bit,
videocodec, ks0127, bt866, zr36060, zr36067

Inputs/outputs:
        Six physical inputs. 1-6 are composite,
        1-2, 3-4, 5-6 doubles as S-video,
        1-3 triples as component.
        One composite output.

Norms: PAL, SECAM (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)

Card number: 8

.. note::

   Not autodetected, card=8 is necessary.

Linux Media Labs LML33
~~~~~~~~~~~~~~~~~~~~~~

* Zoran zr36067 PCI controller
* Zoran zr36060 MJPEG codec
* Brooktree bt819 TV decoder
* Brooktree bt856 TV encoder

Drivers to use: videodev, i2c-core, i2c-algo-bit,
videocodec, bt819, bt856, zr36060, zr36067

Inputs/outputs: Composite and S-video

Norms: PAL (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)

Card number: 5

Linux Media Labs LML33R10
~~~~~~~~~~~~~~~~~~~~~~~~~

* Zoran zr36067 PCI controller
* Zoran zr36060 MJPEG codec
* Philips saa7114 TV decoder
* Analog Devices adv7170 TV encoder

Drivers to use: videodev, i2c-core, i2c-algo-bit,
videocodec, saa7114, adv7170, zr36060, zr36067

Inputs/outputs: Composite and S-video

Norms: PAL (720x576 @ 25 fps), NTSC (720x480 @ 29.97 fps)

Card number: 6

Pinnacle/Miro DC10(new)
~~~~~~~~~~~~~~~~~~~~~~~

* Zoran zr36057 PCI controller
* Zoran zr36060 MJPEG codec
* Philips saa7110a TV decoder
* Analog Devices adv7176 TV encoder

Drivers to use: videodev, i2c-core, i2c-algo-bit,
videocodec, saa7110, adv7175, zr36060, zr36067

Inputs/outputs: Composite, S-video and Internal

Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)

Card number: 1

Pinnacle/Miro DC10+
~~~~~~~~~~~~~~~~~~~

* Zoran zr36067 PCI controller
* Zoran zr36060 MJPEG codec
* Philips saa7110a TV decoder
* Analog Devices adv7176 TV encoder

Drivers to use: videodev, i2c-core, i2c-algo-bit,
videocodec, saa7110, adv7175, zr36060, zr36067

Inputs/outputs: Composite, S-video and Internal

Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)

Card number: 2

Pinnacle/Miro DC10(old)
~~~~~~~~~~~~~~~~~~~~~~~

* Zoran zr36057 PCI controller
* Zoran zr36050 MJPEG codec
* Zoran zr36016 Video Front End or Fuji md0211 Video Front End (clone?)
* Micronas vpx3220a TV decoder
* mse3000 TV encoder or Analog Devices adv7176 TV encoder

Drivers to use: videodev, i2c-core, i2c-algo-bit,
videocodec, vpx3220, mse3000/adv7175, zr36050, zr36016, zr36067

Inputs/outputs: Composite, S-video and Internal

Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)

Card number: 0

Pinnacle/Miro DC30
~~~~~~~~~~~~~~~~~~

* Zoran zr36057 PCI controller
* Zoran zr36050 MJPEG codec
* Zoran zr36016 Video Front End
* Micronas vpx3225d/vpx3220a/vpx3216b TV decoder
* Analog Devices adv7176 TV encoder

Drivers to use: videodev, i2c-core, i2c-algo-bit,
videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36016, zr36067

Inputs/outputs: Composite, S-video and Internal

Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)

Card number: 3

Pinnacle/Miro DC30+
~~~~~~~~~~~~~~~~~~~

* Zoran zr36067 PCI controller
* Zoran zr36050 MJPEG codec
* Zoran zr36016 Video Front End
* Micronas vpx3225d/vpx3220a/vpx3216b TV decoder
* Analog Devices adv7176 TV encoder

Drivers to use: videodev, i2c-core, i2c-algo-bit,
videocodec, vpx3220/vpx3224, adv7175, zr36050, zr36015, zr36067

Inputs/outputs: Composite, S-video and Internal

Norms: PAL, SECAM (768x576 @ 25 fps), NTSC (640x480 @ 29.97 fps)

Card number: 4

.. note::

   #) No module for the mse3000 is available yet
   #) No module for the vpx3224 is available yet

TV broadcast format과 decoder capability

189-279

NTSC·PAL·SECAM이라는 color system 이름만으로 frame을 decode하기에는 정보가 부족합니다. 각 TV standard에는 여러 broadcast format이 있고 모든 decoder나 driver 조합이 이를 전부 처리하지는 못합니다. 문서는 전 세계에 11개 TV broadcast format이 있다고 설명합니다.

CCIR은 signal broadcast에 필요한 parameter를 A, B, D, E, F, G, H, I, K, K1, L, M, N 등의 standard로 정의하지만 color system 자체는 거의 규정하지 않습니다. A·E·F는 더 이상 사용되지 않습니다.

일반적으로 NTSC는 미국·일본·멕시코·캐나다 등에서 쓰는 CCIR-M과 NTSC color system을, PAL은 여러 국가의 CCIR-B/G와 PAL을, SECAM은 프랑스 등의 CCIR-L과 SECAM을 가리킵니다.

SECAM의 다른 변형인 CCIR-D/K는 Bulgaria, China, Slovakia, Hungary, Republic of Korea, Poland, Romania 등에서 사용됩니다. CCIR-H는 PAL 또는 때때로 SECAM을 쓰며 Egypt, Libya, Sri Lanka, Syrian Arab Republic에서 사용됩니다. CCIR-I의 PAL은 Great Britain, Hong Kong, Ireland, Nigeria, South Africa에서 사용됩니다.

CCIR-N은 PAL color system·frame size와 NTSC frame rate를 결합하며 Argentina, Uruguay 등에서 사용됩니다. 이 설명은 audio broadcast 방식은 다루지 않습니다. 원문은 Sony 지원 site와 방송 norm 참고 URL 두 곳을 추가로 제공합니다.

`NTSC 4.43`은 주로 NTSC playback이 가능한 PAL VCR에서 쓰는 수정 NTSC이고, `PAL 60`과 `NTSC 44`도 같은 계열로 보입니다. `NTSC Comb`은 delay line 대신 comb filter로 chroma와 luma를 분리하는 decoder mode로 추정되지만 저자는 확정하지 못했습니다.

지원 TV decoder
Decoder도입·사용 card처리 가능한 format
Philips `saa7111`1997, BuzPAL B/G/H/I·N·M, NTSC M·N·4.43, SECAM
Philips `saa7110a`1995, DC10(new)·DC10+PAL B/G, NTSC M, SECAM
Philips `saa7114`2000, LML33R10PAL B/G/D/H/I/N·N·M, NTSC M·4.43, SECAM
Brooktree `bt819`1996, LML33PAL B/D/G/H/I, NTSC M
Micronas `vpx3220a`1996, DC30·DC30+PAL B/G/H/I·N·M·60, NTSC M·44·Comb, SECAM
Samsung `ks0127`AVS6EYESNTSC-M/N/44, PAL-M/N/B/G/H/I/D/K/L, SECAM

1.1 What the TV decoder can do an what not
------------------------------------------

The best know TV standards are NTSC/PAL/SECAM. but for decoding a frame that
information is not enough. There are several formats of the TV standards.
And not every TV decoder is able to handle every format. Also the every
combination is supported by the driver. There are currently 11 different
tv broadcast formats all aver the world.

The CCIR defines parameters needed for broadcasting the signal.
The CCIR has defined different standards: A,B,D,E,F,G,D,H,I,K,K1,L,M,N,...
The CCIR says not much about the colorsystem used !!!
And talking about a colorsystem says not to much about how it is broadcast.

The CCIR standards A,E,F are not used any more.

When you speak about NTSC, you usually mean the standard: CCIR - M using
the NTSC colorsystem which is used in the USA, Japan, Mexico, Canada
and a few others.

When you talk about PAL, you usually mean: CCIR - B/G using the PAL
colorsystem which is used in many Countries.

When you talk about SECAM, you mean: CCIR - L using the SECAM Colorsystem
which is used in France, and a few others.

There the other version of SECAM, CCIR - D/K is used in Bulgaria, China,
Slovakai, Hungary, Korea (Rep.), Poland, Rumania and a others.

The CCIR - H uses the PAL colorsystem (sometimes SECAM) and is used in
Egypt, Libya, Sri Lanka, Syrain Arab. Rep.

The CCIR - I uses the PAL colorsystem, and is used in Great Britain, Hong Kong,
Ireland, Nigeria, South Africa.

The CCIR - N uses the PAL colorsystem and PAL frame size but the NTSC framerate,
and is used in Argentina, Uruguay, an a few others

We do not talk about how the audio is broadcast !

A rather good sites about the TV standards are:
http://www.sony.jp/support/
http://info.electronicwerkstatt.de/bereiche/fernsehtechnik/frequenzen_und_normen/Fernsehnormen/
and http://www.cabl.com/restaurant/channel.html

Other weird things around: NTSC 4.43 is a modificated NTSC, which is mainly
used in PAL VCR's that are able to play back NTSC. PAL 60 seems to be the same
as NTSC 4.43 . The Datasheets also talk about NTSC 44, It seems as if it would
be the same as NTSC 4.43.
NTSC Combs seems to be a decoder mode where the decoder uses a comb filter
to split coma and luma instead of a Delay line.

But I did not defiantly find out what NTSC Comb is.

Philips saa7111 TV decoder
~~~~~~~~~~~~~~~~~~~~~~~~~~

- was introduced in 1997, is used in the BUZ and
- can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC N, NTSC 4.43 and SECAM

Philips saa7110a TV decoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~

- was introduced in 1995, is used in the Pinnacle/Miro DC10(new), DC10+ and
- can handle: PAL B/G, NTSC M and SECAM

Philips saa7114 TV decoder
~~~~~~~~~~~~~~~~~~~~~~~~~~

- was introduced in 2000, is used in the LML33R10 and
- can handle: PAL B/G/D/H/I/N, PAL N, PAL M, NTSC M, NTSC 4.43 and SECAM

Brooktree bt819 TV decoder
~~~~~~~~~~~~~~~~~~~~~~~~~~

- was introduced in 1996, and is used in the LML33 and
- can handle: PAL B/D/G/H/I, NTSC M

Micronas vpx3220a TV decoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- was introduced in 1996, is used in the DC30 and DC30+ and
- can handle: PAL B/G/H/I, PAL N, PAL M, NTSC M, NTSC 44, PAL 60, SECAM,NTSC Comb

Samsung ks0127 TV decoder
~~~~~~~~~~~~~~~~~~~~~~~~~

- is used in the AVS6EYES card and
- can handle: NTSC-M/N/44, PAL-M/N/B/G/H/I/D/K/L and SECAM

TV encoder capability

280-327

TV encoder는 decoder와 반대 방향으로 동작합니다. Digital data를 받아 composite 또는 SVHS signal을 생성하며 color system과 TV norm의 배경은 앞 decoder 절과 같습니다.

지원 TV encoder
Encoder도입·사용 card생성 가능한 format
Philips `saa7185`1996, BuzPAL B/G, NTSC M
Brooktree `bt856`1994, LML33PAL B/D/G/H/I/N·M, NTSC M, PAL-N Argentina
Analog Devices `adv7170`2000, 원문 `LML300R10`PAL B/D/G/H/I/N·M·60, NTSC M
Analog Devices `adv7175`1996, DC10·DC10+·DC10 old·DC30·DC30+PAL B/D/G/H/I/N·M, NTSC M
ITT `mse3000`1991, DC10 oldPAL, NTSC, SECAM
Conexant `bt866`AVS6EYESNTSC/PAL, PAL-M, PAL-N

`adv717x`는 PAL N을 생성할 수 있어야 하지만 register에는 PAL N 전용 설정이 없습니다. 문서는 다른 standard의 설정을 재사용해야 할 수 있으며 PAL M 설정이 동작할 가능성을 제시합니다.

What the TV encoder can do an what not
--------------------------------------

The TV encoder is doing the "same" as the decoder, but in the other direction.
You feed them digital data and the generate a Composite or SVHS signal.
For information about the colorsystems and TV norm take a look in the
TV decoder section.

Philips saa7185 TV Encoder
~~~~~~~~~~~~~~~~~~~~~~~~~~

- was introduced in 1996, is used in the BUZ
- can generate: PAL B/G, NTSC M

Brooktree bt856 TV Encoder
~~~~~~~~~~~~~~~~~~~~~~~~~~

- was introduced in 1994, is used in the LML33
- can generate: PAL B/D/G/H/I/N, PAL M, NTSC M, PAL-N (Argentina)

Analog Devices adv7170 TV Encoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- was introduced in 2000, is used in the LML300R10
- can generate: PAL B/D/G/H/I/N, PAL M, NTSC M, PAL 60

Analog Devices adv7175 TV Encoder
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- was introduced in 1996, is used in the DC10, DC10+, DC10 old, DC30, DC30+
- can generate: PAL B/D/G/H/I/N, PAL M, NTSC M

ITT mse3000 TV encoder
~~~~~~~~~~~~~~~~~~~~~~

- was introduced in 1991, is used in the DC10 old
- can generate: PAL , NTSC , SECAM

Conexant bt866 TV encoder
~~~~~~~~~~~~~~~~~~~~~~~~~

- is used in AVS6EYES, and
- can generate: NTSC/PAL, PAL-M, PAL-N

The adv717x, should be able to produce PAL N. But you find nothing PAL N
specific in the registers. Seem that you have to reuse a other standard
to generate PAL N, maybe it would work if you use the PAL M settings.

Module loading과 mainboard 호환성

328-396

먼저 `zr36067.o`를 load합니다. Card를 자동 검출하지 못하면 앞 절의 card number를 `card=X` insmod option으로 지정합니다. 여러 card는 `card=X1[,X2[,X3,[X4[..]]]]` 형식으로 지정합니다.

자동화를 위해 `/etc/modprobe.d/zoran.conf`에 `options zr36067 card=...`와 `alias char-major-81-0 zr36067`을 추가할 수 있습니다. 다만 alias는 module을 즉시 load하지 않고 요청 시 loading만 자동화합니다.

일부 system에서 일반 user가 `xawtv`를 시작하면 module loading 권한이 없어 `permission denied`가 날 수 있습니다. X를 기본 사용하면 `XF86Config-4`에 `Load "v4l"`을 추가하고, X를 쓰지 않으면 startup script인 보통 `rc.local`에서 `v4l-conf -c <device>`를 실행해 root account로 boot 때 module을 준비할 수 있습니다.

문서에 기록된 당시 경험은 SiS·Intel chipset을 상대적으로 양호하게, VIA를 문제 가능성이 높은 것으로 평가합니다. Buz는 평균적으로 DC10+·LML33보다 문제가 많았고 VIA MVP3·KT 계열에서 특히 좋지 않았습니다. 이 평가는 오래된 hardware 경험 기록이라는 맥락으로 읽어야 합니다.

두 Intel 440BX board는 dual CPU version이었습니다. 이후 Bernhard Praschinger는 AMD 751과 AMD 760에서 Buz가 perfect에서 tolerable 수준이었다고 덧붙였습니다.

대체로 Buz가 동작하면 LML33도 동작하고, LML33이 동작하면 DC10+·DC30+도 동작할 것으로 볼 수 있습니다. DC10+·DC30+가 지원 card 가운데 mainboard chipset 변화에 가장 관대하다고 문서는 설명합니다.

Capture timeout이 발생하면 mainboard를 바꾸거나 quality·buffer size를 낮춰 봅니다. Hang이 나면 IRQ를 확인하고 card가 단독 interrupt를 갖는지 확인해야 합니다.

Zoran module 준비
`zr36067.o` loadAutodetect 성공Device ready
Autodetect 실패`card=X` 또는 card list
`/etc/modprobe.d/zoran.conf``options zr36067 card=...``alias char-major-81-0 zr36067`
Boot-time root load`Load "v4l"` 또는 `v4l-conf -c <device>`
Capture testIRQ·timeout 확인

Card identification과 boot-time module loading 순서입니다.

문서에 기록된 mainboard 경험
ChipsetLML33Buz
VIA MVP3동작하지 않음으로 평가동작하지 않음으로 평가
Intel 430FXPerfectTolerable, movie당 3-4 frame drop
Intel 440BX earlyTolerable시간당 6-10 frame drop
Intel 440BX late거의 perfectTolerable
SiS735PerfectTolerable
VIA KT133문제가 커지기 시작Poor
AMD 751-Perfect-tolerable
AMD 760-Perfect-tolerable

How do I get this damn thing to work
------------------------------------

Load zr36067.o. If it can't autodetect your card, use the card=X insmod
option with X being the card number as given in the previous section.
To have more than one card, use card=X1[,X2[,X3,[X4[..]]]]

To automate this, add the following to your /etc/modprobe.d/zoran.conf:

options zr36067 card=X1[,X2[,X3[,X4[..]]]]
alias char-major-81-0 zr36067

One thing to keep in mind is that this doesn't load zr36067.o itself yet. It
just automates loading. If you start using xawtv, the device won't load on
some systems, since you're trying to load modules as a user, which is not
allowed ("permission denied"). A quick workaround is to add 'Load "v4l"' to
XF86Config-4 when you use X by default, or to run 'v4l-conf -c <device>' in
one of your startup scripts (normally rc.local) if you don't use X. Both
make sure that the modules are loaded on startup, under the root account.

What mainboard should I use (or why doesn't my card work)
---------------------------------------------------------


<insert lousy disclaimer here>. In short: good=SiS/Intel, bad=VIA.

Experience tells us that people with a Buz, on average, have more problems
than users with a DC10+/LML33. Also, it tells us that people owning a VIA-
based mainboard (ktXXX, MVP3) have more problems than users with a mainboard
based on a different chipset. Here's some notes from Andrew Stevens:

Here's my experience of using LML33 and Buz on various motherboards:

- VIA MVP3
        - Forget it. Pointless. Doesn't work.
- Intel 430FX (Pentium 200)
        - LML33 perfect, Buz tolerable (3 or 4 frames dropped per movie)
- Intel 440BX (early stepping)
        - LML33 tolerable. Buz starting to get annoying (6-10 frames/hour)
- Intel 440BX (late stepping)
        - Buz tolerable, LML3 almost perfect (occasional single frame drops)
- SiS735
        - LML33 perfect, Buz tolerable.
- VIA KT133(*)
        - LML33 starting to get annoying, Buz poor enough that I have up.

- Both 440BX boards were dual CPU versions.

Bernhard Praschinger later added:

- AMD 751
        - Buz perfect-tolerable
- AMD 760
        - Buz perfect-tolerable

In general, people on the user mailinglist won't give you much of a chance
if you have a VIA-based motherboard. They may be cheap, but sometimes, you'd
rather want to spend some more money on better boards. In general, VIA
mainboard's IDE/PCI performance will also suck badly compared to others.
You'll noticed the DC10+/DC30+ aren't mentioned anywhere in the overview.
Basically, you can assume that if the Buz works, the LML33 will work too. If
the LML33 works, the DC10+/DC30+ will work too. They're most tolerant to
different mainboard chipsets from all of the supported cards.

If you experience timeouts during capture, buy a better mainboard or lower
the quality/buffersize during capture (see 'Concerning buffer sizes, quality,
output size etc.'). If it hangs, there's little we can do as of now. Check
your IRQs and make sure the card has its own interrupts.

Programming interface와 application

397-445

Driver는 Video4Linux2를 따릅니다. V4L1 support와 Zoran custom ioctl은 kernel 2.6.38에서 제거됐습니다. Programming example은 MJPEG-tools의 `lavrec.c`, `lavplay.c`와 `http://mjpeg.sf.net/`에서 확인할 수 있습니다.

Driver는 현재 TV standard인 norm에 따라 `maxwidth`와 `maxheight`를 반환합니다. Application은 이 값을 질의하기 전에 올바른 norm을 먼저 설정해야 합니다. 한 국가의 TV standard가 capture card마다 달라질 수 있는 ITU 또는 square-pixel geometry보다 더 고정적이라는 설계입니다.

TV viewing에는 `xawtv`, `kwintv`와 V4L/V4L2 application이 알려져 있습니다. MJPEG capture·playback에는 `mjpegtools/lavtools` 또는 Linux Video Studio, `gstreamer`, `mplayer`를 사용할 수 있습니다.

General raw capture에는 `xawtv`, `gstreamer`와 일반 V4L/V4L2 application을, video editing에는 `Cinelerra`, `MainActor`, `mjpegtools` 또는 Linux Video Studio를 사용할 수 있습니다.

Interface와 application
용도지원·도구
Kernel APIVideo4Linux2; V4L1·custom ioctl은 2.6.38에서 제거
Programming example`lavrec.c`, `lavplay.c` in MJPEG-tools
Geometry queryNorm 설정 후 `maxwidth`·`maxheight` 조회
TV viewing`xawtv`, `kwintv`, V4L/V4L2 application
MJPEG capture/playback`lavtools`, Linux Video Studio, `gstreamer`, `mplayer`
Raw capture`xawtv`, `gstreamer`, V4L/V4L2 application
Video editing`Cinelerra`, `MainActor`, `mjpegtools`

Programming interface
---------------------

This driver conforms to video4linux2. Support for V4L1 and for the custom
zoran ioctls has been removed in kernel 2.6.38.

For programming example, please, look at lavrec.c and lavplay.c code in
the MJPEG-tools (http://mjpeg.sf.net/).

Additional notes for software developers:

   The driver returns maxwidth and maxheight parameters according to
   the current TV standard (norm). Therefore, the software which
   communicates with the driver and "asks" for these parameters should
   first set the correct norm. Well, it seems logically correct: TV
   standard is "more constant" for current country than geometry
   settings of a variety of TV capture cards which may work in ITU or
   square pixel format.

Applications
------------

Applications known to work with this driver:

TV viewing:

* xawtv
* kwintv
* probably any TV application that supports video4linux or video4linux2.

MJPEG capture/playback:

* mjpegtools/lavtools (or Linux Video Studio)
* gstreamer
* mplayer

General raw capture:

* xawtv
* gstreamer
* probably any application that supports video4linux or video4linux2

Video editing:

* Cinelerra
* MainActor
* mjpegtools (or Linux Video Studio)

JPEG compression, buffer와 quality 계산

446-530

`zr36060`의 이론상 최대 JPEG compression은 1:2입니다. Driver는 maximum output size를 1:4 compression으로 제한할 수도 있습니다. Buz 같은 일부 card는 1:2에서 몇 분 뒤 capture가 멈출 수 있으므로 `low_bitrate=1`을 사용하면 최대 1:4 mode로 동작합니다.

실질적으로 JPEG quality 100%가 1:2 compression입니다. Full PAL 720x576에서 JPEG field는 YUY2이므로 field당 `720x288x16/2 bits = 207360 bytes`, frame당 두 field로 `414720 bytes`입니다. Header와 DHT Huffman·DQT quantization table을 더하면 1:2에서 frame당 약 512 kB이고, 1:4에서는 절반 정도입니다.

Martin Samuelsson의 10초 output 예는 `-q 50 -b 128`에서 24,283,332 byte, `-q 50 -b 256`에서 48,442,368 byte, `-q 25 -b 128`에서 24,655,992 byte, `-q 25 -b 256`에서 25,859,820 byte를 기록했습니다.

704x288 한 field는 202,752 pixel입니다. Block당 64 pixel로 나누면 field당 3,168 block이고 pixel당 2 byte이므로 block당 128 byte 또는 1,024 bit입니다. Quality 100%의 1:2 compression은 계산상 block당 512 bit를 허용합니다.

`d1q50`은 block당 256 bit를 원하므로 3,168 block에 811,008 bit, field당 101,376 byte입니다. Frame은 field 두 개이므로 202,752 byte가 필요하고 frame 하나가 buffer 하나에 들어갑니다.

그러나 `-b128`은 128 kB, 즉 131,072 byte뿐입니다. 두 field에 나누면 field당 65,536 byte이고 block당 약 20.686 byte 또는 165 bit만 쓸 수 있습니다. 따라서 block당 256 bit 요청을 수용할 수 없어 `-q50`이 조용히 override되고 `-b128`이 우선해 대략 `-q32`가 됩니다.

Driver에는 지정 buffer의 6/8보다 많이 채우는 `-q`를 허용하지 않는 추가 rate limit이 있습니다. 165 bit의 6/8인 약 124 bit/block까지 다시 낮아져 `-q24`와 같아집니다. PAL 704-pixel width의 `-d1`에서 128 kB buffer로는 `-q24`보다 크게 사용할 수 없습니다.

같은 과정으로 세 번째 예도 `-q24`, 두 번째 예는 `-q48`로 제한됩니다. 지정한 `-q`를 실제로 사용하는 것은 마지막 예이며 file size에서 차이가 드러납니다.

결론적으로 결과 movie quality는 buffer size, quality와 `zr36060` module의 `low_bitrate=1` 사용 여부 등에 좌우됩니다. Timeout이 있으면 quality·buffer size를 낮추거나 `low_bitrate=1`로 1:4 compression을 쓰는 것이 도움이 될 수 있습니다.

PAL JPEG 크기 계산
단계계산결과
720-pixel PAL field`720x288x16/2 bits``207360 bytes/field`
두 field/frame`207360 x 2``414720 bytes/frame`
Header·DHT·DQT 포함1:2 compression약 `512 kB/frame`
704-pixel field`704x288 / 64``3168 blocks/field`
Raw block`64 pixels x 2 bytes``128 bytes = 1024 bits`
100% quality1:2`512 bits/block`
`d1q50``256 x 3168``101376 bytes/field`

`-q50 -b128`가 `-q24`로 제한되는 과정
128 kB buffer131072 bytes/frame65536 bytes/field
3168 blocks/field약 165 bits/block capacity
요청 `-q50`256 bits/block수용 불가
Buffer 우선약 `-q32`
6/8 rate limit124 bits/block최종 약 `-q24`

요청 quality보다 buffer capacity와 6/8 safety limit이 우선합니다.

Concerning buffer sizes, quality, output size etc.
--------------------------------------------------


The zr36060 can do 1:2 JPEG compression. This is really the theoretical
maximum that the chipset can reach. The driver can, however, limit compression
to a maximum (size) of 1:4. The reason for this is that some cards (e.g. Buz)
can't handle 1:2 compression without stopping capture after only a few minutes.
With 1:4, it'll mostly work. If you have a Buz, use 'low_bitrate=1' to go into
1:4 max. compression mode.

100% JPEG quality is thus 1:2 compression in practice. So for a full PAL frame
(size 720x576). The JPEG fields are stored in YUY2 format, so the size of the
fields are 720x288x16/2 bits/field (2 fields/frame) = 207360 bytes/field x 2 =
414720 bytes/frame (add some more bytes for headers and DHT (huffman)/DQT
(quantization) tables, and you'll get to something like 512kB per frame for
1:2 compression. For 1:4 compression, you'd have frames of half this size.

Some additional explanation by Martin Samuelsson, which also explains the
importance of buffer sizes:
--
> Hmm, I do not think it is really that way. With the current (downloaded
> at 18:00 Monday) driver I get that output sizes for 10 sec:
> -q 50 -b 128 : 24.283.332 Bytes
> -q 50 -b 256 : 48.442.368
> -q 25 -b 128 : 24.655.992
> -q 25 -b 256 : 25.859.820

I woke up, and can't go to sleep again. I'll kill some time explaining why
this doesn't look strange to me.

Let's do some math using a width of 704 pixels. I'm not sure whether the Buz
actually use that number or not, but that's not too important right now.

704x288 pixels, one field, is 202752 pixels. Divided by 64 pixels per block;
3168 blocks per field. Each pixel consist of two bytes; 128 bytes per block;
1024 bits per block. 100% in the new driver mean 1:2 compression; the maximum
output becomes 512 bits per block. Actually 510, but 512 is simpler to use
for calculations.

Let's say that we specify d1q50. We thus want 256 bits per block; times 3168
becomes 811008 bits; 101376 bytes per field. We're talking raw bits and bytes
here, so we don't need to do any fancy corrections for bits-per-pixel or such
things. 101376 bytes per field.

d1 video contains two fields per frame. Those sum up to 202752 bytes per
frame, and one of those frames goes into each buffer.

But wait a second! -b128 gives 128kB buffers! It's not possible to cram
202752 bytes of JPEG data into 128kB!

This is what the driver notice and automatically compensate for in your
examples. Let's do some math using this information:

128kB is 131072 bytes. In this buffer, we want to store two fields, which
leaves 65536 bytes for each field. Using 3168 blocks per field, we get
20.68686868... available bytes per block; 165 bits. We can't allow the
request for 256 bits per block when there's only 165 bits available! The -q50
option is silently overridden, and the -b128 option takes precedence, leaving
us with the equivalence of -q32.

This gives us a data rate of 165 bits per block, which, times 3168, sums up
to 65340 bytes per field, out of the allowed 65536. The current driver has
another level of rate limiting; it won't accept -q values that fill more than
6/8 of the specified buffers. (I'm not sure why. "Playing it safe" seem to be
a safe bet. Personally, I think I would have lowered requested-bits-per-block
by one, or something like that.) We can't use 165 bits per block, but have to
lower it again, to 6/8 of the available buffer space: We end up with 124 bits
per block, the equivalence of -q24. With 128kB buffers, you can't use greater
than -q24 at -d1. (And PAL, and 704 pixels width...)

The third example is limited to -q24 through the same process. The second
example, using very similar calculations, is limited to -q48. The only
example that actually grab at the specified -q value is the last one, which
is clearly visible, looking at the file size.
--

Conclusion: the quality of the resulting movie depends on buffer size, quality,
whether or not you use 'low_bitrate=1' as insmod option for the zr36060.c
module to do 1:4 instead of 1:2 compression, etc.

If you experience timeouts, lowering the quality/buffersize or using
'low_bitrate=1 as insmod option for zr36060.o might actually help, as is
proven by the Buz.

Hang·crash·capture 실패 진단

531-548

먼저 `/proc/interrupts`에서 card가 단독 interrupt를 갖는지 확인합니다. `zr36067.o`는 `debug=2`, 다른 module은 `debug=1`로 load해 높은 verbosity의 `dmesg`를 확인합니다.

Mainboard가 앞 호환성 경험에 비추어 적합한지 확인하고 필요하면 다른 computer에서 card를 시험합니다. 일정 시간 뒤 recording이 실패하면 quality, buffer size, capture size를 낮춰 봅니다.

그래도 해결되지 않으면 문제를 명확히 설명하고 memory 용량·brand, mainboard·chipset·brand, MJPEG card, processor, 관련 PCI card 등 상세 hardware 정보를 제공합니다. `/proc/interrupts`, `/proc/dma`, `/proc/devices`의 system PnP 정보도 포함합니다.

Kernel·driver·glibc·gcc version과 관련될 수 있는 기타 정보, 높은 verbosity의 `dmesg` output도 함께 제공합니다. 개발자 연락 방법은 뒤의 maintainer 절을 참고합니다.

문제 보고 checklist
분류확인·첨부 항목
Interrupt단독 IRQ, `/proc/interrupts`
Debug log`zr36067.o debug=2`, 기타 module `debug=1`, `dmesg`
Capture tuningQuality·buffer size·capture size 낮추기
HardwareMemory, mainboard/chipset, MJPEG card, CPU, PCI card
PnP state`/proc/interrupts`, `/proc/dma`, `/proc/devices`
Software versionsKernel, driver, glibc, gcc
Reproduction명확한 증상과 다른 computer 시험 결과

It hangs/crashes/fails/whatevers! Help!
---------------------------------------

Make sure that the card has its own interrupts (see /proc/interrupts), check
the output of dmesg at high verbosity (load zr36067.o with debug=2,
load all other modules with debug=1). Check that your mainboard is favorable
(see question 2) and if not, test the card in another computer. Also see the
notes given in question 3 and try lowering quality/buffersize/capturesize
if recording fails after a period of time.

If all this doesn't help, give a clear description of the problem including
detailed hardware information (memory+brand, mainboard+chipset+brand, which
MJPEG card, processor, other PCI cards that might be of interest), give the
system PnP information (/proc/interrupts, /proc/dma, /proc/devices), and give
the kernel version, driver version, glibc version, gcc version and any other
information that might possibly be of interest. Also provide the dmesg output
at high verbosity. See 'Contacting' on how to contact the developers.

이전 maintainer와 developer

549-559

문서가 기록한 이전 maintainer·developer는 Laurent Pinchart, Ronald Bultje, Serguei Miridonov, Wolfgang Scherr, Dave Perks, Rainer Johanni입니다.

이전 maintainer·developer
이름연락처
Laurent Pinchart`laurent.pinchart@skynet.be`
Ronald Bultje`rbultje@ronald.bitfreak.net`
Serguei Miridonov`mirsev@cicese.mx`
Wolfgang Scherr`scherr@net4you.net`
Dave Perks`dperks@ibm.net`
Rainer Johanni`Rainer@Johanni.de`

Maintainers/Contacting
----------------------

Previous maintainers/developers of this driver are
- Laurent Pinchart <laurent.pinchart@skynet.be>
- Ronald Bultje rbultje@ronald.bitfreak.net
- Serguei Miridonov <mirsev@cicese.mx>
- Wolfgang Scherr <scherr@net4you.net>
- Dave Perks <dperks@ibm.net>
- Rainer Johanni <Rainer@Johanni.de>

Driver license

560-575

이 driver는 GNU General Public License 조건으로 배포됩니다. Free Software Foundation이 공표한 GPL version 2 또는 선택에 따라 그 이후 version의 조건으로 재배포하거나 수정할 수 있습니다.

Program은 유용하길 바라며 제공되지만 어떠한 보증도 없습니다. 상품성이나 특정 목적 적합성에 대한 묵시적 보증도 제공하지 않습니다. 자세한 내용은 GNU General Public License와 `http://www.gnu.org/`를 참고합니다.

License 요약
항목내용
LicenseGNU General Public License
VersionVersion 2 또는 선택에 따른 이후 version
권한재배포와 수정
보증명시적·묵시적 보증 없음
정보`http://www.gnu.org/`

Driver's License
----------------

    This driver is distributed under the terms of the General Public License.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

See http://www.gnu.org/ for more information.