TechNazgul RSS

Sunday, September 19, 2010

Making sense of XBMC remote mapping



Understanding lircmap.xml, remote.xml, and keyboard.xml


I’ve written in the past about using irxevent to set up custom remote commands in XBMC on Linux.  That was the way I originally set up my remote after getting hopelessly confused trying to follow the more common method of configuring lircmap.xml, remote.xml, and keyboard.xml.

 

In an effort to help others navigate this maze, I’ll try to explain what I’ve learned.  Note that this is primarily directed at Linux users, though the key mapping relationships in Windows are nearly identical (but the file locations are different).  For the most part, a Windows Media Center Edition (MCE) remote will work out of the box, though there are several unused remote codes that you can remap to custom keys using the guide below.

 

First, consider the graphic below outlining all of the pieces involved.

 xbmc-remote-diagram_2

 

#1: Remote Control Commands

 

Open up a terminal and enter the irw command.  You won’t see anything immediately, but will see confirmation of the IR code (or “Lirc button” in the graphic above) received when a button is pressed on the remote.  This will confirm what Lirc button the system is receiving.

 

#2: The system lircmap and keymaps

 

As the graphic says above, do not edit anything in these files.  These are the default xbmc files.  They are also overwritten every time you reinstall xbmc, so any time you spend here to get your system running right will be washed away the first time you upgrade xbmc.

 

#3: Lircmap.xml in the xbmc userdata folder

 

In Lircmap.xml, you must define any Lirc button names that are not already defined in your /usr/share/xbmc/Lircmap.xml file.  (i.e. if you look through that file under the entries for your remote and do not find an entry for the IR code in question, you need to define it here).


Here is one example of a way to map RecTV (an LIRC button) to recordedtv (an XBMC button):

<lircmap>
  <remote device="mceusb">

     <recordedtv>RecTV</recordedtv>

  </remote>
</lircmap>

 

#4: Remote.xml (and keyboard.xml) in the xbmc userdata folder

 

In Remote.xml, you continue to define for XBMC what to do when the system receives the RecTV Lirc Button.  At this point, Linux has converted the RecTV IR code (Lirc button) to a button XBMC understands “recordedtv.” View the full list of the buttons XBMC understands here.

 

We define the function of recordedtv (an XBMC button that otherwise has no function in XBMC), by making an entry in the remote.xml file.

 

<keymap>
  <global>

    <remote>
       <recordedtv>XBMC.ActivateWindow(videolibrary,movietitles)</recordedtv>

    </remote>
</global>

</keymap>

 

This entry in remote.xml tells XBMC what action to take when the button <recordedtv> is pressed (which is a button it recognizes, but which has no function until defined here).  The command above tells XBMC to open the movie library when this button is pressed.

 

You can repeat this process for other buttons you wish to define via remote shortcut.  Other shortcuts I recommend to map to a key are:

 

  • XBMC.ActivateWindow(favourites)
  • XBMC.RestartApp
  • XBMC.ActivateWindow(videolibrary,tvshowtitles)
  • Fullscreen (returns XBMC to full screen video if you navigate through the menu/library while watching a movie in the background)

Wednesday, September 8, 2010

Add custom remote control commands to XBMC Dharma



XBMC Remote Setup with irxevent

If you need to setup custom remote commands, i.e. mapping non- standard keys like “LiveTV” on your Windows MCE remote to a new function in XBMC, one method of doing so is using irxevent.

To be clear, this is not the most common way to set up customized remote commands.  The more common method is using lircmap.xml and remote.xml, which can be confusing, so this is another way of accomplishing the same thing.

 

This guide is a good start.  Here’s what I took away and customized for use with the XBMCFreak version of Dharma Beta 1.

 

  • Install irxevent
    • sudo apt-get install lirc-x
  • Create your customized .lircrc file in your ~user directory (/home/user)

 

This is what mine looks like:

begin
#MAPS LIVETV button to “tab” key for toggling between menus and fullscreen video

        prog = irxevent
        button = LiveTV
        config = Key Tab XBMC
end

# MAPS RECTV BUTTON TO SHOW MOVIE LIBRARY - SET UP AS F2 IN KEYBOARD.XML
begin
    prog = irxevent
    button = RecTV
    config = Key F2 XBMC
end

# MAPS  BUTTON TO RESTART XBMC - SET UP AS F3 in KEYBOARD.XML
begin
        prog = irxevent
        button = Print
        config = Key F3 XBMC
end

# MAPS  BUTTON TO OPEN FAVOURITES - SET UP AS F4 in KEYBOARD.XML
begin
        prog = irxevent
        button = Radio
        config = Key F4 XBMC
end


As you can see above in the notes, you have to set up the associated entries in your keyboard.xml file, which is located in /home/user/.xbmc/userdata/keymaps/keyboard.xml.  Here are a few examples of custom entries in my keyboard.xml file.

 

<keymap>
  <global>
    <keyboard>

… LOTS OF DATA OTHER STANDARD LINES EXCLUDED HERE …

 

     <f2>XBMC.ActivateWindow(videolibrary,movietitles)</f2> <!-- CUSTOM -->
     <f3>XBMC.RestartApp</f3> <!-- CUSTOM -->
     <f4>XBMC.ActivateWindow(favourites)</f4> <!-- CUSTOM --> 

 

     … LOTS OF DATA OTHER STANDARD LINES EXCLUDED HERE …

 

  </keyboard>
</global>

 

 

You can add other commands to the irxevent configuration as well, just make sure that whatever remote code you choose for irxevent isn’t already used in XBMC for something else.  If you choose a remote code or button that is already mapped to another functionality in remote.xml, lircmap.xml, or keyboard.xml, XBMC will send two button presses every time you use the custom mapped button.  The first function will be the one in .lircrc (using irxevent functionality) and the second function will be the one defined in remote.xml/lircmap.xml/keyboard.xml.  As long as you don’t overlap anything, this will work fine.

 

Autostart  irexec

 

Lastly, you need to add irexec to autostart with your XBMC Live session.  You do this by editing this file:  /usr/bin/xbmc

 

The text in red is the only text you need to add.  The rest is shown just so that you can see where you include it in the file.

 

#  You should have received a copy of the GNU General Public License
#  along with XBMC; see the file COPYING.  If not, write to
#  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
#  http://www.gnu.org/copyleft/gpl.html

 

# start irxevent

irxevent &

 

SAVED_ARGS="$@"
prefix="/usr"

 

Technorati Tags: ,,

Installing XBMC Dharma Beta on the Acer Aspire Revo



XBMC Dharma Setup Guide
XBMC recently unveiled the first official Beta of their “Dharma” release. It includes numerous enhancements from the last complete version.

 

Note:  original post updated with general links to XBMCFreak’s site for the latest Dharma iso.  The process is otherwise unchanged. 

The most notable for me include:

 

  • Windows hardware-accelerated video through DXVA (though I’m sticking with Linux for now)
  • OSX hardware accelerated video for H.264
  • A new awesome addon system that makes it MUCH easier to install plug-ins (now “addons”) without ssh’ing into your box to copy plugin data
  • Support for embedded PGS subtitles (the kind that are standard on Bluray rips)

 

And lots lots more.  

 

I’ve been happily using XBMC on two Acer Aspire Revo 1600s with xbmc-standalone on Ubuntu (Jaunty) for the past ~9 months.  One of these is connected to a 1080p projection system with 7.1 audio, and the other to an older 720p TV with stereo sound.

 

In general, the release looks very promising, but for me, the real problems I was hoping it would solve were:

 

  • Problems with playing interlaced content:
    • 1080i 60fps content commonly captured by personal HD video cameras.  My Canon Vixia HD cam captures in this format, and with the previous version of XBMC, despite dozens of hours of tweaking, smooth playback of these types of files was just not possible.
    • Also, a rare number of Blu-ray discs like Rush: Snakes and Arrows and Harvard vs Yale, both of which are mastered in 1080i instead of 1080p caused very jittery playback on the previous XBMC version.
  • Problems with a very limited number of videos that caused minor stuttering during playback.  This was primarily with full bit-rate Blu-ray rips and was not due to CPU limitations.
  • Problems with high CPU usage and resulting stuttering video playback when using PGS subtitles on HD playback (this wasn’t an XBMC problem at the time, it had to do with a library they were importing I believe, but I was still hoping they would have integrated a fix by the time the new release came out)

 

Quick Setup Guide (Linux: using XBMCfreak LiveCD)

 

Tonight I tested by installing the XBMCFreak version of the Dharma Beta release.  Here are the quick steps for those who want to do the same.  You really should be able to do this inside an hour following the steps below, but let me know if you have questions and I’ll do my best.

 

  1. Download the XBMCFreak iso using the link directly above.
  2. Burn the ISO to CD or, easier, to a USB disk using Unetbootin.
  3. Boot your Revo from the USB disk you just created with Unetbootin.  (press F12 during the Revo’s boot up to select the disk you wish to boot from)
  4. Select the option to install XBMCLive.  You can install to a separate USB key plugged into the Revo or to the Revo’s hard drive.  In my case, I installed to another USB drive first as I didn’t want to blow away my primary install until I did quite a bit of testing with the new version.
  5. Once the install completes, remove the  XBMCFreak Live CD/USB and boot to wherever you installed the Dharma Beta.
  6. If you are using Analog audio, everything pretty much works out of the box (it did for me at least).  If you need HDMI audio, read on.
  7. Open a terminal connection to your Revo using putty
  8. Install wget so that you can download the NVIDIA driver.
    1. sudo apt-get update
    2. sudo apt-get install wget
  9. Grab the 256.53 NVIDIA driver using this command:  “wget http://us.download.nvidia.com/XFree86/Linux-x86/256.53/NVIDIA-Linux-x86-256.53.run”
  10. Kill X:  sudo pkill X
  11. Completely remove all current NVIDIA drivers to ensure you have the most current compatible driver. sudo apt-get --purge remove nvidia-*. [Thanks Balthazaar for the tip]
  12. Install the drivers using “sudo sh NVIDIA-Linux-x86-256.53.run”  (follow the prompts until it completes)
  13. Fix the screwed up channel mapping in multi-channel PCM (i.e. FLAC and TrueHD tracks) by downloading these two files (will they ever get this correct?!)
    “sudo wget http://pastebin.com/download.php?i=f5f9654bb -O /etc/asound.conf”
    ”sudo wget http://pastebin.com/download.php?i=f2e38265 -O /usr/share/alsa/cards/HDA-Intel.conf”
  14. reboot for good measure
  15. Within XBMC, configure Settings \ System \ Video \
    1. Audio Output = hdmi
    2. Custom Passthrough device = plughw:0,3
  16. Enjoy!

Thanks to Roelio on the XBMC forums for some of this information from a slightly older post.

Note, you can also follow any related discussions on this guide on XBMC’s forums.

 

I’m still testing, but so far, most/all of the previous problems mentioned above appear to be resolved by upgrading to this new version.  Awesome!

 

If you’re looking for information on how to set up custom remote commands with irexec in XBMC, check this post.

 


Technorati Tags: ,,

Wednesday, September 1, 2010

Gmail: The conversation that you requested could not be loaded…



gmail-smalllogo The conversation you requested could not be loadedGmail has been doing a lot more of this lately. I’m not sure if it’s load-related or if they’ve got buggy code, but something has caused it to pop up a lot more frequently in the last 1-2 weeks.

The solution (which is ugly) is to view your Gmail in plain HTML mode. I’ve found that this only occurs with certain messages, so if you have a message you need to open and can’t wait for Google to fix itself, change to basic HTML mode using the link at the bottom of the Gmail page (highlighted in yellow below). Once you’ve done that, all messages should open fine.

basic-html

Technorati Tags:

Followers

Facebook