mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -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
c153f39720
commit
758805d65d
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