Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d4cf3e1 authored by Derek Chen's avatar Derek Chen
Browse files

configs: add car audio configuration for multi-zone support

Add car audio configuration xml file including
    - Audio zones
    - Display to audio zone mappings
    - Context to audio bus mappings
    - Volume groups
Deprecate car volume groups overlay file.
Add rear seat zone as secondary zone in audio policy
configuration.

Change-Id: Ie7b8b1e6ee16b0cef8bdb48afed43faa729591f8
parent 4ab289fa
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@
                <item>Sys Notification Bus</item>
                <item>Nav Guidance Bus</item>
                <item>Phone Bus</item>
                <item>Rear Seat Bus</item>
                <item>Telephony Tx</item>
                <item>Built-In Mic</item>
                <item>Built-In Back Mic</item>
@@ -81,6 +82,10 @@
                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                </mixPort>
                <mixPort name="rear_seat" role="source">
                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                </mixPort>
                <mixPort name="primary output" role="source" flags="AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST">
                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
@@ -191,6 +196,15 @@
                                minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
                    </gains>
                </devicePort>
                <devicePort tagName="Rear Seat Bus" role="sink" type="AUDIO_DEVICE_OUT_BUS"
                        address="BUS08_REAR_SEAT">
                    <profile name="" format="AUDIO_FORMAT_PCM_16_BIT"
                             samplingRates="48000" channelMasks="AUDIO_CHANNEL_OUT_STEREO"/>
                    <gains>
                        <gain name="" mode="AUDIO_GAIN_MODE_JOINT"
                                minValueMB="-6000" maxValueMB="600" defaultValueMB="0" stepValueMB="100"/>
                    </gains>
                </devicePort>
                <devicePort tagName="Earpiece" type="AUDIO_DEVICE_OUT_EARPIECE" role="sink">
                </devicePort>
                <devicePort tagName="Speaker" type="AUDIO_DEVICE_OUT_SPEAKER" role="sink">
@@ -238,6 +252,8 @@
                       sources="nav_guidance"/>
                <route type="mix" sink="Phone Bus"
                       sources="phone"/>
                <route type="mix" sink="Rear Seat Bus"
                       sources="rear_seat"/>
                <route type="mix" sink="Earpiece"
                       sources="primary output,raw,deep_buffer,mmap_no_irq_out,voip_rx"/>
                <route type="mix" sink="Speaker"
+91 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
 * Copyright (c) 2019, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 */
-->
<!-- Copyright (C) 2018 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.
-->

<!--
  Defines the audio configuration in a car, including
    - Audio zones
    - Display to audio zone mappings
    - Context to audio bus mappings
    - Volume groups
  in the car environment.
-->
<carAudioConfiguration version="1">
    <zones>
        <zone name="primary zone" isPrimary="true">
            <volumeGroups>
                <group>
                    <device address="BUS00_MEDIA">
                        <context context="music"/>
                    </device>
                </group>
                <group>
                    <device address="BUS01_SYS_NOTIFICATION">
                        <context context="alarm"/>
                        <context context="notification"/>
                        <context context="system_sound"/>
                    </device>
                </group>
                <group>
                    <device address="BUS02_NAV_GUIDANCE">
                        <context context="navigation"/>
                        <context context="voice_command"/>
                    </device>
                </group>
                <group>
                    <device address="BUS03_PHONE">
                        <context context="call"/>
                        <context context="call_ring"/>
                    </device>
                </group>
            </volumeGroups>
            <displays>
                <display port="0"/>
            </displays>
            <!-- to specify displays associated with this audio zone, use the following tags
                <displays>
                    <display port="1"/>
                    <display port="2"/>
                </displays>
                where port is the physical port of the display (See DisplayAddress.Phyisical)
            -->
        </zone>
        <zone name="rear seat zone">
            <volumeGroups>
                <group>
                    <device address="BUS08_REAR_SEAT">
                        <context context="music"/>
                        <context context="navigation"/>
                        <context context="voice_command"/>
                        <context context="call_ring"/>
                        <context context="call"/>
                        <context context="alarm"/>
                        <context context="notification"/>
                        <context context="system_sound"/>
                    </device>
                </group>
            </volumeGroups>
            <displays>
                <display port="1"/>
            </displays>
        </zone>
    </zones>
</carAudioConfiguration>
+0 −57
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
     Not a Contribution.

     Copyright (C) 2018 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.
-->

<!--
  Defines the all available volume groups for volume control in a car.
  One can overlay this configuration to customize the groups.

  This configuration will be populated by CarAudioService and
  surfaced to Car Settings App and/or other volume control interfaces.

  Certain constraints applied to this configuration
    - One context should not appear in two groups
    - All contexts are assigned
    - One bus should not appear in two groups
    - All gain controllers (set on each bus) in one group have same step value

  It is fine that there are buses that do not appear in any group, those buses
  may be reserved for other usages.

  Important note: when overlaying this configuration,
  make sure the resources are in the same package as CarAudioService.
-->
<volumeGroups xmlns:car="http://schemas.android.com/apk/res-auto">
    <group>
        <context car:context="music"/>
    </group>
    <group>
        <context car:context="call"/>
        <context car:context="call_ring"/>
    </group>
    <group>
        <context car:context="alarm"/>
        <context car:context="notification"/>
        <context car:context="system_sound"/>
    </group>
    <group>
        <context car:context="navigation"/>
        <context car:context="voice_command"/>
    </group>
</volumeGroups>
+7 −0
Original line number Diff line number Diff line
@@ -102,6 +102,13 @@ outputs {
    bit_width 16
    app_type 69936
  }
  rear_seat {
    flags AUDIO_OUTPUT_FLAG_REAR_SEAT
    formats AUDIO_FORMAT_PCM_16_BIT
    sampling_rates 48000
    bit_width 16
    app_type 69936
  }
}

inputs {
+11 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
        <device name="SND_DEVICE_OUT_BUS_SYS" acdb_id="60"/>
        <device name="SND_DEVICE_OUT_BUS_NAV" acdb_id="14"/>
        <device name="SND_DEVICE_OUT_BUS_PHN" acdb_id="94"/>
        <device name="SND_DEVICE_OUT_BUS_RSE" acdb_id="60"/>
        <device name="SND_DEVICE_OUT_BT_SCO" acdb_id="94"/>
        <device name="SND_DEVICE_OUT_BT_SCO_WB" acdb_id="94"/>
        <device name="SND_DEVICE_OUT_BT_A2DP" acdb_id="60"/>
@@ -90,6 +91,11 @@
        <usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD6" type="out" id="23"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD7" type="out" id="24"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD8" type="out" id="25"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_MEDIA" type="out" id="0"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION" type="out" id="9"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_NAV_GUIDANCE" type="out" id="1"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_PHONE" type="out" id="12"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_REAR_SEAT" type="out" id="54"/>
        <usecase name="USECASE_VOICEMMODE1_CALL" type="in" id="2"/>
        <usecase name="USECASE_VOICEMMODE1_CALL" type="out" id="2"/>
        <usecase name="USECASE_VOICEMMODE2_CALL" type="in" id="15"/>
@@ -146,6 +152,11 @@
        <device name="SND_DEVICE_OUT_VOICE_SPEAKER" interface="TERT_TDM_RX_2"/>
        <device name="SND_DEVICE_OUT_VOICE_SPEAKER_HFP" interface="TERT_TDM_RX_2"/>
        <device name="SND_DEVICE_OUT_VOICE_SPEAKER_STEREO" interface="TERT_TDM_RX_2"/>
        <device name="SND_DEVICE_OUT_BUS_MEDIA" interface="TERT_TDM_RX_0"/>
        <device name="SND_DEVICE_OUT_BUS_SYS" interface="TERT_TDM_RX_0"/>
        <device name="SND_DEVICE_OUT_BUS_NAV" interface="TERT_TDM_RX_1"/>
        <device name="SND_DEVICE_OUT_BUS_PHN" interface="TERT_TDM_RX_2"/>
        <device name="SND_DEVICE_OUT_BUS_RSE" interface="QUAT_TDM_RX_0"/>
        <device name="SND_DEVICE_IN_HANDSET_MIC" interface="TERT_TDM_TX_0"/>
        <device name="SND_DEVICE_IN_SPEAKER_MIC" interface="TERT_TDM_TX_0"/>
        <device name="SND_DEVICE_IN_HEADSET_MIC" interface="TERT_TDM_TX_0"/>
Loading