DVR (Digital Video Recorder) aka PVR
The modern VHS, the ability to record TV to watch it later, fast forward, rewind, pause, and even skip commercials! These devices are affordable to buy off the shelf but here at operationlinux we’ll show you how we made our own from open source and a desktop computer.
First thing you’ll need is a TV tuner. What that does is take the TV signal out of the air or cable and then converts it to a format your computer understands. We ended up buying the Silicon Dust HDHR3-US; it is a really nice product because it connects to your network whereas most tuners connect internally through PCI. But you could probably get away with almost any tuner as long as it supports Linux.
We took a quick look at XBMCBuntu and really liked the Live DVD but ended up choosing the elder DVR software MythTV to install. We installed mythtv version 0.26.0 and ran into many problems! But eventually we conquered all the pitfalls operationlinux-style! Hopefully our misadventures will help the next person who has trouble…
We have a headless server running Slackware. Our goal is to run this server all the time so it can record TV, and then have client boxes connect to it to watch live TV and recordings. Slackware is hardcore linux, you install most software from source code. We came across a really nice website called slackbuilds.org to help you along that path.
First make sure mysql is running, in Slackware this is really easy.
# mysql_install_db –user=mysql
root@blade:/etc/rc.d# chmod u+x rc.mysqld
root@blade:/etc/rc.d# ./rc.mysqld start
root@blade:/etc/rc.d# 121025 19:51:15 mysqld_safe Logging to ‘/var/lib/mysql/blade.err’.
121025 19:51:15 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Go download the tar ball (R1) in our example mythtv-0.26.0.tar.bz2.
39m to 148m way2go bzip
(R4) has lots of slack commands
yasm not found, use –disable-yasm for a crippled buildIf you think configure made a mistake, make sure that you are using the latest
version of MythTV from git. If the latest version fails, report the problem to the
firstname.lastname@example.org mailing list or IRC #mythtv on irc.freenode.net
Include the log file “config.ep” produced by configure as this will help
solving the problem.
Our first problem, we have to install yasm. We will use slackbuilds.org, you download two files a normal tar.gz and the source code tar.gz. Then you place the source into the normal tars extracted directory, then run its config which will make an install package.
# wget http://slackbuilds.org/slackbuilds/13.1/development/yasm.tar.gz
root@blade:~/downloads# tar -xvf yasm.tar.gz
root@blade:~/downloads# mv yasm-1.1.0.tar.gz yasm/
root@blade:~/downloads# cd yasm
Slackware package /tmp/yasm-1.1.0-i486-1_SBo.tgz created.
# installpkg /tmp/yasm-1.1.0-i486-1_SBo.tgz
Package yasm-1.1.0-i486-1_SBo.tgz installed.
ERROR! You must have the Lame MP3 encoding library installed to compile MythTV.
Our second ERROR, not too hard though, we will do the slackbuilds method (in full detail above) to install lame.
# installpkg /tmp/lame-3.98.4-i486-1_SBo.tgz
FINALLY got the config in mythtv-0.26.0 to work here’s the full output:
WARNING: disabling Python bindings; missing MySQLdb
WARNING: disabling Python bindings; missing lxml
WARNING: disabling Python bindings; missing urlgrabber
WARNING: disabling Perl bindings; missing HTTP::Request
WARNING: disabling Perl bindings; missing LWP::UserAgent
WARNING: disabling Perl bindings; missing Net::UPnP::QueryResponse
WARNING: disabling Perl bindings; missing Net::UPnP::ControlPoint
WARNING: disabling Perl bindings; missing IO::Socket::INET6
# Basic Settings
Compile type profile
Compiler cache yes
install prefix /usr/local
runtime prefix /usr/local
CPU x86 x86_32 (AMD Athlon(tm) XP 3200+)
MMX enabled yes
MMX2 enabled yes
3DNow! enabled yes
3DNow! extended enabled yes
SSE enabled yes
SSSE3 enabled yes
AVX enabled yes
CMOV enabled no# Input Support
Joystick menu yes
lirc support yes
libCEC device support no [/usr/include]
Video4Linux sup. yes (v1 yes)
ivtv support yes
HD-PVR support yes
FireWire support no
DVB support yes [/usr/include]
DVB-S2 support yes
HDHomeRun support yes
Ceton support yes
IPTV support yes
ASI support no
# Sound Output Support
PulseAudio support no
OSS support yes
ALSA support yes
JACK support no
libfftw3 support no
# Video Output Support
x11 support yes
xrandr support yes
xv support yes
VDPAU support no
VAAPI support no
CrystalHD support no
OpenGL video yes
MHEG support yes
libass subtitle support no
# Misc Features
multi threaded libavcodec yes
libxml2 support yes [/usr/include/libxml2]
libdns_sd (Bonjour) no
OpenGL ES 2.0 no
# External Codec Options
Creating libs/libmythbase/mythconfig.h and libs/libmythbase/mythconfig.mak
tried to run qmake but mythtv.pro didn’t exist so just ran “make”, getting a billion warnings about not able to distribute work, in the output it looks like make called qmake so maybe this is more up to date then my doc (R4).
RAN for a whole hour with many warnings, killing and trying this:
# ./configure –disable-distcc
took about 45 minutes and appeared to work
# make install
Now setup the database, there is a script “mc.sql” within the database subfolder.
Next you need to run /usr/local/bin/mythtv-setup but we cannot on this headless server so we’ll need to do a remote X-Windows session. That could be a tutorial by itself so we won’t go into that here, just know we used the ssh method seen below. 192.168.1.103 is the IP Address of our Slackware server and the ssh command is being run on a Linux client with a full GUI (X-Windows, KDE).
/usr/bin/xauth: creating new authority file /home/operationlinux/.Xauthority
2012-10-27 11:17:46.771165 E Error preparing query: SELECT DISTINCT dirname FROM storagegroup WHERE groupname = :GROUP AND hostname = :HOSTNAME
2012-10-27 11:17:46.771254 E Driver error was [2/1146]:
QMYSQL3: Unable to prepare statement
Database error was:
Table ‘mythconverg.storagegroup’ doesn’t exist2012-10-27 11:17:46.772136 E DB Error (StorageGroup::StorageGroup()):
SELECT DISTINCT dirname FROM storagegroup WHERE groupname = :GROUP AND hostname = :HOSTNAME
Driver error was [2/1064]:
QMYSQL: Unable to execute query
Database error was:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘:GROUP AND hostname = :HOSTNAME’ at line 1
2012-10-27 11:17:48.690654 E MySQL time zone support is missing. Please install it and try again. See ‘mysql_tzinfo_to_sql’ for assistance.
So those are pretty serious errors. We ran the same command a second time and the only error generated is the timezone one then the X-window closes immediately. The ERROR tells us to see mysql_tzinfo_to_sql, that happens to be an executable (R6). Here’s how we fixed our database:
It generated some silly Warnings but it appeared to work. Now you can run the GUI setup to completion.
Now to a confusing part, the tutorial we read (R2) told us to initially setup a zap2it.com account but within the myth setup GUI (mythtv-setup) our only options are schedulesdirect.org or over the air (EIT scan). And even later within their own tutorial they mention and have a screenshot of schedulesdirect instead of zap2it. For now we left it over the air.
had a lot of ERRORs don’t think it downloaded the channel data.
“2012-10-27 13:29:09.697318 E DataDirect: Failed to get data: Download error”
then it complained the master server isn’t running…
We probably didn’t do this part correct but we still got the backend to run.
Now to prove it is working we connect the mythfrontend…coming up next we’ll show you how we did that.
R3: vi /etc/rc.d/rc.mysqld