Re: Correlating SOF with host system time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 6 Dec 2012, Stefan Tauner wrote:

> On Wed, 5 Dec 2012 10:35:31 -0500 (EST)
> Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
 
> > Your theory omits an important point: The host system generally doesn't
> > care exactly when frames start.  Forcing it to keep track of these
> > events adds overhead.
> 
> Yes, it does, but that overhead is largely negligible when you have an
> overpowered x86 machine on one side and a number of tiny
> microcontrollers on the other. :)

Ah, but the code you'd need to add -- along with its attendant overhead
-- would be present on _all_ Linux systems, not just on overpowered x86
machines.

> Thanks for the inputs and ill report back, when i have some interesting
> findings. I would still like to know how one would/should implement the
> frame number-based scheme in a current linux kernel if anyone wants to
> elaborate on that...

Well, to do this generally you would have to change all the host
controller drivers, which would be a big job.  Each driver would need
to enable frame-boundary interrupts and store the current time and
frame number whenever one of these interrupts occurs.  (That's the
extra overhead I was referring to.)  Or maybe you wouldn't need 
frame-boundary interrupts; you could just store the time and frame 
information whenever any interrupt occurs.  With many controllers, IRQs 
are raised only at frame or microframe boundaries.

(Bear in mind that with EHCI, the frame number appearing on the bus can
be different from the value reported by the EHCI hardware.)

Then you would need to define a userspace API for retrieving these 
times and numbers.  Probably some sort of ioctl in usbfs.

On the other hand, if all you need is roughly millisecond precision,
you could simply define a USBDEVFS_GET_FRAME_NUMBER ioctl.  It wouldn't
be referenced to the frame boundary but it would be good to within a
millisecond or so.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux