04 January 2014

541. Setting up mythtv on debian with leadtek 1000s (SAA7130)

I've been using me-tv (and occasionally kaffeine and vlc) to watch DVB-T on linux for the better part of two years. While it's working absolutely fine, and I really like me-tv, I'd like to get it to work in mythtv as well in the hope that it will support closed captioning.

Note that mythtv is only available via the deb-multimedia repo and not in the offical debian repos. I first tried to install mythtv that way, and while I got pretty far (scanned for channels etc.) I couldn't get a picture when trying to watch TV using mythtv-frontend. The deb-multimedia packages also screwed up my graphics card set-up somehow, which didn't improve my mood. So while that's probably a viable method, I finally decided to compile things myself. Note that if you do keep deb-multimedia enable and do a dist-upgrade the mythplugins package below will be replaced, and with that the main mythtv package as well, leading to all kinds of fun. You might want to give mythplugins a higher version number than I've done below to circumvent that.


sudo dpkg-reconfigure dash

Select 'No', so that /bin/sh/ points to bash instead of dash.

The next port of call was http://www.mythtv.org/wiki/User_Manual:Initial_Installation 

sudo apt-get install build-essential liblircclient-dev libasound2-dev libdts-dev libdvdnav-dev \
 libxv-dev libxxf86vm-dev transcode libmp3lame-dev subversion qt4-dev-tools libqt4-dev libsamplerate0 \
 libxvidcore4 liba52-0.7.4-dev libfame-dev libcdio-dev msttcorefonts libasound2-doc libmad0-dev \
 libid3tag0-dev libvorbis-dev libflac-dev libcdaudio-dev libcdparanoia0-dev fftw3-dev libfaad-dev \
 libsmpeg-dev libmp4v2-dev libtag1-dev mysql-server libvisual-0.4-dev libexif-dev libxvmc-dev \
 libxinerama-dev uuid-dev libicu-dev 
sudo apt-get install yasm checkinstall gdb python-mysqldb python-urlgrabber libnet-upnp-perl
mkdir ~/tmp/mythtv -p
cd ~/tmp/mythtv
git clone -b fixes/0.27 git://github.com/MythTV/mythtv.git
cd mythtv/mythtv/
./configure --enable-proc-opt
sudo checkinstall --fstrans=no --install=no
0 - Maintainer: [ andy@helium ] 1 - Summary: [ mythtv 0.27 ] 2 - Name: [ mythtv ] 3 - Version: [ 0.27 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ amd64 ] 8 - Source location: [ mythtv ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ mythtv ] 12 - Conflicts: [ ] 13 - Replaces: [ ]
Exclude files that are in the home directory.

sudo dpkg -i mythtv_0.27-1_amd64.deb
cd ../mythplugins/
sudo apt-get install libmysql++-dev python-oauth libdate-manip-perl libxml-simple-perl libimage-size-perl libdatetime-format-iso8601-perl libsoap-lite-perl libjson-perl 
sudo checkinstall --fsmetrans=no --install=no
0 - Maintainer: [ root@helium ] 1 - Summary: [ mythplugins 0.27 ] 2 - Name: [ mythplugins ] 3 - Version: [ 0.27 ] 4 - Release: [ 1 ] 5 - License: [ GPL ] 6 - Group: [ checkinstall ] 7 - Architecture: [ amd64 ] 8 - Source location: [ mythplugins ] 9 - Alternate source location: [ ] 10 - Requires: [ ] 11 - Provides: [ mythplugins ] 12 - Conflicts: [ ] 13 - Replaces: [ ]
sudo dpkg -i mythplugins_0.27-1_amd64.deb

Note that you may want to use a much higher version number for mythplugins than I've done above -- with 0.27 the deb-multimedia version of the package will take precendence, and cause all kinds of fun...

Setting up

sudo useradd mythtv
sudo usermod -a -G mythtv $USER
mkdir ~/.mythtv

Create a file called ~/.mythtv/mysql.txt:
where helium is my hostname.
Before you can run mythtv-setup you should prepare the mysql database.

mysql -u root -p
> show databases;
> create database mythconverg;zymichost.com
> create user 'mythtv'@'%' identified by 'mythtv';
> create user 'mythtv'@'localhost' identified by 'mythtv';
> set password for 'mythtv'@'%' = password('mythtv');
> set password for 'mythtv'@'localhost' = password('mythtv');
> connect mythconverg;
> grant all privileges on *.* to 'mythtv'@'%' with grant option;
> grant all privileges on *.* to 'mythtv'@'localhost' with grant option;
> flush privileges;
> exit;

Now run setup:

The first time I did this it asked about country and language, and then exited. I then ran it again and went through the setup as shown in the figures below. Note that I had to use the IP,, of my computer rather than (i.e. localhost).

I then ran

and let it run in a terminal, followed by

in another terminal. And it worked! I mean, not the first time, but by following the instructions above I actually got it to work -- up to a point. The audio wasn't working.

While TV is a visual medium it's still nice to have sound. So, in mythfrontend I went to Settings, Audio and picked Pulseaudio, since that's what I use by default anyway.

 I did have the occasional issue with sudden white noise, so I changed to ALSA, and all has been perfect ever since:

Test driving:
Everything seems to be working fine. Hit M for menu:
 You can choose subtitles (or just hit T):

To bring up the Electronic Program Guide (EPG) hit S:
See http://www.mythtv.org/wiki/Keybindings for a list of shortcuts.

Anyway, I'm still exploring. The one thing that's not working yet is the remote control, but that will be solved in due course.

Missing channels:
Mythtv didn't pick up channels Nine, Gem and Go. While scan found them without issue by doing 'scan /usr/share/dvb/dvb-t/au-Melbourne > channels.conf', I couldn't find an easy way to import the scan data.


Trying to import an existing scan in mythtv didn't allow me to provide a URL, but only showed two old scans pre-populating the import dialogue, which was both weird and annoying.

Instead the key was to add a new transport: fire up mythtv-setup, and go to the Channel editor. Note that I'm using a different skin/menu to the default one (Terra), but the process is the same.

See scan output above for the values to add here

 And you're pretty much done.


  1. You should take a look at vdr and vdradmin-am too.

    Greetings from Germany

  2. Thanks for the suggestion. Looking at http://www.linuxintro.org/wiki/Watch_digital_TV_with_VDR_and_a_streaming_client I seem to understand that vdr basically acts as a server (like mtyh backend) and you just need a client to connect to it.

    Seems neat.

    1. And here are better links for those interested: