Linux USB
 help / color / mirror / Atom feed
From: Thilo Roerig <thilo.roerig@googlemail.com>
To: stern@rowland.harvard.edu
Cc: linux-usb@vger.kernel.org, thilo.roerig@googlemail.com
Subject: Re: Receiving report multiple times when changing cpu
Date: Wed, 22 Feb 2023 09:24:44 +0100	[thread overview]
Message-ID: <20230222082444.419-1-thilo.roerig@googlemail.com> (raw)
In-Reply-To: <Y0lk+IiDmrkmAfRk@rowland.harvard.edu>

> > > As Greg mentioned, usbmon is a better way to snoop the data transfers.
> >
> > I have continued to investigate the issue using usbmon, but unfortunately, I
> > could not find any other irregularity, but the jumps in the report id pattern.
> 
> Did you check the timestamps carefully?  In particular, did you
> examine the times when each transfer was submitted and completed?  If
> two adjacent transfers complete more than one or two microseconds
> apart, that indicates a problem.

It took some time, but thanks to your pointers I was finally able to narrow
down the possible causes of the problem and it turned out that there was a
problem in the firmware of the usb device.

More precisely, I took a closer look at the timestamps of my usbmon log, as you
suggested, and it showed a pattern that changed once the duplicate reports
started. With this knowledge I could analyze the details together with the
device provider. We ended up sniffing the data on the wire and fixed some of
the issues by an update of the device firmware that does not show the problem
anymore.

On the linux end, I have moved some of my python code to C to increase the
read speed. I was loosing some reports because I was not emptying the hid
report queue used in the libusb backend of the hidapi library fast enough.

Thank you again for your great help.

Best
Thilo Roerig

      reply	other threads:[~2023-02-22  8:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-12 14:35 Receiving report multiple times when changing cpu Thilo Rörig
2022-10-12 16:00 ` Greg KH
2022-10-14 11:18   ` Thilo Roerig
2022-10-14 13:52     ` Greg KH
2023-02-22  8:27       ` Thilo Roerig
2022-10-12 16:54 ` Alan Stern
2022-10-14 11:20   ` Thilo Roerig
2022-10-14 13:32     ` Alan Stern
2023-02-22  8:24       ` Thilo Roerig [this message]

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=20230222082444.419-1-thilo.roerig@googlemail.com \
    --to=thilo.roerig@googlemail.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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