My ongoing experiences with Ubuntu, and later Mythbuntu, as a media center with MythTV. I'm also using the system for a virtual machine server, a mediawiki server and a general all around home infrastructure base.

Showing posts with label mythbuntu. Show all posts
Showing posts with label mythbuntu. Show all posts

Tuesday, June 22, 2010

Installing Mythbuntu 10.04 from scratch (part one).








As I mentioned in my previous post, I decided to install Mythbuntu to use with my Hauppauge WinTV HVR-1600 (model 01199) tuner card. I started by installing Mythbuntu 10.04 from the CD and I followed the Happauge HVR-1600 directions from the MythTV website. Note that I am only configuring the ATSC digital over-the-air tuner and not the analog tuner.


First I went through the standard install screens (language, time zone, keyboard layout, etc.). For partitioning, I used a 80GB partition for the root partition, created a 19GB swap partition and a 50GB /home partition.


For installation type, I chose "Primary Backend w/Frontend."


For services I left the defaults: SSH and Samba.


I enabled a Remote Control and chose "Haupauge TV-Card" as I didn't see HVR-1600 and that seemed most logical. I left "Enable Dynamic Button Mappings" checked and "Generate Frontend Restart Mapping" unchecked.


For Graphics Driver I chose "NVDIA Graphics" since I have an NVIDIA card and have been through this before. I left TV-Out disabled.


After about 10 minutes of installation, a screen came up to configure the Backend and I launched MythT Setup:

  • Under "General" I changed nothing.
  • Under "Capture Cards" I created a new capture card of type "DVB DTV capture card (v3.x)". Under Recording options I set the max recordings to 1. (This all per the MythTV web page at the start of this post.)
  • Under "Video Sources" I added a new video source of type "Transmitted guide only (EIT)". Don't forget to give it a name or it will be a blank line on the video sources list which will confuse you into thinking it wasn't added.
  • Under "Input Connections" I selected the DVB capture device and set the video source to the video source I just just added in the previous step. Then I selected "Scan for Channels" which found roughly a dozen ATSC channels I inserted, plus two MPEG channels I inserted.
  • Under the "Channel Editor" I saw what looked like a reasonable list of over-the-air channels for my area. I didn't do anything under this option.
When I exited MythTV Setup I was prompted to run mythfilldatabase, which I did. It didn't have any apparent effect.



That completed installation, CD ejected and system rebooted.


Hmmm, as the system went down for the reboot I got a bunch of "end_request: I/O error, dev sr0, sector " errors and the system hung. So I power cycled it.

When the system came up I got a dialog box about Ubuntu running in low-graphics mode with a "Failed to initialize NVIDIA graphics device" error. 



I selected "Reconfigure graphics" and then "Create new configuration for the hardware". That seemed to generate a new configuration and I restarted X. MythTV came up fine.

I tried watching TV at this point and tuning seemed to be working, but I didn't appear to be getting audio...

Before I tackled the audio problem, I decided to do some basic system administration. I exited MythTV and fired up a terminal (under Applications/Accessories).

From there I did a update of the system (took about 10 minutes) followed by a reboot:

sudo apt-get update
sudo apt-get dist-upgrade
sudo reboot

When the system came up I got the same "running in low-graphics mode" dialog box. I did the same "Reconfigure graphics" and restart of X as last time. Another problem on the stack...

I checked and tuning still working fine (and still no audio).

My next step was to configure the system with a static IP address. I followed the same directions I have before, but when I ran "/etc/init.d/networking restart" I got a "SIOCDELRT: No such process" error. Wow, this was becoming a painful install.

Ah, I found these directions and doing a "ifup eth0" did indeed restart the interface with a static IP address. I then rebooted the system to make sure the configuration persisted and it did.

OK, now I could install my SSH public key and, ahhh, easy access from my laptop. Much better.

Looking into low-graphics mode problem... I noticed I had no /etc/X11/xorg.conf file, but I did have a /xorg.conf.new, so I copied it to /etc/X11/xorg.conf and rebooted. Now the system didn't complain about being in a low resolution mode, but my monitor did complain about "non optimal mode" and my keyboard didn't seem to work. So I moved it aside and rebooted again. This time the system came up without any warnings about low-graphics mode. Weird. I rebooted again just to make sure and it worked. OK, don't understand it, but problem considered solved for the moment.

Looking into lack of audio... ah, I actually do have audio, it's just really soft. I have to crank the volume and I can hear it. Even if I turned the volume up to 100% (using F11) it was still really soft.

Hmm, I'm also noticing my video is somewhat jittery, like I experienced before when I wasn't using the NVIDIA drivers.


Well, that's enough for this post. I'll pick it up in my next post...

Tuesday, June 8, 2010

Back in the saddle again with Mythbuntu and HDTV OTA...

Well, after deciding I didn't need MythTV any more, I've changed my mind. Mainly because we dropped cable tv and are now relying on over the air (OTA) HDTV, so my old Series 1 Tivo, with only an analog tuner, doesn't do me a lot of good any more.

So, I bought a Hauppauge HVR-1600 (model 1099) with the idea of running MythTV again, this time tuning in OTA HDTV. I've going to install Mythbuntu 10.04 from scratch and go from there.

Stay tuned...

Tuesday, January 12, 2010

So long mythbuntu...

So we recently got a new HD Tivo, which left my ten year-old series one Tivo available. I decided to move it down to my den and remove mythbuntu from my linux box and make it media server.

My experience with mythbuntu was pretty good over all, the only real sore spot being occasional problems with lirc. Certainly if I didn't have a Tivo available, I'd still be using it.

Since I didn't really want to keep any of the recordings I had, I decided to reinstall the system from scratch. Here's my journey...

I choose Ubuntu Server 9.10 as my OS. Really the choice was between 9.10 and 8.04 LTS. I decided I wanted the latest and greatest more than stability. So I grabbed the ubuntu-9.10-server-amd64.iso, burned a CD and away I went.

Next decision was partitioning my three disks: sda @ 250GB, sdb @ 1TB, sdc @ 250GB. I decided to make sda my root and virtual machine partition. sdb was going to be for backups and then sdc for holding my media. So sda broke down as a 80GB root partition, a 1 GB /boot partition, a 19GB swap partition and the remainder (~150GB) as /vms. sdb and sdc were simply /mnt/backups and /mnt/media respectively.

The default install had me doing LVM (logical volume manager), but frankly I couldn't figure out how to getting it reconfigured correctly at a level that I was confident I knew what I was doing, so I disabled it.

Other options selected during the install:
  • Set to do security updates automatically
  • I installed: OpenSSH server, Samba Server and the LAMP Server.
  • I set the mysql root password to my password
After the install was complete I did the following:
Todo at this point:

Saturday, May 2, 2009

Upgrading Mythbuntu from 8.10 to 9.04

Time to upgrade my Mythbuntu box to 9.04 from 8.10. I followed the Network Upgrade directions.

Not unsurprisingly, update-manage-core was already installed, so on to the upgrade (only showing highlights):

# do-release-upgrade
...
8 packages are going to be removed. 82 new packages are going to be
installed. 731 packages are going to be upgraded.
...
What is the password for the MySQL administrator account 'root':
Hmmm. I just enter here, I got an error about a database connection being refused and the upgrade continued. AFAICT, it worked out OK.
...
Will you be using this webserver exclusively with mythweb? Yes

Configuration file `/etc/services'
==> Modified (by you or by a script) since installation.
Y or I : install the package maintainer's version

I got asked about apt-cacher.conf - I hit "D" to get diffs and I got an error and the install went on. Fortunately I got another chance at this later...

What would you like to do about smb.conf? I kept the local version currently installed
...
Configuration file `/etc/apt-cacher/apt-cacher.conf'
N or O : keep your currently-installed version
...
The ending of the upgrade did not look good:

--2009-05-02 10:23:29-- http://switch.dl.sourceforge.net/sourceforge/corefonts/andale32.exe
Resolving localhost... 127.0.0.1
Connecting to localhost|127.0.0.1|:3142... connected.
Proxy request sent, awaiting response... 403 Sorry, not allowed to fetch that type of file: andale32.exe
2009-05-02 10:23:29 ERROR 403: Sorry, not allowed to fetch that type of file: andale32.exe.

andale32.exe: No such file or directory

All done, errors in processing 1 file(s)
dpkg: error processing ttf-mscorefonts-installer (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
ttf-mscorefonts-installer
I'm not sure what ttf-mscorefonts is, but doesn't seem to have any major impact.

Upgrade complete.

The upgrade is completed but there were errors during the upgrade
process.
Ok, not the best message at the end, but at leat things have finished.

First thing I noticed is I started getting emails from cron:
Subject: Cron [ -x /etc/init.d/mythtv-status ] && /etc/init.d/mythtv-status reload > /dev/null
Sorry, failed to fetch http://localhost:6544/xml.
Hmmm. Well, first things first, just on principle:
#reboot
System comes up fine in MythTV. Everything seems to be working well.

Hmmm, another email from cron:

Subject: Cron [ -x /etc/init.d/mythtv-status ] && /etc/init.d/mythtv-status reload > /dev/null
mv: cannot stat `/var/run/motd.new': No such file or directory
Update: This problem was caused by two cron jobs both trying to modify /etc/motd at the same time (every 10 minutes)! The update-motd cron job moves /var/run/motd.new out from underneath the mythtv-status job. You can see the two jobs in /etc/cron.d:
# grep 10 /etc/cron.d/mythtv-status /etc/cron.d/update-motd
/etc/cron.d/mythtv-status:*/10 * * * * root [ -x /etc/init.d/mythtv-status ] && /etc/init.d/mythtv-status reload > /dev/null
/etc/cron.d/update-motd:*/10 * * * * root [ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd 2>/dev/null
I believe what should really be happening is myth-status should be run by update-motd every 10 minutes instead of independently. Here is what I did to make that happen:
# rm /etc/cron.d/mythtv-status
# cd /etc/update-motd.d/
# ln -s /usr/bin/mythtv-status 50-mythtv-status
Test it out...
# /usr/sbin/update-motd
# cat /etc/motd
Linux casey 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686
...typical motd stuff...

MythTV status for localhost
===========================
...typical mythtv-status stuff...

0 packages can be updated.
0 updates are security updates.
End Update.

Checked on vmware and it wasn't running. Usual problem:
# /etc/init.d/vmware start
VMware Server is installed, but it has not been (correctly) configured
for the running kernel. To (re-)configure it, invoke the
following command: /usr/bin/vmware-config.pl.
Usual fix:
# /usr/bin/vmware-config.pl
I took all the defaults. Afterwards, don't forget to fix /etc/vmware/config.

I then checked /usr/share/apt-cacher/apt-cacher-report.pl to see if I needed to patch it and it had been fixed in the distribution - yeah!

Well, I think that's it. Will update this post if I run into any more problems.

Update: This system also acts as my apt-cacher, and when I went to upgrade the next system I got "104 Connection reset by peer" errors. Turns out I had to use the new /etc/apt-cacher/apt-acher.conf file:
# cd /etc/apt-cacher
# mv apt-cacher.conf apt-cacher.conf.8.10
# cp apt-cacher.conf.dpkg-dist apt-cacher.conf
# /etc/init.d/apt-cacher restart
Restarting Apt-Cacher: apt-cacher.
For the record, here's the diff:

# diff apt-cacher.conf.8.10 apt-cacher.conf

26c26
< # optional setting, binds the listening daemon to one specified IP. Use IP --- > # optional setting, binds the listening daemon to specified IP(s). Use IP
40c40
< allowed_hosts="192.168.1.0/24,"> allowed_hosts=*
43c43
< # And similiarly for IPv6 with allowed_hosts_6 and denied_hosts_6. --- > # And similarly for IPv6 with allowed_hosts_6 and denied_hosts_6.
49c49
< # This thing can be done by Apache but is much simplier here - limit access to --- > # This thing can be done by Apache but is much simpler here - limit access to
112a113,117
> # This sets the interface to use for the upstream connection.
> # Specify an interface name, an IP address or a host name.
> # If unset, the default route is used.
> #interface=
>
125,126c130,131
< # To enable data checksumming, install libdbd-sqlite3-perl and set this option < # to 1. Then wait untill the Packages/Sources files have been refreshed once --- > # To enable data checksumming, install libberkeleydb-perl and set this option
> # to 1. Then wait until the Packages/Sources files have been refreshed once
133c138
< # apt-cacher server is beeing relocated (via apt-get's error messages while --- > # apt-cacher server is being relocated (via apt-get's error messages while
140,143c145,147
< # also the only method to use FTP access to the target hosts. The syntax is simple, the part of the beginning to replace, followed by a list of mirror urls, all space separated. Multiple profile are separated by semicolons < # path_map = debian ftp.uni-kl.de/pub/linux/debian ftp2.de.debian.org/debian ; ubuntu archive.ubuntu.com/ubuntu ; security security.debian.org/debian-security ftp2.de.debian.org/debian-security < path_map =" debuntu"> # also the only method to use FTP access to the target hosts. The syntax is
> # simple, the part of the beginning to replace, followed by a list of mirror
> # urls, all space separated. Multiple profile are separated by semicolons
146a151,163
> # path_map = debian ftp.uni-kl.de/pub/linux/debian ftp2.de.debian.org/debian ; ubuntu archive.ubuntu.com/ubuntu ; security security.debian.org/debian-security ftp2.de.debian.org/debian-security
>
> # Permitted package files - this is a perl regular expression which matches all
> # package-type files (files that are uniquely identified by their filename).
> # The default is:
> #package_files_regexp = (?:\.deb|\.rpm|\.dsc|\.tar\.gz|\.diff\.gz|\.udeb|index\.db-.+\.gz|\.jigdo|\.template)$
>
> # Permitted Index files - this is the perl regular expression which matches all
> # index-type files (files that are uniquely identified by their full path and
> # need to be checked for freshness).
> #The default is:
> #index_files_regexp = (?:Index|Packages\.gz|Packages\.bz2|Release|Release\.gpg|Sources\.gz|Sources\.bz2|Contents-.+\.gz|pkglist.*\.bz2|release|release\..*|srclist.*\.bz2|Translation-.+\.bz2)$
>

Sunday, October 12, 2008

Auto-updates under mythbuntu

Seems like mythbuntu doesn't install any sort of auto-update process, so I did the following to set one up.

First, I installed cron-apt:

# apt-get install cron-apt


Then, I created the following cron job:
# crontab -e
# crontab -l | tail -1
0 1 * * * /usr/bin/cron-apt && /usr/bin/apt-get -y dist-upgrade

Adding more space for MythTV

I noticed that my mythtv data directory was almost full:
# df | grep data
/dev/sda6 190957912 176125932 5208248 98% /mnt/data


Since I had 256GB of disk I wasn't using, I decided to add that as a second data directory for MythTV. So I mounted this partition as /mnt/data2 and then created /mnt/data2/mythtv

I then made sure mythtv owned the new directory:
# chown mythtv:mythtv /mnt/data2/mythtv


Then I added this directory to the default MythTV storage group, which was the usual MythTV menu hell:

  1. Select "Utilities/Setup"

  2. Select "Setup"

  3. Select "MythBuntu" and enter root password when prompted

  4. Select "MythTV Configuration"

  5. Select "Launch MythTV Setup"

  6. Select "Storage Directories"

  7. Select "Default"

  8. Select "Add New Directory"

  9. Enter the name of the new directory (e.g. "/mnt/data2/mythtv")

  10. Hit Escape 3 times to start exiting out

  11. At this point I was presented with a warning that *none* of my mythtv data directories were writable. After double checking that I entered it right and that the directories were actually writable by themythtv user, I selected "No, I know what I'm doing"
  12. Continue to exit out of menus by selecting "OK"

  13. I canceled running mythfilldatabase

  14. At this point things seemed to hang for 20-30 seconds with me just starting at a blank MythTV background. I think you just wait it out. I hit escape a couple times, but don't know that actually did anything.

  15. Select "Quit"

  16. Hit Escape until you get back to the top-level MythTV menu and then select "Information Center"

  17. Select "System Status"

  18. Under "Machine" you should now see the second directory listed.

Sunday, September 21, 2008

Mythbuntu install

Ok, I had previously gotten my MythTV configuration messed up, so I decided I had been itching to try Mythbuntu, I would start with a fresh installation.

Here I the steps I took:

  1. Downloaded Mythbuntu 8.04.1 and burned to a CD.

  2. Booted CD and ran the Mythbuntu installer.

  3. I used the Manual partitioner and partitioned my 250GB disk into a 50GB partition for the OS and a 200GB partition for program storage. (This worked out, at the end I'm still only using <2GB of the 50GB partition.)

  4. Did the Advanced Install and took the default for everything except:

    • I disable the Samba Service.

    • I set passwords on mythweb and mysql servers.


  5. I enabled a "Hauppage TV card" remote.



It then did it thing and then launched Mythtv-setup (I already have a schedules direct account). In mythtv-setup I did the following:

  1. Under "Capture Cards", I added a new capture card. As I did previously I used MPEG-2 encoder card (PVR-x50, PVR-500) for my WinTV-PVR 250.

  2. Under "Video Sources", I added my Schedules Direct lineup. It retrieved my lineup just fine.

  3. Under "Input Connections", I set the Tuner 1 video source to Schedules Direct and fetched the channels from listings source.

  4. Under "Storage Groups", I added the directory to the 200GB partition to the Default group.



I exited from mythtv-setup and mythfilldb ran. It then restarted, ejecting the CD for me.

After the system came up, the MythTV fronend started. I could see a full program guide under Manager Recordings/Schedule Recordings/Program Guide which was good.

But "Watch TV" didn't work; the screen would just blank and then come back to the menu. Hmmm, there was a little popup in the corner about restricted drivers. I exited MythTV and clicked on the little "driver icon" in the upper right of the desktop. A menu came up wanting to know if I wanted to enable "NVIDIA accelerated graphics driver". I enabled and it tried to install nvidia-glx-new_169.12 but got a 404 error.

I opened a Terminal and run 'sudo apt-get update' and then tried the driver enable again and it worked. I then rebooted.

Damn. Watching TV still didn't work.

Under Setup/Mythbuntu, there is a Propriety Drivers section and I installed the NVIDIA configuration utility and ran it. Ran fine, and I didn't do anything with it. But it just locked up my display when I tried to quit it.

Ah, after reading the advice here and looking in /var/log/mythtv/mythbackend, that provided the missing clue:


2008-09-22 21:52:33.292 TFW, Error: Opening file '/mnt/data/mythtv/1002_20080922215232.mpg'.
eno: Permission denied (13)


The directory /mnt/data was where I had mounted the 200GB partition and then I had created mythtv but I (i.e. the user I had provided during installation) owned it. Apparently, the mythtv user needed to own it.

# chown mythtv:mythtv /mnt/data/mythtv/


And now Watch TV worked!

Some minor administration followed:

  1. Reset static IP address using directions here. Note that as soon as I changed /etc/networks/interfaces, the eth0 network went away and I had to run '/etc/init.d/networking restart' to restore it.

  2. Installed some utils I like:
    apt-get install screen cvs

  3. Ran '/usr/bin/apt-get -y dist-upgrade' to update everything.

  4. Ran 'apt-get autoremove' to clean up

  5. And a reboot after all of that...



Ok, everything seems to be basically working at this point except for some minor tweaks with the remote and channgel changing with mythtv. But I got a bunch of recordings scheduled and that's enough for tonight.