Loading hal/audio_hw.c +4 −20 Original line number Diff line number Diff line Loading @@ -884,7 +884,6 @@ int start_input_stream(struct stream_in *in) } break; } in->pcm_error_type = PCM_ERROR_NONE; ALOGV("%s: exit", __func__); return ret; Loading Loading @@ -1249,7 +1248,6 @@ int start_output_stream(struct stream_out *out) } break; } out->pcm_error_type = PCM_ERROR_NONE; } else { out->pcm = NULL; out->compr = compress_open(adev->snd_card, Loading Loading @@ -1697,12 +1695,6 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer, ALOGD(" %s: sound card is not active/SSR state", __func__); ret= -ENETRESET; goto exit; } else if (PCM_ERROR_ENETRESET == out->pcm_error_type) { ALOGD(" %s restarting pcm session on post SSR", __func__); out->standby = false; pthread_mutex_unlock(&out->lock); out_standby(&out->stream.common); pthread_mutex_lock(&out->lock); } } Loading Loading @@ -1756,12 +1748,11 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer, } exit: /* ToDo: There may be a corner case when SSR happens back to back during start/stop. Need to post different error to handle that. */ if (-ENETRESET == ret) { pthread_mutex_lock(&adev->snd_card_status.lock); adev->snd_card_status.state = SND_CARD_STATE_OFFLINE; out->pcm_error_type = PCM_ERROR_ENETRESET; out->standby = true; /*standby will be called on post SSR */ pthread_mutex_unlock(&adev->snd_card_status.lock); } Loading Loading @@ -2120,12 +2111,6 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer, ALOGD(" %s: sound card is not active/SSR state", __func__); ret= -ENETRESET; goto exit; } else if (PCM_ERROR_ENETRESET == in->pcm_error_type) { ALOGD(" %s restarting pcm session on post SSR", __func__); in->standby = false; pthread_mutex_unlock(&in->lock); in_standby(&in->stream.common); pthread_mutex_lock(&in->lock); } } Loading Loading @@ -2162,13 +2147,12 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer, memset(buffer, 0, bytes); exit: /* ToDo: There may be a corner case when SSR happens back to back during start/stop. Need to post different error to handle that. */ if (-ENETRESET == ret) { pthread_mutex_lock(&adev->snd_card_status.lock); adev->snd_card_status.state = SND_CARD_STATE_OFFLINE; in->pcm_error_type = PCM_ERROR_ENETRESET; memset(buffer, 0, bytes); in->standby = true; /*standby will be called on post SSR */ pthread_mutex_unlock(&adev->snd_card_status.lock); } pthread_mutex_unlock(&in->lock); Loading hal/audio_hw.h +0 −8 Original line number Diff line number Diff line Loading @@ -132,12 +132,6 @@ enum { OFFLOAD_STATE_PAUSED, }; enum { PCM_ERROR_NONE, PCM_ERROR_EIO, PCM_ERROR_ENETRESET, //Send from pcm driver during SSR }; struct offload_cmd { struct listnode node; int cmd; Loading Loading @@ -178,7 +172,6 @@ struct stream_out { void *offload_cookie; struct compr_gapless_mdata gapless_mdata; int send_new_metadata; int pcm_error_type; struct audio_device *dev; }; Loading @@ -197,7 +190,6 @@ struct stream_in { bool enable_aec; bool enable_ns; audio_format_t format; int pcm_error_type; struct audio_device *dev; }; Loading Loading
hal/audio_hw.c +4 −20 Original line number Diff line number Diff line Loading @@ -884,7 +884,6 @@ int start_input_stream(struct stream_in *in) } break; } in->pcm_error_type = PCM_ERROR_NONE; ALOGV("%s: exit", __func__); return ret; Loading Loading @@ -1249,7 +1248,6 @@ int start_output_stream(struct stream_out *out) } break; } out->pcm_error_type = PCM_ERROR_NONE; } else { out->pcm = NULL; out->compr = compress_open(adev->snd_card, Loading Loading @@ -1697,12 +1695,6 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer, ALOGD(" %s: sound card is not active/SSR state", __func__); ret= -ENETRESET; goto exit; } else if (PCM_ERROR_ENETRESET == out->pcm_error_type) { ALOGD(" %s restarting pcm session on post SSR", __func__); out->standby = false; pthread_mutex_unlock(&out->lock); out_standby(&out->stream.common); pthread_mutex_lock(&out->lock); } } Loading Loading @@ -1756,12 +1748,11 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer, } exit: /* ToDo: There may be a corner case when SSR happens back to back during start/stop. Need to post different error to handle that. */ if (-ENETRESET == ret) { pthread_mutex_lock(&adev->snd_card_status.lock); adev->snd_card_status.state = SND_CARD_STATE_OFFLINE; out->pcm_error_type = PCM_ERROR_ENETRESET; out->standby = true; /*standby will be called on post SSR */ pthread_mutex_unlock(&adev->snd_card_status.lock); } Loading Loading @@ -2120,12 +2111,6 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer, ALOGD(" %s: sound card is not active/SSR state", __func__); ret= -ENETRESET; goto exit; } else if (PCM_ERROR_ENETRESET == in->pcm_error_type) { ALOGD(" %s restarting pcm session on post SSR", __func__); in->standby = false; pthread_mutex_unlock(&in->lock); in_standby(&in->stream.common); pthread_mutex_lock(&in->lock); } } Loading Loading @@ -2162,13 +2147,12 @@ static ssize_t in_read(struct audio_stream_in *stream, void *buffer, memset(buffer, 0, bytes); exit: /* ToDo: There may be a corner case when SSR happens back to back during start/stop. Need to post different error to handle that. */ if (-ENETRESET == ret) { pthread_mutex_lock(&adev->snd_card_status.lock); adev->snd_card_status.state = SND_CARD_STATE_OFFLINE; in->pcm_error_type = PCM_ERROR_ENETRESET; memset(buffer, 0, bytes); in->standby = true; /*standby will be called on post SSR */ pthread_mutex_unlock(&adev->snd_card_status.lock); } pthread_mutex_unlock(&in->lock); Loading
hal/audio_hw.h +0 −8 Original line number Diff line number Diff line Loading @@ -132,12 +132,6 @@ enum { OFFLOAD_STATE_PAUSED, }; enum { PCM_ERROR_NONE, PCM_ERROR_EIO, PCM_ERROR_ENETRESET, //Send from pcm driver during SSR }; struct offload_cmd { struct listnode node; int cmd; Loading Loading @@ -178,7 +172,6 @@ struct stream_out { void *offload_cookie; struct compr_gapless_mdata gapless_mdata; int send_new_metadata; int pcm_error_type; struct audio_device *dev; }; Loading @@ -197,7 +190,6 @@ struct stream_in { bool enable_aec; bool enable_ns; audio_format_t format; int pcm_error_type; struct audio_device *dev; }; Loading