≡ Menu

audio controller

Recently, my old TV Tuner card died. So I brought a new Pinnacle PCTV Card 50i/110i as it is supported by Linux kernel. All you have to do is insert card into PCI slot and boot into Linux. Following instructions are tested on Ubuntu Linux (kernel version 2.6.22-14-generic), but should work on any other Linux distribution.

Step # 1: Update your PCI ID list

Use update-pciids command to fetch the current version of the pci.ids file from the primary distribution site and installs it
$ sudo update-pciids
Output:

[sudo] password for vivek:
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  126k  100  126k    0     0  33247      0  0:00:03  0:00:03 --:--:-- 43577
Done.

Step # 2: Make sure PCI card is detected by Linux kernel

Use lspci command to display information about all PCI buses in the system and all devices connected to them including newly installed PCI card:
$ lspci
Output:

00:00.0 Host bridge: Intel Corporation 82975X Memory Controller Hub
00:01.0 PCI bridge: Intel Corporation 82975X PCI Express Root Port
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)
00:1c.4 PCI bridge: Intel Corporation 82801GR/GH/GHM (ICH7 Family) PCI Express Port 5 (rev 01)
00:1c.5 PCI bridge: Intel Corporation 82801GR/GH/GHM (ICH7 Family) PCI Express Port 6 (rev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)
00:1f.2 IDE interface: Intel Corporation 82801GB/GR/GH (ICH7 Family) SATA IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
01:00.0 VGA compatible controller: nVidia Corporation GeForce 8600 GT (rev a1)
03:00.0 SATA controller: Marvell Technology Group Ltd. 88SE6145 SATA II PCI-E controller (rev a1)
04:00.0 Ethernet controller: Intel Corporation 82573E Gigabit Ethernet Controller (Copper) (rev 03)
04:00.3 Serial controller: Intel Corporation Active Management Technology - SOL (rev 03)
04:00.4 IPMI SMIC interface: Intel Corporation 82573E KCS (Active Management) (rev 03)
05:00.0 Multimedia controller: Philips Semiconductors SAA7133/SAA7135 Video Broadcast Decoder (rev d1)
05:02.0 Network controller: RaLink RT2561/RT61 rev B 802.11g
05:04.0 FireWire (IEEE 1394): Texas Instruments TSB43AB23 IEEE-1394a-2000 Controller (PHY/Link)

Step #3: saa7134 driver

This card requires saa7134 driver (a video4linux module) in the Linux kernel. This driver is by default included in most distro including Ubuntu. Just run old good dmesg command to see if a driver loaded or not.
$ dmesg | grep saa7133
Output:

Jan 14 11:15:50 vivek-desktop kernel: [ 8123.516415] saa7134 ALSA driver for DMA sound unloaded
Jan 14 11:16:25 vivek-desktop kernel: [ 8157.694883] saa7130/34: v4l2 driver version 0.2.14 loaded
Jan 14 11:16:25 vivek-desktop kernel: [ 8157.694939] saa7133[0]: found at 0000:05:00.0, rev: 209, irq: 21, latency: 32, mmio: 0x9300c800
Jan 14 11:16:25 vivek-desktop kernel: [ 8157.694948] saa7133[0]: subsystem: 11bd:002e, board: Pinnacle PCTV 40i/50i/110i (saa7133) [card=77,autodetected]
Jan 14 11:16:25 vivek-desktop kernel: [ 8157.694960] saa7133[0]: board init: gpio is 200e000
Jan 14 11:16:25 vivek-desktop kernel: [ 8157.804325] input: Pinnacle PCTV as /class/input/input7
Jan 14 11:16:25 vivek-desktop kernel: [ 8157.804347] ir-kbd-i2c: Pinnacle PCTV detected at i2c-0/0-0047/ir0 [saa7133[0]]
Jan 14 11:16:25 vivek-desktop kernel: [ 8157.888301] tuner 0-004b: chip found @ 0x96 (saa7133[0])
Jan 14 11:16:25 vivek-desktop kernel: [ 8157.940031] tuner 0-004b: setting tuner address to 61
Jan 14 11:16:25 vivek-desktop kernel: [ 8157.979968] tuner 0-004b: type set to tda8290+75a
Jan 14 11:16:26 vivek-desktop kernel: [ 8159.369812] tuner 0-004b: setting tuner address to 61
Jan 14 11:16:26 vivek-desktop kernel: [ 8159.409750] tuner 0-004b: type set to tda8290+75a
Jan 14 11:16:28 vivek-desktop kernel: [ 8160.799592] saa7133[0]: i2c eeprom 00: bd 11 2e 00 54 20 1c 00 43 43 a9 1c 55 d2 b2 92
Jan 14 11:16:28 vivek-desktop kernel: [ 8160.799607] saa7133[0]: i2c eeprom 10: ff e0 60 02 ff 20 ff ff ff ff ff ff ff ff ff ff
Jan 14 11:16:28 vivek-desktop kernel: [ 8160.799619] saa7133[0]: i2c eeprom 20: 01 2c 01 23 23 01 04 30 98 ff 00 e2 ff 22 00 c2
Jan 14 11:16:28 vivek-desktop kernel: [ 8160.799639] saa7133[0]: i2c eeprom 30: 96 ff 03 30 15 01 ff 15 0e 6c a3 ea 03 b0 9b 70
Jan 14 11:16:28 vivek-desktop kernel: [ 8160.799655] saa7133[0]: i2c eeprom 40: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Jan 14 11:16:28 vivek-desktop kernel: [ 8160.799674] saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Jan 14 11:16:28 vivek-desktop kernel: [ 8160.799693] saa7133[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Jan 14 11:16:28 vivek-desktop kernel: [ 8160.799714] saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
Jan 14 11:16:30 vivek-desktop kernel: [ 8163.366190] saa7133[0]: registered device video0 [v4l2]
Jan 14 11:16:30 vivek-desktop kernel: [ 8163.366212] saa7133[0]: registered device vbi0
Jan 14 11:16:30 vivek-desktop kernel: [ 8163.366228] saa7133[0]: registered device radio0
Jan 14 11:16:30 vivek-desktop kernel: [ 8163.442604] saa7134 ALSA driver for DMA sound loaded
Jan 14 11:16:30 vivek-desktop kernel: [ 8163.442633] saa7133[0]/alsa: saa7133[0] at 0x9300c800 irq 21 registered as card -2

As you see everything was automatically detected and loaded by Linux kernel.

Step #4: Watch TV with tvview

tvtime is a high quality Linux television application for use with video capture cards. tvtime processes the input from a capture card and displays it on a computer monitor or projector. It is simple and easy to use. To install tvtime, enter:
$ sudo apt-get install tvtime

Step #5: Configure tvview application

Start tvtime by visiting Application > Sound and Video > Tvtime Television Viewer. Alternatively, you can type the following command at a shell prompt:
$ tvtime &
Right click to open a setup menu. You can also hit [F1] or [tab] key to show configuration menu:
Linux Tvtime configuration hit [F1] or [tab] key to show configuration menu
(Fig. 01: Linux tvtime application configuration menu)
First, you need to setup video source, frequencies and channels etc.

Setup video source

Visit Input Configuration > Change Video Source > Setup source as per your setup.

Setup frequencies table

You need to setup the channels you are receiving with the tuner. Here we use europe frequencies table. Visit Channel management > Change Frequency table > Select new table

Scan Channel

Finally, you need to scan for channels by visiting Channel management > Change Frequency table > Scan channels for signal > Back > Exit

Step #6: Sound configuration

You need to attach internal cables to get sound out of TV tuner card. Use driver saa7134-oss or saa7134-alsa to get sound out of card. This driver get loaded automatically. Open terminal and type the following command to hear the audio through ALSA using tvtime (or other programs that don't support it directly):
$ sox -c 2 -s -w -r 32000 -t ossdsp /dev/dsp1 -t ossdsp -w -r 32000 /dev/dsp
Note: You may have to adjust /dev/dsp1.
To watch tv, enter:
$ tvtime
tvtime a high quality Linux television application in action
(Fig. 02: Tvtime a high quality Linux television application in action)

tvtime Keyboard keys

Here are the core set of key bindings you want to learn for using tvtime:

  • Escape or q : Quit
  • F1 or tab : Show menu
  • up/down arrow keys : Change channels
  • 0-9 and Enter : Change channels
  • Backspace : Jump to previous channel
  • m : Mute
  • +/- or left/right : Volume control
  • f : Fullscreen
  • s : Take a screenshot

Further readings: