Showing posts with label XBMC. Show all posts
Showing posts with label XBMC. Show all posts

Sunday, February 3, 2013

Remapping RaspBMC Remote Keybindings

I've updated my HTPC to be a Raspberry Pi that uses RaspBMC as the OS. The really hard part was integrating my existing RAID with the device (over USB) to serve up my media; that's a subject for another post.

Something that didn't quite work out of the RaspBMC box (and to be fair A LOT did work) was the Context Menu for XBMC. I like to call it the "right click" option if I was using a mouse. This was because my remote didn't have the default button that XBMC was expecting. As mentioned in a previous post I have a generic RC6 IR receiver that I had used the mceusb2 kernel driver. Looking at the remote config file for XBMC (/opt/xbmc-bcm/xbmc-bin/share/xbmc/system/keymaps/remote.xml) the ContextMenu is mapped to the <title> key. Looking in the LIRC config file for XBMC (/opt/xbmc-bcm/xbmc-bin/share/xbmc/system/Lircmap.xml) for a mceusb remote the "title" is mapped to the "Guide" key. Looking on my trusty remote diagram there was a Guide button, but why didn't it bring up the context menu?

Turns out that RaspBMC was using a different remote config in Lircmap.xml Using irw to see the remote codes I get:

16d 0 KEY_EPG devinput
16d 0 KEY_EPG_UP devinput
Searching Lircmap.xml for devinput I got a different <remote> profile, with no mapping for <title> So I added:
<title>KEY_EPG</title>
and the Context Menu is displayed.

Handy little util irw for figuring out remote config.

Friday, July 2, 2010

MythBox is the key - not Asia

Apologies to any readers who don't play Risk for the post title.

I'm up to the stage where I need to get the recording functionality working. That was the major selling point to my wife. So I bought an Aver Media DVB-T 777 second hand from eBay on the recommendation of a mate. The reason he has it, and that he suggested it to me, was that it plays nicely with Linux as the Phillips SAA7134 chipset is well supported in the Linux kernel. I'm currently using version 2.6.31-gentoo-r6, with this config

Device Drivers
--> Multimedia Support
<*> Video For Linux
<*> DVB for Linux
[*] Video capture adapters -->
<*> Phillips SAA7134 support
<*> Phillips SAA7134 DMA audio support
<*> DVB/ATSC Support for saa7134 based TV cards

Compile, reboot, and done. TV card supported.

I emerged media-tv/mythtv-0.22_p23069 and followed the instructions on the MythTV wiki for configuring the backend.

When running mythtv-setup, if all you have is a keyboard, the left and right arrows allow you select options from combo boxes, the up and down arrows select combo boxes, buttons, text fields, etc and ENTER/RETURN selects whatever is highlighted. You'll get the hang of it.

When selecting your capture card, make sure that you select the DVB under the card type. In the case of my card, because I had multiple inputs (there's an S-Video adapter) I didn't change the card type, so I spent a lot of time figuring out what I couldn't scan for channels. The DVB "section" of your card is the antenna port.

Once you quit mythtv-setup and run mythfilldatabase, if you get an error about not being able to create a QObject/widget start your backend again. This is a weird error with not much information to go on, and took me a lot of googling to figure out. It's because the backend can't be connected to, so starting it solves the problem.

Once I got MythTV configured, it was time to check out how to integrate it with XBMC. The inbuilt stuff to connect to a MythTV backend is buggy, causes XBMC to lock up, and isn't very feature rich.

However MythBox is the saviour of this piece. Has everything the wife would want. So I'm testing the recording abilities now, and can watch live tv. Once I do some more tweaking I should have a decent PVR in the HTPC.

I really do need to get a new HD though.

Thursday, June 3, 2010

HTPC tweaking

I fixed my XBMC problems

  1. My XBMC hanging/screen issue is fixed by turning System->Video->Playback Sync playback to OFF.

  2. My sound popping issues were fixed by turning the System->Video->Video Blank Sync to ON.


I discovered how to use a handy little util called ddcprobe which is part of the xresprobe project. It helps figure out what modes, refresh rates, etc, your monitor/card supports. Great for filling out your Xorg.conf :)

For some reason the ddcprobe as part of Xorgautoconfig doesn't work properly (I kept getting segfaults), so get the source and build it yourself.

Some TV tweaks, and I'm done. If only the TV wasn't busted. My next step is to put a capture card in, because my wife hates missing her soaps :p

Tuesday, June 1, 2010

To boldly go where ....

It's been a while since I wrote anything HTPC related. The reason is that I set up the HTPC as best I could, but I didn't own a HDTV. Until last Saturday (29/05/2010) when I got a Samsung 40" LCD. However after 6 hours out of the box, it breaks. :( :( :( One of the panels started distorting the picture. I'm in the process of sorting out a replacement.

However it does give me something to try out the HTPC on. Boot it up, and lovely XBMC appears. Some config tweaking and voila, full HD playback.

All is not well though.

I did a portage upgrade and amongst other packages the ati-drivers got upgraded to 10.5. Now I have a problem with XBMC hanging when I push stop on the remote. I've posted to the XBMC forums if anyone has any ideas. I tried downgrading to 10.2 but got blocked (see this forum post)

While investigating the above issue, I also found (IMO) a borked ebuild for XBMC for xbmc-9.11-r4. I had 9.11-r3 installed and I thought upgrading to 9.11-r4 might fix my blank screen problem. Seems 9.11-r4 has a dependency on Python 2.4, when the rest of Gentoo (at least on my boxes) is using 2.6 Looking into this it's because the XBMC scripting engine is 2.4 based. There's a Gentoo forum post on the matter. Why the ebuild is borked is because (from the associated bug report)

If I understand the problem correctly, than its not a matter of the python-version. Xbmc has made a few patches/additions to python, which aren't upstream. The included python has this patches, python as an external library misses this features.

So putting a dependency on an external 2.4 python interpreter WONT EVEN FIX THE PROBLEM

What should be done is to incorporate the suggestion made by comment 12 in the bug report into the ebuild. As comment 15 pointed out, having an external python 2.4 interpreter will fix somethings, but not everything, where as using the bundled interpreter with XBMC will ensure all plugins working (as far as the infrastructure is concerned).

I updated my xbmc-9.11-r4 ebuild and it built fine. Doesn't fix my XBMC hanging problem though.

Sunday, April 4, 2010

Autostarting HTPC

As mentioned I've got a dummy user set up on my HTPC box (tvuser) that needs to autologin when the machine boots up. Reading this gave me an overview of what needed to be done. I edited my /etc/inittab to change
c1:12345:respawn:/sbin/agetty 38400 tty1 linux
to
c1:12345:respawn:/sbin/agetty 38400 -l /sbin/autologin.sh -n
tty1 linux
where /sbin/autologin.sh looks like
#! /bin/bash
exec login -f tvuser
Note that the inittab entry should all be on one line (I had to put a line break in there for formatting), and the autologin script has root permissions, so only the bootup sequence (or me as root) can execute it. I previously was using fluxbox as my window manager since that's what I use on my laptop, however it was time to get XBMC going.
 emerge -vDp xbmc
did the trick. I then altered tvuser's .xinitrc to contain the line
exec xbmc
To make sure that X is started when tvuser (auto)logins, I set the following in tvuser's .bashrc
if [ "`tty`" = "/dev/tty1" ] ; then
startx
fi
The conditional helps because when I was debugging some config by sshing into the HTPC as the tvuser user, X kept trying to start. The conditional has X only start of the tty value is /dev/tty1 which only happens as boot time.

The remote works so far with XBMC, however I haven't tried anything too exotic.

The boot process is a bit slow for my liking. I've got some other boxes that could do with a boot boost, so I'll probably take the time now to research how to reduce the bootup time of my Gentoo boxes.