Tuesday, April 28, 2009

Record TV programs with Asus U3100 Mini in my EeePC

I have recently purchased an Asus My Cinema-U3100 Mini USB DVB-T Digital TV Tuner and I spent the last few days testing how to record TV programs with it. Although it is 100% EeePC compatible, the supplied driver asus-dmbth-20080528.tar.bz2 is only for watching TV, but not for recording.

To install this driver and the Digital TV (DVBT) program, follow the instructions in the readme.txt, copy the package to "My Home" (from the folder \For EeePC\Linux of the TV Tuner - Driver & Utilities CD), then open a terminal and enter these commands:
sudo su
tar jxvf asus-dmbth-20080528.tar.bz2
cd asus-dmbth-20080528
Then simply plug-in the ASUS USB dongle, and the AP will auto launch. [Note: You can also start this program with the icon "Digital TV (DVBT) in the "Play" tab]

The manuals in the CD are not useful to EeePC Linux users at all. However, Asus do have a U3000/U3100 Mini Quick Guide For EeePC on Linux Operating System on their website.

Basically, the initial setup is of course, selecting country and scanning for available channels. I don't know why, although it is listed in the manual, but there is no selection for "Hong Kong". But anyway, with the coaxial cable of home antenna connected, I have been able to watch TV for all available free Hong Kong TV channels. [NB. The portable AV antennas is of no use in my home.]

Just for watching TV, this is simple enough. But I bought this mainly for recording TV programs so that I don't need to stay up late to watch those weekend blockbuster movies, and of course skip the ads. So I have to look for a program that can record TV programs.

Initially, I looked for MythTV. There is a wiki page on getting Asus MyCinema U3100 Mini USB to work: http://www.mythtv.org/wiki/Asus_My_Cinema_U3100_mini, but apparently this is for other Linux distributions, not for EeePC Linux.

Meeting with no success, I checked on kaffeine and found that Asus has provided a package kaffeine-dtv (and v4ldvbpb). And further checking their dependencies, it seems that these 2 packages are built all independent. They come pre-installed in EeePC Linux version 1.6 en locale, but should also be possible to install in any other version.

To install this, you can add this entry to your /etc/apt/sources.list,
deb http://update.eeepc.asus.com/1.6 en main
Then in a terminal,
sudo apt-get update
sudo apt-get install kaffeine-dtv
[EDIT 2009/5/3: Re-installing kaffeine-dtv again in my 4G with the standard 701 version, I met with an error: not able to overwrite the file /etc/udev/rules.d/15-usbmycinema.rules, and has to install with the dpkg force overwrite option. Be careful you need to backup the file first and restore it after this operation, or the popup TV won't work.]

To run kaffeine is a bit tricky. After some trials, I've found that to be able for the program to find the DVB device at start up, you have to run kaffeine as root.
sudo kaffeine &
EDIT 2009/5/4: I have worked out another way to run kaffeine by ordinary user instead of root because I don't feel comfortable running applications as root. I got this information from this blog. And to achieve this, I set an bash alias for the command "kaffeine" by editing ~/.bashrc and add this line:
alias kaffeine='sudo chgrp user /dev/dvb0*; kaffeine'

Next, again, is to scan for TV channels. From the pull down menu, select [DVB] > [Channels].

Then click on [START Scan]. For the first time, it will take quite a while. If channels can be found (will show up in the "Found" box on the right), click on [Select All], then [ Add Selected].

Now you can watch TV with kaffeine. If you want to record instantaneously, you can either select [DVB] > [Instant Record], or just press on the icon in the shape of a floppy disk. But you will probably need to change the "Records directory" first because a 30 mins file is 2.25 GB.

To do this, from the menu select [DVB] > [Configure DVB]. In the [Recording] tab, you can find the "Records directory". You will probably need an USB stick or SDHC to store this file.

Finally, to schedule recording is very straightforward, select [DVB] > [Timers], then enter start/stop time and channel. However, be careful not to watch TV while recording another channel. In my experience, kaffeine will record the channel you are watching instead of the channel you've told it to record.

What's next?

- I guess I still need to write a simple shell script to close kaffeine and switch off my EeePC after finish recording the TV program.
- Also, how to convert programs recorded by kaffeine to another video format, e.g. mpeg4, for to watch with my cellphone.
- Fix font display problem with program list in Chinese.
- Finally work out how to use the remote controller (need to re-compile the kernel modules).

EDIT 2009/5/3: I found that my EeePC cannot properly shutdown after watching TV. I believe this is because the USB dvb driver modules have not been unloaded. Finally, today, I worked out the solution. Just edit /sbin/fastshutdown.sh (as root) and add this line:
/sbin/modprobe -r dvb_usb_dibusb_mc

1 comment: