mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
alsa: fix rate matching in the sequencer
The alsa sequencer rate matching was not actually working correctly. It would compare the previous queue time with the current time and compare that to the quantum. This would include uncorrected errors from jitter and would result in the timeouts being scaled in the wrong direction forever. Instead, calculate an ideal queue time and compare our current queue time against that. We then use the correction to scale the timeout or the next queue time prediction. Also use the predicted time as the base time for the event timestamps. this results in less jitter. Fixes #3657
This commit is contained in:
parent
4e6b629ae2
commit
22db59d8a3
2 changed files with 26 additions and 16 deletions
|
|
@ -142,6 +142,8 @@ struct seq_state {
|
|||
uint64_t next_time;
|
||||
uint64_t base_time;
|
||||
uint64_t queue_time;
|
||||
uint64_t queue_next;
|
||||
double queue_corr;
|
||||
|
||||
unsigned int opened:1;
|
||||
unsigned int started:1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue