On Tue, Mar 01, 2022 at 10:48:30AM -0600, Andrew Eikum wrote:
This one causes a ton of underruns with native xaudio2. I tested with the "James Cameron's Avatar The Game Demo". I can provide you the installation files, if you can't dig them up someplace.
It looks to me like the new thread timer slowly drifts, which means the device eventually runs out of data and we never catch up (note drifting thousandths and accumulating avail value):
[snip]
The pulse driver doesn't run into this problem because it keeps track of the time between callbacks and accounts for the drift, see the 'adjust' parameter and 'delay' calculation in pulse.c:pulse_timer_loop.
We could do the same adjustment in ALSA, or find a way to keep using the timer queue?
Hi Andrew,
Thanks for this looking at this. I'd somehow convinced myself that we didn't need to account for drift, but apparently we do.
I've sent in v2 of the series that adds "adjust" logic similar to that in the pulse driver.
Huw.