A while ago, I got a crazy cheap ATI TV Wonder HD 600 USB TV Tuner from Woot for $20. They’re still on Amazon for almost $50. The original XO doesn’t even come close to having the horsepower to use it, but the XO 1.5 does.
Now why in the world would you want to watch TV on the XO? Say the power goes out as a hurricane blows through, so your internet is down. And you can’t find the batteries for your radio! Well, get out your XO and watch your local weatherman freak out. Or if a thunderstorm knocks out the power in the middle of the big football game, you’re not completely SOL.
Of course, you have to compile modules into the kernel. I tried with 2.6.31 and it didn’t work, but a bit of research later I found out that it should work with later kernels. Luckily you can get 2.6.35 from the git repository now.
git clone git://dev.laptop.org/olpc-2.6
git checkout origin/olpc-2.6.35
When I did up the config, I enabled the following modules. How did I know which modules? Well, I plugged the USB TV Tuner into my desktop and did lsmod to see what it was using. Once I figured that out, I used xconfig, as it’s very easy to search and browse around.
Search for “dvb”
Enable “DVB For Linux” and “Support for various USB DVB devices”
Empia EM28xx USB video capture support
Empia EM29xx ALSA audio module
DVB/ATSC Support for em28xx based TV cards
Compile and install the kernel like usual. You’ll also need the firmware linked from this page:
I’m using the mplayer I compiled for the XO 1.5 beforehand. The only other dependency is:
yum install dvb-apps
So you’ve got all that and have booted into your custom 2.6.35 kernel. If the XO 1.5 stalls booting, power it off, then power it back on while holding down the checkmark button.
Here’s what lsmod should give you when you plug in the TV tuner:
[olpc@192 ~]$ lsmod
Module Size Used by
em28xx_dvb 4980 0
tda10023 5551 1 em28xx_dvb
zl10353 5769 1 em28xx_dvb
lgdt330x 6534 1 em28xx_dvb
dvb_core 73123 2 em28xx_dvb,lgdt330x
em28xx_alsa 5487 0
tuner 14221 1
tuner_xc2028 15854 2 em28xx_dvb,tuner
tvp5150 13279 1
em28xx 72432 2 em28xx_dvb,em28xx_alsa
videobuf_vmalloc 3448 1 em28xx
tveeprom 9825 1 em28xx
fuse 55004 2
xt_tcpudp 1903 3
iptable_filter 1040 1
ip_tables 7748 1 iptable_filter
x_tables 11658 3 xt_tcpudp,iptable_filter,ip_tables
uinput 5920 1
via_camera 12914 0
v4l2_common 11909 4 tuner,tvp5150,em28xx,via_camera
videodev 34750 5 tuner,tvp5150,em28xx,via_camera,v4l2_common
v4l1_compat 12454 1 videodev
videobuf_dma_sg 6811 1 via_camera
videobuf_core 11770 4 em28xx,videobuf_vmalloc,via_camera,videobuf_dma_sg
mousedev 8370 0
psmouse 21485 0
serio_raw 3788 0
libertas_sdio 7341 0
libertas 70143 1 libertas_sdio
cfg80211 116798 1 libertas
And here are the device nodes it creates:
[olpc@192 ~]$ ls /dev/dvb/adapter0/
demux0 dvr0 frontend0 net0
Before you can watch TV, you’ll need to create your channel list. This is for US broadcast stations. Make sure to do this as the olpc user.
scandvb /usr/share/dvb-apps/atsc/us-NTSC-center-frequencies-8VSB > /home/olpc/channels.conf
You’ll get a bunch of “tuning failed!!” messages as it goes through all the frequencies. This will also take several minutes. Hopefully you’ll be able to pick up some channels.
[olpc@192 ~]$ cat channels.conf
Not too bad! But I live at the base of Red Mountain where most of the area’s transmitters are located. I took this picture from my backyard.
I’ve already set up my /home/olpc/.mplayer/config
[olpc@192 ~]$ cat /home/olpc/.mplayer/config
lavdopts=skiploopfilter=all:fast=1 #DVD playback crashes with this
I copy channels.conf into /home/olpc/.mplayer so mplayer can see it. I’m ready to watch TV!
mplayer -cache 8192 dvb://WBRC
Oh, look, here’s our crazy local weatherman wearing a ridiculous bow tie.
Since WBRC is the local Fox affiliate, I can change its line in channels.conf to
…so I don’t have to remember the station call letters:
mplayer -cache 8192 dvb://FOX
This will use almost all of the XO 1.5’s CPU, so don’t plan on doing anything else while you’re watching TV. And while playback is decent enough, it’s still going to be kinda jerky at times.
A couple of the HD channels here don’t want to play at the correct aspect ratio. I started them up like this:
Then maximized and restored the mplayer window to make the stream look pretty much OK. You might have to drag the window down a bit as well.
If you want to take screenshots of the TV broadcast, add this to the mplayer command and you can hit “s” to take a screenshot to the current working directory.
Here’s a screenshot of our local Labor Day weekend forecast. Apparently we’re supposed to “eat outside” on Saturday. I’ll see if I can’t have lunch out on the porch, then.
Audio level is very low. Run alsamixer as root (!?!) to max it up.
The camera doesn’t work, as the TV tuner takes over /dev/video0 Not sure if it’s due to the 2.6.35 kernel or compiling the TV tuner support.
Switching between Sugar and Gnome gives the message:
/bin/sh: /sys/devices/platform/dcon/freeze: no such file or directory
… And there’s no dcon directory
Hit enter to get to a console, then “halt -p” and boot back up into Sugar or Gnome with the power and checkmark buttons.