+ if (input) {
+ audio_in_unprepare(input);
+ audio_in_destroy(input);
+ }
+
+ if (device_list)
+ sound_manager_free_device_list(device_list);
+
+ pthread_exit(0);
+
+ return NULL;
+}
+
+static void _test_echo_cancel(const char *filename, int rate, int channels, int ref_deviceid, bool capture)
+{
+ int status;
+ pthread_t thread_echo_cancel;
+ test_echo_cancel_t data;
+
+ snprintf(data.filename, FILENAME_MAX, "%s", filename);
+ data.rate = rate;
+ data.channels = channels;
+ data.ref_deviceid = ref_deviceid;
+ pthread_create(&thread_echo_cancel, NULL, _record_echo_cancel_thread, &data);
+
+ if (capture) {
+ pthread_t thread_capture;
+ test_echo_cancel_t data_capture;
+
+ snprintf(data_capture.filename, FILENAME_MAX, "%s_%s", filename, "norm");
+ data_capture.rate = rate;
+ data_capture.channels = channels;
+ data_capture.ref_deviceid = SOUND_MANAGER_STREAM_NO_REFERENCE_DEVICE;
+
+ pthread_create(&thread_capture, NULL, _record_echo_cancel_thread, &data_capture);
+ pthread_join(thread_capture, (void**)&status);
+ }
+
+ pthread_join(thread_echo_cancel, (void**)&status);