linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [libgpiod] gpiomon loses events
@ 2020-09-14 10:38 Maxim Devaev
  2020-09-14 15:12 ` Andy Shevchenko
  0 siblings, 1 reply; 16+ messages in thread
From: Maxim Devaev @ 2020-09-14 10:38 UTC (permalink / raw)
  To: linux-gpio

Hi. I noticed a strange behavior of gpiomon and gpiomon.py. It seems
that in some cases, if the signal arrives at the GPIO pin too quickly,
the last event on it may be rising, despite the fact that the actual
signal is already set to 0. a Cursory study of the sources showed that
both of these utilities read only one (the first?) event from the
line. I changed gpiomon.py rby replacing read_event() to
read_event_multiply() and iterating by all events, and it looks like
the lost faling events were there.

So, I have a few questions.

1) Is this really a bug in gpiomon, or is it intended to be?

2) If I use read_events_multiple(), can it skip some events? I noticed
that sometimes I can get several falling and rising in a row. Why is
this happening? Shouldn't they be paired? Can the state transition,
i.e. the final falling or rising, be lost?

3) It seems there can only be 16 events in a line. What happens if
more events occur in one iteration of the loop, such as 20? The last 4
events will be lost, they will be available in the next iteration of
event_wait(), or the first 4 events in the current iteration will be
discarded?

Thank you for your attention.

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-09-17 14:29 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-14 10:38 [libgpiod] gpiomon loses events Maxim Devaev
2020-09-14 15:12 ` Andy Shevchenko
2020-09-14 15:54   ` Andy Shevchenko
2020-09-14 15:55     ` Andy Shevchenko
2020-09-14 16:38       ` Maxim Devaev
2020-09-15  0:45       ` Kent Gibson
2020-09-15  3:34         ` Kent Gibson
2020-09-15  7:34           ` Maxim Devaev
2020-09-15  7:46             ` Bartosz Golaszewski
2020-09-15 13:57             ` Kent Gibson
2020-09-16  9:29               ` Bartosz Golaszewski
2020-09-16  9:57                 ` Kent Gibson
2020-09-17 10:36                   ` Maxim Devaev
2020-09-17 13:41                     ` Andy Shevchenko
2020-09-17 13:45                       ` Maxim Devaev
2020-09-17 13:51                         ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).