# PAL configuration

Source: [https://docs.qualcomm.com/doc/80-70014-16/topic/pal_configuration.html](https://docs.qualcomm.com/doc/80-70014-16/topic/pal_configuration.html)

Audio use cases can be configured at the PAL level using the mixer\_paths,
        resourcemanager, and usecasekvmanager XML files.

## mixer\_paths XML

Mixer control is a control variable exposed from the ALSA mixer to the user space. It
                allows the user space to access set and get functions and pass parameters to the
                ALSA mixer.

For example, the following is the entry for enabling the mono speaker device in the
                    mixer\_path.xml. Whenever playback is triggered and the
                device selected is speaker, the following mixer controls will be fired with the help
                of the audio route helper
                class.

    <path name="speaker">
         <ctl name="SpkrLeft PA Volume" value="20" />
         <ctl name="WSA RX0 MUX" value="AIF1_PB" />
         <ctl name="WSA_RX0 INP0" value="RX0" />
         <ctl name="WSA_COMP1 Switch" value="1" />
         <ctl name="SpkrLeft WSA MODE" value="1" />
         <ctl name="SpkrLeft COMP Switch" value="1" />
         <ctl name="SpkrLeft BOOST Switch" value="1" />
         <ctl name="SpkrLeft DAC Switch" value="1" />
         <ctl name="SpkrLeft VISENSE Switch" value="1" />
         <ctl name="SpkrRight PA Volume" value="20" />
         <ctl name="WSA RX1 MUX" value="AIF1_PB" />
         <ctl name="WSA_RX1 INP0" value="RX1" />
         <ctl name="WSA_COMP2 Switch" value="1" />
         <ctl name="SpkrRight WSA MODE" value="1" />
         <ctl name="SpkrRight COMP Switch" value="1" />
         <ctl name="SpkrRight BOOST Switch" value="1" />
         <ctl name="SpkrRight DAC Switch" value="1" />
         <ctl name="SpkrRight VISENSE Switch" value="1" />
    </path>
    Copy to clipboard

The name of the mixer path used by the platform will generally be
                    mixer\_paths\_&lt;sound-card-name&gt;.xml and can be found at
                    /etc/ directory on the target.

For example, if the sound card name on the platform is
                    `qcm6490-rb3-snd-card`, then the mixer path file name will be
                    mixer\_paths\_qcm6490\_rb3.xml.

## Resourcemanager XML

This XML file includes all possible devices, use cases, and combinations. It also
                includes the various configurations, module parameters, and global parameters.

The following is an example for the entry of a speaker device in the resource manager
                XML file. It will have all the configurations for the speaker device such as
                back-end name, channels, sample-rate, bit-width,
                etc.

    out-device>
         <id>PAL_DEVICE_OUT_SPEAKER</id>
         <back_end_name>CODEC_DMA-LPAIF_WSA-RX-0</back_end_name>
         <max_channels>2</max_channels>
         <channels>2</channels>
         <samplerate>48000</samplerate>
         <bit_width>16</bit_width>
         <snd_device_name>speaker</snd_device_name>
    </out-device>
    Copy to clipboard

## Usecasekvmanager XML

This XML file contains the GKV details for each use case. PAL uses this XML file to
                retrieve the KV configuration for each use case and subsequently use that
                configuration to retrieve graph information from the ACDB files. This file is
                located at the  /etc path on the device.

The following is an example of one stream and device graph key vector
                configuration.

**Stream                KV**

    <stream type="PAL_STREAM_LOW_LATENCY">
         <keys_and_values Direction="RX" Instance="1">
         <!-- STREAMRX - PCM_LL_PLAYBACK -->
         <graph_kv key="0xA1000000" value="0xA100000E"/>
         <!-- INSTANCE - INSTANCE_1 -->
         <graph_kv key="0xAB000000" value="0x1"/>
    </keys_and_values>Copy to clipboard

**Device KV**

    <!-- Speaker Device -->
    <device id="PAL_DEVICE_OUT_SPEAKER">
         <keys_and_values>
         <!-- DEVICERX - SPEAKER -->
         <graph_kv key="0xA2000000" value="0xA2000001"/>
         </keys_and_values>
    </device>
    Copy to clipboard

**DevicePP                KV**

    <!-- OUT Speaker DevicePPs -->
    <devicepp id="PAL_DEVICE_OUT_SPEAKER">
    <keys_and_values StreamType="PAL_STREAM_COMPRESSED,PAL_STREAM_LOW_LATENCY">
         <!-- DEVICERX - SPEAKER -->
         <graph_kv key="0xA2000000" value="0xA2000001"/>
         <!-- DEVICEPP_RX - DEVICEPP_RX_AUDIO_MBDRC -->
         <graph_kv key="0xAC000000" value="0xAC000002"/>
    </keys_and_values>
    Copy to clipboard

**Parent Topic:** [Customize](https://docs.qualcomm.com/doc/80-70014-16/topic/customize.html)

Last Published: Jul 15, 2024

[Previous Topic
Sync and compile audio components](https://docs.qualcomm.com/bundle/publicresource/80-70014-16/topics/compile_audio_components.md) [Next Topic
Debug](https://docs.qualcomm.com/bundle/publicresource/80-70014-16/topics/debug.md)