* Questions about ir-keytable and ir-ctl
@ 2023-10-28 13:21 Vince Ricosti
2023-10-28 13:40 ` Sean Young
0 siblings, 1 reply; 3+ messages in thread
From: Vince Ricosti @ 2023-10-28 13:21 UTC (permalink / raw)
To: linux-media@vger.kernel.org
Hello,
I have described my experiments on linux with a rpi and I am a bit surprised that nothing works as it should.
I have posted here my tests https://forums.raspberrypi.com/viewtopic.php?t=358522
And I would like to discuss the different issues.
1) Why when enabling all protocols a sony15 is not properly recognized ?
Testing events. Please, press CTRL-C to abort.
557.572052: lirc protocol(rc5_sz): scancode = 0x2fff toggle=1
557.572077: event type EV_MSC(0x04): scancode = 0x2fff
557.572077: event type EV_SYN(0x00).
557.572138: event type EV_MSC(0x04): scancode = 0x970026
557.572138: event type EV_SYN(0x00).
557.572130: lirc protocol(sony15): scancode = 0x970026
and when I enable only sony protocol it's properly recognized:
1236.384059: lirc protocol(sony15): scancode = 0x970026
1236.384082: event type EV_MSC(0x04): scancode = 0x970026
1236.384082: event type EV_SYN(0x00).
2) When sending a sony scancode it doesn't work because the scancode is sent only once while for it work it need to be sent 3 times (or at least 2 times separated with a space of 43 * 600ms = 28500. Is there any flags to do that because I had to patch ir-ctl to make it work.
If nothing exists can I submit some patches to fix it ?
Regards
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Questions about ir-keytable and ir-ctl
2023-10-28 13:21 Questions about ir-keytable and ir-ctl Vince Ricosti
@ 2023-10-28 13:40 ` Sean Young
[not found] ` <DS0PR19MB65262E1BBF637CC86C5A5490D3A2A@DS0PR19MB6526.namprd19.prod.outlook.com>
0 siblings, 1 reply; 3+ messages in thread
From: Sean Young @ 2023-10-28 13:40 UTC (permalink / raw)
To: Vince Ricosti; +Cc: linux-media@vger.kernel.org
Hi Vince,
On Sat, Oct 28, 2023 at 01:21:15PM +0000, Vince Ricosti wrote:
> I have described my experiments on linux with a rpi and I am a bit surprised that nothing works as it should.
> I have posted here my tests https://forums.raspberrypi.com/viewtopic.php?t=358522
> And I would like to discuss the different issues.
>
> 1) Why when enabling all protocols a sony15 is not properly recognized ?
>
> Testing events. Please, press CTRL-C to abort.
> 557.572052: lirc protocol(rc5_sz): scancode = 0x2fff toggle=1
> 557.572077: event type EV_MSC(0x04): scancode = 0x2fff
> 557.572077: event type EV_SYN(0x00).
That's a "suprious" decode. You can ignore it.
This is a case where the same IR can be decoded in multiple ways, if all
the decoders are enabled. The Sony/rc5_sz protocols are "non-robust", see
http://hifi-remote.com/wiki/index.php/Spurious_decodes_and_non-robust_protocols
> 557.572138: event type EV_MSC(0x04): scancode = 0x970026
> 557.572138: event type EV_SYN(0x00).
> 557.572130: lirc protocol(sony15): scancode = 0x970026
>
> and when I enable only sony protocol it's properly recognized:
> 1236.384059: lirc protocol(sony15): scancode = 0x970026
> 1236.384082: event type EV_MSC(0x04): scancode = 0x970026
> 1236.384082: event type EV_SYN(0x00).
Only enabling the sony protocol is the right solution, or simply ignoring
the spurious decode. This works in most cases, because the resulting scancode
is not something you would expect.
> 2) When sending a sony scancode it doesn't work because the scancode is sent only once while for it work it need to be sent 3 times (or at least 2 times separated with a space of 43 * 600ms = 28500. Is there any flags to do that because I had to patch ir-ctl to make it work.
Yes, you are right about this. My sony system also needs the IR repeated at
least twice or else it ignores it.
> If nothing exists can I submit some patches to fix it ?
Sure, I think this is a useful addition to ir-ctl.
On the other hand, I have been working on a new tool that replaces ir-ctl
and ir-keytable called cir: https://github.com/seanyoung/cir/ It might be
interesting to use this instead.
Using cir you would describe the sony protocol in IRP and send it that way,
and the IRP says that it should be repeated 3 times, rather than building
this into the IR tool itself:
cir transmit irp -fD=1,F=1 '{40k,600}<1,-1|2,-1>(4,-1,F:7,D:8,^45m)3[D:0..255,F:0..127]'
Alternatively you can also specify IRP repeats like so:
cir transmit irp -fD=1,F=1 -r 3 '{40k,600}<1,-1|2,-1>(4,-1,F:7,D:8,^45m)*[D:0..255,F:0..127]'
cir transmit works very well and can also transmit lircd.conf files and
pronto hex, that is well tested and stable. However decoding needs work,
and the day-job is keeping me very busy lately. When I have some time I want
convert the decoding DFA to BPF and generate an IR decoder for the IRP.
Sean
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Questions about ir-keytable and ir-ctl
[not found] ` <DS0PR19MB65262E1BBF637CC86C5A5490D3A2A@DS0PR19MB6526.namprd19.prod.outlook.com>
@ 2023-10-29 23:00 ` Vince Ricosti
0 siblings, 0 replies; 3+ messages in thread
From: Vince Ricosti @ 2023-10-29 23:00 UTC (permalink / raw)
To: Sean Young; +Cc: linux-media@vger.kernel.org
I forgot this patch that will avoid people to wonder why nothing happens when sys dev is wrong:
--- tmp/v4l-utils-1.20.0/utils/keytable/keytable.c 2020-05-21 11:22:36.000000000 +0100
+++ v4l-utils-1.20.0/utils/keytable/keytable.c 2023-10-29 20:23:48.580655881 +0000
@@ -2067,6 +2067,7 @@
return -1;
rc_dev.sysfs_name = names->name;
if (get_attribs(&rc_dev, names->name)) {
+ fprintf(stderr, _("Wrong sysdev %s: cannot retrieve attributes\n"), devclass);
free_names(names);
return -1;
}
Regards
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-10-29 23:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-28 13:21 Questions about ir-keytable and ir-ctl Vince Ricosti
2023-10-28 13:40 ` Sean Young
[not found] ` <DS0PR19MB65262E1BBF637CC86C5A5490D3A2A@DS0PR19MB6526.namprd19.prod.outlook.com>
2023-10-29 23:00 ` Vince Ricosti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox