Ok, below are the exact notes I used to get the remote working in Dharma Beta 3 and I copied from them and pasted each command exactly as they are into a putty session to avoid any typos
The machine is a revo r3610, I installed the Dharma Beta 3 live cd to the whole internal hard drive from an external bd player
I've now switched to W7 version as it's making life so much simpler and just works out of the box for me with very few tweaks to windows, and to my surprise is playing 1080p content fine (and flv's with AAC which was a bug bear with lucid)
--------------------------------------------------------------------------------------------
These notes document how I got my Emprex 3009URF Remote fully working with XBMC
The mod is designed to get the keys that don't work "as is" (or thru .xsessionrc) working
These notes are based on installing the stock dharma beta 3 live cd to a hard drive (or, probably, large usb stick)
In my case the PC is an Acer Revo R3610
I know very little about linux, so these are just notes of the actions I took
Some of the actions are probably completely unnecessary...
You follow/attempt/use/etc these notes etc entirely at your own risk!
The base patch file to get the emprex remote to work comes from:
https://patchwork.kernel.org/patch/70351/
To build the new USB HID driver with emprex remote support perform the following
(assumes you have logged in as the user created when installing xbmc live to hard disk):
sudo su -
aptitude update
apt-get install linux-source
mkdir ~/src
cd ~/src
tar xjvf /usr/src/linux-source-2.6.32.tar.bz2
cd linux-source-2.6.32
(not sure which of any of the 4 lines below are actually necessary, but I did them all anyway)
cp -vi /boot/config-2.6.32-25-generic .config
apt-get install qt3-dev-tools libqt3-mt-dev
apt-get install libncurses5 libncurses5-dev
apt-get install kernel-package
(at this point I also install the SMB file system so I grab a copy of the emprex patch from my windows server
though this should have no relevance on anything else. "apt-get install smbfs")
Download the emprex patch file from
https://patchwork.kernel.org/patch/70351/
to ~/src/linux-source-2.6.32 and apply the patch:
cd ~/src/linux-source-2.6.32
patch -p1 < HID-driver-for-BTC-Emprex-3009URF-III-Vista-MCE-Remote-quirky-remote.patch
The output from this should like this:
patching file drivers/hid/hid-btc.c
patching file drivers/hid/hid-core.c
Hunk #1 succeeded at 1294 (offset 4 lines).
patching file drivers/hid/hid-ids.h
Hunk #1 succeeded at 122 (offset 9 lines).
patching file drivers/hid/Kconfig
Hunk #1 succeeded at 86 (offset 6 lines).
patching file drivers/hid/Makefile
Hunk #1 succeeded at 23 (offset 1 line).
EDIT THE hid-btc.c file in vi to set the key mappings you wish to apply
(SEE SEPERATE NOTES BELOW FOR DETAILS)
vi ~/src/linux-source-2.6.32/drivers/hid/hid-btc.c
Edit these 3 files:
vi /lib/modules/2.6.32-25-generic/build/.config
vi /lib/modules/2.6.32-25-generic/build/include/config/tristate.conf
vi /lib/modules/2.6.32-25-generic/build/include/config/auto.conf
Placing the line
CONFIG_HID_BTC=m (M for tristate.conf)
Immediately BEFORE the line that says CONFIG_HID_CHERRY=m
Also before #define CONFIG_HID_CHERRY_MODULE 1
put #define CONFIG_HID_BTC_MODULE 1 in this file:
vi /lib/modules/2.6.32-25-generic/build/include/linux/autoconf.h
(NOTE: IF YOU EDIT HID-BTC.C AGAIN LATER JUST START AGAIN FROM THIS POINT)
cd ~/src/linux-source-2.6.32/drivers/hid
make -C /usr/src/linux-headers-`uname -r` M=`pwd` modules
(use ls to check the btc hid has compiled, look for files hid-btc.c hid-btc.ko hid-btc.mod.c hid-btc.mod.o hid-btc.o)
make -C /usr/src/linux-headers-`uname -r` M=`pwd` modules_install
depmod -a
cp /lib/modules/2.6.32-25-generic/extra/hid.ko /lib/modules/2.6.32-25-generic/kernel/drivers/hid/hid.ko
The above will have installed a replacement usbhid driver BUT by default when the system reboots
a version, I assume from the kernel, gets loaded so it's necessary after a reboot to somehow
action the following commands:
modprobe -r usbhid (this will disable usb keyboard/mouse etc so use putty or something for testing)
modprobe usbhid
An "lsmod" at this point should show the following entries
hid_btc 2010 0
usbhid 36110 0
hid 65807 2 hid_btc,usbhid
I have opted, on my system, to edit the xbmc startup script as follows
vi /etc/init/xbmc-live.conf
and put the modprobe lines immediately BEFORE the line that says "exec /usr/bin/runXBMC"
I then reboot to test the remote in XBMC
when I get time I'll be looking to put the modprobe lines elsewhere so they don't get overwritten
by an xbmc upgrade
And that's it!
Notes on the Emprex Remote Keys
The remote can be considered to contain 3 types of key with regards to xbmc:
a) Those that just work (e.g. Play, volume, mute, 0-9 etc)
b) Those that can be remapped to work via an /home/xbmc/.xsessionrc file (e.g. record)
c) Those that need the hid-btc file (e.g. dvd, music, text etc)
When editing the hid-btc you can either assign the exact keys you want or perhaps use unused keys
like F12, F13 etc and then just remap them in .xsessionrc
If you just want the extra keys defined in the original BTC file then you just need to edit the
functions you want to assign (e.g. if you want the TEXT key to be the context menu then change
the KEY_TEXT to KEY_C)
If you also want the 3 keys for channel up, channel down and guide then you'll need to replace the
section shown below with the new version
OLD VERSION:
switch (usage->hid & HID_USAGE) {
case 0x00d: btc_map_key_clear(KEY_MEDIA); break;
case 0x024: btc_map_key_clear(KEY_MENU); break;
case 0x048: btc_map_key_clear(KEY_TV2); break;
case 0x025: btc_map_key_clear(KEY_TV); break;
case 0x047: btc_map_key_clear(KEY_MP3); break;
case 0x049: btc_map_key_clear(KEY_CAMERA); break;
case 0x04a: btc_map_key_clear(KEY_VIDEO); break;
case 0x050: btc_map_key_clear(KEY_RADIO); break;
case 0x05b: btc_map_key_clear(KEY_RED); break;
case 0x05c: btc_map_key_clear(KEY_GREEN); break;
case 0x05d: btc_map_key_clear(KEY_YELLOW); break;
case 0x05e: btc_map_key_clear(KEY_BLUE); break;
case 0x05a: btc_map_key_clear(KEY_TEXT); break;
default:
return 0;
}
NEW VERSION (with remote button names indicated):
switch (usage->hid & HID_USAGE_PAGE) {
case 0x0ffbc0000:
switch (usage->hid & HID_USAGE) {
case 0x00d: btc_map_key_clear(KEY_MEDIA); break; /* WINDOWS */
case 0x024: btc_map_key_clear(KEY_MENU); break; /* DVDMENU */
case 0x048: btc_map_key_clear(KEY_TV2); break; /* RECTV */
case 0x025: btc_map_key_clear(KEY_TV); break; /* LIVETV */
case 0x047: btc_map_key_clear(KEY_MP3); break; /* MUSIC */
case 0x049: btc_map_key_clear(KEY_CAMERA); break; /* PICTURES */
case 0x04a: btc_map_key_clear(KEY_VIDEO); break; /* VIDEO */
case 0x050: btc_map_key_clear(KEY_RADIO); break; /* RADIO */
case 0x05b: btc_map_key_clear(KEY_RED); break; /* RED */
case 0x05c: btc_map_key_clear(KEY_GREEN); break; /* GREEN */
case 0x05d: btc_map_key_clear(KEY_YELLOW); break; /* YELLOW */
case 0x05e: btc_map_key_clear(KEY_BLUE); break; /* BLUE */
case 0x05a: btc_map_key_clear(KEY_TEXT); break; /* TEXT */
default:
return 0;
}
break;
case 0x0000c0000:
switch (usage->hid & HID_USAGE) {
case 0x09c: btc_map_key_clear(KEY_PAGEUP); break; /* CH UP */
case 0x09d: btc_map_key_clear(KEY_PAGEDOWN); break; /* CH DOWN */
case 0x08d: btc_map_key_clear(KEY_C); break; /* GUIDE */
default:
return 0;
}
break;
default:
return 0;
}
All other keys on the remote will work "as is" or will be mapped thru .xsessionrc
For details of mapping keys thru .xsessionrc refer to earlier in this thread of course!