• 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 9
Anyone have a Emprex 3009URF MCE RC?
#61
danz0l Wrote:nice one mate. Looking forward to seeing how you get on

Have hit a bit of a brick wall at the moment as I can't get a bootable kernel to build. The sources on the live cd are slightly older than the actual generic build it uses (21 instead of 24). That might not be the cause though, I need to work out how to get rid of the xbmc splash boot screen to see if there are any error messages.

I may go back to the 9.11 xbmc live cd instead and try a kernel build on that to see if it's me or the source code that's the problem (most likely me!)
Reply
#62
Have found a way to implement the patch WITHOUT having to build a new kernel Big Grin

Just trying to find a way to make it stick between reboots as the kernel is loading it's own usbhid driver and to make it work I currently have to unload/reload usbhid after each reboot

I guess as a very dirty solution I could just script the unload/reload at the end of the boot cycle?
Reply
#63
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 2 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-24-generic .config
apt-get install qt3-dev-tools libqt3-mt-dev
apt-get install libncurses5 libncurses5-dev
apt-get install kernel-package

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

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-24-generic/build/.config
vi /lib/modules/2.6.32-24-generic/build/include/config/tristate.conf
vi /lib/modules/2.6.32-24-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-24-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
make -C /usr/src/linux-headers-`uname -r` M=`pwd` modules_install
depmod -a

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
modprobe 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"

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!
Reply
#64
Hi Folks,
Read this thread with interest. Anyone have any joy in getting this to work under Windows 7?

Used EventGhost etc, and it seems I need to something at the registry or driver level as the keypresses aren't being picked up (e.g. the Info button, the colour buttons).

thx
B.
Reply
#65
sorry, just notice this is a linux forum, will ask elsewhere
Reply
#66
Thanks tony, been a way a few days so have only just seen this. Will certainly give it a try but looks complicated so will do so on a day i can concentrate and report back. Thanks very much for doing this though mate, really appreciated.
-= My Media Centre =-
ACER Revo R3610 | x2 1.5TB WD Caviar Green SATA Hard Drives (WD15EADS) | x2 2.0TB WD Caviar Green SATA Hard Drive ( WD15EARS ) | 3.5in Black eSATA USB Trayless SATA External Hard Drive Enclosure | Emprex 3009URF Wireless MCE Remote Control | XBMCLive Dharma Beta1
Reply
#67
Thanks for the write up, I'll try it out and post my results.
Reply
#68
If you decide to try the modprobe bit manually 1st please remember that modprobe -r usbhid will disable USB input devices, so a usb keyboard will stop functioning (I used a remote session using putty to avoid this sort of problem)
Reply
#69
Currently the easiest way to get all the buttons working is probably to backport a kernel 2.6.36 release candidate. No need to patch anything - it's had the support implemented in the hid-topseed driver since rc5. I'm compiling rc7 right now.

Update: Unfortunately I was too optimistic with my interpretation of the changelog. The update enables some keys(atleast the big green one, dvdmenu, pictures) but for example the little colored ones give me no scancodes in xev.
Reply
#70
tonyt Wrote:...
case 0x00d: btc_map_key_clear(KEY_MEDIA); break; /* WINDOWS */
...

For details of mapping keys thru .xsessionrc refer to earlier in this thread of course!

Thanks tonyt for the write up Smile I followed all the steps and now I'm stuck.

Lets say I want to enable the KEY_MEDIA button to say work as the 'F1' key? Just edit the KEY_MEDIA text to KEY_F1 ? Then throw a line in the keyboard.xml config file to take use of the F1 key yea?
Reply
#71
Shouldn't be any need to edit the keyboard.xml

If F1 doesn't have a recognised function in xbmc then the way I would do it, rightly or wrongly is just put an entry in .xsessionrc to map F1 to whatever I want it to do (at least that's what I used to do when I just assigned all the keys to F9 thru F22). Perhaps keyboard.xml is a better way but I really don't know

What I've done this time around is just assigned the keys I actually want in hid-btc.c. So if i wanted KEY_MEDIA to be the context menu I've just changed it to KEY_C and that's it, no need to edit anything else

I originally assigned the keys F9 thru F24 as it was a pain to recompile the kernel, but now it's just a quick recompile of the HID driver it seems simpler to just assign the keys I want since I can make the change in a couple of minutes if I change my mind

HTH

Tony
Reply
#72
Have just tried this on a fresh install of Dharma Beta 3

It all seems to compile ok if you change any instance of 2.6.32-24 to 2.6.32-25

BUT it isn't loading the BTC module, am looking into what the issue is
Reply
#73
This seems to fix it

cp /lib/modules/2.6.32-25-generic/extra/hid.ko /lib/modules/2.6.32-25-generic/kernel/drivers/hid/hid.ko
Reply
#74
tonyt Wrote:This seems to fix it

cp /lib/modules/2.6.32-25-generic/extra/hid.ko /lib/modules/2.6.32-25-generic/kernel/drivers/hid/hid.ko

if it can't find the files it should be

cp /lib/modules/2.6.32-25-generic/extra/usbhid.ko /lib/modules/2.6.32-25-generic/kernel/drivers/hid/usbhid.ko

(can't check as I'm currently trying to get the remote working on karmic)

Followed the above steps, not working. Any debug info I can give yea?
For the update to cp the hid.ko file, I've had no issue with a missing file though
Reply
#75
KeRbDoG Wrote:Followed the above steps, not working. Any debug info I can give yea?
For the update to cp the hid.ko file, I've had no issue with a missing file though

Have just looked back over my console session history and the 1st copy was the correct one

I've no idea whay it's not working for you, the instructions are just copied down pat from what i did using beta2/beta3 live cd on an r3610 to a hard disk

I went back and followed them precisely on a scratch install to ensure I hadn't made a mistake and they worked fine

You could try, not from a usb keyboard, to modprobe -r usbhid then modeprobe usbhid and then lsmod

From the lsmod you should see the usbhid module loaded and if it doesn't have hid-btc to the right of it then it's not loading the new version for some reason. If it's not there I don't know why, but then I don't understand why I had to copy the hid.ko file under beta3 and not under beta2!
Reply
  • 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 9

Logout Mark Read Team Forum Stats Members Help
Anyone have a Emprex 3009URF MCE RC?0