Upgrading Mythbuntu from Lucid to Precise

September 22, 2013

Recently I decided to finally take the plunge and upgrade my Mythbuntu installation from Lucid (10.04) to Precise (12.04). I’d been getting prompts to do the release upgrade for a while, and I knew if I put it off too long then the upgrade path would disappear and I’d have to do a full reinstall.

The upgrade process was mostly painless. I did:

sudo do-release-upgrade

and walked away for quite a while. I had to kill X, and while churning the upgrade noticed that I’d modified /etc/sysctl.conf for the HDHomeRun:

net.core.rmem_max=2097152

The big issue was lirc – the StreamZap remote has been turned into a devinput device by default, meaning it behaves like a keyboard. I decided that I would rather have the old lircd behaviour where different apps could have different keys. Here’s what I had to do:

1. Add a file /usr/share/X11/xorg.conf.d/90-streamzap.conf with the following contents:

Section "InputClass"
 Identifier "Ignore Streamzap IR"
 MatchProduct "Streamzap"
 MatchIsKeyboard "true"
 Option "Ignore" "true"
EndSection

This tells X not to treat the StreamZap remote as a keyboard. That means lirc has a shot at getting the keystrokes, and means that only one keystroke will be generated (rather than 2 – one from lirc and one from the devinput driver).

I didn’t do this first, which led me to problems. (I ended up pushing the Mute button, which muted a bunch of my audio devices which I then had to undo.)

2. sudo dpkg-reconfigure lirc

I’m not sure how often I did this (I did it more than once). I also made sure to select the Streamzap remote in the Mythbuntu Control Centre. At the end, here’s what my /etc/lirc/lircd.conf looked like:

#This configuration has been automatically generated via
#the Ubuntu LIRC package maintainer scripts.
#
#It includes the default configuration for the remote and/or
#transmitter that you have selected during package installation.
#
#Feel free to add any custom remotes to the configuration
#via additional include directives or below the existing
#Ubuntu include directives from your selected remote and/or
#transmitter.

#Configuration for the Streamzap PC Remote remote:
include "/usr/share/lirc/remotes/streamzap/lircd.conf.streamzap"

Here’s what the first stanza of my /etc/lirc/hardware.conf looked like:

# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Streamzap PC Remote"
REMOTE_MODULES="lirc_dev streamzap"
REMOTE_DRIVER=""
REMOTE_DEVICE="/dev/lirc0"
REMOTE_SOCKET=""
REMOTE_LIRCD_CONF="streamzap/lircd.conf.streamzap"
REMOTE_LIRCD_ARGS=""

3. Save your existing ~/.lirc/mythtv files, and any others you don’t want to lose. (I didn’t do this, and regretted it later.)

4. Run the following two lines:

mythbuntu-lirc-generator
mythbuntu-lircrc-generator

This nukes your exsisting ~/.lirc/mythtv (and ~/.lircrc) and creates new ones based on Mythbuntu defaults.

5. My mythtv file in the end (after putting my modifications back) looked like this:

# LIRCRC Auto Generated by Mythbuntu Lirc Generator
# Author(s): Mario Limonciello, Nick Fox, John Baab
# Created for use with Mythbuntu
begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_0
config = 0
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_1
config = 1
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_2
config = 2
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_3
config = 3
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_4
config = 4
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_5
config = 5
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_6
config = 6
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_7
config = 7
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_8
config = 8
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_9
config = 9
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_MUTE
config = |
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_CHANNELUP
config = Up
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_VOLUMEUP
config = ]
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_CHANNELDOWN
config = Down
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_VOLUMEDOWN
config = [
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_UP
config = Up
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_LEFT
config = Left
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_OK
config = Return
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_RIGHT
config = Right
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_DOWN
config = Down
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_MENU
config = M
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_EXIT
config = Escape
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_PLAY
config = P
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_PAUSE
config = P
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_STOP
config = Escape
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_PREVIOUS
config = Q
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_NEXT
config = Z
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_RECORD
config = R
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_REWIND
config = PgUp
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_FORWARD
config = PgDown
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_POWER
config = Escape
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_BLUE
config = I
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_RED
config = D
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_YELLOW
config = A
repeat = 0
delay = 0
end

begin
remote = Streamzap_PC_Remote
prog = mythtv
button = KEY_GREEN
config = W
repeat = 0
delay = 0
end

I’ve got the blue button pushing I (for info), the red button pushing D (for delete), the green button pushing W (for width) and the yellow button pushing A (for playback speed).

I also set the power button to be another Escape, and Forward to PgDown and Backwards to PgUp.

You want to make sure the remote = Streamzap_PC_Remote, not the devinput remote.

Edit: Ha, I spoke too soon. I’m troubled by endless “Sorry, Ubuntu 12.04 has experienced an internal error” passwords. Luckily, this post explains how to at least turn them off, if not fix the problems.


Building a quiet MythTV box – selecting a case

April 20, 2012

I’ve started looking around for a quiet but thermally good case for a MythTV box. My first thought was to do an HTPC case – the Lian Li HTPC C60 looked good.

But then I started worrying about airflow around the case. I’ve got a fairly narrow spot to put it in – about 46 cm – so a PC that’s 44 cm wide doesn’t leave a lot of room for cooling.

I decided to look into mini towers instead. The Lian Li V600F looks like it would be nice, but it has these ugly blue fans.

I also looked into the NZXT H2 (some were saying it was too flimsy), Antec P183 (too tall, not a mini tower) and Silverstone TJ-8e (an 18 inch fan in front, but only that. How hard to get a replacement when it dies?)

Now I’m leaning towards the Lian Li B10. It’s too bad that SPCR hasn’t reviewed it – they seem to know a thing or two about quiet and heat.


Building a quiet MythTV box – step 1 – thinking aloud

April 1, 2012

Due to decreased WAF for the old MythTV box, I’m looking into building a quieter one. I’ve decided to do a couple of things differently:

  • Use HDHomeRun for capture cards. That way, I won’t be stuck to a particular bus architecture. It also means the capture cards won’t be generating heat in the case.
  • Use a pair of 5400 RPM hard drives (maybe a 2.5″ one for the OS, and a 3.5″ one for the recordings? Need to have fans on all of them to cool them down.
  • Replace all the fans with FDB or maglev bearing fans
  • Use an external PSU like the PicoPSU or something like that. Here’s an adapter to make it fit in a standard fan bay. (This might also be a good idea for ham radio PSUs…)
  • Use an HTPC case or at least a quiet PC case
  • Probably end up with an nVidia video card.
  • I think I want a core2 duo 3.1 MHz or so motherboard/ processor combo
  • Does the Pico PSU mean I won’t be able to drive a DVD player? Maybe another external one (eSATA?) Am I going to end up with a bunch of individual set top boxes?

The CPU cooling fans, video card and hard drives should generate most of the heat (and noise). Need to figure out how much power a video card uses.


Failed while running mythtranscode to cut commercials

February 27, 2011

For a long time I’ve had the error message “failed while running mythtranscode to cut commercials” on my MythTV box. Today I did some searching to find out more about it.

It turns out the error is caused by the existence or permissions of .ICEauthority.

I nuked ~/.ICEauthority and was able to mythtranscode. Apparently this file is recreated occasionally, so if I see this again I’ll check permissions.


Echo when playing back MythTV

October 26, 2010

I recently ran into an interesting problem with my MythTV audio. When I played back a program, it would play back with varying degrees of echo in the audio. Usually the echo would be around 100 ms behind, but if I skipped forward or back I could get it up to 3 seconds behind. This problem did not happen outside of MythTV.

First I started with alsa-mixer. There I determined that there was no level I could change to affect the echo. Changing the level always changed both the first audio and the echo.

Next I tried reinstalling the AC97 sound driver, because I saw a website that noted when the driver was corrupt you could get an echo. No dice.

Finally, I happened to be running top, and I saw this:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 4273 myth 20   0  220m  85m 3588 S   12  8.5  11:55.43 mythfrontend.re
 4257 myth 20   0  245m  85m 3700 S   12  8.5  10:20.79 mythfrontend.re

I had two copies of mythfrontend.real running! Both were getting the lirc keypresses and acting on them. This meant everything (including the player) was being run twice… hence an echo slightly behind the main audio.

Somehow the Gnome session state had been saved with a mythfrontend.real running, and when it was restored it would restore with that mythfrontend.real as well as start a new one. I made sure the session state wasn’t being saved (under Settings), killed all the running mythfrontend.real instances, and then logged out saving the session. Next I logged in and out but unchecked the button to save session on logout. That seems to have done the trick.


Modeline for Samsung LN32A450C

October 25, 2009

When I switched my video card after the capacitors burnt out on the old one, I found I could no longer do 1366×768 video on a Samsung LN32A450C. Most frustrating was the fact that I’d see the video for about four seconds, before the TV decided it didn’t want to display it and showed “Mode not supported”.

Apparently, this is a common problem with Samsung TVs – and cvt was no help.

Luckily, I found this post – so here is the modeline for the Samsung LN32A450C

Modeline "1360x768" 85.500 1360 1440 1552 1792 768 771 777 795 +hsync +vsync

I just had to add that to my Monitor section of /etc/X11/xorg.conf and the autodetection on Ubuntu 9.04 did the rest. This is actually 1360×768, not the specified 1366×768 that Samsung is supposed to support – but I don’t miss the few pixels on either side.