Loading hal/audio_hw.c +9 −0 Original line number Diff line number Diff line Loading @@ -2909,6 +2909,8 @@ int start_input_stream(struct stream_in *in) if (audio_extn_ext_hw_plugin_usecase_start(adev->ext_hw_plugin, uc_info)) ALOGE("%s: failed to start ext hw plugin", __func__); android_atomic_acquire_cas(true, false, &(in->capture_stopped)); if (audio_extn_cin_attached_usecase(in->usecase)) { ret = audio_extn_cin_open_input_stream(in); if (ret) Loading Loading @@ -6532,6 +6534,13 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer, in->standby = 0; } /* Avoid read if capture_stopped is set */ if (android_atomic_acquire_load(&(in->capture_stopped)) > 0) { ALOGD("%s: force stopped catpure session, ignoring read request", __func__); ret = -EINVAL; goto exit; } // what's the duration requested by the client? long ns = 0; Loading hal/audio_hw.h +2 −0 Original line number Diff line number Diff line Loading @@ -473,6 +473,8 @@ struct stream_in { float zoom; audio_microphone_direction_t direction; volatile int32_t capture_stopped; /* Array of supported channel mask configurations. +1 so that the last entry is always 0 */ audio_channel_mask_t supported_channel_masks[MAX_SUPPORTED_CHANNEL_MASKS + 1]; audio_format_t supported_formats[MAX_SUPPORTED_FORMATS + 1]; Loading hal/audio_hw_extn_api.c +6 −1 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ #include <inttypes.h> #include <errno.h> #include <log/log.h> #include <cutils/atomic.h> #include <hardware/audio.h> #include "sound/compress_params.h" Loading Loading @@ -201,9 +202,13 @@ int qahwi_in_stop(struct audio_stream_in* stream) { if (!in->standby) { if (in->pcm != NULL ) { pcm_stop(in->pcm); } else if (audio_extn_cin_format_supported(in->format)) { } else if (audio_extn_cin_attached_usecase(in->usecase)) { audio_extn_cin_stop_input_stream(in); } /* Set the atomic variable when the session is stopped */ if (android_atomic_acquire_cas(false, true, &(in->capture_stopped)) == 0) ALOGI("%s: capture_stopped bit set", __func__); } pthread_mutex_unlock(&adev->lock); Loading Loading
hal/audio_hw.c +9 −0 Original line number Diff line number Diff line Loading @@ -2909,6 +2909,8 @@ int start_input_stream(struct stream_in *in) if (audio_extn_ext_hw_plugin_usecase_start(adev->ext_hw_plugin, uc_info)) ALOGE("%s: failed to start ext hw plugin", __func__); android_atomic_acquire_cas(true, false, &(in->capture_stopped)); if (audio_extn_cin_attached_usecase(in->usecase)) { ret = audio_extn_cin_open_input_stream(in); if (ret) Loading Loading @@ -6532,6 +6534,13 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer, in->standby = 0; } /* Avoid read if capture_stopped is set */ if (android_atomic_acquire_load(&(in->capture_stopped)) > 0) { ALOGD("%s: force stopped catpure session, ignoring read request", __func__); ret = -EINVAL; goto exit; } // what's the duration requested by the client? long ns = 0; Loading
hal/audio_hw.h +2 −0 Original line number Diff line number Diff line Loading @@ -473,6 +473,8 @@ struct stream_in { float zoom; audio_microphone_direction_t direction; volatile int32_t capture_stopped; /* Array of supported channel mask configurations. +1 so that the last entry is always 0 */ audio_channel_mask_t supported_channel_masks[MAX_SUPPORTED_CHANNEL_MASKS + 1]; audio_format_t supported_formats[MAX_SUPPORTED_FORMATS + 1]; Loading
hal/audio_hw_extn_api.c +6 −1 Original line number Diff line number Diff line Loading @@ -34,6 +34,7 @@ #include <inttypes.h> #include <errno.h> #include <log/log.h> #include <cutils/atomic.h> #include <hardware/audio.h> #include "sound/compress_params.h" Loading Loading @@ -201,9 +202,13 @@ int qahwi_in_stop(struct audio_stream_in* stream) { if (!in->standby) { if (in->pcm != NULL ) { pcm_stop(in->pcm); } else if (audio_extn_cin_format_supported(in->format)) { } else if (audio_extn_cin_attached_usecase(in->usecase)) { audio_extn_cin_stop_input_stream(in); } /* Set the atomic variable when the session is stopped */ if (android_atomic_acquire_cas(false, true, &(in->capture_stopped)) == 0) ALOGI("%s: capture_stopped bit set", __func__); } pthread_mutex_unlock(&adev->lock); Loading