wahoo: Add Moto Dolby support

Change-Id: I11e837a91e12bc52b102717d0c2f4cf62081b5f7

Signed-off-by: Pranav Vashi <neobuddy89@gmail.com>
Signed-off-by: Asriadi Rahim <asriadirahim03@gmail.com>
This commit is contained in:
Pranav Vashi
2024-01-20 17:50:25 +00:00
committed by Asriadi Rahim
parent f2a5ca22ad
commit b520e3ed96
19 changed files with 2213 additions and 0 deletions

View File

@@ -148,6 +148,7 @@ CHRE_DAEMON_ENABLED := true
CHRE_DAEMON_USE_SDSPRPC := true
# Audio
AUDIO_FEATURE_ENABLED_DS2_DOLBY_DAP := true
BOARD_USES_ALSA_AUDIO := true
AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS := true
AUDIO_FEATURE_ENABLED_SND_MONITOR := true

View File

@@ -59,6 +59,15 @@
<profile name="" format="AUDIO_FORMAT_AAC_HE_V2"
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
<profile name="" format="AUDIO_FORMAT_AC3"
samplingRates="32000,44100,48000"
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1"/>
<profile name="" format="AUDIO_FORMAT_E_AC3"
samplingRates="32000,44100,48000"
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
<profile name="" format="AUDIO_FORMAT_E_AC3_JOC"
samplingRates="32000,44100,48000"
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
</mixPort>
<mixPort name="voice_tx" role="source">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"

View File

@@ -59,6 +59,15 @@
<profile name="" format="AUDIO_FORMAT_AAC_HE_V2"
samplingRates="8000,11025,12000,16000,22050,24000,32000,44100,48000"
channelMasks="AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_MONO"/>
<profile name="" format="AUDIO_FORMAT_AC3"
samplingRates="32000,44100,48000"
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1"/>
<profile name="" format="AUDIO_FORMAT_E_AC3"
samplingRates="32000,44100,48000"
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
<profile name="" format="AUDIO_FORMAT_E_AC3_JOC"
samplingRates="32000,44100,48000"
channelMasks="AUDIO_CHANNEL_OUT_MONO,AUDIO_CHANNEL_OUT_STEREO,AUDIO_CHANNEL_OUT_2POINT1,AUDIO_CHANNEL_OUT_QUAD,AUDIO_CHANNEL_OUT_PENTA,AUDIO_CHANNEL_OUT_5POINT1,AUDIO_CHANNEL_OUT_6POINT1,AUDIO_CHANNEL_OUT_7POINT1"/>
</mixPort>
<mixPort name="voice_tx" role="source">
<profile name="" format="AUDIO_FORMAT_PCM_16_BIT"

View File

@@ -523,6 +523,16 @@ PRODUCT_PACKAGES += \
PRODUCT_PROPERTY_OVERRIDES += \
ro.fastbootd.available=true
# Dolby
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/dolby/dax-default.xml:$(TARGET_COPY_OUT_VENDOR)/etc/dolby/dax-default.xml
PRODUCT_PROPERTY_OVERRIDES += \
persist.vendor.audio_fx.current=dolby \
vendor.audio.dolby.ds2.enabled=true \
vendor.audio.dolby.ds2.hardbypass=true \
ro.vendor.dolby.dax.version=DAX3_3.6.0.12_r1
# Audio effects
PRODUCT_PACKAGES += \
@@ -595,6 +605,7 @@ PRODUCT_COPY_FILES += \
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
$(LOCAL_PATH)/media_codecs_dolby_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_dolby_audio.xml \
$(LOCAL_PATH)/media_codecs_performance.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_performance.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \

2077
dolby/dax-default.xml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -754,3 +754,7 @@ on property:sys.boot_completed=1
on property:vendor.fps.init.succeed=true && property:init.svc.vendor.fps_hal=stopped
start init-fingerprint-sh
# Dolby
mkdir /data/vendor/dolby 0770 media media
mkdir /data/vendor/multimedia 0775 system system

View File

@@ -306,4 +306,13 @@
<instance>cnd</instance>
</interface>
</hal>
<hal format="hidl">
<name>vendor.dolby.hardware.dms</name>
<transport>hwbinder</transport>
<version>2.0</version>
<interface>
<name>IDms</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@@ -349,4 +349,5 @@ Only the three quirks included above are recognized at this point:
<!-- Audio Software -->
</Decoders>
<Include href="media_codecs_google_video.xml" />
<Include href="media_codecs_dolby_audio.xml" />
</MediaCodecs>

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2016 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
This file was modified by Dolby Laboratories, Inc. The portions of the
code that are surrounded by "DOLBY..." are copyrighted and
licensed separately, as follows:
(C) 2018 Dolby Laboratories, Inc.
All rights reserved.
This program is protected under international and U.S. Copyright laws as
an unpublished work. This program is confidential and proprietary to the
copyright owners. Reproduction or disclosure, in whole or in part, or the
production of derivative works therefrom without the express permission of
the copyright owners is prohibited.
-->
<Included>
<Decoders>
<!-- DOLBY_UDC -->
<MediaCodec name="OMX.dolby.ac3.decoder" type="audio/ac3">
<Limit name="channel-count" max="6" />
<Limit name="sample-rate" ranges="32000,44100,48000" />
<Limit name="bitrate" range="32000-640000" />
</MediaCodec>
<MediaCodec name="OMX.dolby.eac3.decoder" type="audio/eac3">
<Limit name="channel-count" max="8" />
<Limit name="sample-rate" ranges="32000,44100,48000" />
<Limit name="bitrate" range="32000-6144000" />
</MediaCodec>
<MediaCodec name="OMX.dolby.eac3-joc.decoder" type="audio/eac3-joc">
<Limit name="channel-count" max="8" />
<Limit name="sample-rate" ranges="48000" />
<Limit name="bitrate" range="32000-6144000" />
</MediaCodec>
<!-- DOLBY_UDC END -->
<!-- DOLBY_AC4 -->
<MediaCodec name="OMX.dolby.ac4.decoder" type="audio/ac4">
<Limit name="channel-count" max="2" />
<Limit name="sample-rate" ranges="48000" />
<Limit name="bitrate" range="16000-2688000" />
</MediaCodec>
<!-- DOLBY_AC4 END -->
</Decoders>
</Included>

View File

@@ -282,6 +282,8 @@
<item>"/apex/com.android.art/javalib/core-oj.jar"</item>
<item>"/apex/com.android.art/javalib/core-libart.jar"</item>
<item>"/system_ext/priv-app/SystemUIGoogle/SystemUIGoogle.apk"</item>
<item>"/system_ext/priv-app/MotoDolbyDax3/MotoDolbyDax3.apk"</item>
<item>"/system_ext/priv-app/daxService/daxService.apk"</item>
<item>"/system/bin/surfaceflinger"</item>
</string-array>

View File

@@ -0,0 +1 @@
hal_attribute_lineage(dms)

View File

@@ -281,3 +281,7 @@
# b/70518189 vDSO experiments
/sys/module/vdso/parameters u:object_r:sysfs_vdso:s0
# Dolby
/data/vendor/dolby(/.*)? u:object_r:vendor_data_file:s0
/(vendor|system/vendor)/bin/hw/vendor\.dolby\.hardware\.dms@2\.0-service u:object_r:hal_dms_default_exec:s0

View File

@@ -8,3 +8,6 @@ hal_client_domain(hal_audio_default, hal_power)
userdebug_or_eng(`
allow hal_audio diag_device:chr_file rw_file_perms;
')
allow hal_audio_default hal_dms_hwservice:hwservice_manager find;
binder_call(hal_audio_default, hal_dms_default)

6
sepolicy/vendor/hal_dms.te vendored Normal file
View File

@@ -0,0 +1,6 @@
# HwBinder IPC from client to server, and callbacks
binder_call(hal_dms_client, hal_dms_server)
binder_call(hal_dms_server, hal_dms_client)
add_hwservice(hal_dms_server, hal_dms_hwservice)
allow hal_dms_client hal_dms_hwservice:hwservice_manager find;

11
sepolicy/vendor/hal_dms_default.te vendored Normal file
View File

@@ -0,0 +1,11 @@
type hal_dms_default, domain;
hal_server_domain(hal_dms_default, hal_dms)
type hal_dms_default_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(hal_dms_default)
allow hal_dms_default vendor_data_file:file { rw_file_perms create unlink };
allow hal_dms_default vendor_data_file:dir { rw_file_perms add_name remove_name };
binder_call(hal_dms_default, hal_audio_default)
binder_call(hal_dms_default, platform_app)
binder_call(hal_dms_default, mediacodec)

View File

@@ -4,3 +4,4 @@ type vnd_atcmdfwd_hwservice, hwservice_manager_type, vendor_hwservice_type;
type hal_imsrtp_hwservice, hwservice_manager_type, vendor_hwservice_type;
type nxpnfc_hwservice, hwservice_manager_type, vendor_hwservice_type;
type nxpese_hwservice, hwservice_manager_type, vendor_hwservice_type;
type hal_dms_hwservice, hwservice_manager_type;

View File

@@ -8,3 +8,4 @@ com.quicinc.cne.api::IApiService u:object_r:hal_c
com.quicinc.cne.server::IServer u:object_r:hal_cne_hwservice:s0
vendor.nxp.nxpnfc::INxpNfc u:object_r:nxpnfc_hwservice:s0
vendor.nxp.nxpese::INxpEse u:object_r:nxpese_hwservice:s0
vendor.dolby.hardware.dms::IDms u:object_r:hal_dms_hwservice:s0

View File

@@ -6,3 +6,6 @@ allow mediacodec system_file:dir r_dir_perms;
userdebug_or_eng(`
allow mediacodec dumpstate:fd use;
')
allow mediacodec hal_dms_hwservice:hwservice_manager find;
binder_call(mediacodec, hal_dms_default)

View File

@@ -0,0 +1,3 @@
allow platform_app hal_dms_hwservice:hwservice_manager find;
binder_call(platform_app, hal_dms_default)
get_prop(platform_app, audio_config_prop)