|
dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
|
A clock is an object with an origin: a device (its hw clock), a bus (the USB frame counter), a stream (an endpoint's IO callback, e.g. a CoreAudio IOProc), or something outside the device altogether (word clock, another interface, the far end of an interconnect, a network). Clocks therefore live in a registry outside the device - not in the device's own domain device.hw - to which devices, buses and streams publish theirs. A clock domain (desc::clock, stream::config::clock::domain) selects exactly one clock via clocksource, whatever its origin; the domain's group derives its tick source from that clock: free running for a synthetic origin (period interval(samplerate, granularity)), the clock's event otherwise. Master/slave is nothing more than which clock a domain selected; a domain slaved to a foreign clock takes that clock's rate along, and an incompatible selection is refused, never resampled.
The clock is independent of the transport, which is what makes the mixed cases representable:
Open: the clock id namespace across device boundaries (who issues it, does it persist in the desc), how a slave adopts the master's rate, and what an external clock delivers to a group - the tick event only, or timestamps and frame counters as usb::stream::group::sync takes them from the bus frame.