Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO dvb remotes without lirc (outdated)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Matteo Azzali
Retired Dev
Retired Dev


Joined: 23 Sep 2004
Posts: 1133

PostPosted: Thu Aug 25, 2005 8:53 pm    Post subject: HOWTO dvb remotes without lirc (outdated) Reply with quote

This metod has becomed outated as new apps can have issues with it.
So ,since now is possible to hook the eventX driver (follow the link...)
rollbacked to the lirc method that you can find Here


This howto is specifical for cinergy T2 remote,( media/dvb/cinergyT2/cinergyT2.c)
but you can adapt to lot of other dvb remotes (check media/dvb/ttpci/av_7110_ir.c,
media/video/cx88/cx88-input.c,media/dvb/dibusb/dvb-dibusb-remote.c under /usr/src/linux/drivers/)
Please read all document before starting,will help.

1) First of all, u will need to change some settings in the kernel, to "move" some key
so they can be viewed by X (non cinergyT2 users: u can check with xev if keys are recognized).

the cinergyT2.c will have a section like this (search for KEY_EPG to find):
Code:

static const uint32_t rc_keys [] = {
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xfe01eb04,   KEY_POWER,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xfd02eb04,   KEY_1,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xfc03eb04,   KEY_2,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xfb04eb04,   KEY_3,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xfa05eb04,   KEY_4,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf906eb04,   KEY_5,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf807eb04,   KEY_6,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf708eb04,   KEY_7,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf609eb04,   KEY_8,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf50aeb04,   KEY_9,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf30ceb04,   KEY_0,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf40beb04,   KEY_VIDEO,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf20deb04,   KEY_REFRESH,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf10eeb04,   KEY_SELECT,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf00feb04,   KEY_EPG,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xef10eb04,   KEY_UP,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xeb14eb04,   KEY_DOWN,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xee11eb04,   KEY_LEFT,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xec13eb04,   KEY_RIGHT,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xed12eb04,   KEY_OK,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xea15eb04,   KEY_TEXT,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe916eb04,   KEY_INFO,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe817eb04,   KEY_RED,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe718eb04,   KEY_GREEN,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe619eb04,   KEY_YELLOW,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe51aeb04,   KEY_BLUE,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe31ceb04,   KEY_VOLUMEUP,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe11eeb04,   KEY_VOLUMEDOWN,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe21deb04,   KEY_MUTE,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe41beb04,   KEY_CHANNELUP,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe01feb04,   KEY_CHANNELDOWN,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xbf40eb04,   KEY_PAUSE,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xb34ceb04,   KEY_PLAY,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xa758eb04,   KEY_RECORD,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xab54eb04,   KEY_PREVIOUS,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xb748eb04,   KEY_STOP,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xa35ceb04,   KEY_NEXT
};


We need to modify some KEYS or they will not be recognized (make a backup!):
Code:

static const uint32_t rc_keys [] = {
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xfe01eb04,   KEY_POWER,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xfd02eb04,   KEY_1,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xfc03eb04,   KEY_2,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xfb04eb04,   KEY_3,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xfa05eb04,   KEY_4,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf906eb04,   KEY_5,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf807eb04,   KEY_6,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf708eb04,   KEY_7,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf609eb04,   KEY_8,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf50aeb04,   KEY_9,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf30ceb04,   KEY_0,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf40beb04,   KEY_V,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf20deb04,   KEY_REFRESH,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf10eeb04,   KEY_S,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xf00feb04,   KEY_E,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xef10eb04,   KEY_UP,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xeb14eb04,   KEY_DOWN,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xee11eb04,   KEY_LEFT,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xec13eb04,   KEY_RIGHT,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xed12eb04,   KEY_K,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xea15eb04,   KEY_T,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe916eb04,   KEY_I,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe817eb04,   KEY_R,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe718eb04,   KEY_G,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe619eb04,   KEY_Y,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe51aeb04,   KEY_B,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe31ceb04,   KEY_VOLUMEUP,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe11eeb04,   KEY_VOLUMEDOWN,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe21deb04,   KEY_MUTE,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe41beb04,   KEY_U,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xe01feb04,   KEY_D,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xbf40eb04,   KEY_PAUSE,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xb34ceb04,   KEY_PLAY,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xa758eb04,   KEY_RECORD,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xab54eb04,   KEY_P,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xb748eb04,   KEY_STOP,
   CINERGYT2_RC_EVENT_TYPE_NEC,   0xa35ceb04,   KEY_N
};

then recompile the kernel and reboot.

2) now some of your keys (1-9, and the letters we modified as KEY_S or KEY_E)
will be recognized as keyboard keys (try it on a terminal).

for the others u can use xev to get the keycode: use xev, press button and the output will be
like this:

---------------------------------------------------------------------------------------------------
KeyRelease event, serial 30, synthetic NO, window 0x2e00001,
root 0x47, subw 0x0, time 1409225, (89,-91), root:(792,695),
state 0x0, keycode 231 (keysym 0x0, NoSymbol), same_screen YES,
XLookupString gives 0 bytes:
X connection to :0.0 broken (explicit kill or server shutdown).
---------------------------------------------------------------------------------------------------

keycode 231 in this example (is refresh button), NoSymbol , sign value and button you pressed if they
are NoSymbol.
if a key shows a symbol instead of NoSymbol, that key is already assigned, elsewhere you can use eg.:
Code:

xmodmap -e "keycode 231 = XF86Refresh"

to assign the keycode 231 to a keyboard extended button (for a list u can spy /usr/X11R6/lib/X11/XKeysymDB,
if u want to add new buttons there you can, but label and number MUST be unique).
after using xmodmap for every unassigned keycode u can do
Code:

xmodmap -pke > ~/xmodmap.conf

so you will have xmodmap.conf ready in your home directory. Then put
Code:

xmodmap xmodmap.conf

somewhere to be executed when u start X
(eg Autostart directory for KDE: echo "xmodmap xmodmap.conf" > ~/.kde/Autostart/xmodmap.sh , then check privileges
with chmod 744 ~/.kde/Autostart/xmodmap.sh).

note: if you choose to use XF86---- buttons in /usr/X11R6/lib/X11/XKeysymDB they will have functions
already assigned in X, create new ones (with new numbers,eg 1000FF01-1000FF99) if u don't want these features.

3)Ok, now your remote is setup, you just have to link it at apps by using the shortcut features, as X
will recognize your remote's buttons as keyboard's keys!

note: You have to remodify kernel file each time u upgrade kernel, so making a backup of the keys you modified
also in home directory is wise to keep the same buttons. (don't backup entire cinergyT2.c or you will broke update overwriting the
new one)

note for cinergy T2 users: if you experience key repeating, go in kernel menu,
Device Drivers->Multimedia devices->Digital Video Broadcasting->Terratec cinergy T2.. ->Infrared Remote Controller Update interval
lower the value (I'm using 50 now) and recompile the kernel.
_________________
Every day a new distro comes to birth. Every day a distro "eats" another.
If you're born distro, no matter what, start to run.
---- http://www.linuxprinting.org/ ---- http://tuxmobil.org/
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum