summaryrefslogtreecommitdiff
path: root/audio_alsa.c
diff options
context:
space:
mode:
authorMike Brady <mikebrady@eircom.net>2018-12-03 17:00:12 +0000
committerMike Brady <mikebrady@eircom.net>2018-12-03 17:00:12 +0000
commit60315b63c90944fb4d9da78e5608cfb92d3f01b7 (patch)
treebde3268596925b490070da7a4a925c353ba85277 /audio_alsa.c
parent4bb29bc198541d5dacf7cb1ba9a2fcd82f2afe86 (diff)
Try to ensure that any alsa command sequences are uncancellable. Leave a little time afterwards where possible.
Diffstat (limited to 'audio_alsa.c')
-rw-r--r--audio_alsa.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/audio_alsa.c b/audio_alsa.c
index 9818298..c233a67 100644
--- a/audio_alsa.c
+++ b/audio_alsa.c
@@ -506,7 +506,8 @@ static int init(int argc, char **argv) {
} else {
debug(1, "alsa: no hardware mixer selected.");
}
-
+
+ usleep(200000); // see if it makes a difference
alsa_mix_handle = NULL;
return response;
}
@@ -883,7 +884,7 @@ int actual_open_alsa_device(void) {
break;
}
}
-
+ usleep(200000); // see if it makes a difference
return 0;
}
@@ -910,6 +911,7 @@ static void start(int i_sample_rate, int i_sample_format) {
frame_index = 0;
measurement_data_is_valid = 0;
+ usleep(200000); // see if it makes a difference
}
//assuming pthread cancellation is disabled
@@ -1163,6 +1165,7 @@ static void flush(void) {
measurement_data_is_valid = 0;
alsa_handle = NULL;
}
+ usleep(200000); // see if it makes a difference
debug_mutex_unlock(&alsa_mutex, 3);
pthread_cleanup_pop(0); // release the mutex
pthread_setcancelstate(oldState, NULL);