• Home
  • Raw
  • Download

Lines Matching refs:handle

156 static struct cirrus_playback_session handle;  variable
171 memset(&handle, 0, sizeof(handle)); in audio_extn_spkr_prot_init()
177 handle.adev_handle = adev; in audio_extn_spkr_prot_init()
178 handle.state = INIT; in audio_extn_spkr_prot_init()
180 pthread_mutex_init(&handle.fb_prot_mutex, NULL); in audio_extn_spkr_prot_init()
183 (void)pthread_create(&handle.calibration_thread, in audio_extn_spkr_prot_init()
185 audio_extn_cirrus_calibration_thread, &handle); in audio_extn_spkr_prot_init()
187 (void)pthread_create(&handle.calibration_thread, in audio_extn_spkr_prot_init()
189 audio_extn_cirrus_config_thread, &handle); in audio_extn_spkr_prot_init()
197 pthread_join(handle.failure_detect_thread, NULL); in audio_extn_spkr_prot_deinit()
199 pthread_join(handle.calibration_thread, NULL); in audio_extn_spkr_prot_deinit()
200 pthread_mutex_destroy(&handle.fb_prot_mutex); in audio_extn_spkr_prot_deinit()
207 struct audio_device *adev = handle.adev_handle; in audio_extn_cirrus_run_calibration()
388 struct audio_device *adev = handle.adev_handle; in audio_extn_cirrus_load_usecase_configs()
459 struct audio_device *adev = handle.adev_handle; in audio_extn_cirrus_calibration_thread()
473 prev_state = handle.state; in audio_extn_cirrus_calibration_thread()
474 handle.state = CALIBRATING; in audio_extn_cirrus_calibration_thread()
501 handle.pcm_rx = pcm_open(adev->snd_card, pcm_dev_rx_id, in audio_extn_cirrus_calibration_thread()
504 if (handle.pcm_rx && !pcm_is_ready(handle.pcm_rx)) { in audio_extn_cirrus_calibration_thread()
506 pcm_get_error(handle.pcm_rx)); in audio_extn_cirrus_calibration_thread()
511 if (pcm_start(handle.pcm_rx) < 0) { in audio_extn_cirrus_calibration_thread()
513 pcm_get_error(handle.pcm_rx)); in audio_extn_cirrus_calibration_thread()
528 if (handle.pcm_rx) { in audio_extn_cirrus_calibration_thread()
530 pcm_close(handle.pcm_rx); in audio_extn_cirrus_calibration_thread()
531 handle.pcm_rx = NULL; in audio_extn_cirrus_calibration_thread()
539 handle.state = (prev_state == PLAYBACK) ? PLAYBACK : IDLE; in audio_extn_cirrus_calibration_thread()
542 if (handle.state == PLAYBACK) in audio_extn_cirrus_calibration_thread()
543 (void)pthread_create(&handle.failure_detect_thread, in audio_extn_cirrus_calibration_thread()
546 &handle); in audio_extn_cirrus_calibration_thread()
557 struct audio_device *adev = handle.adev_handle; in audio_extn_cirrus_config_thread()
640 struct audio_device *adev = handle.adev_handle; in audio_extn_cirrus_failure_detect_thread()
685 pthread_mutex_lock(&handle.fb_prot_mutex); in audio_extn_cirrus_failure_detect_thread()
687 pthread_mutex_unlock(&handle.fb_prot_mutex); in audio_extn_cirrus_failure_detect_thread()
731 while ((handle.state == PLAYBACK) && det_en) { in audio_extn_cirrus_failure_detect_thread()
732 pthread_mutex_lock(&handle.fb_prot_mutex); in audio_extn_cirrus_failure_detect_thread()
734 pthread_mutex_unlock(&handle.fb_prot_mutex); in audio_extn_cirrus_failure_detect_thread()
803 struct audio_device *adev = handle.adev_handle; in audio_extn_spkr_prot_start_processing()
822 pthread_mutex_lock(&handle.fb_prot_mutex); in audio_extn_spkr_prot_start_processing()
827 handle.pcm_tx = NULL; in audio_extn_spkr_prot_start_processing()
843 handle.pcm_tx = pcm_open(adev->snd_card, in audio_extn_spkr_prot_start_processing()
847 if (handle.pcm_tx && !pcm_is_ready(handle.pcm_tx)) { in audio_extn_spkr_prot_start_processing()
848 ALOGE("%s: PCM device not ready: %s", __func__, pcm_get_error(handle.pcm_tx)); in audio_extn_spkr_prot_start_processing()
853 if (pcm_start(handle.pcm_tx) < 0) { in audio_extn_spkr_prot_start_processing()
855 pcm_get_error(handle.pcm_tx)); in audio_extn_spkr_prot_start_processing()
861 if (handle.state == IDLE) in audio_extn_spkr_prot_start_processing()
862 (void)pthread_create(&handle.failure_detect_thread, in audio_extn_spkr_prot_start_processing()
865 &handle); in audio_extn_spkr_prot_start_processing()
868 handle.state = PLAYBACK; in audio_extn_spkr_prot_start_processing()
871 handle.state = IDLE; in audio_extn_spkr_prot_start_processing()
872 if (handle.pcm_tx) { in audio_extn_spkr_prot_start_processing()
874 pcm_close(handle.pcm_tx); in audio_extn_spkr_prot_start_processing()
875 handle.pcm_tx = NULL; in audio_extn_spkr_prot_start_processing()
884 pthread_mutex_unlock(&handle.fb_prot_mutex); in audio_extn_spkr_prot_start_processing()
891 struct audio_device *adev = handle.adev_handle; in audio_extn_spkr_prot_stop_processing()
895 pthread_mutex_lock(&handle.fb_prot_mutex); in audio_extn_spkr_prot_stop_processing()
897 handle.state = IDLE; in audio_extn_spkr_prot_stop_processing()
901 if (handle.pcm_tx) { in audio_extn_spkr_prot_stop_processing()
903 pcm_close(handle.pcm_tx); in audio_extn_spkr_prot_stop_processing()
904 handle.pcm_tx = NULL; in audio_extn_spkr_prot_stop_processing()
916 pthread_mutex_unlock(&handle.fb_prot_mutex); in audio_extn_spkr_prot_stop_processing()