Mythtv
I start this blog with an account of re-installing everything on my mythtv box after I borked an Ubuntu upgrade over SSH last week and managed to uninstall everything including init. I decided to start over with the latest Ubuntu (Jaunty) and also realised I need to record more details on how to get things like this going so that next time I do something stupid, I can go back and consult my notes.
I won’t go through the ins and outs of installing Ubuntu, the short story is I downloaded the ubuntu server install disk on a Vista laptop, burnt an image using some random software that was already on the machine, put the CD in the drive of the target machine, rebooted and followed the instructions. About half an hour later I had a root prompt.
I suppose I should state some specs of the machine, it’s the cheapest desktop I could find but with a 2.2GHz dual pentium and 1GB of RAM. It has two hard disks, the primary is an 80GB ATA and has the OS, the secondary is a 320GB ATA and has all the mythtv data.
For mythtv, I have a Hauppuage PVR 350 (which is an analog tuner with built-in TV-out and IR receiver: I actually wouldn’t buy this card if I had my time again since digital is so much better but at the time (2005), I wanted to get a card that was well documented as working in linux). I also recently acquired a mystery dual digital tuner PCI card.
I plugged the monitor in for most of the installation because TV-out was one of the last things I attempted but I also did a fair bit over SSH so I didn’t have to sit on the floor in front of my TV (since I don’t have a wireless keyboard or mouse!)
I ran aptitude and installed mythbuntu-desktop which did a bunch of stuff and I just followed my nose for most of it. In the lirc configuration, I chose ‘Hauppuage remote’ (more on this later).
Then I turned my attention to the tuner hardware. The first step is to examine the dmesg output to see what the kernel figured out about the hardware while it was booting, with any luck, the kernel autoloads most modules.
You can look at the dmesg output below, but I’ll note at this stage that I could see mostly happy messages about a cx88 module and an ivtv module. The dmesg output also gives some clues about where to find the devices in the /dev hierarchy but is not always reliable (in this case the ivtv output is very helpful but the cx88 not so much)
Next I had a look at lspci which gives you the chipset names and PCI slot numbers / addresses. The PCI address becomes useful later.
I used the PCI addresses to have a look at the /sys filesystem as well, e.g. here are some paths I found that helped:
$ ls /sys/bus/pci/devices/0000\:01\:09.0/video4linux/
vbi1 video1$ ls /sys/bus/pci/devices/0000\:01\:09.2/dvb/
dvb0.demux0 dvb0.dvr0 dvb0.frontend0 dvb0.net0$ ls /sys/bus/pci/devices/0000\:01\:0a.0/video4linux/
radio0 vbi0 vbi16 vbi8 video0 video16 video24 video32 video48
Now that I knew the /dev paths for the tuner cards and knew their chipset, I was ready to configure mythtv. Mythbuntu has a way that you can get to a mythbuntu setup screen within mythtv and from their you can run mythtv-setup but it’s just as easy to get a console up: move the mouse to the top of the screen and a menu pops down from which you can start a console.
A brief walkthrough of the mythtv-setup menus, anything I don’t mention was left as default:
General: set TV Format to PAL, set Channel frequency table to Australia (because I live there) and timezone to +1000. Set Allow Transcoding jobs to yes (but haven’t tried this yet),
Capture cards: ‘Analog V4L Capture Card’ on /dev/video0 (from looking at dmesg output), ‘DVB DTV Capture Card’ with DVB device number 0 (since dmesg was printing cx880)
Video Sources: I made one source for each card and left the grabber blank (because I use shepherd which sets this up later)
Input Connections: Used the Tuner input on the analog card and the DVB input on the digital card: pretty straightforward.
Channel Editor: did a scan on both cards and didn’t edit any of the channel names just yet.
Storage: set it to use a path on my second hard disk.
After that, I exited mythtv-setup, alt-tabbed to the mythfrontend and watched some TV on the computer monitor. At this stage I found out that the remote control buttons weren’t mapped correctly and that the volume was muted (since I wasn’t getting any sound).
To unmute the volume, I ran alsamixer in a console and pressed ‘m’ on the master, PCM and front channels. I also ran them all up to 100% (using up arrow) and quit (press esc). The channel levels are saved and restored when you reboot so you should only have to do this once.
At this stage I needed a break so it seems like a good place to end this post. Next will be setting up shepherd and then the trials and tribulations of TV-out and then maybe a few posts on other details that needed taking care of.
For reference, dmesg gobbledygook follows:
[ 7.529148] ivtv: Start initialization, version 1.4.0
[ 7.529264] ivtv0: Initializing card #0
[ 7.529267] ivtv0: Autodetected Hauppauge card (cx23415 based)
[ 7.529666] ivtv 0000:01:0a.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22
[ 7.574031] cx88/2: cx2388x MPEG-TS Driver Manager version 0.0.6 loaded
[ 7.584588] tveeprom 0-0050: Hauppauge model 48139, rev K2B7, serial# 8661663
[ 7.584591] tveeprom 0-0050: tuner model is Philips FM1216ME MK5 (idx 117, type 38)
[ 7.584594] tveeprom 0-0050: TV standards PAL PAL SECAM PAL (eeprom 0×74)
[ 7.584596] tveeprom 0-0050: audio processor is MSP4418 (idx 25)
[ 7.584597] tveeprom 0-0050: decoder processor is SAA7115 (idx 19)
[ 7.584599] tveeprom 0-0050: has radio, has IR receiver, has no IR transmitter
[ 7.584601] ivtv0: Autodetected Hauppauge WinTV PVR-350
[ 7.598900] cx88/0: cx2388x v4l2 driver version 0.0.6 loaded
[ 7.773418] HDA Intel 0000:00:1b.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
[ 7.773487] HDA Intel 0000:00:1b.0: setting latency timer to 64
[ 7.791765] saa7127 0-0044: saa7129 found0x88 (ivtv i2c driver #0) [ 7.834963] msp3400 0-0040: MSP4418G-B3 found0×80 (ivtv i2c driver #0)
[ 7.834966] msp3400 0-0040: msp3400 supports nicam and radio, mode is autodetect and autoselect
[ 7.858343] tuner 0-0043: chip found0x86 (ivtv i2c driver #0) [ 7.864667] tda9887 0-0043: creating new instance [ 7.864670] tda9887 0-0043: tda988[5/6/7] found [ 7.866013] tuner 0-0061: chip found0xc2 (ivtv i2c driver #0)
[ 7.873880] tuner-simple 0-0061: creating new instance
[ 7.873884] tuner-simple 0-0061: type set to 38 (Philips PAL/SECAM multi (FM1216ME MK3))
[ 7.887812] ivtv0: Registered device video0 for encoder MPG (4096 kB)
[ 7.887834] ivtv0: Registered device video32 for encoder YUV (2048 kB)
[ 7.887854] ivtv0: Registered device vbi0 for encoder VBI (1024 kB)
[ 7.887875] ivtv0: Registered device video24 for encoder PCM (320 kB)
[ 7.887908] ivtv0: Registered device radio0 for encoder radio
[ 7.887927] ivtv0: Registered device video16 for decoder MPG (1024 kB)
[ 7.887945] ivtv0: Registered device vbi8 for decoder VBI (64 kB)
[ 7.887963] ivtv0: Registered device vbi16 for decoder VOUT
[ 7.887984] ivtv0: Registered device video48 for decoder YUV (1024 kB)
[ 7.887986] ivtv0: Initialized card #0: Hauppauge WinTV PVR-350
[ 7.888011] ivtv: End initialization
[ 7.888646] cx880: subsystem: 18ac:db11, board: DViCO FusionHDTV DVB-T Plus [card=21,autodetected], frontend(s): 1
[ 7.888648] cx880: TV tuner type 4, Radio tuner type -1 cx2388× 8802 Driver Manager
[ 8.071523] cx88-mpeg driver manager 0000:01:09.2: PCI INT A -> GSI 21 (level, low) -> IRQ 21 found at 0000:01:09.2, rev: 5, irq: 21, latency: 64, mmio: 0xbe000000
[ 8.071551] cx8802_probe() allocating 1 frontend(s)
[ 8.071612] cx8800 0000:01:09.0: PCI INT A -> GSI 21 (level, low) -> IRQ 21 found at 0000:01:09.0, rev: 5, irq: 21, latency: 64, mmio: 0xbd000000 registered device video1 [v4l2] registered device vbi1
[ 8.092980] cx88/2: cx2388x dvb driver version 0.0.6 loaded
[ 8.092983] cx88/2: registering cx8802 driver, type: dvb access: shared subsystem: 18ac:db11, board: DViCO FusionHDTV DVB-T Pl
us [card=21] cx2388x based DVB/ATSC card
[ 8.176201] DVB: registering new adapter (cx880)
[ 8.176205] DVB: registering adapter 0 frontend 0 (Zarlink MT352 DVB-T)...
[ 15.474165] lirc_dev: IR Remote Control driver registered, major 61
[ 15.508177] bttv: driver version 0.9.17 loaded
[ 15.508180] bttv: using 8 buffers with 2080k (520 pages) each for capture
[ 15.514760] lirc_i2c: chip 0×10020 found @ 0×18 (Hauppauge IR)
[ 15.514787] lirc_dev: lirc_register_plugin: sample_rate: 10
[ 21.450038] ivtv 0000:01:0a.0: firmware: requesting v4l-cx2341x-enc.fw
[ 21.490095] eth0: no IPv6 routers present
[ 21.515037] ivtv0: Loaded v4l-cx2341x-enc.fw firmware (376836 bytes)
[ 21.515073] ivtv 0000:01:0a.0: firmware: requesting v4l-cx2341x-dec.fw
[ 21.536209] ivtv0: Loaded v4l-cx2341x-dec.fw firmware (262144 bytes)
[ 21.730404] ivtv0: Encoder revision: 0×02060039
[ 21.730537] ivtv0: Decoder revision: 0×02020023
[ 21.771351] ivtv 0000:01:0a.0: firmware: requesting v4l-cx2341x-init.mpg
[ 21.816212] ivtv0: Loaded v4l-cx2341x-init.mpg firmware (155648 bytes)
And here is the lspci output:
$ lspci01:09.0 Multimedia video controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder (rev 05)
01:09.2 Multimedia controller: Conexant Systems, Inc. CX23880/1/2/3 PCI Video and Audio Decoder [MPEG Port] (rev 05)
01:0a.0 Multimedia video controller: Internext Compression Inc iTVC15 MPEG-2 Encoder (rev 01)
