Thursday, May 9, 2013

ATI Remote Wonder and Linux XBMC

Controlling XBMC from your couch can be achieved in many ways. The easiest solution would be to just get a wireless keyboard/mouse combo but us Linux users don't often go for what's easiest. We enjoy tinkering around and learning new things otherwise we'd just be using Windows in the first place. We like to innovate, at least I do. The next easiest thing to do would be to install an XBMC Remote control app on your smartphone, the Official XBMC Remote control app from joethefox is FREE within the Apple Store. There are other paid XBMC remote apps but the FREE one works just fine when tested on my iPhone 4S running iOS 6.1.  However this post will be about getting an old ATI Remote Wonder working in Linux XBMC. I believe there are a couple different variations of the remote but the one that I have is pictured below, if yours looks different then your mileage may vary.

First let me inform you what versions of everything I am performing this on.
Ubuntu = Ubuntu 12.04.2 LTS (running mythbuntu-desktop cause I dislike Unity)
Kernel = 3.2.0-40-generic i686
XBMC = 2:12.2~git20130502.1706-frodo-0precise (obtained from team-xbmc PPA)

This tutorial will mostly be done using a terminal session, if you're scared of the terminal don't be. I will try to explain what each command does and why sudo (root priveleges) are required. When you first plug in your ATI Remote Wonder usb receiver most likely the kernel will automagically load the "ati_remote" module and what that does is basically make the remote act like a mouse. If you used the large circular pad towards the top of the remote you'll see it moving your mouse and such. We don't want that so let's remove that module by issuing the following command. Sudo is required due to removing a module which interacts with the kernel but don't worry as that kernel module was only loaded because it sensed the usb reciever when it was plugged in. Normally that's a good that the kernel automagically loads modules when hardware is plugged in but in this case we don't want that functionality. Whenever you use sudo it asks for your users password, enter it and press the 'enter' key. It doesn't show you that you're entering any letters but you are in fact typing in your password.
sudo rmmod ati_remote
If it says it can't remove it because it's in use then just ignore that and continue on with the tutorial. Now we need to make it so when we reboot the machine that module doesn't automagically load, this is done by editing a configuration file. Since this config is located within the /etc/ directory and is owned by root, we'll again need root privileges so we'll be using sudo but since we're opening a GUI (Graphical User Interface) application, we want to actually use 'gksudo'. This is the command (NOTE: gedit is the default GUI text editor for Ubuntu, if you're using Kubuntu it is kate I believe. I am using Mythbuntu so the GUI text editor is actually called mousepad for me. Replace the gedit command with whatever GUI text editor your distribution uses.
gksudo gedit /etc/modprobe.d/blacklist.conf
Once the file opens in your GUI text editor we're going to add the following text in red to the very bottom of the file
#to get ATI Remote Wonder working
blacklist ati_remote
The pound symbol is used for comments and isn't read as a configuration line. Save the file and close the text editor. Restart your computer ONLY if you previously couldn't remove the ati_remote module. When you restart it won't load this time because you blacklisted it. Now we need to install lirc which stands for 'Linux Infra-red Remote Control'. We again will do that from the terminal session and require sudo because installing software requires root privileges. Type in the following command:
sudo apt-get install lirc
Choose 'Y' if it asks you if you're sure you want to install the software. If lirc was already installed and you'd like to reconfigure it you would use the following command:
sudo dpkg-reconfigure lirc
It will bring up a debconf window. Debconf stands for debian configuration, most applications within Ubuntu are of the .deb extension and is the common package management tool used within Debian based Linux distributions. Within the debconf window using the up and down arrow keys, highlight the ATI/NVidia/X10 RF Remote (userspace) option and then click tab so that the '<Ok>' option is highlighted, then click the 'enter' key on your keyboard. The next window that appears is for a transmitter but we aren't transmitting anything so highlight 'None', click tab so that the '<Ok>' option is highlighted, then click the 'enter' key on your keyboard. If everything went ok lirc should have been installed and the proper config files should be in place. Now we just have to let XBMC know that we'll be using a remote instead of a keyboard to control it and that's done using a config file, Lircmap.xml which will need to be stored within your users .xbmc folder. To do this we don't need root privileges because we're writing the file within our own home directory which we have write access to. The tilde (~) is a short way of entering your users home directory, which is /home/yourusernamehere/, so the whole path is actually /home/yourusernamehere/.xbmc/userdata/. The command is as follows:
gedit ~/.xbmc/userdata/Lircmap.xml
I uploaded my Lircmap.xml to pastebin, you can download the file from this link: Lircmap.xml
Note the 'L' is capital, that's important for the filename. So that button presses don't register twice I had to edit the advancedsettings.xml file located within my users home directory .xbmc/userdata/ and add the following lines. You may or may not already have an advancedsettings.xml file, if you don't have one just create it, if you already have one just add the single line for the remotedelay as you probably already have the top and bottom <advancedsettings> lines.

That should be it, fire up XBMC and your ATI Remote Wonder should now be working. If you want to know which button on the remote does what within XBMC just look at the Lircmap.xml file with a text editor. Example being the "back" command in XBMC is performed with the remote button 'c' as per the following in the Lircmap.xml file <back>c</back>.

-Ubu out

Monday, May 6, 2013

Portal - Released for Steam on Linux

Linux gaming is slowly making strides to become more mainstream. Valve opened the public BETA, Steam for Linux, back in late 2012 which has brought many titles to the Linux gaming platform. There has even been a Humble Bundle which featured many Linux titles and now Valve has released their popular puzzle game, Portal, to run natively within Linux. I have read that Portal 2 is coming to Linux soon as well.

Portal originally came out in 2007 for the PC and Xbox 360. It was later released for Playstation 3 as well as the OS X Operating System. It is of the First Person Puzzle/Platformer genre. It involves the creation of "portals", using a portal gun, to move yourself and possibly objects around a level so that you can get to the exit. It requires some real brain power at times which is what puzzle games are made for. Thinking outside the box will allow you to excel while playing Portal.
It is available thru Steam for Linux now for only $9.99 USD. I happily paid the money and am already enjoying the game thoroughly. I am playing it on Xubuntu 12.04.2 64bit version with an Nvidia 8400GS ando only 2GB of DDRII Ram. The game doesn't require too beefy of a machine as you can see by my computer's specifications. My CPU is only an E4300, 1.8Ghz Core2Duo so I can assure you that you don't need much to enjoy the game. Are you going to purchase the game for Linux and show your support for Linux Gaming?

-Ubu out