IR Hauppauge

Aus Bennys Wiki
Wechseln zu: Navigation, Suche


Howto use Hauppauge remote as keyboard

Im using a Hauppauge WinTV FM by loading the bttv module. lspci shows this:

Multimedia controller: Brooktree Corporation Bt878 Audio Capture (rev 11)

getting started

  1. Install the ir_kbd_i2c module
    ~> modprobe ir_kbd_i2c
  2. put it on debug mode
    ~> echo "1" > /sys/module/ir_kbd_i2c/parameters/debug
  3. and monitor whats coming in.
    ~> tail -f /var/log/syslog

    Press some buttons on your remote. Each button returns a decimal unique buttonid.

Configure Keys

  1. run lsinput and get the input number. In this example its Number 4.
    ~> lsinput
    [...]
    /dev/input/event4
       bustype : BUS_I2C
       vendor  : 0x0
       product : 0x0
       version : 0
       name    : "i2c IR (Hauppauge)"
       phys    : "i2c-0/0-0018/ir0"
       bits ev : EV_SYN EV_KEY EV_REP
    
  2. Read the keymapping by running input-kbd <InputNumber>
    ~> input-kbd 4                 
    /dev/input/event4
       bustype : BUS_I2C
       vendor  : 0x0
       product : 0x0
       version : 0
       name    : "i2c IR (Hauppauge)"
       phys    : "i2c-0/0-0018/ir0"
       bits ev : EV_SYN EV_KEY EV_REP
    
    map: 33 keys, size: 128/128
    0x0000 =  11  # KEY_0
    0x0001 =   2  # KEY_1
    0x0002 =   3  # KEY_2
    0x0003 =   4  # KEY_3
    0x0004 =   5  # KEY_4
    0x0005 =   6  # KEY_5
    0x0006 =   7  # KEY_6
    0x0007 =   8  # KEY_7
    0x0008 =   9  # KEY_8
    0x0009 =  10  # KEY_9
    0x000b = 363  # KEY_CHANNEL
    0x000c = 116  # KEY_POWER
    0x000d = 113  # KEY_MUTE
    0x000f = 377  # KEY_TV
    0x0010 = 115  # KEY_VOLUMEUP
    0x0011 = 114  # KEY_VOLUMEDOWN
    0x0012 = 225  # KEY_BRIGHTNESSUP
    0x0013 = 224  # KEY_BRIGHTNESSDOWN
    0x001e = 217  # KEY_SEARCH
    0x0020 = 402  # KEY_CHANNELUP
    0x0021 = 403  # KEY_CHANNELDOWN
    0x0022 = 363  # KEY_CHANNEL
    0x0023 = 368  # KEY_LANGUAGE
    0x0026 = 142  # KEY_SLEEP
    0x002e = 139  # KEY_MENU
    0x0030 = 119  # KEY_PAUSE
    0x0032 = 168  # KEY_REWIND
    0x0033 = 354  # KEY_GOTO
    0x0035 = 207  # KEY_PLAY
    0x0036 = 128  # KEY_STOP
    0x0037 = 167  # KEY_RECORD
    0x003c = 388  # KEY_TEXT
    0x003d = 205  # KEY_SUSPEND
    
  3. Copy the keys in a file or run this command:
    ~> input-kbd 4 >~/default.conf
    ~> cp ~/default.conf ~/myIRkeyset.conf
    

    edit this file now. The hex values are the buttonIds (convert the decimal Ids from syslog to hexadecimal!) from the remote and the decimal values are keybindings.
    All keynubers are listed in /usr/src/linux/include/linux/input.h or by running

    ~> dumpkeys -l
    
  4. now use input-kbd -f <configfile> <InputNumber> to activate the new bindings
    ~> input-kbd -f ~/myIRkeyset.conf 4
    
  5. If everything is woking fine, deactivate debug.
    ~> echo "0" > /sys/module/ir_kbd_i2c/parameters/debug