Hi Liam,
How do you handle any clock drift here between the HDA hardware interface clock and the PA timer ?
Good question. This is already handled by PulseAudio. The timer isn't programmed with a fixed value but is adapted precisely to track differences between system time and audio time. PulseAudio relies on snd_pcm_avail() to query the number of samples played, and correlates timer values with samples. There's a longer blurb on this at [1]. The use of timers has pretty much broken most of the drivers as the values returned by snd_pcm_avail weren't precise enough. However it's been a year and a half now and things are ok on most hardware. The main reason why this is interesting is that you can vary the latency on the fly simply by reprogramming the timer. Having to define a fixed period size for all use cases is a real problem for us. You end-up with a compromise between latency and power that makes things suboptimal across the board. Cheers -Pierre