From: Jon Smirl <jonsmirl@gmail.com>
To: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Ferenc Wagner <wferi@niif.hu>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Jarod Wilson <jarod@wilsonet.com>,
Jarod Wilson <jarod@redhat.com>,
Devin Heitmueller <dheitmueller@kernellabs.com>,
Maxim Levitsky <maximlevitsky@gmail.com>,
awalls@radix.net, j@jannau.net, khc@pm.waw.pl,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org, lirc-list@lists.sourceforge.net,
superm1@ubuntu.com, Christoph Bartelmus <lirc@bartelmus.de>
Subject: Re: [RFC v2] Another approach to IR
Date: Thu, 3 Dec 2009 11:50:04 -0500 [thread overview]
Message-ID: <9e4733910912030850w188f163bxa2ca149ec81c5bb1@mail.gmail.com> (raw)
In-Reply-To: <4B17E874.5020003@redhat.com>
On Thu, Dec 3, 2009 at 11:33 AM, Mauro Carvalho Chehab
<mchehab@redhat.com> wrote:
> Ferenc Wagner wrote:
>> Mauro Carvalho Chehab <mchehab@redhat.com> writes:
>>
>>> Dmitry Torokhov wrote:
>>>
>
>> The interesting thing is that input.h defines KEY_TV, KEY_PC, KEY_SAT,
>> KEY_CD, KEY_TAPE etc., but no corresponding scan codes will ever be sent
>> by any remote (ok, I'm stretching it a bit).
>
> Unfortunately, this is not true. Some IR's do send a keycode for TV/PC/SAT/CD, etc.
>
> On those remotes, if you press TV and then press for example Channel UP
> and press Radio, then press Channel UP, the channel UP code will be the same.
>
> For example, on Hauppauge Grey IR, we have:
>
> <TV>
> [13425.128525] ir_g_keycode_from_table: em28xx IR (em28xx #0): scancode 0x1e1c keycode 0x179
> [13425.136733] ir_input_key_event: em28xx IR (em28xx #0): key event code=377 down=1
> [13425.144170] ir_input_key_event: em28xx IR (em28xx #0): key event code=377 down=0
>
> <CHANNEL UP>
> [13428.350223] ir_g_keycode_from_table: em28xx IR (em28xx #0): scancode 0x1e20 keycode 0x192
> [13428.358434] ir_input_key_event: em28xx IR (em28xx #0): key event code=402 down=1
> [13428.365871] ir_input_key_event: em28xx IR (em28xx #0): key event code=402 down=0
>
> <Radio>
> [13430.672266] ir_g_keycode_from_table: em28xx IR (em28xx #0): scancode 0x1e0c keycode 0x181
> [13430.680473] ir_input_key_event: em28xx IR (em28xx #0): key event code=385 down=1
> [13430.687913] ir_input_key_event: em28xx IR (em28xx #0): key event code=385 down=0
>
> <CHANNEL UP>
> [13433.697268] ir_g_keycode_from_table: em28xx IR (em28xx #0): scancode 0x1e20 keycode 0x192
> [13433.705480] ir_input_key_event: em28xx IR (em28xx #0): key event code=402 down=1
> [13433.712916] ir_input_key_event: em28xx IR (em28xx #0): key event code=402 down=0
>
> In this IR, the address is bogus: it is always 0x1e. This scenario is very common with the
> shipped IR's.
The remote is treating everything as a single integrated device which
is not inconsistent with what has been said. In this case there really
is only one multi-function device not two independent ones.
If you want to control two independent devices you need to buy a
different remote. Remotes are cheap so that's not a big deal.
If you really want to use this remote to control two independent
devices you need user space scripting to split the single device into
two devices and then inject new events into the input layer. This is a
complex case and not in the goal of getting 90% of users to "just
work".
>
>> Instead, a multifunction
>> remote (or two distinct remotes) would send different scan codes[1],
>> which should be mapped to KEY_PLAYCD and KEY_PLAYDVD for example.
>> Btw. the former is already defined, besides the generic KEY_PLAY.
>>
>> Even if all this worked, user space would need integration with
>> hal/devicekit to open the new input devices appearing on the fly (if
>> it's initiated by the arrival of a scan code belonging to some new
>> protocol), and also be able to decide whether the new event source is
>> for it or not.
>>
>> Given that commodity home appliances manage not to be confused by
>> multiple or multifunction remotes, decent software should be able to do
>> so as well.
>>
>> [1] scan codes in the broadest possible sense, containing vendor,
>> address and whatever, and only treating the case which is possible to
>> handle in principle.
>
> I see two alternatives for it:
> 1) to map a multifunction scancode Address=TV/command=channel up as two
> separate events: KEY_TV | KEY_CHANNELUP and let some userspace program to
> handle it (lirc or other programs that knows IR keycodes);
>
> 2) to implement Jon's filter idea of splitting one evdev interface into
> several evdevs interface, one for each address.
>
> We should not forget that simple IR's don't have any key to select the address,
> so the produced codes there will never have KEY_TV/KEY_DVD, etc.
>
> Cheers,
> Mauro.
>
--
Jon Smirl
jonsmirl@gmail.com
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-12-03 16:49 UTC|newest]
Thread overview: 72+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-01 15:08 [RFC v2] Another approach to IR Jon Smirl
2009-12-01 15:47 ` Maxim Levitsky
2009-12-01 16:16 ` Jon Smirl
2009-12-01 17:03 ` Mauro Carvalho Chehab
2009-12-01 17:09 ` Devin Heitmueller
2009-12-01 17:29 ` Mauro Carvalho Chehab
2009-12-01 17:54 ` Dmitry Torokhov
2009-12-01 19:00 ` Mauro Carvalho Chehab
2009-12-01 19:27 ` Jon Smirl
2009-12-01 20:11 ` Dmitry Torokhov
2009-12-01 21:05 ` Mauro Carvalho Chehab
2009-12-02 9:38 ` Dmitry Torokhov
2009-12-02 12:44 ` Mauro Carvalho Chehab
2009-12-02 17:10 ` Dmitry Torokhov
2009-12-02 17:30 ` Jon Smirl
2009-12-02 18:23 ` Dmitry Torokhov
2009-12-02 18:57 ` Jon Smirl
2009-12-02 20:54 ` Mauro Carvalho Chehab
2009-12-02 19:22 ` Jarod Wilson
2009-12-02 19:56 ` Dmitry Torokhov
2009-12-02 20:04 ` Jarod Wilson
2009-12-02 20:14 ` Dmitry Torokhov
2009-12-02 20:23 ` Mauro Carvalho Chehab
2009-12-02 20:53 ` Dmitry Torokhov
2009-12-02 21:13 ` Mauro Carvalho Chehab
2009-12-03 16:03 ` Ferenc Wagner
2009-12-03 16:33 ` Mauro Carvalho Chehab
2009-12-03 16:50 ` Jon Smirl [this message]
2009-12-03 17:19 ` Mauro Carvalho Chehab
2009-12-03 17:31 ` Dmitry Torokhov
2009-12-04 16:11 ` Ferenc Wagner
2009-12-02 20:42 ` Jarod Wilson
2009-12-02 20:48 ` Dmitry Torokhov
2009-12-02 20:57 ` Jarod Wilson
2009-12-02 21:12 ` Trent Piepho
2009-12-02 21:28 ` Jarod Wilson
2009-12-02 21:40 ` Mauro Carvalho Chehab
2009-12-03 18:06 ` Krzysztof Halasa
2009-12-03 1:19 ` Andy Walls
2009-12-03 2:27 ` hermann pitton
2009-12-03 0:20 ` Jon Smirl
2009-12-03 2:22 ` Mauro Carvalho Chehab
2009-12-03 5:08 ` Jon Smirl
2009-12-03 11:09 ` Mauro Carvalho Chehab
2009-12-03 18:18 ` Krzysztof Halasa
2009-12-03 20:54 ` Mauro Carvalho Chehab
2009-12-03 2:48 ` Trent Piepho
2009-12-03 4:13 ` Jarod Wilson
2009-12-03 5:18 ` Jon Smirl
2009-12-03 11:20 ` Mauro Carvalho Chehab
2009-12-03 19:48 ` alhaz
2009-12-02 19:33 ` Mauro Carvalho Chehab
2009-12-02 19:50 ` Jon Smirl
2009-12-02 19:58 ` Jon Smirl
2009-12-02 20:47 ` Mauro Carvalho Chehab
2009-12-02 19:55 ` Jarod Wilson
2009-12-03 1:02 ` Andy Walls
2009-12-03 10:00 ` Mauro Carvalho Chehab
2009-12-03 12:02 ` Andy Walls
2009-12-03 11:09 ` Mauro Carvalho Chehab
2009-12-02 20:01 ` Dmitry Torokhov
2009-12-02 15:37 ` Jon Smirl
2009-12-02 17:00 ` Dmitry Torokhov
2009-12-02 11:26 ` Gerd Hoffmann
2009-12-02 12:45 ` Mauro Carvalho Chehab
2009-12-01 17:35 ` Patrick Boettcher
2009-12-01 17:41 ` Mauro Carvalho Chehab
2009-12-01 18:19 ` Jon Smirl
2009-12-01 17:37 ` Mauro Carvalho Chehab
-- strict thread matches above, loose matches on Subject: below --
2009-12-03 19:47 Guus Sliepen
2009-12-03 21:53 ` Jarod Wilson
2009-12-05 11:23 ` Guus Sliepen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9e4733910912030850w188f163bxa2ca149ec81c5bb1@mail.gmail.com \
--to=jonsmirl@gmail.com \
--cc=awalls@radix.net \
--cc=dheitmueller@kernellabs.com \
--cc=dmitry.torokhov@gmail.com \
--cc=j@jannau.net \
--cc=jarod@redhat.com \
--cc=jarod@wilsonet.com \
--cc=khc@pm.waw.pl \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=lirc-list@lists.sourceforge.net \
--cc=lirc@bartelmus.de \
--cc=maximlevitsky@gmail.com \
--cc=mchehab@redhat.com \
--cc=superm1@ubuntu.com \
--cc=wferi@niif.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).