BKTR(4)

πŸ“¦
version 11.0 Β· 2 versions
, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

bktr β€” Brooktree 848 compatible TV card driver. Yep bestie, this is the BKTR(4) manual page and we're gonna get through it together, hand in hand, no cap πŸ’…


✨ SYNOPSIS ✨

bktr* at pci? dev ? function ?
radio* at bktr?

#include <dev/ic/bt8xx.h>

options BKTR_OVERRIDE_CARD=n
options BKTR_OVERRIDE_TUNER=n
options BKTR_OVERRIDE_DBX=n
options BKTR_OVERRIDE_MSP=n
options BKTR_SYSTEM_DEFAULT=n
options BKTR_USE_PLL
options BKTR_GPIO_ACCESS
options BKTR_NO_MSP_RESET

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so this driver is the whole personality for video capture (frame grabber) and TV tuner cards built on the Brooktree Bt848, Bt848A, Bt849A, Bt878, and Bt879 chips. Iconic chips, honestly.

Important vibe check first: bktr is not part of the dtv(4) framework. Not in it. Separate. Don't @ me.

Supported cards include most cards by AVerMedia, Hauppauge, Leadtek, Miro, Pinnacle, Pixelview, Terratec, and some other companies β€” especially all cards based on the Brooktree Bt848, Bt848A, Bt849A, Bt878, or Bt879 chips. A notable exception are the ATI All-in-Wonder cards, which are simply not invited to this party 😭

The following kernel configuration options are available:

  • options BKTR_OVERRIDE_CARD=n β€” if the card is not recognized correctly by the auto-detection routine (happens, auto-detect can be a little flop sometimes), you can override it by setting this option to the appropriate value. The following values are allowed:
    1. 1 β€” Pinnacle Systems (Miro) TV
    2. 2 β€” Hauppauge WinCast/TV
    3. 3 β€” STB TV/PCI
    4. 4 β€” Intel Smart Video III and Videologic Captivator PCI
    5. 5 β€” IMS TV Turbo
    6. 6 β€” AVerMedia TV/FM
    7. 7 β€” MMAC Osprey
    8. 8 β€” NEC PK-UG-X017
    9. 9 β€” I/O DATA GV-BCTV2/PCI
    10. 10 β€” Animation Technologies FlyVideo
    11. 11 β€” Zoltrix TV
    12. 12 β€” KISS TV/FM PCI
    13. 13 β€” Video Highway Xtreme
    14. 14 β€” Askey/Dynalink Magic TView
    15. 15 β€” Leadtek WinFast TV 2000/VC100
    16. 16 β€” TerraTec TerraTV+, and
    17. 17 β€” TerraTec TValue.
  • options BKTR_OVERRIDE_TUNER=n β€” if the TV tuner is not recognized correctly by the auto-detection routine, override it with this one. Known values are:
    1. 1 β€” Temic NTSC
    2. 2 β€” Temic PAL
    3. 3 β€” Temic SECAM
    4. 4 β€” Philips NTSC
    5. 5 β€” Philips PAL
    6. 6 β€” Philips SECAM
    7. 7 β€” Temic PAL I
    8. 8 β€” Philips PAL I
    9. 9 β€” Philips FR1236 NTSC FM
    10. 10 β€” Philips FR1216 PAL FM
    11. 11 β€” Philips FR1236 SECAM FM
    12. 12 β€” ALPS TSCH5 NTSC FM, and
    13. 13 β€” ALPS TSBH1 NTSC.
  • options BKTR_OVERRIDE_DBX=n β€” to override detection of the BTSC (dbx) chip, set this to 1 if you have one, or 0 if not. Just be honest with it 🫢
  • options BKTR_OVERRIDE_MSP=n β€” to override detection of the MSP 34xx chip, set this to 1 if you have one, or 0 if not.
  • options BKTR_SYSTEM_DEFAULT=n β€” if this option is set to BROOKTREE_PAL, default to PAL, else to NTSC.
  • options BKTR_USE_PLL β€” default to PLL instead of XTAL.
  • options BKTR_GPIO_ACCESS β€” use ioctl()s for direct GPIO access.
  • 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. Sneaky little dual-boot hack, I respect it πŸ’…

πŸ”₯ VIDEO CAPTURE INTERFACE πŸ”₯

The video capture interface to bktr is accessed through the /dev/bktrN devices. The following ioctl(2) commands are supported on the Brooktree848 video capture interface:

🌈 METEORSFMT unsigned long *

This command sets the video format, also sometimes referred to as the video norm. The supported formats are:

  • METEOR_FMT_NTSC β€” NTSC
  • METEOR_FMT_PAL β€” PAL
  • METEOR_FMT_SECAM β€” SECAM
  • METEOR_FMT_AUTOMODE β€” hardware default

πŸŽ€ METEORGFMT unsigned long *

This command retrieves the current video format into the unsigned long * argument.

⭐ METEORSETGEO struct meteor_geomet *

This command sets the video properties that affect the bit size of a frame through the meteor_geomet * argument.

struct meteor_geomet {
        u_short         rows;    /* height in pixels*/
        u_short         columns; /* width in pixels */
        u_short         frames;
        u_long          oformat;
}

The frames field is the number of frames to buffer. Currently only 1 frame is supported for most operations β€” so don't get too ambitious with it, bestie πŸ™ˆ

The 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:

  • METEOR_GEO_RGB16 β€” 16-bit RGB
  • METEOR_GEO_RGB24 β€” 24-bit RGB in 32 bits
  • METEOR_GEO_YUV_PACKED β€” 16-bit 4:2:2 YUV
  • METEOR_GEO_YUV_PLANAR β€” 16-bit 4:2:2 YUV
  • METEOR_GEO_YUV_UNSIGNED β€” unsigned UV
  • METEOR_GEO_YUV_422
  • METEOR_GEO_YUV_12
  • METEOR_GEO_YUV_9

The following are supported field capture modes:

  • METEOR_GEO_ODD_ONLY β€” only odd fields
  • METEOR_GEO_EVEN_ONLY β€” only even fields

By default, frames will consist of both the odd and even fields. Balanced, as all things should be ✨

πŸ¦‹ METEORGSUPPIXFMT struct meteor_pixfmt *

This command is used interactively to fetch descriptions of supported output pixel formats into the meteor_pixfmt * argument.

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;
}

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. That error isn't a fail, it's a graduation πŸŽ“

πŸ’– METEORSACTPIXFMT int *

This command sets the active pixel format. The int * argument is the index of the pixel format as returned by METEORGSUPPIXFMT.

🌸 METEORGACTPIXFMT int *

This command fetches the active pixel format index into the int * argument.

πŸ‘‘ METEORSINPUT unsigned long *

This command sets the input port of the Brooktree848 device. The following are supported input ports:

  • METEOR_INPUT_DEV0 β€” composite (RCA)
  • METEOR_INPUT_DEV1 β€” tuner
  • METEOR_INPUT_DEV2 β€” composite S-video
  • METEOR_INPUT_DEV3 β€” mystery device πŸ”
  • METEOR_INPUT_DEV_RGB β€” rgb meteor
  • METEOR_INPUT_DEV_SVIDEO β€” S-Video

Not all devices built with Brooktree848 chips support the full list of input ports. So like… check before you plug your whole heart into port 3, okay? 😭

πŸ“ METEORGINPUT unsigned long *

This command retrieves the current input port into the unsigned long * argument.

🧚 METEORSFPS unsigned short *

This command sets the number of frames to grab each second. Valid frame rates are integers from 0 to 30.

πŸ’œ METEORGFPS unsigned short *

This command fetches the number of frames to grab each second into the unsigned short * argument.

🌈 METEORCAPTUR int *

This command controls capturing of video data. The following are valid arguments:

  • METEOR_CAP_SINGLE β€” capture one frame
  • METEOR_CAP_CONTINOUS β€” continuously capture
  • METEOR_CAP_STOP_CONT β€” stop continuous capture

⭐ METEORSSIGNAL unsigned int *

This command controls the signal emission properties of bktr. If the 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:

  • METEOR_SIG_FRAME β€” signal every frame
  • METEOR_SIG_FIELD β€” signal every field

By default, signals will be generated for every frame. Generation of signals is terminated with the METEOR_SIG_MODE_MASK argument. Periodt β€” that's the off switch πŸ”Œ


πŸ’… TUNER INTERFACE πŸ’…

Most cards supported by this driver feature a hardware television tuner on the I2C bus. The tuner interface to bktr is accessed through the /dev/tunerN devices. The following ioctl(2) commands are supported on the tuner interface:

πŸŽ€ TVTUNER_SETTYPE 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 β€” order of operations, bestie, it matters 🫢 The following is a list of valid channel sets:

  • CHNLSET_NABCST β€” North America broadcast
  • CHNLSET_CABLEIRC β€” North America IRC cable
  • CHNLSET_CABLEHRC β€” North America HRC cable
  • CHNLSET_WEUROPE β€” Western Europe
  • CHNLSET_JPNBCST β€” Japan broadcast
  • CHNLSET_JPNCABLE β€” Japan cable
  • CHNLSET_XUSSR β€” Russia
  • CHNLSET_AUSTRALIA β€” Australia
  • CHNLSET_FRANCE β€” France

πŸ¦‹ TVTUNER_GETTYPE unsigned int *

This command fetches the tuner's current channel set into the unsigned int * argument.

🌸 TVTUNER_SETCHNL unsigned int *

This command sets the tuner's frequency to a specified channel in the current channel set.

πŸ‘‘ TVTUNER_GETCHNL 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 TVTUNER_SETCHNL will not update this setting β€” and it defaults to 0 on driver initialization. So your "last selected channel" memory can be a little delulu, that's just how it is πŸ’€

✨ TVTUNER_SETFREQ unsigned int *

This command sets the tuner's frequency to 1/16th the value of the unsigned int * argument, in MHz. Note that the current channelset is used to determine frequency offsets when this command is executed. Math! But make it fashion πŸ“

πŸ“ TVTUNER_GETFREQ unsigned int *

This command fetches the tuner's current frequency into the unsigned int * argument. Note that this value is 16 times the actual tuner frequency, in MHz. Yes, 16Γ—. It's giving conversion era, and honestly she ate with that consistency πŸ”₯

πŸ’œ BT848_SAUDIO int *

This command controls the audio input port and mute state. The following is a list of valid arguments:

  • AUDIO_TUNER β€” tuner audio port
  • AUDIO_EXTERN β€” external audio port
  • AUDIO_INTERN β€” internal audio port
  • AUDIO_MUTE β€” mute audio
  • AUDIO_UNMUTE β€” unmute audio

🧚 BT848_GAUDIO int *

This command fetches the audio input and mute state bits into the int * argument.


🌈 FILES 🌈

  • /dev/bktr* β€” bktr driver interface device
  • /dev/tuner* β€” bktr tuner interface device
  • /dev/vbi* β€” teletext interface device

still more to come, stay tuned bestie πŸ‘€

🌈 SEE ALSO ✨

okay so if you wanna go deeper down this rabbit hole (and honestly why wouldn't you πŸ’…), go peek at:

  • options(4) β€” kernel config option lore, iykyk
  • pci(4) β€” the PCI bus icon itself
  • radio(4) β€” radio device gang πŸŽ€
  • pkgsrc/audio/xmradio β€” a whole lil app for ur tuner vibes
  • pkgsrc/multimedia/ffmpeg β€” the goat of multimedia, no cap
  • pkgsrc/multimedia/fxtv β€” the classic TV watcher bestie πŸ¦‹

πŸŽ€ HISTORY πŸŽ€

okay so fun little time-travel moment ✨ the bktr driver first appeared in FreeBSD 2.2 and then in NetBSD 1.5. it's giving elder millennial of drivers, honestly iconic of it 🌸


πŸ‘‘ AUTHORS πŸ‘‘

real ones, in order, let's go 🫢:

  • the bktr driver was originally written by Amancio Hasty for FreeBSD, and is now maintained by Roger Hardiman πŸ’–
  • the NetBSD porting was done by Bernd Ernesti, Berndt Josef Wulf, Matthias Scheler, and Thomas Klausner 🌟

and that's literally the whole page bestie, u ate it up πŸ“ thanks for reading all the way to the end, ur a real one fr fr πŸ’œ

cute lil sign-off: this page came from the Debian crew, dated August 30, 2011, and it's the BKTR(4) manual page πŸŽ€βœ¨ go forth and capture some video, u got this πŸ’…
πŸ“¦ where this page comes from