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.


Standard for 12 volt DC Edison sockets

September 2, 2013

I recently decided to create a 12 V DC lamp for emergency lighting. I started with a 120 V AC desk lamp from a big box store ($5.99) and added one of the 2W 12V DC bulbs that use the Edison E26/E27 socket.

Of course, I needed to remove the existing NEMA 1 plug and replace it with something that can’t be plugged into household current. I chose PowerPole connectors. That brought up the question: what should be the positive terminal and what should be the negative?

I did a lot of searching in RV and boat wiring, but couldn’t find anything regarding polarity of Edison E26 / E27 sockets. So in the end I just went with what seemed sensible. I wired what used to be connected to the wide blade of the 120 V plug (neutral) to negative, and what used to be connected to the narrow blade to the positive terminal.

This means that in the E26 / E27 socket, the brass projection ends up connected to the + terminal and the shell ends up connected to the – terminal.

That seems to make sense to me – but if anyone knows a better standard I’d love to hear about it.