Crunchbang media center - Part 3

I love XBMC, I've been playing with it in one form or another since my original XBox (still the best standard definition media/everything center ever) So yes: XBMC! It's amazing! Everybody likes it! The stable repo is on an old version!

Oh, that last bit ain't great. XBMC 13 is about to come out, and Debian stable (the distibution Crunchbang is based on) is still stuck on XBMC 11. Of course, I only figured that out after trying to install it with apt-get...

sudo apt-get install xbmc

Booo old versions. After a bit of stalking through the Crunchbang forums it turns out there's some additional apt repositories I can add in, called deb-multimedia. This software repo isn't official for Debian (and there's been a bit of sooking about the potentially confusing name) Anyway, adding a new source should just be a quick edit to the sources.list file, but when I went to try:

$ sudo vim /etc/apt/sources.list
sudo: vim: command not found

WHAT? No VIM installed? The horror. Sure, I could use one of the other editors supplied by Crunchbang (I think I was using geany for the most part) but VIM... I need that handy. Fortunately it's easy to fix up:

sudo apt-get install vim

Phew... VIM installed, crisis averted. So then I was able to add the following line to the sources.list file:

deb wheezy main non-free

and as suggested on the deb-multimedia site, run

apt-get install deb-multimedia-keyring

presumably to stop the 'unsigned' warnings that came up when I ran apt-get update before installing that keyring...

I decided to install using Synaptic (which I probably could have used to add in the deb-multimedia source now that I think about it.) But when selecting XBMC I got a bunch messages about dependencies not resolving correctly. The solution I struck on was to specify the dependencies manually, so I went back to a terminal and went for:

apt-get install xbmc xbmc-bin libavfilter3 libavformat54

I have a feeling the almost-dependency-hell was caused by deb-multimedia not playing nice under crunchbang: I was pretty sure I'd already installed libavformat54, so maybe I just overwrote the debian stable version with the newer deb-multimedia one. For that matter running apt-get upgrade might have avoided some of those problems.

In any case, that's XBMC up and running!

Running audio

I've got a set of Logitech Z-5500 surround speakers in the lounge, and when Sussudio ran Windows 7 it would send audio to the surround system over optical and not push any audio through HDMI. Unfortunately so far I haven't been able to find out how to turn off HDMI Audio without it also turning off Optical under Crunchbang. So as a workaround, yep, I'm just turning the volume down on the telly... Feels like a cheat though.

XBMC Plugins

XBMC plugins are fantastic, and since I last looked somebody had gone out of their way to make an iView plugin. No more minimising XBMC and opening up a browser for us any more! The iView plugin works really well, except there was one little thing being annoying:


When playing back (some) video, there were little green dots flickering all over the screen. After a little forum trawling it transpires the problem can be fixed by switching shaders in the menu to 'basic shaders.' I'm blaming the cruddy Intel integrated graphics for that change.

Lenovo remote

As my media center remote I've been using a Lenovo N5902 (image forthcoming), it's a great piece of kit, but I noticed that I was getting some weird phantom keypresses or mouse moves while typing with it. Terminal windows would suddenly scroll upwards, and while in XBMC navigating with the arrow keys the mouse would register some movement, making the mouse cursor appear and moving whatever I had selected with the keyboard away.

It all used to work so nicely under Windows... awww...

The workarounds I've put in are:

  1. Disable the mouse in XBMC all-together.
  2. Disable the scrolling pad on the N5902

Neither of these are ideal by any stretch, but I couldn't find any info to help fix them properly.

Disabling scrolling

I only discovered that it was an errant scroll event by using a utility called xev. After playing around with the keyboard xev revealed that mouse button 4 was triggering randomly, which scrolled upwards.

Now, I didn't realise this, but at least under Linux scrolling up and down is triggered as two separate mouse buttons - 4 & 5. So if I could disable those two mouse buttons, I would disable scrolling.

I was able to use xinput to find the device, and discovered that the Lenovo remote was device #9. So I ended up running the following to disable scrolling:

xinput set-button-map 9 1 2 3 0 0

xinput's set-button-map facility takes an id (device 9), then a list of which button should be mapped to which input, so I'm just mapping buttons 4 & 5 to nothing. I've put that line in my OpenBox autorun script so it persists over reboots. Hopefully someday I'll figure out why button 4 was triggering when it shouldn't and I can go back to fix this up.

Next time

TV playback in XBMC!