alsa: improve headroom calculations

Make a function to recalculate the headroom and call it whenever the
resample state of the node can change.

When we are IRQ based scheduling but need to resample, we are actually
not driving the graph whit IRQ and need to adjust our period size and
headroom as if we are using timers.
This commit is contained in:
Wim Taymans 2023-10-18 14:45:47 +02:00
parent 2e066e6b1e
commit 6b8c267e91
2 changed files with 37 additions and 28 deletions

View file

@ -218,6 +218,7 @@ struct state {
unsigned int sources_added:1;
unsigned int auto_link:1;
unsigned int linked:1;
unsigned int is_batch:1;
uint64_t iec958_codecs;