alsa: add dll to estimate clock drift

Make delay signed in the clock io so that we can simply add it to the
tick to get the hw position.
Add clock drift to clock info
This commit is contained in:
Wim Taymans 2018-11-09 15:24:24 +01:00
parent 7925aed863
commit e69cf24f24
8 changed files with 98 additions and 46 deletions

View file

@ -71,14 +71,17 @@ struct spa_io_range {
uint32_t max_size; /**< maximum size of data */
};
/** A time source */
/** A time source. Nodes that can report clocking information will
* receive this. The application sets the id. */
struct spa_io_clock {
uint32_t id; /**< unique clock id, set by application */
uint32_t flags; /**< clock flags */
uint64_t nsec; /**< time in nanoseconds */
struct spa_fraction rate; /**< rate for position/delay */
uint64_t position; /**< current position */
uint64_t delay; /**< delay between position and hardware,
add to position for capture,
subtract for playback */
int64_t delay; /**< delay between position and hardware,
* positive for capture, negative for playback */
double rate_diff; /**< rate difference between clock and monotonic time */
};
/** latency reporting */