Howto : Remote Ortek VRC1100 MCE vista
#1
Image

Ce howto est fait sur Ubuntu Hardy.

J'ai decider de le faire en francais pour éviter le massacre que se serait si je le fesais en anglais. Vous allez voir ca va déjà etre bien massacré en francais Big Grin
Donc voila cette telecommande coute 9$ sur Ebay ca serait dommage de ne pas pouvoir s'en servir.

J'ai mis le temps avant de reussir a la faire marcher, mais bingo elle fonctionne !


Elle est composé de 3 modules d'un point de vue peripherique:
_une souris.
_un clavier.
_et un module télécommande.

La souris, le clavier sont reconnu directement sans aucune manipulation.
Pour le module télécommande on utilisera Lirc.

Le clavier est reconnu mais les codes renvoyé sont plus ou moins bizare, et certainement pas basé sur des standard (que je ne connais pas de toute facon).
Donc pour arriver a exploiter le clavier , on va se servir de xbindkeys pour mapper les touches une premiere fois, puis pour certaines touche on va remapper dans Keymap.xml.

Dans mes recherches je me suis heurté a un leger probleme, les fichiers de config du repertoire UserData sont sensible a la case, et doivent avoir la premiere lettre en majuscule :
Lircmap.xml
Keymap.xml



Le module remote
installation de lirc :
sudo apt-get install lirc (apt://lirc)

installation de gnome lirc properties:
sudo apt-get gnome-lirc-properties (apt://gnome-lirc-properties)


les fichiers de conf.
pour savoir quelle valeur mettre dans REMOTE_DEVICE utilisez gnome-lirc-properties


/etc/lirc/lircd.conf
Code:
#This configuration has been automatically generated via
#the Ubuntu LIRC package maintainer scripts.
#
#It includes the default configuration for the remote and/or
#transmitter that you have selected during package installation.
#
#Feel free to add any custom remotes to the configuration
#via additional include directives or below the existing
#Ubuntu include directives from your selected remote and/or
#transmitter.

#Configuration for the Windows Media Center Remotes (new version Philips et al.) remote:
include /usr/share/lirc/remotes/mceusb/lircd.conf.mceusb

#Configuration for the Microsoft Windows Media Center V2 (usb) : Direct TV Receiver transmitter:
include /usr/share/lirc/transmitters/directtv/general.conf

# Configuration selected with GNOME LIRC Properties
include /etc/lirc/lircd.conf.gnome

/etc/lirc/hardware.conf
Code:
# /etc/lirc/hardware.conf
#
#Chosen Remote Control
REMOTE="Windows Media Center Remotes (new version Philips et al.)"
REMOTE_MODULES="lirc_dev lirc_mceusb2"
REMOTE_DRIVER="devinput"
REMOTE_DEVICE="/dev/input/event9"
REMOTE_LIRCD_CONF="mceusb/lircd.conf.mceusb"
REMOTE_LIRCD_ARGS=""

#Chosen IR Transmitter
TRANSMITTER="Microsoft Windows Media Center V2 (usb) : Direct TV Receiver"
TRANSMITTER_MODULES="lirc_dev lirc_mceusb2"
TRANSMITTER_DRIVER=""
TRANSMITTER_DEVICE=""
TRANSMITTER_LIRCD_CONF="directtv/general.conf"
TRANSMITTER_LIRCD_ARGS=""

#Enable lircd
START_LIRCD=true

#Don't start lircmd even if there seems to be a good config file
#START_LIRCMD="false"

#Try to load appropriate kernel modules
LOAD_MODULES="true"

# Default configuration files for your hardware if any
LIRCMD_CONF=""

#Forcing noninteractive reconfiguration
#If lirc is to be reconfigured by an external application
#that doesn't have a debconf frontend available, the noninteractive
#frontend can be invoked and set to parse REMOTE and TRANSMITTER
#It will then populate all other variables without any user input
#If you would like to configure lirc via standard methods, be sure
#to leave this set to "false"
FORCE_NONINTERACTIVE_RECONFIGURATION="false"
START_LIRCMD=""

# Receiver settings required by gnome-lirc-properties
RECEIVER_MODEL="HID 05a4:9881"
RECEIVER_VENDOR="Linux Input Device"

# Remote settings required by gnome-lirc-properties
REMOTE_MODEL="Linux Input Layer compatible Remote"
REMOTE_VENDOR="Generic"
Reply
#2
Lircmap.xml:
n'oubliez pas le L en majuscule

les codes sont obtenu en lancant "irw" dans une vraie session root "sudo -s"

Code:
<lircmap>
    <remote device="linux-input-layer">
        <pause>PLAYPAUSE</pause>
        <stop>STOPCD</stop>
        <start>HOMEPAGE</start>
        <volumeplus>VOLUMEUP</volumeplus>
        <volumeminus>VOLUMEDOWN</volumeminus>
        <mute>MUTE</mute>
        <forward>NEXTSONG</forward>
        <reverse>PREVIOUSSONG</reverse>
        <power>SLEEP</power>
    </remote>
</lircmap>

Keymap.xml
: le K en majuscule

Code:
<keymap>
  <Global>
<remote name="linux-input-layer">
    <power>XBMC.ActivateWindow(ShutdownMenu)</power>
</remote>

  </Global>
</keymap>
Reply
#3
Le module clavier

La télécommande envoie plusieurs code sur la pression d'une seule touche.

xbindkey va nous permettre de mapper cette combinaison de touche vers une seule touche.



Pour les lire j'ai utiliser
Code:
xbindkeys -mk

j'ai donc fait le fichier suivant

fichier ~/.xbindkeys
Code:
###########################
# xbindkeys configuration #
###########################
#
# Version: 0.1.3
#
# If you edit this, do not forget to uncomment any lines that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# A list of keys is in /usr/include/X11/keysym.h and in
# /usr/include/X11/keysymdef.h
# The XK_ is not needed.
#
# List of modifier (on my keyboard):
#   Control, Shift, Mod1 (Alt), Mod2 (NumLock),
#   Mod3 (CapsLock), Mod4, Mod5 (Scroll).
#
# Another way to specifie a key is to use 'xev' and set the
# keycode with c:nnn or the modifier with m:nnn where nnn is
# the keycode or the state returned by xev
#
# This file is created by xbindkey_config
# The structure is :
# # Remark
# "command"
# m:xxx + c:xxx
# Shift+...


#keystate_numlock = enable
#keystate_scrolllock = enable
#keystate_capslock = enable

#jaune (MyVideo)
"/usr/bin/xvkbd -xsendevent -text "v""
m:0x15 + c:37, m:0x11 + c:50, m:0x10 + c:28

#bleu (MyMusic)
"/usr/bin/xvkbd -xsendevent -text "y""
m:0x14 + c:37, m:0x10 + c:58

#vert (MyPicture)
"/usr/bin/xvkbd -xsendevent -text "w""
m:0x14 + c:37, m:0x10 + c:31

#rouge (playlist)
"/usr/bin/xvkbd -xsendevent -text "z""
m:0x14 + c:37, m:0x10 + c:26


#sous_jaune (info)
"/usr/bin/xvkbd -xsendevent -text "i""
m:0x14 + c:37, m:0x10 + c:32

#sous_bleu (Playlist move up)
"/usr/bin/xvkbd -xsendevent -text "u""
m:0x14 + c:37, m:0x10 + c:42

#sous_vert (Playlist move down)
"/usr/bin/xvkbd -xsendevent -text "d""
m:0x14 + c:37, m:0x10 + c:28

#sous_rouge (Queue in playlist)
"/usr/bin/xvkbd -xsendevent -text "q""
m:0x15 + c:37, m:0x11 + c:50, m:0x10 + c:58

#rewind
"/usr/bin/xvkbd -xsendevent -text "r""
m:0x15 + c:37, m:0x11 + c:50, m:0x10 + c:56

#forward
"/usr/bin/xvkbd -xsendevent -text "f""
m:0x15 + c:37, m:0x11 + c:50, m:0x10 + c:41

#record (context meunu)
"/usr/bin/xvkbd -xsendevent -text "c""
m:0x14 + c:37, m:0x10 + c:27

#backspace : don't need to xbindkey map
#"/usr/bin/xvkbd -xsendevent -text "back""
#m:0x10 + c:22

#chanel+ : don't need to xbindkey map
#"/usr/bin/xvkbd -xsendevent -text "chanel+""
#m:0x10 + c:99

#chanel- :  don't need to xbindkey map
#"/usr/bin/xvkbd -xsendevent -text "chanel-""
#m:0x10 + c:105

#green start button : Active OSD menu
"/usr/bin/xvkbd -xsendevent -text "m""
m:0x58 + c:64,  m:0x50 + c:115, m:0x10 + c:36

#enter :  don't need to xbindkey map
#"/usr/bin/xvkbd -xsendevent -text "enter""
#m:0x10 + c:36

#clear : correspond to delete (remaped in Keymap.xml)
"/usr/bin/xvkbd -xsendevent -text "t""
m:0x10 + c:9

#
# End of xbindkeys configuration
analyse de la premiere partie concernant le bouton jaune.
premiere ligne c'est un commentaire
deuxieme ligne c'est la commande a executer quand la combinaison est tapé, dans notre cas on va faire comme si on avais pressé la touche v
Troisieme ligne la combinaison de touche qui correspond.

On note qu'on pourrais se servir de ce fichier pour faire une action sur le PC avec la telecommande, comme un reboot par exemple.


Comme il n'etait pas possible d'envoyer directement les bon code d'en certain cas un deuxieme mapping au niveau de xbmc ete necessaire :

Keymap.xml (n'oublier pas le K en majuscule)
Code:
<keymap>
  <Global>
    <remote name="linux-input-layer">
        <power>XBMC.ActivateWindow(ShutdownMenu)</power>
    </remote>
    <keyboard>
<!--        <z>ActivateWindow(Favourites)</z>  -->
        <z>Playlist</z>
              <y>XBMC.ActivateWindow(MyMusic)</y>
              <w>XBMC.ActivateWindow(MyPictures)</w>
              <v>XBMC.ActivateWindow(MyVideos)</v>
        <t>Delete</t>
    </keyboard>
  </Global>
</keymap>


voila, n'oubliez pas de lancer

Code:
xbindkeys &
avant xbmc

et bien sur lircd doit etre lancer aussi.
Reply
#4
Hello
ton tuto marche avec les telecommandes de microsoft mce (philips)?
tu peux mettre en veille l'ordi et l'en resortir (sans mot de pass)?
Les touches continuent a marcher apres une mise en veille (actuellement c'est mon problème avec une autre config). Merci de répondre, ca me permettra de voir si ca marche avant de casser ma configuration actuel.
Reply
#5
je ne sais pas pour la MCE Philips, je peux pas tester car je ne l'ai pas.

Actuelement ce tuto ne marche que si XBMC n'est pas en plein ecran, je ne trouve pas pourquoi surement un lien entre xbindkeys et le WindowManager.

Pour la mise en veille tu dois pouvoir si tu met la bonne commande dans xbindkeysrc.
Reply
#6
This is a nice start for me to get this remote working in Ubuntu. I had to do a little hacking as xbindkey does not work in the full screen mode. If you install the keycaps application it will show you what key combos are being pressed. This comes in handy as this remote sends command like L_cntl-L_shift-o and the like to make it work. If you use xmodmap you can disable the left cntrl and shift key and basically making the key look like an "o" or a "t" to xbmc. Then it is just a matter of changing the Keymap.xml to the key codes and you are off and running.
Reply
#7
thank to information, but i not arive to do it. More with xmodmap, it not possible to intercept Media key (play pause stop).

I dont understand why xbmc dont recive xbindkeys when is in fullscreen, and not in windowed. Maybe windowmanager may be the way to get fullscreen mode.

Actualy i search a way to run xbmc in windowed and rescale it by windowmanager, but dont arrive thince compiz not compatible...

Probaly i return to my first idée and patch the source code of xbmc http://forum.xbmc.org/showthread.php?tid=38326
Reply
#8
Thank you neotrex.

desactive les touches CTR ALT et SHIFT

Code:
#!/bin/bash

xmodmap -display :0 -e "clear shift"
xmodmap -display :0 -e "clear control"
xmodmap -display :0 -e "clear mod1"


active les touches CTR ALT et SHIFT

Code:
#!/bin/bash

xmodmap -e "add shift = Shift_L Shift_R"
xmodmap -e "add control = Control_L Control_R"
xmodmap -e "add mod1 = Alt_L Meta_L"



i have see too this line work :

Code:
/usr/bin/xvkbd -xsendevent -text "p" -window "xbmc.bin" -display :0


I think now when xbmc is in full screen mode, xbindkeys not receive keypress xevent.
Reply

Logout Mark Read Team Forum Stats Members Help
Howto : Remote Ortek VRC1100 MCE vista0