Bug 27532 - events from remote control not mapped correctly to X events
Summary: events from remote control not mapped correctly to X events
Status: RESOLVED WONTFIX
Alias: None
Product: xorg
Classification: Unclassified
Component: Input/evdev (show other bugs)
Version: 7.5 (2009.10)
Hardware: All All
: medium normal
Assignee: Peter Hutterer
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-08 00:24 UTC by Paul Menzel
Modified: 2016-11-28 04:39 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
X log file (52.58 KB, application/octet-stream)
2010-04-08 00:24 UTC, Paul Menzel
no flags Details
keymap (56.35 KB, text/plain)
2010-04-08 00:24 UTC, Paul Menzel
no flags Details

Description Paul Menzel 2010-04-08 00:24:10 UTC
Created attachment 34798 [details]
X log file

This refers to this post [1] to the xorg mailing list.

I have a TerraTec Cinergy DT USB XS Diversity DVB-T USB device [2] which has an infrared receiver (IR) included and comes with a remote control. (To get it working `dvb_usb_dib0700` has to be loaded with `dvb_usb_dib0700_ir_proto=0` [3].)

Anyway some buttons work as expected like the mute button and numbers, but most media control buttons (play, stop, pause, previous, next) do not get mapped correctly.

    $ evtest /dev/input/event8 
    Input driver version is 1.0.0
    Input device ID: bus 0x3 vendor 0xccd product 0x81 version 0x100
    Input device name: "IR-receiver inside an USB DVB receiver"
    Supported events:
      Event type 0 (Sync)
      Event type 1 (Key)
        Event code 0 (Reserved)
        Event code 2 (1)
        Event code 3 (2)
        Event code 4 (3)
        Event code 5 (4)
        Event code 6 (5)
        Event code 7 (6)
        Event code 8 (7)
        Event code 9 (8)
        Event code 10 (9)
        Event code 11 (0)
        Event code 41 (Grave)
        Event code 52 (Dot)
        Event code 55 (KPAsterisk)
        Event code 102 (Home)
        Event code 103 (Up)
        Event code 105 (Left)
        Event code 106 (Right)
        Event code 108 (Down)
        Event code 111 (Delete)
        Event code 113 (Mute)
        Event code 114 (VolumeDown)
        Event code 115 (VolumeUp)
        Event code 116 (Power)
        Event code 119 (Pause)
        Event code 128 (Stop)
        Event code 139 (Menu)
        Event code 158 (Back)
        Event code 164 (PlayPause)
        Event code 167 (Record)
        Event code 168 (Rewind)
        Event code 173 (Refresh)
        Event code 207 (Play)
        Event code 208 (Fast Forward)
        Event code 210 (Print)
        Event code 223 (Cancel)
        Event code 226 (Media)
        Event code 352 (Ok)
        Event code 354 (Goto)
        Event code 355 (Clear)
        Event code 358 (Info)
        Event code 363 (Channel)
        Event code 365 (EPG)
        Event code 370 (Subtitle)
        Event code 375 (Screen)
        Event code 377 (TV)
        Event code 385 (Radio)
        Event code 386 (Tuner)
        Event code 388 (Text)
        Event code 389 (DVD)
        Event code 392 (Audio)
        Event code 393 (Video)
        Event code 398 (Red)
        Event code 399 (Green)
        Event code 400 (Yellow)
        Event code 401 (Blue)
        Event code 402 (ChannelUp)
        Event code 403 (ChannelDown)
        Event code 405 (Last)
        Event code 407 (Next)
        Event code 410 (Shuffle)
        Event code 412 (Previous)
    Testing ... (interrupt to exit)
    Event: time 1270710612.843993, type 1 (Key), code 207 (Play), value 1
    Event: time 1270710612.844023, type 1 (Key), code 207 (Play), value 0
    Event: time 1270710612.844028, -------------- Report Sync ------------
    Event: time 1270710614.069827, type 1 (Key), code 128 (Stop), value 1
    Event: time 1270710614.069853, type 1 (Key), code 128 (Stop), value 0
    Event: time 1270710614.069861, -------------- Report Sync ------------
    Event: time 1270710614.853090, type 1 (Key), code 119 (Pause), value 1
    Event: time 1270710614.853116, type 1 (Key), code 119 (Pause), value 0
    Event: time 1270710614.853124, -------------- Report Sync ------------
    Event: time 1270710616.361078, type 1 (Key), code 412 (Previous), value 1
    Event: time 1270710616.361104, type 1 (Key), code 412 (Previous), value 0
    Event: time 1270710616.361112, -------------- Report Sync ------------
    Event: time 1270710616.973562, type 1 (Key), code 168 (Rewind), value 1
    Event: time 1270710616.973587, type 1 (Key), code 168 (Rewind), value 0
    Event: time 1270710616.973593, -------------- Report Sync ------------
    Event: time 1270710617.649047, type 1 (Key), code 208 (Fast Forward), value 1
    Event: time 1270710617.649071, type 1 (Key), code 208 (Fast Forward), value 0
    Event: time 1270710617.649076, -------------- Report Sync ------------
    Event: time 1270710618.325034, type 1 (Key), code 407 (Next), value 1
    Event: time 1270710618.325060, type 1 (Key), code 407 (Next), value 0
    Event: time 1270710618.325064, -------------- Report Sync ------------
    ^C

    $ xev # same sequence of key presses
    Outer window is 0x3e00001, inner window is 0x3e00002

    PropertyNotify event, serial 8, synthetic NO, window 0x3e00001,
        atom 0x27 (WM_NAME), time 3296617, state PropertyNewValue

    PropertyNotify event, serial 9, synthetic NO, window 0x3e00001,
        atom 0x22 (WM_COMMAND), time 3296617, state PropertyNewValue

    PropertyNotify event, serial 10, synthetic NO, window 0x3e00001,
        atom 0x28 (WM_NORMAL_HINTS), time 3296617, state PropertyNewValue

    CreateNotify event, serial 11, synthetic NO, window 0x3e00001,
        parent 0x3e00001, window 0x3e00002, (10,10), width 50, height 50
    border_width 4, override NO

    PropertyNotify event, serial 14, synthetic NO, window 0x3e00001,
        atom 0x109 (WM_PROTOCOLS), time 3296618, state PropertyNewValue

    MapNotify event, serial 15, synthetic NO, window 0x3e00001,
        event 0x3e00001, window 0x3e00002, override NO

    ConfigureNotify event, serial 18, synthetic NO, window 0x3e00001,
        event 0x3e00001, window 0x3e00001, (0,0), width 178, height 178,
        border_width 0, above 0x3c00003, override NO

    PropertyNotify event, serial 18, synthetic NO, window 0x3e00001,
        atom 0x181 (_NET_WM_ALLOWED_ACTIONS), time 3296619, state PropertyNewValue

    PropertyNotify event, serial 18, synthetic NO, window 0x3e00001,
        atom 0x181 (_NET_WM_ALLOWED_ACTIONS), time 3296619, state PropertyNewValue

    ReparentNotify event, serial 18, synthetic NO, window 0x3e00001,
        event 0x3e00001, window 0x3e00001, parent 0xc65228,
        (0,0), override NO

    PropertyNotify event, serial 18, synthetic NO, window 0x3e00001,
        atom 0x111 (_NET_WM_DESKTOP), time 3296620, state PropertyNewValue

    PropertyNotify event, serial 18, synthetic NO, window 0x3e00001,
        atom 0x111 (_NET_WM_DESKTOP), time 3296620, state PropertyNewValue

    PropertyNotify event, serial 18, synthetic NO, window 0x3e00001,
        atom 0x10e (_NET_FRAME_EXTENTS), time 3296620, state PropertyNewValue

    ConfigureNotify event, serial 18, synthetic NO, window 0x3e00001,
        event 0x3e00001, window 0x3e00001, (4,22), width 178, height 178,
        border_width 0, above 0x0, override NO

    PropertyNotify event, serial 18, synthetic NO, window 0x3e00001,
        atom 0x12c (WM_STATE), time 3296620, state PropertyNewValue

    PropertyNotify event, serial 18, synthetic NO, window 0x3e00001,
        atom 0x117 (_NET_WM_STATE), time 3296620, state PropertyNewValue

    PropertyNotify event, serial 18, synthetic NO, window 0x3e00001,
        atom 0x147 (XKLAVIER_STATE), time 3296624, state PropertyNewValue

    MapNotify event, serial 18, synthetic NO, window 0x3e00001,
        event 0x3e00001, window 0x3e00001, override NO

    VisibilityNotify event, serial 18, synthetic NO, window 0x3e00001,
        state VisibilityUnobscured

    Expose event, serial 18, synthetic NO, window 0x3e00001,
        (0,0), width 178, height 10, count 3

    Expose event, serial 18, synthetic NO, window 0x3e00001,
        (0,10), width 10, height 58, count 2

    Expose event, serial 18, synthetic NO, window 0x3e00001,
        (68,10), width 110, height 58, count 1

    Expose event, serial 18, synthetic NO, window 0x3e00001,
        (0,68), width 178, height 110, count 0

    PropertyNotify event, serial 18, synthetic NO, window 0x3e00001,
        atom 0x117 (_NET_WM_STATE), time 3296626, state PropertyNewValue

    FocusIn event, serial 18, synthetic NO, window 0x3e00001,
        mode NotifyNormal, detail NotifyNonlinear

    KeymapNotify event, serial 18, synthetic NO, window 0x0,
        keys:  4294967235 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
               0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

    PropertyNotify event, serial 18, synthetic NO, window 0x3e00001,
        atom 0x117 (_NET_WM_STATE), time 3296626, state PropertyNewValue

    PropertyNotify event, serial 29, synthetic NO, window 0x3e00001,
        atom 0x178 (_NET_WM_ICON_GEOMETRY), time 3296740, state PropertyNewValue

    FocusOut event, serial 30, synthetic NO, window 0x3e00001,
        mode NotifyGrab, detail NotifyAncestor

    FocusIn event, serial 30, synthetic NO, window 0x3e00001,
        mode NotifyUngrab, detail NotifyAncestor

    KeymapNotify event, serial 30, synthetic NO, window 0x0,
        keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
               0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

    KeyPress event, serial 30, synthetic NO, window 0x3e00001,
        root 0x102, subw 0x0, time 3306232, (803,429), root:(807,476),
        state 0x0, keycode 136 (keysym 0xff69, Cancel), same_screen YES,
        XLookupString gives 0 bytes: 
        XmbLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyRelease event, serial 30, synthetic NO, window 0x3e00001,
        root 0x102, subw 0x0, time 3306232, (803,429), root:(807,476),
        state 0x0, keycode 136 (keysym 0xff69, Cancel), same_screen YES,
        XLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyPress event, serial 33, synthetic NO, window 0x3e00001,
        root 0x102, subw 0x0, time 3307532, (803,429), root:(807,476),
        state 0x0, keycode 127 (keysym 0xff13, Pause), same_screen YES,
        XLookupString gives 0 bytes: 
        XmbLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyRelease event, serial 33, synthetic NO, window 0x3e00001,
        root 0x102, subw 0x0, time 3307532, (803,429), root:(807,476),
        state 0x0, keycode 127 (keysym 0xff13, Pause), same_screen YES,
        XLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyPress event, serial 33, synthetic NO, window 0x3e00001,
        root 0x102, subw 0x0, time 3311588, (803,429), root:(807,476),
        state 0x0, keycode 176 (keysym 0x1008ff3e, XF86AudioRewind), same_screen YES,
        XLookupString gives 0 bytes: 
        XmbLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyRelease event, serial 33, synthetic NO, window 0x3e00001,
        root 0x102, subw 0x0, time 3311588, (803,429), root:(807,476),
        state 0x0, keycode 176 (keysym 0x1008ff3e, XF86AudioRewind), same_screen YES,
        XLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyPress event, serial 33, synthetic NO, window 0x3e00001,
        root 0x102, subw 0x0, time 3312680, (803,429), root:(807,476),
        state 0x0, keycode 216 (keysym 0x1008ff97, XF86AudioForward), same_screen YES,
        XLookupString gives 0 bytes: 
        XmbLookupString gives 0 bytes: 
        XFilterEvent returns: False

    KeyRelease event, serial 33, synthetic NO, window 0x3e00001,
        root 0x102, subw 0x0, time 3312680, (803,429), root:(807,476),
        state 0x0, keycode 216 (keysym 0x1008ff97, XF86AudioForward), same_screen YES,
        XLookupString gives 0 bytes: 
        XFilterEvent returns: False
    ^C

I guess it boils down to the questions what X events should be used. For example XF86AudioPause or Pause and that stop for example should be mapped to XF86AudioStop.

Please find the output of `xkbcomp -xkb $DISPLAY -` and `Xorg.0.log` attached.


[1] http://lists.freedesktop.org/archives/xorg/2010-April/049835.html
[2] http://www.linuxtv.org/wiki/index.php/TerraTec_Cinergy_DT_USB_XS_Diversity
[3] http://www.linuxtv.org/wiki/index.php/TerraTec_Cinergy_DT_USB_XS_Diversity#Specific_Remote_control_support
[4] http://www.linuxtv.org/wiki/index.php/TerraTec_Cinergy_DT_USB_XS_Diversity#Using_evdev
Comment 1 Paul Menzel 2010-04-08 00:24:45 UTC
Created attachment 34799 [details]
keymap
Comment 2 Dirk Wallenstein 2010-04-08 08:46:40 UTC
(In reply to comment #0)
> 
> I guess it boils down to the questions what X events should be used. For
> example XF86AudioPause or Pause and that stop for example should be mapped to
> XF86AudioStop.


Right. 
In the keymap, you would have to change for example this line:
    key <STOP> {         [          Cancel ] };
to this:
    key <STOP> {         [          XF86AudioStop ] };

The general approach for a button is as follows (with examples for the
Stop Button):
        - Note the keycode from the xev output
                state 0x0, keycode 136 (keysym 0xff69, Cancel),
        - Get the symbolic name from the top of the keymap
                <STOP> = 136;
        - Find the keysym section for the key and adapt it 
                key <STOP> {         [          XF86AudioStop ] };

Then load the result with
        xkbcomp your-edited-keymap.xkb ${DISPLAY}

The problem is that the multimedia-key of a keyboard would generate the
keycode 174 (StopCd), while your RC generates keycode 136 (Stop).

The buttons above 255 are not accessible because of bug 11227.
Comment 3 Daniel Stone 2010-04-08 10:19:55 UTC
On Thu, Apr 08, 2010 at 08:46:41AM -0700, bugzilla-daemon@freedesktop.org wrote:
> --- Comment #2 from Dirk Wallenstein <halsmit@t-online.de> 2010-04-08 08:46:40 PDT ---
> (In reply to comment #0)
> > I guess it boils down to the questions what X events should be used. For
> > example XF86AudioPause or Pause and that stop for example should be mapped to
> > XF86AudioStop.
> 
> Right. 
> In the keymap, you would have to change for example this line:
>     key <STOP> {         [          Cancel ] };
> to this:
>     key <STOP> {         [          XF86AudioStop ] };
> 
> The general approach for a button is as follows (with examples for the
> Stop Button):
>         - Note the keycode from the xev output
>                 state 0x0, keycode 136 (keysym 0xff69, Cancel),
>         - Get the symbolic name from the top of the keymap
>                 <STOP> = 136;
>         - Find the keysym section for the key and adapt it 
>                 key <STOP> {         [          XF86AudioStop ] };
> 
> Then load the result with
>         xkbcomp your-edited-keymap.xkb ${DISPLAY}
> 
> The problem is that the multimedia-key of a keyboard would generate the
> keycode 174 (StopCd), while your RC generates keycode 136 (Stop).

Hm.  Is there a list around of IR remote controls and the keycodes they
generate? If so, it'd be great to get a set of keymaps that could be fed
to the kernel so that everyone (including but not limited to the X
server) could get the correct keycodes through evdev.
Comment 4 Dirk Wallenstein 2010-04-08 11:05:20 UTC
(In reply to comment #3)

> Hm.  Is there a list around of IR remote controls and the keycodes they
> generate? If so, it'd be great to get a set of keymaps that could be fed
> to the kernel so that everyone (including but not limited to the X
> server) could get the correct keycodes through evdev.

Not that I know of.
I have read the on the mailing list referred article at
http://lwn.net/Articles/364515/ some time ago but haven't followed the topic.
The interesting (though partly argued) parts seem to be that LIRC works out the
quirks and the kernel provides a high level interface through evdev. Maybe they
disambiguate such things like STOP / STOPCD, too.
Comment 5 Paul Menzel 2010-04-08 11:56:43 UTC
(In reply to comment #3)
> On Thu, Apr 08, 2010 at 08:46:41AM -0700, bugzilla-daemon@freedesktop.org
> wrote:
> > --- Comment #2 from Dirk Wallenstein <halsmit@t-online.de> 2010-04-08 08:46:40 PDT ---
> > (In reply to comment #0)
> > > I guess it boils down to the questions what X events should be used. For
> > > example XF86AudioPause or Pause and that stop for example should be mapped to
> > > XF86AudioStop.
> > 
> > Right. 
> > In the keymap, you would have to change for example this line:
> >     key <STOP> {         [          Cancel ] };
> > to this:
> >     key <STOP> {         [          XF86AudioStop ] };
> > 
> > The general approach for a button is as follows (with examples for the
> > Stop Button):
> >         - Note the keycode from the xev output
> >                 state 0x0, keycode 136 (keysym 0xff69, Cancel),
> >         - Get the symbolic name from the top of the keymap
> >                 <STOP> = 136;
> >         - Find the keysym section for the key and adapt it 
> >                 key <STOP> {         [          XF86AudioStop ] };
> > 
> > Then load the result with
> >         xkbcomp your-edited-keymap.xkb ${DISPLAY}
> > 
> > The problem is that the multimedia-key of a keyboard would generate the
> > keycode 174 (StopCd), while your RC generates keycode 136 (Stop).
> 
> Hm.  Is there a list around of IR remote controls and the keycodes they
> generate? If so, it'd be great to get a set of keymaps that could be fed
> to the kernel so that everyone (including but not limited to the X
> server) could get the correct keycodes through evdev.

I can ask on the LIRC and VDR list for samples if you tell me what you need. The output of `evtest`?
Comment 6 Peter Hutterer 2016-11-28 04:39:46 UTC
This is a mass change of bugs. Bugs assigned to me that haven't been updated in the last 3 years are closed as WONTFIX, because, well, let's at least be honest about it.

Please do not re-open unless you have a really good reason to do so (e.g. you're fixing it yourself). If it hasn't been fixed in the last 3 years, it probably won't be fixed anytime soon either. Sorry.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.