Linux Media Controller development
 help / color / mirror / Atom feed
From: Sean Young <sean@mess.org>
To: Vince Ricosti <vricosti@outlook.com>
Cc: "linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: Re: Questions about ir-keytable and ir-ctl
Date: Sat, 28 Oct 2023 14:40:45 +0100	[thread overview]
Message-ID: <ZT0PXddD2tphScNh@gofer.mess.org> (raw)
In-Reply-To: <DS0PR19MB6526C9164F0E0883B380D2D3D3A3A@DS0PR19MB6526.namprd19.prod.outlook.com>

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

  reply	other threads:[~2023-10-28 13:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-28 13:21 Questions about ir-keytable and ir-ctl Vince Ricosti
2023-10-28 13:40 ` Sean Young [this message]
     [not found]   ` <DS0PR19MB65262E1BBF637CC86C5A5490D3A2A@DS0PR19MB6526.namprd19.prod.outlook.com>
2023-10-29 23:00     ` Vince Ricosti

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=ZT0PXddD2tphScNh@gofer.mess.org \
    --to=sean@mess.org \
    --cc=linux-media@vger.kernel.org \
    --cc=vricosti@outlook.com \
    /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