diff options
| author | android-build-team Robot <android-build-team-robot@google.com> | 2020-06-10 01:04:27 +0000 |
|---|---|---|
| committer | android-build-team Robot <android-build-team-robot@google.com> | 2020-06-10 01:04:27 +0000 |
| commit | d3d59a00d861f9f7d014192ee7cd0d3e38df7ef5 (patch) | |
| tree | ff4aeaddaf4bc796b1422f76ed22cebcc729bddd | |
| parent | e573be93ee81d6ce04f266bd7198c80f3f2c29d4 (diff) | |
| parent | 7e30a80912f8a9b5f38b6f8a52cc62415edc7a76 (diff) | |
| download | platform_hardware_qcom_audio-android11-tests-release.tar.gz platform_hardware_qcom_audio-android11-tests-release.tar.bz2 platform_hardware_qcom_audio-android11-tests-release.zip | |
Snap for 6573866 from 7e30a80912f8a9b5f38b6f8a52cc62415edc7a76 to rvc-releaseandroid-vts-11.0_r5android-vts-11.0_r4android-vts-11.0_r3android-vts-11.0_r2android-vts-11.0_r1android-security-11.0.0_r1android-cts-11.0_r5android-cts-11.0_r4android-cts-11.0_r3android-cts-11.0_r2android-cts-11.0_r1android-11.0.0_r5android-11.0.0_r4android-11.0.0_r3android-11.0.0_r2android-11.0.0_r17android-11.0.0_r1android11-tests-releaseandroid11-security-releaseandroid11-release
Change-Id: I1f71b415c06f0c46eef88af3b0be7569e3a6fdbd
| -rw-r--r-- | hal/audio_hw.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c index 0f868ca..0f9dcf0 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -5002,6 +5002,30 @@ static void in_update_sink_metadata(struct audio_stream_in *stream, pthread_mutex_unlock(&in->lock); } +static int check_and_set_gapless_mode(struct audio_device *adev) +{ + bool gapless_enabled = false; + const char *mixer_ctl_name = "Compress Gapless Playback"; + struct mixer_ctl *ctl; + + ALOGV("%s:", __func__); + gapless_enabled = property_get_bool("vendor.audio.offload.gapless.enabled", false); + + ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name); + if (!ctl) { + ALOGE("%s: Could not get ctl for mixer cmd - %s", + __func__, mixer_ctl_name); + return -EINVAL; + } + + if (mixer_ctl_set_value(ctl, 0, gapless_enabled) < 0) { + ALOGE("%s: Could not set gapless mode %d", + __func__, gapless_enabled); + return -EINVAL; + } + return 0; +} + static int adev_open_output_stream(struct audio_hw_device *dev, audio_io_handle_t handle, audio_devices_t devices, @@ -5170,6 +5194,9 @@ static int adev_open_output_stream(struct audio_hw_device *dev, out->non_blocking = 1; out->send_new_metadata = 1; + + check_and_set_gapless_mode(adev); + create_offload_callback_thread(out); ALOGV("%s: offloaded output offload_info version %04x bit rate %d", __func__, config->offload_info.version, |
