public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: "Marko Mäkelä" <marko.makela@iki.fi>
To: Sean Young <sean@mess.org>
Cc: Antti Palosaari <crope@iki.fi>, linux-media@vger.kernel.org
Subject: Re: Inconsistent RC5 ir-keytable events
Date: Wed, 9 Feb 2022 10:12:34 +0200	[thread overview]
Message-ID: <YgN3cq+utQAFFnEW@jyty> (raw)
In-Reply-To: <YgKeZ+vAynWvvijz@gofer.mess.org>

Hi Sean,

Tue, Feb 08, 2022 at 04:46:31PM +0000, Sean Young wrote:
>Hi Marko,
>
>On Sat, Jan 29, 2022 at 07:15:57PM +0200, Marko Mäkelä wrote:
>> Hi Sean,
>>
>> Did you have a chance to repeat my findings with a remote control unit that
>> uses the RC5 protocol?
>
>Yes, I've reproduced the problem now. It's very weird.
>
>After pressing button 1, waiting for a second or two, and then pressing button
>3, the device reports some old IR from button 1 before reporting the IR from
>button 3.
>
>The IR is not a copy of old data, it so presumably its IR that was not
>reported before. Now I don't know why this IR gets reported so late.

When I repeated the problem, the delay between subsequent button presses 
could have been even less than a second.

How did you determine that it is not a copy of old data? I assume that 
you can do that fairly easily for any kernel-side buffers, but what 
about the buffer on the USB device itself?

[snip]

>I have not seen this happen. You can enable debugging for this using:
>
>echo 'file rtl28xxu.c +p' > /sys/kernel/debug/dynamic_debug/control
>
>dmesg -w

Thank you. It might take me some time to return to this.

>I do not know exactly how the buffer works, only some experimentation 
>will help here. Unless there is a vendor driver/documentation for this 
>device.

I am just guessing here, since I do not have any experience with USB 
programming, and hardly any experience with the Linux kernel. Could it 
be that the IR samples are being stored in a ring buffer, and the device 
does not implicitly discard IR events as it is sending them to the USB 
host? A simple test could be to read the buffer twice in a row. Will it 
return the same contents, instead of returning nothing on the second 
read?

If my ring buffer hypothesis holds, perhaps the kernel driver should 
keep track on where the data ended on the previous read, re-read the 
device's entire ring buffer, and resume parsing from the previous end of 
the ring buffer? In that way, we should not see phantom old events.

Best regards,

	Marko

  reply	other threads:[~2022-02-09  8:12 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <YdKdPosyzj2urFpS@jyty>
2022-01-03  9:21 ` Inconsistent RC5 ir-keytable events Sean Young
2022-01-03 10:35   ` Marko Mäkelä
2022-01-03 11:07     ` Sean Young
2022-01-03 12:21       ` Marko Mäkelä
2022-01-04 16:07         ` Marko Mäkelä
2022-01-05  9:53           ` Sean Young
2022-01-06 11:41             ` Marko Mäkelä
2022-01-13 16:55               ` Sean Young
2022-01-14  6:31                 ` Marko Mäkelä
2022-01-29 17:15                   ` Marko Mäkelä
2022-02-08 16:46                     ` Sean Young
2022-02-09  8:12                       ` Marko Mäkelä [this message]
2022-02-12 11:16                         ` Sean Young
2022-02-12 16:34                           ` Sean Young
2022-02-13 17:12                             ` Marko Mäkelä
2022-03-26 18:44                               ` Marko Mäkelä
2022-04-10 14:07                                 ` Marko Mäkelä

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=YgN3cq+utQAFFnEW@jyty \
    --to=marko.makela@iki.fi \
    --cc=crope@iki.fi \
    --cc=linux-media@vger.kernel.org \
    --cc=sean@mess.org \
    /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