Mythtv Iso

Table of Contents[ Hide]

Introduction
List of hardware
BIOS Update
installing mythbunty
update the system
modify grub.cfg
Network settings
Disk labels vs UUID
USB flash drive precautions
no access time
Reduce swappiness
Use ramdisk
Add storage disk
Wester Digital WD drive spin down
Sudo setup
Display
Mythwelcome
MythWelcome tweak
Sound
analog sound
hdmi sound
Sound over HDMI and Analog
MySQL
Remote Control
Installing Philips OVU412000 USB IR receiver
Other settings
Mythtv General setup
configure tuners
Add capture cards
add video source
create input connecions
import channel info
Update program guide daily
20X4 LCD Smartie USB display
Disk labels vs UUID
Monitoring backend
recording Schedule
upnp
samba
Connecting to TV
backup mysql database
Contact

Introduction

Category: Live Medium, MythTV; Status: Discontinued; Popularity: Not ranked. Mythbuntu is an Ubuntu-based distribution and live CD focused upon setting up a standalone MythTV system similar to KnoppMyth or Mythdora. It can be used to install a standalone frontend, backend, or combination machines. In the context of MythTV, an ISO is a complete copy of removable media such as DVDs or VCDs stored in a single file which has the extension.iso. MythVideo can play ISOs. Additionally, MythVideo is able to do a full rip to ISO.

This page will be used to document the development of my 4th Mythtv system which will be based on the Intel DZ68DB moherboard, i3 2120T Processor and Quad Hauppauge Tuner.
You can also find my previous mythtv build here in this wiki.

List of hardware

  • Motherboard: DZ68DB moherboard
  • CPU: Intel i3 2120T
  • Memory: Corsair Value Select 4 GB DDR3 (1333 MHz / PC3-10600) Ean's 0843591010061
  • Western Digital WD10EZRX 1G green HDD
  • PSU: DC-DC ATX 150W 20PIN ITX Motherboard/Micro-ATX Motherboard Power Supply + Universal 12V 8A 96W AC/DC Power Supply Adapter Charger for PC LCD monitor TV
  • Capture cards: 2 x Hauppauge PVR500 (total of 4 tuners)
  • Case: Silverstone GD07B
  • IR receiver: Philips OVU412000 USB IR
  • LCD display: 20X4 LCD Smartie USB display Sure Electronics
  • USB-CEC adapter for HDMI (Pulse Eight)

BIOS Update

Mythtv Iso
The Intel DZ68DB came with an older BIOS. To update the BIOS (not having a Windows PC) you have the option to place the .BIO file on a USB thumb driver (FAT32), remote the yellow BIOS jumper from the motherboard and boot the system with te thumbdrive plugged in. I'll take a few minutes for the firmware to flash. The process is very simple, but you have to open the case to access the motherboard

installing mythbunty

Download MythBunty 64bits .iso file and use Unetbootin (or similar) to create a bootable USB stick
Boot from USB stick, place the A-Data USB3.0 stick in the machine and run 'Install Mythbuntu 12.04'
Created 1 ext2 partition of the full 16G:

Note: we don't use SWAP as 4G is more than enough for mythtv and we don't wan to wear out the USB stick with the O.S.
username: myth (mythtv is reserverd)
Select all additional services (vnc, ssh, samba, nfs and mythtv services)
Select 'Hauppauge TV card' and unselect Generate dynamic button mapping

update the system

apt-get update
reboot the system (a new kernel is used)

modify grub.cfg

Add a rootdeley to the current kernel. This was necessary because the USB thumb drive took longer to initialize, causing fsck to fail, because the disk (stick) is not ready.
->

This is my complete /etc/default/grub (played a lot with all the options before it was stable in a USB3.0 port)

update /boot/grub/grub.cfg:

update-grub

Network settings

This can easily be done with the Gnome Nerwork manager (/usr/bin/nm-connection-editor)
Mythbuntu uses UUID instead of disk labels. This means you can't simply create an image of a system and restore it on a new harddisk. I prever to use disk labels.
# sudo e2label /dev/sdb1 mythtv
change /etc/fstab
LABEL=mythtv / ext2 defaults,noatime,nodiratime 0 0
change /etc/default/grub
uncomment: #GRUB_DISABLE_LINUX_UUID=true
update /boot/grub/grub.cfg:
sudo grup-mkconfig > /boot/grub/grub.cfg

USB flash drive precautions

Flash drives die if the files are re-written over and over. Therefore we have to take some precautions so the flash drives doesn't wear out to soon:

- no acccess time
- reduce or no swap
- disable ext4 journalling (or choose a non journalling file system like ext2)
- no logging to disk (only in memory)

no access time

Add the noatime (no access time), no diratime (same for directories instead of files) and data=writeback options after the defaults parameters for each drive, except swap. Modified line should read something like:

Reduce swappiness

Reduce swappiness to make the operating system avoid the use of the swap area and prefer to use the memory modules instead. Open your /etc/sysctl.conf file with the gedit text editor, make a new line at the bottom of the file and add this:

vm.swappiness=10

Because I didn't create a swap file at all, this action was not nessecary.

Use ramdisk

Using a ramdisk instead of the thumb drive to store temporary files will speed things up and will cause no writes in flash memory. Downside: it will cost you a few megabytes of RAM.

Open your fstab file:

Add this line to fstab to mount /tmp (temporary files) as tmpfs (temporary file system):

Reboot for the changes to take effect. Running df, you should see a new line with /tmp mounted on tmpfs:

same for /var/tmp

For /var/log it is a little more difficult. We use the aufs (AnotherUnionFS) filesystem for this, which allows you to join to mount points (in this case, one on disk/flash and one in memory)

Some daemons expect a certain directory structure in var log. It can't be an empty directory on system start.

First create a template directory structure based an the current directories in /var/log:

mkdir /var/log.template

cd /var/log

Copy all files en dirs from /var/log to /var/log.template preserving ownership and permissions

tar cvf - . | (cd /var/log.template/; tar xvf -)

Mythtv Iso Download

Remove all files

cd /var/log.templage

find . -type f -exec rm {} ;

edit /etc/fstab and add:

then

sudo mkdir /var/log.memory
sudo mount /var/log.memory
sudo mv /var/log /var/log.orig
sudo mkdir /var/log
sudo mount /var/log

If we ever need to add directories to the template, simply add them to /var/log.template

Add storage disk

For storage I added a 3.5' regular 1T disk. I chose the WD green drive for two reasons:
- less noise
First add the disk and find out the device name
fdisk /dev/sdb
d (to delete partitions)
p (to create a primairy partition)
(create 500G mythtvdata partition)
83 (linux)
p (to create a primairy partition)
(rest of the drive is voor other data storage)
83 (linux)
w (write and quit)
Now format the partition:
edit /etc/fstab and add:
create the mount point
Now lets move the mythtv data from /var/lib to /data

Wester Digital WD drive spin down

The whole idea behind using an USB stick for the OS, was to be able to spin down de storage HDD when not in use. This saves energy, creates less heat and makes less noise. The disk (although quiet silent) is the component that creates the most noise! The PSU is 100% silent, the large silverstone fans are very quiet.
Normally hdparm -S 1 will spin down the disk in 5 seconds. I used this method to test hdparm (didn't want to wait a whole hour for the disk to spin down) but it didn't work! Then I used hdparm -y wich immediately spins down the disk. So the disk is able to spin down. I also tried recording to a spinned down disk and this worked as well. The disk spun up, and was ready by the time the buffer was full. Googling around to find out why the WD disk didn't obey the -S 1, I came across some posts that the WD only accepts spin down time larger (or equal) to 10 minutes. Tested it out and YES! it worked. This applies to this Western Digital HDD (WD10EZRX) but I've read the same about the WD Raptor and other drives. They also only accepted values over or equal to 10 minutes.
I'm not sure if hdparm is persistent or not so I created a file /etc/hdparm.conf:

Another issue I have with this disk is the noise it makes. When the drive is spinning (not even moving it's head), it makes a high frequency sound. This is very disapointing. I have a 100% quiet PSU, fans that are very very quiet so the sound of this disk is 5 times more the all the rest together. Hopefully fixing the drive without touching the metal might help (some rubber banding setup) but I still have to try that....

Sudo setup

setup sudo so that asrock user doesn't need a password to use sudo
# sudo visudo
add this as the last line:

Display

Display setup didn't need anything special. De monitor was recognized by X and all settings worked without change.
Iso
xscreensaver was a little annoying. I disabled the screensaver function but after a suspend, it asked for a login password. I ended up with simply removing xsreensaver completely (why do you want a screensaver on your HTPC anyway...)

After that, the screen turned black after a few minutes idle.

The mouse pointer is shown. This can be hidden by the unclutter command:

./unclutter -root -idle 1 -reset -display :0

Mythwelcome

Use the Session and Settings tool (in XFCE menu) to configure startup applicationsMythtv iso bootable
Uncheck:
- Update notifier (TODO)
- XFCE Volume daemon

Disable the auto start of mythfrontend (press i when the mythwelcome page is open, to enter the settings screen)

MythWelcome tweak

The Mythbuntu theme which I use, now has a bug (I think) in the Mythwelcome page. If you hit OK on the remote, the frontend will start. In previous versions of mythwelcome, you had visual feedback from the page that you had pressed the OK button (the text 'start frontend' had a sort of butten behind it, which hilited when the OK button was pressed). This visual feedback is now gone, and because it takes one or two seconds for mythfrontend to show, you'll end up pressing the button a few times, wondering if the IR signal was received. I created a small workaround for this, so you'll get al little bit of feedback again.
First install the dzen2 package
then run the mythwelcome setup and change the frontend startup line:
mythfrontend command: /usr/local/bin/mythfrontend_osd
Create a little script /usr/local/bin/mythfrontend_osd:
That's it. dzen2 can handle lots of options to create the text excactly on the place and with the size and font you want. I positioned the window just on top of the normal 'start frontend' button.
(not needed for Mythwelcome version 25.30, so simply choose that theme now)

Sound

analog sound

strart alsamixer from the commandline
increase volume to max.
Test plugin a headset and start:
# play /usr/share/sounds/alsa/*

hdmi sound

To get sound over HDMI I've installed pulseaudio:

Start pavucontrol en select the desired output on the config page. (Digital Stereo (HDMI) output + Analog Stereo Input)
TODO: I want both analog out (to receiver) *and* hdmi out (to TV)
Configure mythtv (to use Pulseaudio) Setup->Audio.

Sound over HDMI and Analog

First, users need to understand the system's audio layout. This is accomplished using aplay which is part of the alsa-utils package.
The key to a configuration like this is to understand that whatever is selected in pavucontrol under Configuration>Internal AUdio is the default device. Load pavucontrol>Configuration and select HDMI as the profile.
Mythtv iso software
Add the following to /etc/pulse/default.pa to setup the analog as a secondary source:
Restart PulseAudio, run pavucontrol and select the 'Output Devices' tab. You can now show the virtual Output devices.
Now start a program that will use pulseaudio such as mplayer, vlc, mpd, etc. and switch to the 'Playback' tab. A pulldown should be available for the running program to select one of the three sources.
Make sure to set Alsa:pulse in the mythtv setup (setup->audio: 'Audio output device'=ALSA:pulse)

MySQL

By default the mythtv db user has a generated? password jbkYW23r
If you want to change this to something you can remember, change it in the followin places:
  1. sudo dpkg-reconfigure mysql-server-5.5
  2. New password for the MySQL 'root' user: mythtv
  3. Repeat password for the MySQL 'root' user: mythtv

/etc/apache2/sites-enabled/mythweb.conf

Remote Control

After testing the Hauppauge remote, it turned out that most of the key presses would get a double keypress making it very hard to navigate. Only sometimes I got a single key press.
Googled a bit and found a solution where every 'config =..' line in the mythtv file (/home/myth/.lirc/mythtv) is preceded with this line 'config = echo ' > /dev/null'
So for example the section of the Right button looks like this:
remote = Hauppauge_350
button = Right
config = Right
delay = 0

This does the trick, however the remote wasn't responding as quick as I was used to (on my previous mythtv, the menu's could follow my key presses no mather how fast I tried to navigate, now it's a little slower. Not as slow as the usual consumer electronics but also not as fast as I would like it to be).
I looked through the config files and noticed that the hauppauge config files (hauppauge_350) did not only contain my remote config, but also from some other hauppauge devices. This resulted sometimes in the same codes from different remotes. For example in the file /usr/share/lirc/extras/more_remotes/hauppauge/lircd.conf.hauppauge the code for Right (0x0000000000001797) was listed at the Hauppauge_350 and at the Hauppauge_WinTV_Nexus-S remote.
I removed the complete sections of all devices except from Hauppauge_350. After that, it worked like I was used to....
Most of the time I use the TV guide and the Recorded video's menu. So I created a few jumppoints to get there quickly with a single button:
configure jumppoints:
start mythweb en go to settings->mythtv->key bindings
Program Guide: Ctrl+g
TV Recording Playback: Ctrl+p
Main menu: Ctrl+m
edit /home/asrock/.lirc/mythtv and add:
begin
remote = Hauppauge_350
prog = mythtv
button = Videos
config = Ctrl+p
repeat = 0
delay = 0
end
begin
remote = Hauppauge_350
prog = mythtv
button = Guide
config = Ctrl+g
repeat = 0
delay = 0
end
begin
remote = Hauppauge_350
prog = mythtv
button = Go
config = Ctrl+m
repeat = 0
delay = 0
end
begin
# add delete button to the remote
remote = Hauppauge_350
prog = mythtv
button = red
config = d
repeat = 0
delay = 0
end
# add two buttons to solve the 'Allow Channel Jumping in Guide' bug in 0.22
# key 1 and 7 don't go one day back/forward so we use two extra buttons for that
begin
remote = Hauppauge_350
prog = mythtv
button = yellow
config = Home
repeat = 0
delay = 0
end
begin
remote = Hauppauge_350
prog = mythtv
button = blue
config = End
repeat = 0
delay = 0
end
# add button to get the menu back in the Watch Recording page that displays several options
# Before 0.22 you would get this menu by hitting the right key on a recording.
begin
remote = Hauppauge_350
prog = mythtv
button = Prev.Ch
config = I
repeat = 0
delay = 0
end

Installing Philips OVU412000 USB IR receiver

No special tweaks neede. Just plug it in, reboot and you're done.

Other settings

In Ubuntu disable the screensaver (who thought it was a good idea to turn this on default in MythBuntu?!)
In the MythtvFrontend:
setup->video>playback->next:
on playback exit: save position and exit
setup->video->Program Guide
1/1 Guide starts at channel: 6
disable jobs
disable commercial detection

Default always record some extra time
setup->video->general
start recording -120sec
end recording +600secd

Mythtv General setup

Mythtv Iso

Start mythbuntu control center from the Applications->System menu
Startup behavior
- automaticly login asrock
- disable frontend startup (we are going to use mythwelcome)
Services
- enable ssh, samba, nfs and vnc
- enable daily optimaize repair
- enable perf. tweaks

configure tuners

Start mythtv setup
General:
- TV Format = PAL
- Channel freq. teable = europe west

For PVR500 select MPEG-2 encoder card. We have 2 PVR500 so 4 caputercards (/dev/video0.../dev/video3) should be created.

add video source

video source name: tvguide
listings grabber: no grabber (we use direct db import)

create input connecions


change the recording resoltions from 480 x 576 to 768 x 576 (or 720 x 576??)

import channel info

don't use the channel editor but import xmltv data
wget http://www.xxxx/mythtv/data.xmltv.gz
mythfilldatabase --file --sourceid 1 --xmlfile data.xmltv
fill in the rest via mythweb (settings->tv->channel info):
http://localhost/
add channel number, frequency and set all channels to commercial fee (I don't want commercial flagging)

Update program guide daily

create a cron job /etc/cron.d/getXmlTv

apt-get install git
cd /home/myth/xmltv
git clone https://github.com/tvgrabbers/tvgrabnlpy/
create get_xmltv.sh script in /home/myth/xmltv
Iso

The tv_grab_nl_py.conf file contains a list of channels to grab


you can also add one line to your /etc/rc.local so that after a reboot, the data gets imported (so you don't have to wait for the cron job to kick in.
The delay is to make sure all process are running like network and mythbackend before the scripts starts

sudo -H -u myth bash -c '/home/myth/xmltv/get_xmltv.sh -delay' &

20X4 LCD Smartie USB display

I found it very annoying to always turn on the tv to check the mythtv status or to listen to mythmusic. After buying a new tv and AV surround receiver that where connected with HDMI, it was more than annoying! To select your music, you need to turn on the TV. If you've selected your music to play, you can power off the TV but the HDMI signals the receiver to turn off as well, so you need to power up the reciever again. This is why I purchased a nice external (USB connected) LCD device from Sure Electronics.
The USB device is listed by lsusb as:

Mythtv Iso File

lcdproc now days contain the driver for the Smartie display including the SureElec.so driver
d
apt-get install lcdproc
/etc/init.d/LCDd restart
You should get a Clients: 0 and Screens: 0 on the LCD display.
To see something more interesting, start a client application. For example, start 'lcdproc -f' on the command line.
Now tell mythtv to use lcdproc:

Disk labels vs UUID

Mythbuntu uses UUID instead of disk labels. This means you can't simply create an image of a system and restore it on a new harddisk or in this case a new thumbdrive. I prever to use disk labels.
# sudo e2label /dev/sda1 mythtv
uncomment: #GRUB_DISABLE_LINUX_UUID=true
After line 122 add 2 lines:
(3 lines are commented out, and 2 lines are added)
update /boot/grub/grub.cfg:

Monitoring backend


sudo chmod 755 /usr/local/bin/mythmon
sudo vi /etc/cron.d/mythtmon

recording Schedule

One of my favorite recordingschedules is the Formula 1 power search:
(program.title LIKE '%Formule%1%'
program.title LIKE '%Formula%I%'
program.subtitle LIKE '%Formule%1%'
program.subtitle LIKE '%Formula%I%')
(channel.callsign = 'RTL4' OR
channel.callsign = 'SBS6' OR

upnp

The mythtv backend uses UPNP to stream video to the frontend, so don't disable mythtv upnp
install ushare (geexbox lightweight UPNP server)
# vi /etc/ushare.conf
# /etc/init.d/ushare start

samba

cd /var/www/mythtv

nfs

share data for linux systems
# sudo vi /etc/exports
add the export for example:
/data/mythtv 192.168.2.8(rw,async,no_root_squash,no_subtree_check)
/extdata 192.168.2.8(rw,async,no_root_squash,no_subtree_check)
if nfs is already running, reread the config from /etc/exports by running:
# sudo exportfs -ra
Hey everyone, I'm sorry for the convoluted question, but my eyes are really tired from reading, and I think I'm reading out of date information...
I've got my MythTV backend all setup, videos added, etc. and so forth, and I'm trying to access the UPnP server with VLC. When I go to play one of my files however, it asks for HTTP authentication. I tried the password I had set for Mythweb but that didn't work, and tried the password and account I have set for the database, and that didn't work either. Is there some other setting for the user and password I'm not aware of? I found a page that said VLC isn't a compatible UPnP client so I'm wondering if that's the real issue at play.

Mythtv Iso Bootable

Using MythTV v30. and VLC 3.0.8

Mythtv Iso Software


Also this might be out side the purview of this specific troubleshooting issue, but am I going about the wrong strategy for viewing my files with a Roku or Firestick? I was just figuring on downloading a DLNA client for those to access it via the UPnP, but wondering if there's better options I should try.
Edit:

Mythtv Source


I just tried this with a different DLNA client and am still having problems so I don't think it's specific to VLC. The exact message I get while trying to use VLC is 'Please enter a valid login name and a password for realm MythTV'. I've completely removed MythWeb and all associated .htaccess files so I have no idea how this is being triggered.