Re: [Q] Frequency & duty cycle measurement?

From: Csókás Bence
Date: Wed Feb 05 2025 - 04:58:58 EST


Hi,

On 2025. 02. 05. 10:30, Csókás Bence wrote:
Hi,

On 2025. 02. 05. 0:37, William Breathitt Gray wrote:
The first step is to decide which event we'll monitor and on which
channel: we want to monitor Capture events so that's
COUNTER_EVENT_CAPTURE, and we want event channel 0 (n.b. 0 because
that's the channel parameter value passed to counter_push_event() in the
driver).

Ah, I push 0 and 1 for the two interrupts... So that's why `channel` has to be 0 and 1 as well. Does it make sense to do it this way, or should I push on event channel 0 always?

I had no success using `channel = 0`, only data from `capture0` comes back. If I set both `channel` AND `component.id` to X, then I start to see similar values than what I get from reading sysfs. (For now I hard-coded all values; I agree that the correct way would be to read component IDs from sysfs, but this is still a PoC...)

Did I do something wrong in implementing the driver maybe? (See the submitted patches.) And any idea as to why I might be seeing the slowdown?

The slowdown is still a mystery though...

Bence