context: add option for soft/hard clock rate changes

Hard rate changes (the default now) makes the graph suspend so that the
driver reopens the device with the new sample rate if possible. This
causes a glitch.

Soft rate changes works as before and just changes the clock rate of
the position area, which makes everything resample things to the new
rate without a glitch.

Sample rate changes can currently still only be triggered by
configuring the settings metadata clock.force-rate
This commit is contained in:
Wim Taymans 2021-07-29 17:13:54 +02:00
parent 65e7402d01
commit 08a1ca403f
2 changed files with 20 additions and 0 deletions

View file

@ -64,6 +64,9 @@ struct settings {
unsigned int mem_warn_mlock:1;
unsigned int mem_allow_mlock:1;
unsigned int clock_power_of_two_quantum:1;
#define CLOCK_RATE_UPDATE_MODE_HARD 0
#define CLOCK_RATE_UPDATE_MODE_SOFT 1
int clock_rate_update_mode;
uint32_t clock_force_rate;
uint32_t clock_force_quantum;
};