Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
.\" $NetBSD: bktr.4,v 1.19 2018/08/31 19:36:28 sevan Exp $
.\"
.\" Copyright (c) 2000, 2001, 2002, 2003, 2004, 2005 Thomas Klausner
.\" 	All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. The name of the author may not be used to endorse or promote products
.\"    derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd August 30, 2011
.Dt BKTR 4
.Os
.Sh NAME
.Nm bktr
.Nd Brooktree 848 compatible TV card driver
.Sh SYNOPSIS
.Cd "bktr* at pci? dev ? function ?"
.Cd radio* at bktr?
.Pp
.In dev/ic/bt8xx.h
.Pp
.Cd options BKTR_OVERRIDE_CARD=n
.Cd options BKTR_OVERRIDE_TUNER=n
.Cd options BKTR_OVERRIDE_DBX=n
.Cd options BKTR_OVERRIDE_MSP=n
.Cd options BKTR_SYSTEM_DEFAULT=n
.Cd options BKTR_USE_PLL
.Cd options BKTR_GPIO_ACCESS
.Cd options BKTR_NO_MSP_RESET
.\" The following options have no effect:
.\" .Cd options BKTR_430_FX_MODE
.\" .Cd options BKTR_SIS_VIA_MODE
.Sh DESCRIPTION
This driver supports video capture (frame grabber) and TV tuner cards
based on the
.Tn Brooktree
.Tn Bt848 ,
.Tn Bt848A ,
.Tn Bt849A ,
.Tn Bt878 ,
and
.Tn Bt879
chips.
.Pp
Note that
.Nm
is not part of the
.Xr dtv 4
framework.
.Pp
Supported cards include most cards by
.Tn AVerMedia ,
.Tn Hauppauge ,
.Tn Leadtek ,
.Tn Miro ,
.Tn Pinnacle ,
.Tn Pixelview ,
.Tn Terratec ,
and some other companies, especially all cards based on the
.Tn Brooktree
.Tn Bt848 ,
.Tn Bt848A ,
.Tn Bt849A ,
.Tn Bt878 ,
or
.Tn Bt879
chips.
A notable exception are the
.Tn ATI
.Tn All-in-Wonder
cards.
.Pp
The following kernel configuration options are available:
.Bl -ohang
.It Cd options BKTR_OVERRIDE_CARD=n
If the card is not recognized correctly by the auto-detection routine,
it can be overridden by setting this option to the appropriate
value.
The following values are allowed:
.Bl -tag -width 2n -compact
.It 1
Pinnacle Systems (Miro) TV,
.It 2
Hauppauge WinCast/TV,
.It 3
STB TV/PCI,
.It 4
Intel Smart Video III and Videologic Captivator PCI,
.It 5
IMS TV Turbo,
.It 6
AVerMedia TV/FM,
.It 7
MMAC Osprey,
.It 8
NEC PK-UG-X017,
.It 9
I/O DATA GV-BCTV2/PCI,
.It 10
Animation Technologies FlyVideo,
.It 11
Zoltrix TV,
.It 12
KISS TV/FM PCI,
.It 13
Video Highway Xtreme,
.It 14
Askey/Dynalink Magic TView,
.It 15
Leadtek WinFast TV 2000/VC100,
.It 16
TerraTec TerraTV+,
and
.It 17
TerraTec TValue.
.El
.It Cd options BKTR_OVERRIDE_TUNER=n
If the TV tuner is not recognized correctly by the auto-detection
routine, it can be overridden by setting this option to the
appropriate value.
Known values are:
.Bl -tag -width 2n -compact
.It 1
Temic NTSC,
.It 2
Temic PAL,
.It 3
Temic SECAM,
.It 4
Philips NTSC,
.It 5
Philips PAL,
.It 6
Philips SECAM,
.It 7
Temic PAL I,
.It 8
Philips PAL I,
.It 9
Philips FR1236 NTSC FM,
.It 10
Philips FR1216 PAL FM,
.It 11
Philips FR1236 SECAM FM,
.It 12
ALPS TSCH5 NTSC FM,
and
.It 13
ALPS TSBH1 NTSC.
.El
.It Cd options BKTR_OVERRIDE_DBX=n
To override detection of the BTSC (dbx) chip, set this to
.Em 1
if you have one, or
.Em 0
if not.
.It Cd options BKTR_OVERRIDE_MSP=n
To override detection of the MSP 34xx chip, set this to
.Em 1
if you have one, or
.Em 0
if not.
.It Cd options BKTR_SYSTEM_DEFAULT=n
If this option is set to
.Em BROOKTREE_PAL
default to PAL, else to NTSC.
.It Cd options BKTR_USE_PLL
Default to PLL instead of XTAL.
.It Cd options BKTR_GPIO_ACCESS
Use
.Fn ioctl Ns s
for direct GPIO access.
.It Cd options BKTR_NO_MSP_RESET
Skip the MSP reset.
This option is handy if you initialize the MSP audio in another
operating system first and then do a soft reboot.
.\" The following options have no effect:
.\" .It Cd options BKTR_430_FX_MODE
.\" .It Cd options BKTR_SIS_VIA_MODE
.El
.Sh VIDEO CAPTURE INTERFACE
The video capture interface to
.Nm
is accessed through the
.Pa /dev/bktrN
devices.
The following
.Xr ioctl 2
commands are supported on the Brooktree848 video capture interface:
.Bl -tag -width Ds
.It Dv METEORSFMT Fa "unsigned long *"
This command sets the video format, also sometimes referred to as the
video norm.
The supported formats are:
.Pp
.Bl -tag -compact -width 28n
.It Dv METEOR_FMT_NTSC
NTSC
.It Dv METEOR_FMT_PAL
PAL
.It Dv METEOR_FMT_SECAM
SECAM
.It Dv METEOR_FMT_AUTOMODE
hardware default
.El
.It Dv METEORGFMT Fa "unsigned long *"
This command retrieves the current video format to the
.Vt unsigned long *
argument.
.It Dv METEORSETGEO Fa "struct meteor_geomet *"
This command sets the video properties that affect the bit size of
a frame through the
.Vt meteor_geomet *
argument.
.Bd -literal
struct meteor_geomet {
	u_short		rows;	 /* height in pixels*/
	u_short		columns; /* width in pixels */
	u_short		frames;
	u_long		oformat;
}
.Ed
.Pp
The
.Va frames
field is the number of frames to buffer.
Currently only 1 frame is supported for most operations.
.Pp
The
.Va oformat
field is a bit-field describing the output pixel format
type and which video fields to capture.
The following are supported pixel format types:
  .Pp
.Bl -tag -compact -width 28n
.It Dv METEOR_GEO_RGB16
16-bit RGB
.It Dv METEOR_GEO_RGB24
24-bit RGB in 32 bits
.It Dv METEOR_GEO_YUV_PACKED
16-bit 4:2:2 YUV
.It Dv METEOR_GEO_YUV_PLANAR
16-bit 4:2:2 YUV
.It Dv METEOR_GEO_YUV_UNSIGNED
unsigned UV
.It Dv METEOR_GEO_YUV_422
.It Dv METEOR_GEO_YUV_12
.It Dv METEOR_GEO_YUV_9
.El
.Pp
The following are supported field capture modes:
.Pp
.Bl -tag -compact -width 28n
.It Dv METEOR_GEO_ODD_ONLY
only odd fields
.It Dv METEOR_GEO_EVEN_ONLY
only even fields
.El
.Pp
By default, frames will consist of both the odd and even fields.
.It Dv METEORGSUPPIXFMT Fa "struct meteor_pixfmt *"
This command is used interactively to fetch descriptions of supported
output pixel formats into the
.Vt meteor_pixfmt *
argument.
.Bd -literal
struct meteor_pixfmt {
	u_int          index;
	METEOR_PIXTYPE type;
	u_int          Bpp;		/* bytes per pixel */
	u_long         masks[3];	/* YUV bit masks */
	unsigned       swap_bytes :1;
	unsigned       swap_shorts:1;
};
.Ed
.Pp
To query all the supported formats, start with an index field of 0 and
continue with successive encodings (1, 2, ...) until the command returns
an error.
.It Dv METEORSACTPIXFMT Fa "int *"
This command sets the active pixel format.
The
.Vt int *
argument is the index of the pixel format as returned by
.Dv METEORGSUPPIXFMT .
.It Dv METEORGACTPIXFMT Fa "int *"
This command fetches the active pixel format index into the
.Vt int *
argument.
.It Dv METEORSINPUT Fa "unsigned long *"
This command sets the input port of the Brooktree848 device.
The following are supported input ports:
.Pp
.Bl -tag -compact -width 28n
.It Dv METEOR_INPUT_DEV0
composite (RCA)
.It Dv METEOR_INPUT_DEV1
tuner
.It Dv METEOR_INPUT_DEV2
composite S-video
.It Dv METEOR_INPUT_DEV3
mystery device
.It Dv METEOR_INPUT_DEV_RGB
rgb meteor
.It Dv METEOR_INPUT_DEV_SVIDEO
S-Video
.El
.Pp
Not all devices built with Brooktree848 chips support the
full list of input ports.
.It Dv METEORGINPUT Fa "unsigned long *"
This command retrieves the current input port to the
.Vt unsigned long *
argument.
.It Dv METEORSFPS Fa "unsigned short *"
This command sets the number of frames to grab each second.
Valid frame rates are integers from 0 to 30.
.It Dv METEORGFPS Fa "unsigned short *"
This command fetches the number of frames to grab each second into the
.Vt unsigned short *
argument.
.It Dv METEORCAPTUR Fa "int *"
This command controls capturing of video data.
The following are valid arguments:
.Pp
.Bl -tag -compact -width 28n
.It Dv METEOR_CAP_SINGLE
capture one frame
.It Dv METEOR_CAP_CONTINOUS
continuously capture
.It Dv METEOR_CAP_STOP_CONT
stop continuous capture
.El
.It Dv METEORSSIGNAL Fa "unsigned int *"
This command controls the signal emission properties of
.Nm .
If the
.Vt unsigned int *
argument is a valid signal, then that signal will be emitted
when either a frame or field capture has completed.
To select between frame or field signalling, the following arguments
are used:
.Pp
.Bl -tag -compact -width 28n
.It Dv METEOR_SIG_FRAME
signal every frame
.It Dv METEOR_SIG_FIELD
signal every field
.El
.Pp
By default, signals will be generated for every frame.
Generation of signals is terminated with the
.Dv METEOR_SIG_MODE_MASK
argument.
.El
.Sh TUNER INTERFACE
Most cards supported by this driver feature a hardware television tuner
on the I2C bus.
The tuner interface to
.Nm
is accessed through the
.Pa /dev/tunerN
devices.
The following
.Xr ioctl 2
commands are supported on the tuner interface:
.Bl -tag -width Ds
.It Dv TVTUNER_SETTYPE Fa "unsigned int *"
This command sets the tuner's TV channel set, also sometimes called the TV
channel band.
This setting is used to calculate the proper tuning frequencies.
The desired channel set must be selected before attempting to set the tuner
channel or frequency.
The following is a list of valid channel sets:
.Pp
.Bl -tag -compact -width 28n
.It Dv CHNLSET_NABCST
North America broadcast
.It Dv CHNLSET_CABLEIRC
North America IRC cable
.It Dv CHNLSET_CABLEHRC
North America HRC cable
.It Dv CHNLSET_WEUROPE
Western Europe
.It Dv CHNLSET_JPNBCST
Japan broadcast
.It Dv CHNLSET_JPNCABLE
Japan cable
.It Dv CHNLSET_XUSSR
Russia
.It Dv CHNLSET_AUSTRALIA
Australia
.It Dv CHNLSET_FRANCE
France
.El
.It Dv TVTUNER_GETTYPE Fa "unsigned int *"
This command fetches the tuner's current channel set to the
.Vt unsigned int *
argument.
.It Dv TVTUNER_SETCHNL Fa "unsigned int *"
This command sets the tuner's frequency to a specified channel in the
current channel set.
.It Dv TVTUNER_GETCHNL Fa "unsigned int *"
This command fetches the last selected channel.
Note that it is not necessarily the current channel.
In particular, changing the tuner's frequency by a command other than
.Dv TVTUNER_SETCHNL
will not update this setting, and it defaults to 0 on driver
initialization.
.It Dv TVTUNER_SETFREQ Fa "unsigned int *"
This command sets the tuner's frequency to 1/16th the value of the
.Vt unsigned int *
argument, in MHz.
Note that the current channelset is used to determine frequency
offsets when this command is executed.
.It Dv TVTUNER_GETFREQ Fa "unsigned int *"
This command fetches the tuner's current frequency to the
.Vt unsigned int *
argument.
Note that this value is 16 times the actual tuner frequency, in MHz.
.It Dv BT848_SAUDIO Fa "int *"
This command controls the audio input port and mute state.
The following is a list of valid arguments:
.Pp
.Bl -tag -compact -width 18n
.It Dv AUDIO_TUNER
tuner audio port
.It Dv AUDIO_EXTERN
external audio port
.It Dv AUDIO_INTERN
internal audio port
.It Dv AUDIO_MUTE
mute audio
.It Dv AUDIO_UNMUTE
unmute audio
.El
.It Dv BT848_GAUDIO Fa "int *"
This command fetches the audio input and mute state bits to the
.Vt int *
argument.
.El
.Sh FILES
.Bl -tag -width /dev/tuner* -compact
.It Pa /dev/bktr*
.Nm
driver interface device
.It Pa /dev/tuner*
.Nm
tuner interface device
.It Pa /dev/vbi*
teletext interface device
.El
.Sh SEE ALSO
.Xr options 4 ,
.Xr pci 4 ,
.Xr radio 4 ,
.Pa pkgsrc/audio/xmradio ,
.Pa pkgsrc/multimedia/ffmpeg ,
.Pa pkgsrc/multimedia/fxtv
.Sh HISTORY
The
.Nm
driver appeared in
.Fx 2.2
and
.Nx 1.5 .
.Sh AUTHORS
.An -nosplit
The
.Nm
driver was originally written by
.An "Amancio Hasty"
for
.Fx
and is now maintained by
.An "Roger Hardiman" .
.Nx
porting was done by
.An "Bernd Ernesti" ,
.An "Berndt Josef Wulf" ,
.An "Matthias Scheler" ,
and
.An "Thomas Klausner" .