Install Mythbuntu From Usb



  1. Install Mythbuntu From Usb Flash Drive
  2. Install Mythbuntu From Usb Wireless Adapter
  3. Install Mythbuntu From Usb Drive
  4. Install Mythbuntu From Usb Pc Camera

Background

I've previously installed Mythbuntu and used it happily, but after upgrading to 0.25 (and Mythbuntu 12.04 LTS), I've had severe glitches when recording most channels. This is most unsatisfactory. So I decided to do a complete reinstall and see if the problem persisted. It did. However, I've documented everything I did, so that when I find out what's wrong, this will hopefully serve as a step-by-step guide for others.

Create Mythbuntu DVD/USB. In order to install Mythbuntu, we first need to download the software and write it to a DVD or a USB flash drive. Download Mythbuntu 14.04.1 64-bit.iso; Burn the.iso file as an image to a DVD-R(RW), or write the image to a USB flash drive. Note that the image is too large to fit on a CD-R(RW). Install Mythbuntu. The Universal USB Installer is easy to use. Simply choose a Live Linux Distribution, the ISO file, your Flash Drive and, Click Install. Upon completion, you should have a ready to run bootable USB Flash Drive with your select operating system installed. Booting from a USB flash drive created with usb-creator alias Startup Disk Creator and mkusb will behave just as if you had booted from the install CD. It will show the language selection and then the install menu, from which you can install Ubuntu onto the computer's hard drive or launch the LiveCD environment. Start installation of Ubuntu Now attach the flash drive to a USB port and press the 'F11' key (for a Supermicro motherboard) during the boot process. As soon as the boot menu appears, select your stick and the installation will start. Now proceed as illustrated in the following screenshot gallery. The USB drive will not show up in the startup manager so I can’t boot to it from my new machine. I was wondering if there is a relatively simple change that can be made to the process above so that the usb install will be available in the Mac startup manager.

But until then: If you have an EEE Box and an HDHomeRun, I cannot recommend you to install Mythbuntu 12.04. Use an earlier version, which has been working nicely for me.
By the way: I'm sorry that the formatting on this page is a bit messed up. I'm just not able to format blog posts on Blogger decently...

Installation


Create USB disk

Download the 64-bit edition of Mythbuntu. Create a USB disk as described in the official Ubuntu documentation (I have a Mac, so I followed this).


Boot

Put the USB disk in the EEE Box, boot the machine. Hold down F2 during boot to go to the BIOS menu. Go to the Boot tab, select 'Hard Disk Drives', press enter. In the list of hard disk drives, you should see both the real hard disk and your USB disk. Re-arrange the list so that the USB disk is first, and your hard disk is second. Save and exit, and your machine should now boot from your USB disk.


Install

Choose 'Install Mythbuntu' when the welcome screen appears. You can choose 'Download updates while installing', and I guess you need to select 'Install this third-party software'. Click 'Continue'.
Since I had a previous Mythbuntu install, I had the chance of installing the new side by side. I chose the 'Erase and reinstall' option.
As for disk partitioning, I like to have 20GB for the actual Mythbuntu install, 5GB swap space, and the rest as a separate partition for my recordings (mounted as '/data'). Choose what fits you the best. And remember to select the right 'Device for boot loader installation' (the guide had chosen the USB disk, which is obviously wrong).
As for 'Installation type', choose 'Primary Backend w/Frontend'.
For 'Additional Services', I chose 'VNC Service', 'SSH Service', and 'MythTV service'. I deselected 'Samba Service' and left 'NFS Service' unselected. Do what you want here.
When asked about 'Infrared Remotes', choose 'USB & Serial Remote support via LIRC (Linux Infrared Remote Control', and choose 'Windows Media Center-Transceivers/Remotes (all)', make sure that 'Generate dynamic button mappings' is checked.
As 'Graphics Drivers', select 'NVIDIA Graphics', and disable TV-Out. That should finish off the installation.
After rebooting, Update Manager wants to update some packages. Let it. And restart your box.

Backend setup

General

Go to 'General', and set your 'Locale Settings'. I've chosen 'PAL' as 'TV format', 'PAL teletext' ad 'VBI format', and 'europe-west' as 'Channel frequency table'.

Storage paths

Before you start using MythTV for real, remember to adjust the paths in MythBackend that define where recordings, live-tv, etc. go. It's under 'Storage Directories'. If, like me, you've mounted most of the EeeBox harddisk under '/data', you probably want values such as '/data/mythtv/recordings', '/data/mythtv/livetv', etc.
You should also create these directories in the file system, and remember to give proper rights to the mythtv user. I've just set all these directories to the mythtv user, the mythtv group, and given all rights possible. Perhaps that's a bit too much, but I don't want to spend time fiddling with this.

Tuner

Create a new 'Capture card', with Card type 'HDHomeRun DTV tuner box'. As 'Available devices', choose the one with your serial number and ending in '-0'. Create yet another 'Capture card', now choose the one with your serial number and ending in '-1'.
Create a new 'Video source'. What you choose here depends heavily on where you are, etc. I have an account at a Danish XMLTV provider which is not officially supported by MythTV, so I choose 'No grabber' as 'Listings grabber'. As name, I have chosen 'ontv'.


Go to 'Input connections' and connect your two HDHomeRun tuners to the new video source: Select one line at a time, and select your video source under 'Video source'.

Channel scan

First, you need to find out where your channels are situated. Run
hdhomerun_config 12106FA4 scan 0
(where 12106FA4 is your tuner's serial number.) This will show you at which frequences and modulations your channels are.
Go to 'Channel Editor', and choose 'Channel Scan'. Choose 'Full Scan (Tuned)' as 'Scan type', and enter the various frequencies and modulations and scan for each.

Sound and picture quality


Sound via HDMI or TOSLINK

Install Mythbuntu From Usb Flash Drive

If you want sound through the HDMI cable, create the file /etc/asound.conf with the following contents:
pcm.!default {
card 0
}
If instead you want sound through the optical digital out, specify device 1.
Start 'alsamixer' from a terminal and unmute 'S/PDIF 1' by clicking M on it.


Picture quality

Turn on VDPAU in the 'Setup -> Video -> Playback', otherwise the EeeBox doesn't stand a chance when playing HD content.
Still, playback isn't always perfect, since the refresh rate on your TV doesn't necessarily match the refresh rate of the played material. To fix this, you need to do two things: First, go to 'Setup -> Appearance', and on the 'Video Mode Settings' page, check 'Separate video modes for GUI and TV playback'. Just choose 1920x1080 as the GUI and Video output resolution, and choose 'Auto' as the rate. Don't change the values in the 'Overrides for specific video sizes' section.
Secondly, open nvidia-settings and uncheck the 'Force Full GPU Scaling' on one of the pages. Voila! Playback is now perfect! (At least on my setup :-) )

Importing XMLTV


First, set all the XMLTV IDs for your channels: Go to MythWeb, click the 'MythTV' link in the upper left, and choose 'Settings -> TV -> Channel Info'.

Install Mythbuntu From Usb Wireless Adapter


Since I get my XMLTV from a specific URL, I have a mythfilldatabase.sh script which is quite simple:

#!/bin/bash


LOGFILE=/home/me/mythfilldatabase.log


source /home/me/.profile


mv /home/me/tvgrabbed.xmltv.1 /var/log/mythtv/tvgrabbed.xmltv.2
mv /home/me/tvgrabbed.xmltv /var/log/mythtv/tvgrabbed.xmltv.1


cd /home/me/
wget --output-document=/home/me/tvgrabbed.xmltv http://ontv.dk/xmltv/SECRET
/usr/bin/mythfilldatabase --file --sourceid 1 --xmlfile /home/me/tvgrabbed.xmltv > ${LOGFILE} 2>&1
It just wgets the xmltv file, loads it, and stores the last two days of xmltv files. (Of course, replace 'me' with your user name and SECRET with your ontv ID if you want to use the above.)

Then set up a Cron job: Run 'crontab -e', define a line like:
00 06 * * * /home/me/mythfilldatabase.sh

Various settings

Drive

Securing MythWeb

Open 'Mythbuntu Control Centre' (start it as root), go to the 'Plugins' page, and enable password protection.

Start/end of recordings

It's nice to start recording e.g. 2 minutes before the official starting time, and end recording e.g. 5 minutes after the official ending time. In MythWeb, you can alter the setting 'DefaultStartOffset' and 'DefaultEndOffset'. Both are specified in minutes, so I've set them to 2 and 5, respectively. This implies that the default values of the fields 'Start Early' and 'End Late' in the recording dialog page will be set to 2 and 5 minutes.

Current status

Well... some channels work fine, and others have glitches, just like some network packets get lost.
The problem is not network-related: I've tried wiring the EEE Box and the HDHomeRun directly to each others (setting 'Link-Local Only' in 'IPv4 Settings' in the network config GUI). MythTV found the HDHomeRun and could show the channels, but with exactly the same problems as before.
The problem is not related to the EEE Box: I can start hdhomerun_config_gui, scan for channels, and see all channels perfectly with VLC. No glitches. (And I can do the same with other machines on the network, naturally.)
You can see an example here. The first few seconds are not that bad, but then the artifacts start. For more action-packed sequences, the artifacts make the recordings unwatchable.
By the way, my problems look a lot like these, except that my problems don't seem to be network-related.

This is part of my tutorial “How to stream analog tv to mobile android devices with Ubuntu, MythTV, xmltv and MythFrontEnd“.

In Linux video devices can be accessed through “/dev/video0”, “/dev/video1” and so on. The problem is that the device designations can change after a reboot, but there is a way to “fix” your video devices. You can do this by making “symbolic links” to your devices, based on device name, driver or any other unique identifier. You can then use this symbolic link instead of “/dev/video0” and your device order will hold up after every reboot. Since I also install ZoneMinder with 3 webcams, this step is a must for me.

This is a synopsis from the MythTV guide I followed:

– make sure your devices are connected and can be accessed as “/dev/video0“, “/dev/video1” and so on.

– in a terminal, type:
udevadm info -a -p $(udevadm info -q path -n /dev/video0)
– copy/paste the output to a text editor and save it

– now for device #2, #3 type:
udevadm info -a -p $(udevadm info -q path -n /dev/video1),
udevadm info -a -p $(udevadm info -q path -n /dev/video2)
and so on.

– copy/paste each output to a text editor and save it for later. Repeat this step for all your video devices.

The output will look something like this:

looking at device '/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0/video4linux/video0':
KERNEL'video0'
SUBSYSTEM'video4linux'
DRIVER'
ATTR{name}'Vimicro USB 2.0 PC Camera (Venu'
ATTR{index}'0'

looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb1/1-3/1-3:1.0':
...

Now look for something that you can use to uniquely identify your video device.
In my case I used:
for “/dev/video0”: ATTR{name}'Vimicro USB 2.0 PC Camera (Venu',
for “/dev/video1”: ATTR{name}'UVC Camera (046d:0805)',
for “/dev/video2”: ATTR{name}'DC10plus[0]' and
for “/dev/video3”: ATTR{name}'ivtv0 encoder MPG',
because they contain the names of the devices and they are unique.

Ok, now we have our unique identifying attributes, now it’s time to make symbolic links using “udev“:

– in a terminal type:

sudo gedit /etc/udev/rules.d/99-server.rules

This will create a new file where we will define our rules.
Use a high number (99 in this case) to start the filename with, this will make sure udev overrides automatic settings. You can choose your own filename, just make it start with a high number.

Install Mythbuntu From Usb Drive

– Now we define one rule per video device. On each boot udev will read these rules, and create a symbolic link for the device found based on this identifier.

– Here’s the contents of my /etc/udev/rules.d/99-server.rules:


KERNEL'video[0-9]*', DRIVERS'zr36067', SYMLINK+='video-DC10'
KERNEL'video[0-9]*', ATTR{name}'ivtv0 encoder MPG', SYMLINK+='video-PVR-150'
KERNEL'video[0-9]*', ATTR{name}'UVC Camera (046d:0805)', SYMLINK+='video-Logitech300'
KERNEL'video[0-9]*', ATTR{name}'Vimicro USB 2.0 PC Camera*', SYMLINK+='video-Vimicro'

Make sure you have 1 rule per line, and no empty lines. It could look different in the browser, but there’s 1 rule per line.

What these rules tell udev:

look for any video device between 0 and 9 that matches DRIVERS”zr36067″, and create a link called “video-DC10“.
look for any video device between 0 and 9 that matches ATTR{name}”ivtv0 encoder MPG”, and create a link called “video-PVR-150” and so on.

Reboot the system to see if the links are there. The easy way to check is to open the Thunar file manager, and browse to “/dev”:

Install Mythbuntu From Usb Pc Camera

From now on you can use these fixed links and your video devices will no longer be mixed up!