Installing MythTV
Introduction
MythTV 0.27.6 is the current version of MythTV; version 0.27.5 is supported in Debian jessie.
System Preparation
System should be prepared as described in Prepare Debian Base Install for MythTV
Software Package Source
Modify apt sources:
$ sudo nano /etc/apt/sources.list.d/deb-multimedia.list
Add a mirror to deb-multimedia to your apt sources list:
/etc/apt/sources.list.d/deb-multimedia.list
...
deb http://<mirror/address> jessie main
...
$ sudo aptitude update
$ sudo aptitude install deb-multimedia-keyring
$ sudo aptitude update
$ sudo aptitude dist-upgrade
Channel Changer
If needed, place channel changer script in /usr/local/bin and test it.
Install MythTV
Install mythtv-frontend or mythtv; I also install xine, mplayer, and vlc, though you certainly may omit
$ sudo aptitude install <mythtv-frontend|mythtv mythweb> mythtv-perl \
libcdio-utils libudf0 \
xine-ui vlc smplayer2
If you only installed mythtv-frontend, install the plugins that you want
$ sudo aptitude install mytharchive mythbrowser mythgallery mythgame mythmusic mythnetvision \
mythnews mythvideo mythweather mythzoneminder
If you want all of the plugins, simply invoke
$ sudo aptitude install mythplugins
For a slave backend, after installing mythtv, you will want to remove the mythconverg database.
$ mysql -u root
mysql> drop database mythconverg;
mysql> exit
Add appropriate users to mythtv group for proper access
$ sudo adduser <user> mythtv
Logout and logon again for group membership to be reflected
Configure MythTV Backend
Run MythTV Setup (also available from the application menu)
$ mythtv-setup
1. General
- Use proper IP if additional frontends will be connecting; DO NOT use FQDNs!
- Change Job Queue CPU Usage to medium if backend-only
- Allow all jobs
2. Capture Cards
4. Video Sources (master backend only)
5. Input Connections
- Enter change channel command script
- Fetch channels and set starting channel
7. Storage Directories
- Set default to /var/lib/mythtv or /mnt/myth/tv/1
Get listing data for a couple of days
$ mythfilldatabase --max-days 2
Start backend
$ sudo invoke-rc.d mythtv-backend restart
Check log file to ensure backend started
$ tail /var/log/mythtv/mythbackend.log
Configure Remote Control
Install lircrc
$ cd .mythtv
$ cp <location of valid lircrc> ./lircrc
$ cd ..
$ ln -s .mythtv/lircrc .lircrc
Configure MythTV Frontend
Start frontend (also available from the application menu)
$ mythfrontend
Setup system
Utilities/Setup -> Setup
- General
- Audio: set volumes to ~ 90%
- Miscellaneous: Halt is sudo halt; Reboot is sudo reboot
- Remote Control: LIRC daemon socket is /dev/lircd
- Myth Database Logging: Enable logging and automatic cleaning
- Mythfilldatabase: Enable automatic mythfilldatabase
- Appearance
- Theme:
Paint engine is OpenGL unless bad cardPaint engine is Qt - QT: Popup background is Image
- Theme:
- TV Settings
- General (Basic): Enable Avoid conflicts...
- General (Jobs): Enable transcoder
- Program Guide
- 2/2: Enable Use select...
- Playback
- Playback Profiles: set to VDPAU Normal, VDPAU Slim, VAAPI Normal, or VAAPI Slim
- Recording Profiles
- Enable auto-transcode... on all MPEG-2 profiles
- Move all volumes to 100%
- Transcoders: Disable Scale bitrate... (may have to set twice)
Quit mythfrontend
Key Bindings for Common Applications
Add key bindings - could run mythwelcome instead of mythfrontend
For lxde:
$ nano ~/.config/openbox/lxde-rc.xml
~/.config/openbox/lxde-rc.xml:
...
<keybind key="A-m">
<action name="Execute">
<command>mythfrontend</command>
</action>
</keybind>
<keybind key="A-x">
<action name="Execute">
<command>lxterminal</command>
</action>
</keybind>
<keybind key="C-A-BackSpace">
<action name="Execute">
<command>pkill xinit</command>
</action>
< /keybind>
< keybind key="C-A-m">
<action name="Execute">
<command>pkill mythfrontend</command>
</action>
< /keybind>
...
For openbox:
$ sudo nano /etc/xdg/openbox/rc.xml
/etc/xdg/openbox/rc.xml:
...
<keybind key="A-m">
<action name="Execute">
<command>mythfrontend</command>
</action>
</keybind>
<keybind key="A-x">
<action name="Execute">
<command>roxterm</command>
</action>
</keybind>
<keybind key="C-A-BackSpace">
<action name="Execute">
<command>pkill xinit</command>
</action>
</keybind>
<keybind key="C-A-m">
<action name="Execute">
<command>pkill mythfrontend</command>
</action>
</keybind>
...
Start MythTV Automatically
Set autostart
For lxde:
$ cd ~/.config
$ mkdir autostart
$ cd autostart
$ ln -s /usr/share/applications/mythtv.desktop
For openbox:
$ nano ~/.config/openbox/autostart
~/.config/openbox/autostart:
# Run the system-wide startup script
. $GLOBALAUTOSTART
# launch mythfrontend; could run mythwelcome instead
( sleep 2 && mythfrontend > ~/.mythtv/mythfrontend.log 2>&1 ) &
Logout of X
Automatic Logon
If running gdm, start gdm config
- Security tab: enable automatic login
If not running gdm, install and configure rungetty, and create .xinitrc and .profile
$ sudo aptitude install rungetty
$ sudo nano /etc/inittab
/etc/system/system/getty.target.wants/getty@tty1.service:
...
ExecStart=-/sbin/agetty --autologin <user> %I $TERM
...
You will need to create an xinitrc. Two are provided here: a simple one which uses the X server as configured; the other automatically sets the resolution to 720p.
$ nano ~/.xinitrc
~/.xinitrc:
#!/bin/bash
# Simple xinitrc
xset -dpms
xset s off
exec openbox-session
~/.xinitrc:
#!/bin/bash
# Set resolution to 720p before starting openbox
TEMPFILE=/tmp/xrandr
xrandr --query > $TEMPFILE
XOUTPUT="$( cat $TEMPFILE | grep ' [Cc]onnected' | sed 's/\(.*\) [Cc]onnected.*/\1/' )"
[ -z "$( grep 1280x720 $TEMPFILE )" ] && {
xrandr --newmode "1280x720" 74.50 1280 1344 1472 1664 720 723 728 748 -hsync +vsync
xrandr --addmode $XOUTPUT "1280x720"
}
rm $TEMPFILE
xset -dpms
xset s off
xrandr --size 1280x720
exec openbox-session
$ chmod +x ~/.xinitrc
$ nano ~/.profile
~/.profile:
if [ -z "$DISPLAY" ] && [ $(tty) == /dev/tty1 ]; then
while [ 1 == 1 ]
do
startx
sleep 5
done
fi
Finished
Restart gdm or reboot to test