Skip to contentSkip to conversation

ir-keytable known bug -- fails to work when device specified

DISCUSSION Adam Di Carlo 2 participants 4 messages Mar 19, 2019 – Mar 20, 2019 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

There seems to be known issue with ir-keytable such that while

./ir-keytable -p rc5

works, this one won't:

./ir-keytable -d /dev/input/event24 -p rc5

Reading the source, it looks like the internal 'rc_dev' struct is really only filled out (get_attribs()) in the case where the device isn't passed in.

Rather than document all this, isn't better to clean it up in the source? I can probably come up with a patch for this issue in fairly short order, if that's welcome.

Signature · 1 line
...Adam Di Carlo...<[email protected]>............................
#1 lore raw
Quoted 9 lines · Adam Di Carlo

There seems to be known issue with ir-keytable such that while

./ir-keytable -p rc5

works, this one won't:

./ir-keytable -d /dev/input/event24 -p rc5

Quoted 8 lines

Reading the source, it looks like the internal 'rc_dev' struct is really only filled out (get_attribs()) in the case where the device isn't passed in.

Rather than document all this, isn't better to clean it up in the source? I can probably come up with a patch for this issue in fairly short order, if that's welcome.

You're right, this is broken. For this to work it would have to get all the details for the all the rc devices and find the one that has an input device with that name.

That command line above implies that the protocol is a property of the input device which it is not. Actually I think the whole -d option is misleading and not really useful. I think the right solution is to just remove it completely.

Sean

From 57fde44ec8723e6c15143f72055bd586628c3d8b Mon Sep 17 00:00:00 2001
From: Sean Young <[email protected]>
Date: Tue, 19 Mar 2019 10:09:55 +0000
Subject: [PATCH] keytable: remove misleading --device argument

Running 'ir-keytable --device /dev/input/event24 -p rc5' does not work since ir-keytable cannot find an rc device via the input device name.

Simply remove this options from ir-keytable since it is not useful and is only misleading.

---
 utils/keytable/ir-keytable.1.in |  8 ------
 utils/keytable/keytable.c       | 45 ++++++++++-----------------------
 2 files changed, 14 insertions(+), 39 deletions(-)
utils/keytable/ir-keytable.1.in +0 -8
index 9a354be4..a717b8da 100644
@@ -3,9 +3,6 @@
 ir\-keytable \- a swiss\-knife tool to handle Remote Controllers.
 .SH SYNOPSIS
 .B ir\-keytable
-[\fIOPTION\fR]... \fI\-\-device\fR [\fI/dev/input/event* device\fR]
-.br
-.B ir\-keytable
 [\fIOPTION\fR]... \fI\-\-sysdev\fR [\fIrc class (f. ex. rc0)\fR]
 .br
 .B ir\-keytable
@@ -26,9 +23,6 @@ Auto\-load a table, based on a configuration file. Only works with
 \fB\-c\fR, \fB\-\-clear\fR
 Clears the scancode to keycode mappings.
 .TP
-\fB\-d\fR, \fB\-\-device\fR=\fIDEV\fR
-Use specified input device.
-.TP
 \fB\-D\fR, \fB\-\-delay\fR=\fIDELAY\fR
 Sets the delay before repeating a keystroke.
 .TP
@@ -73,8 +67,6 @@ print the v4l2\-utils version
 Mandatory or optional arguments to long options are also mandatory or optional
 for any corresponding short options. Options can be combined together.
 .SS The options arguments are:
-.IP \fIDEV\fR
-the /dev/input/event* device to control
 .IP \fISYSDEV\fR
 the rc class as found at /sys/class/rc
 .IP \fIKEYMAP\fR
utils/keytable/keytable.c +14 -31

80 lines not on this page · raw message

Signature · 1 line
2.20.1
#2 lore raw
Quoted 5 lines · Sean Young
Quoted 3 lines · Adam

Rather than document all this, isn't better to clean it up in the source? I can probably come up with a patch for this issue in fairly short order, if that's welcome.

Quoted 8 lines

You're right, this is broken. For this to work it would have to get all the details for the all the rc devices and find the one that has an input device with that name.

That command line above implies that the protocol is a property of the input device which it is not. Actually I think the whole -d option is misleading and not really useful. I think the right solution is to just remove it completely.

Ok, the patch looks good, I definately think this is a step in the right direction.

In cases where there is multiple devices, one would select it with, for instance, '-s rc1' -- is that the intent?

Signature · 1 line
...Adam Di Carlo...<[email protected]>............................
#3 lore raw
Quoted 15 lines · Adam Di Carlo
Quoted 5 lines · Sean Young
Quoted 3 lines · Adam

Rather than document all this, isn't better to clean it up in the source? I can probably come up with a patch for this issue in fairly short order, if that's welcome.

Quoted 8 lines

You're right, this is broken. For this to work it would have to get all the details for the all the rc devices and find the one that has an input device with that name.

That command line above implies that the protocol is a property of the input device which it is not. Actually I think the whole -d option is misleading and not really useful. I think the right solution is to just remove it completely.

Quoted 5 lines

Ok, the patch looks good, I definately think this is a step in the right direction.

In cases where there is multiple devices, one would select it with, for instance, '-s rc1' -- is that the intent?

That's right. I'm not sure that ir-keytable --help or the man page expresses that very clearly, though. Not sure what it should read..

Sean