Archive:Set up Streamzap PC Remote for Linux

From Official Kodi Wiki
Jump to navigation Jump to search

This page is all about getting the Archive: Streamzap PC Remote to work completely with XBMC. Currently it includes only information on how to configure Streamzap on Linux.

1 Remote button configuration

In this tutorial all buttons have mapped to their matching functionality in XBMC. However, since the remote has no display, info, or title button those have been mapped to the color buttons on the bottom of the remote. Feel free to change them as necessary.

Here are the mappings:

  • Display Command: YELLOW button
  • Title Command: RED button
  • Info Command: GREEN Button
  • Blue Command: BLUE Button

2 Linux setups

There are two ways you can set up Streamzap to work with XBMC on Linux.

  • LIRC
  • inputlirc

Important Note:
If you run LIRC and Inputlirc they will conflict when it comes to ownership /dev/lircd. That is service that runs last gets control of it (and on Ubuntu that services always seems to be inputlirc). You can check it out for yourself by restarting either service and the doing ls -la /dev/lircd. Please make sure only one is running at one time.

3 Setups tested


  • Gentoo and XBMC 9.11 (Camelot) and official app-misc/lirc-0.8.7 from portage
  • Ubuntu 10.04 (Lucid Lynx) and XBMC 9.11 (Camelot)
  • Ubuntu 10.10 (Maverick Meerkat) and XBMC 10.0 (Dharma RC1) [buggy, but has workaround, see below]


  • Ubuntu 10.10 (Maverick Meerkat)and XBMC 10.0 (Dharma RC1) [buggy, no workaround yet, see below]

4 Drivers

Streamzap PC Remote is well supported in linux. However, I have seen drivers named differently. Here are the variations I've run into:

  • lirc_streamzap
  • streamzap (new ir_core implementation?)
  • rc_streamzap (new ir_core implementation?)

The configuration of LIRCD I've used in the past combine streamzap with lirc_dev.

5 Bugs and workarounds

In Ubuntu 10.10 (Maverick Meerkat), pressing any button on the remote will send the event twice to the system. It seems to have been caused by including both the new and the old drivers in the kernel and each of the drivers sending the events to /dev/input/*.

Bug has been filed and confirmed, but the fix is still pending:
There is also a forum thread on this:


  • LIRD: Using a LIRCD with a socket configuration bypasses the problem of duplicate events. However, if Streamzap still gets configured as keyboard input device it send keystrokes to the system. This can be fixed by disabling the Streamzap as keyboard as described below.
  • Inputlirc: Disabling XInput device does not work when using Inputlirc since it uses the same event input system and gets the event twice anyways.

6 Xinput: Preventing Streamzap from becoming a keyboard

This applies to people using Xorg 1.8 or higher (i.e. Ubuntu 10.10 (Maverick Meerkat) users)

Xorg 1.8 (and on) automatically scans attached devices using udev and add them as an input device (using Xinput). This creates a problem because Streamzap is then detected and added as keyboard device, and number of remotes keys are mapped to keyboard keys. For example in fresh install of Ubuntu 10.10 (Maverick Meerkat) the arrow buttons can be using to navigate around, volume and mute buttons control sound and power key pops up the shutdown dialog (other keys might work but I have not tested them).

While this feature is cool it does interfere with using the remote properly with XBMC since it is not integrated with Xorg standard keys (maybe one day?). As such I suggest disabling the remote from being detected/used as a keyboard. There are several solutions.

Important Note: if you set AutoAddDevices to false in your xorg configuration, you can skip this section

6.1 Option 1: Disable Streamzap Xinput device usign xorg configuration

The correct way to disable Xinput device on Xorg 1.8 and higher is to use one or more of Match* statement and "Option Ignore" in an "Input Class" Section.

The following configuration block needs to to be added to xorg configuration.

Section "InputClass"
  Identifier "Ignore Streamzap IR"
  MatchProduct "Streamzap"
  MatchIsKeyboard "true"
  Option "Ignore" "true"

There are two ways to do it:

  • Recommended: add a 90-streamzap.conf file to a xorg.conf.d directory
  • add the configuration directly to /etx/X11/xorg.conf

xorg.conf.d locations

xorg.conf.d location may vary on your system.

  • Ubuntu 10.10 (Maverick Meerkat): /usr/share/X11/xorg.conf.d
  • Ubuntu 10.04 (Lucid Lynx): /usr/lib/X11/xorg.conf.d
  • ArchLinux: /etc/X11/xorg.conf.d/

So on Ubuntu 10.10 (Maverick Meerkat) run the following command and paste the configuration into the file.

sudo nano -w /usr/share/X11/xorg.conf.d/90-streamzap.conf

6.2 Option 2: Disable Streamzap Xinput device on user session start

Alternatively the Streamzap Xinput device can be disabled by a script run at login.

The following script disables the Streamzap as an Xinput device. Save it locally as streamzap-xinput-disabler in <SCRIPT_LOCATION>.
The script is configured to look for Streamzap device attached to /dev/lirc0, you might need to change it if you have multiple IR Receivers.

#! /bin/bash


namePath="/sys/`udevadm info -q path -n $REMOTE_DEVICE`/../input*/name"
xinputLine=`xinput list | grep "$(cat $namePath)"`
id=`expr substr "$xinputLine" $(expr $(expr index "$xinputLine" "=") + 1) 100 | awk '{print $1}'`
propID=`xinput list-props $id | grep Enabled | awk '{print $3}'`

xinput set-prop $id $propID 0

Borrowed and slightly modified from:

Add a start up entry for this script in your window manager to run this at start up. GNOME, KDE, XFCE and most WMs have a GUI for that. Alternatively one way to do it is by adding streamzap.desktop in ~/.config/autostart/ with following content. Make sure to replace <SCRIPT_LOCATION> with path you stored the script in.

[Desktop Entry]
Name=Streamzap PC Remote Xinput Disabler

6.3 Option 3: Use inputlirc to cripple Streamzap Xinput device

This a total hack. Not at all recommended. Use it at your own risk.

The premise of this, is that if inputlirc is configured with -g it grabs the input from the devices, specified under EVENTS= setting for inputlirc, so that no other application interferes with it. This way when X initializes the remote will be added as Xinput keyboard but won't receive any events, hence disabling it. This also means that at the end of the boot LIRC daemon needs restarted so it can take back /dev/lircd from inputlirc, making it the primary LIRC device.

Step 1, First follow the Inputlirc setup exactly as described in #Inputlirc

Step 2, Add a line to restart the LIRC daemon at the end of the boot sequence so it can take back control by editing /etc/rc.local

nano -w /etc/rc.local

Add following (above exit 0).

service lirc restart


LIRC is a package that allows you to decode and send infra-red signals of many (but not all) commonly used remote controls. The most important part of LIRC is the lircd daemon that will decode IR signals received by the device drivers and provide the information to the system.

LIRC is versatile and can be configured to received from either a simple device node like /dev/lirc0 or from any device in /dev/input/ layer and to write either to a socket or to generate Linux input events. This tutorial currently only covers the default setup of reading from /dev/lirc0 device node and writing to socket /dev/lircd socket.

7.1 Installation and Configuration

Starting with LIRC 0.7.1 Streamzap PC Remote configuration has been included in the base package.

7.1.1 Ubuntu

During the install when prompted to select the IR Receiver please select "Streamzap PC Remote".

sudo apt-get install lirc

If LIRC is already installed on your system you need run the following to configure it.
Again, when prompted to select the IR Receiver, select "Streamzap PC Remote".

sudo dpkg-reconfigure lirc

This will automatically setup the following files like so:


REMOTE="Streamzap PC Remote"
REMOTE_MODULES="lirc_dev streamzap"





#Configuration for the Streamzap PC Remote remote:
include "/usr/share/lirc/remotes/streamzap/lircd.conf.streamzap"

Fixing Ubuntu 10.10 (Maverick Meerkat) Duplicate Keypresses Issue

In Ubuntu 10.10 (Maverick Meerkat), pressing any button on the remote will send the event twice to the system. For more information read this: #Bugs and Workarounds.

The solution is to prevent Streamzap from becoming a keyboard as describe here #Xinput: Preventing Streamzap from becoming a keyboard

7.1.2 Gentoo

Add streamzap to LIRC_DEVICES in /etc/make.conf



Install app-misc/lirc, add it to boot, and run it.

emerge -av app-misc/lirc
rc-update add lircd default
/etc/init.d/lircd start

It works out of the box. However if you need to edit the either LIRC or remote configuration, use the following files:

LIRCD config: /etc/conf.d/lircd
Streamzap Remote config: /etc/lirc/lircd.conf

7.2 Configuring XBMC

The last thing you need to do is let XBMC know to what buttons to respond. This is done by editing a LIRC Map for XBMC.

nano -w ~/.xbmc/userdata/Lircmap.xml

and pasting the following:

  <remote device="Streamzap_PC_Remote">

In lirc 0.9 the names of the keys changed, so you should used the following configuration for the LIRC MAP:

  <remote device="Streamzap_PC_Remote">

8 Inputlirc

Inputlirc is a daemon which maps remote events as given to it by the driver to linux /dev/input/event*" system.

Attention Ubuntu 10.10 (Maverick Meerkat) users. There is currently a bug with using inputlirc with no workaround.See #Bugs and Workarounds for more details.

8.1 UDEV Setup

First you have to create an own udev rule to ensure, that your device nodes are always the same.

We get the physical address from /proc/bus/input/devices:

cat /proc/bus/input/devices

the output is something like this:

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="Streamzap PC Remote Infrared Receiver (0e9c:0000)"
P: Phys=usb-0000:00:06.0-1/input0
S: Sysfs=/devices/virtual/rc/rc0/input4
U: Uniq=
H: Handlers=kbd event4 
B: EV=100003
B: KEY=3ff 0 0 0 fc000 1 0 0 0 0 18000 4180 c0000801 9e1680 0 0 0


What we need are the values behind Phys=. In my case it is usb-0000:00:06.0-1/input0

Note: Do not worry about any second device appearing for the streamzap with a Phys= like /input0.

Now we write a new rules file for udev:

sudo nano /etc/udev/rules.d/10-irremote.rules

and put the following content in:


Now restart udev and trigger a new discovery:

sudo restart udev
sudo udevadm trigger

Under /dev/input should now be a symlink call irremote0:

ls /dev/input

8.2 Inputlirc Installation and Configuraiton

First you have to install inputlirc and lirc. Please note that here we only need the lirc package because it contains "irw" and other utils. Please do not configure it for the Streamzap PC Remote.

sudo apt-get update
sudo apt-get install inputlirc lirc

Then you need to configure it properly:

sudo nano /etc/default/inputlirc

and put the following content in:

OPTIONS="-c -g -m 0"

The entries under EVENTS are the devices we created via udev. The OPTION entries mean the following:

-g Grabs the input from the devices, specified under EVENTS, so that no other application interferes with it.
-m 0 By default, all keycodes below 88 are filtered out. This setting ensures, that all keycodes are captured
-c Because some of the keys on the remote are mapped to keys with modifiers, this option maps this codes to single events.

Now restart inputlirc

sudo /etc/init.d/inputlirc restart

You can now test the remote via 'irw':

irw /dev/lircd

This is some sample output from irw when pressing buttons:

6a 0 KEY_RIGHT irremote0
6c 0 KEY_DOWN irremote0
160 0 KEY_OK irremote0
8b 0 KEY_MENU irremote0
ae 0 KEY_EXIT irremote0
191 0 KEY_BLUE irremote0
18e 0 KEY_RED irremote0

Note: You may see /dev/input/irremote0 instead of irremote0. If so, that is name inputlirc knows it as and is what you will need to put XBMC's Lircmap.xml instead of just irremote0.

8.3 Configuring XBMC

The last thing you need to do is let XBMC know to what buttons to respond. This is done by editing a LIRC Map for XBMC.

nano -w ~/.xbmc/userdata/Lircmap.xml

and pasting in the following:

  <remote device="irremote0">