summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTreehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com>2023-05-03 20:20:58 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-05-03 20:20:58 +0000
commitb1bcb3eef2bbee10550ec931985685bc2e67274f (patch)
tree245dbc4eb2a618831b0a051c92c9cd948f2dcca1 /modules
parenta90666e9dac385e13ccb4c212fd2fcc86460b93b (diff)
parent90076fb0a6a994af01e00dbc1e0750edeeb05a79 (diff)
downloadlibhardware-b1bcb3eef2bbee10550ec931985685bc2e67274f.tar.gz
Merge changes I89798eee,Ic3dbab31 am: 14f321f5a7 am: d71f056272 am: 90076fb0a6
Original change: https://android-review.googlesource.com/c/platform/hardware/libhardware/+/2550090 Change-Id: Icfbcc7e323131433f181843f46e2a1de65947f15 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/usbaudio/audio_hal.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/modules/usbaudio/audio_hal.c b/modules/usbaudio/audio_hal.c
index 43f8d240..16065e22 100644
--- a/modules/usbaudio/audio_hal.c
+++ b/modules/usbaudio/audio_hal.c
@@ -809,6 +809,8 @@ static int start_output_stream(struct stream_out *out)
ALOGE("%s failed to open device(card: %d device: %d)",
__func__, device_info->profile.card, device_info->profile.device);
goto exit;
+ } else {
+ out->standby = false;
}
}
@@ -835,7 +837,6 @@ static ssize_t out_write(struct audio_stream_out *stream, const void* buffer, si
if (ret != 0) {
goto err;
}
- out->standby = false;
}
struct listnode* node;
@@ -1262,7 +1263,7 @@ static int in_set_gain(struct audio_stream_in *stream, float gain)
return 0;
}
-/* must be called with hw device and output stream mutexes locked */
+/* must be called with hw device and input stream mutexes locked */
static int start_input_stream(struct stream_in *in)
{
// Only care about the first device as only one input device is allowed.
@@ -1273,7 +1274,11 @@ static int start_input_stream(struct stream_in *in)
ALOGV("start_input_stream(card:%d device:%d)",
device_info->profile.card, device_info->profile.device);
- return proxy_open(&device_info->proxy);
+ int ret = proxy_open(&device_info->proxy);
+ if (ret == 0) {
+ in->standby = false;
+ }
+ return ret;
}
/* TODO mutex stuff here (see out_write) */
@@ -1292,7 +1297,6 @@ static ssize_t in_read(struct audio_stream_in *stream, void* buffer, size_t byte
if (ret != 0) {
goto err;
}
- in->standby = false;
}
// Only care about the first device as only one input device is allowed.
@@ -1856,15 +1860,9 @@ static int adev_create_audio_patch(struct audio_hw_device *dev,
device_lock(adev);
if (in != NULL) {
ret = start_input_stream(in);
- if (!ret) {
- in->standby = false;
- }
}
if (out != NULL) {
ret = start_output_stream(out);
- if (!ret) {
- out->standby = false;
- }
}
device_unlock(adev);
}