alsa: improve capture slave resync

When we underrun, send out a buffer of 0 samples and catch up next
time.
Detect discont in the master and resync.
This commit is contained in:
Wim Taymans 2019-04-29 10:00:42 +02:00
parent b43844e7c6
commit 5ac383e7f7
3 changed files with 46 additions and 32 deletions

View file

@ -65,7 +65,7 @@ struct buffer {
struct spa_list link;
};
#define BW_MAX 0.256
#define BW_MAX 0.128
#define BW_MED 0.064
#define BW_MIN 0.016
#define BW_PERIOD (3 * SPA_NSEC_PER_SEC)
@ -125,6 +125,7 @@ struct state {
int timerfd;
uint32_t threshold;
uint32_t last_threshold;
uint64_t last_position;
unsigned int alsa_started:1;
unsigned int alsa_sync:1;
unsigned int slaved:1;