# Convert audio HAL use cases into ALSA mixer controls

Source: [https://docs.qualcomm.com/doc/80-88500-3/topic/27_Convert_audio_HAL_use_cases_into_ALSA_mixer_controls.html](https://docs.qualcomm.com/doc/80-88500-3/topic/27_Convert_audio_HAL_use_cases_into_ALSA_mixer_controls.html)

The audio hardware abstraction layer (HAL) is leveraged from the Qualcomm Android
      platform. Using audio HAL uses the full audio function of the QRB5165 platform.

For the full list of audio HAL use cases, check the audio\_hw.c file in audio HAL. Translate audio HAL use cases into ALSA mixer controls by doing the following:

Sample settings for the USECASE\_AUDIO\_PLAYBACK\_LOW\_LATENCY use case are as follows:

1. Find use\_case\_table in the audio\_hw.c file to get the mixer path name low-latency-playback
2. Find low-latency-playback in mixer\_paths\_iot.xml,
3. Audio PCM data is sent from MultiMedia5 to WSA macro DMA.The mixer control sequence is `amixer cset "WSA_CDC_DMA_RX_0 Audio Mixer MultiMedia5" 1`.

For the complete list of audio devices, check the platform.h file in
      audio HAL. The sample settings with SND\_DEVICE\_OUT\_SPEAKER as the audio playback device are as
      follows:

1. Check device\_table in platform.c.
2. Find the mixer path name `speaker` in
          mixer\_paths\_iot.xml file. The following mixer control sequence is
        present in mixer\_paths\_iot.xmlfile.
    - For Linux Ubuntu:

        amixer cset "WSA_CDC_DMA_RX_0 Channels"  "Two"
        amixer cset "WSA RX0 MUX"  "AIF1_PB"
        amixer cset "WSA RX1 MUX"  "AIF1_PB"
        amixer cset "WSA_RX0 INP0"  "RX0"
        amixer cset "WSA_RX1 INP0"  "RX1"
        amixer cset "WSA_COMP1 Switch"  "1"
        amixer cset "WSA_COMP2 Switch"  "1"
        amixer cset "SpkrLeft COMP Switch"  "1"
        amixer cset "SpkrLeft BOOST Switch"  "1"
        amixer cset "SpkrLeft VISENSE Switch"  "1"
        amixer cset "SpkrLeft SWR DAC_Port Switch"  "1"
        amixer cset "SpkrRight COMP Switch"  "1"
        amixer cset "SpkrRight BOOST Switch"  "1"
        amixer cset "SpkrRight VISENSE Switch"  "1"
        amixer cset "SpkrRight SWR DAC_Port Switch"  "1"Copy to clipboard

    - For Linux Embedded, see [Playback over WSA stereo speaker](https://docs.qualcomm.com/doc/80-88500-3/topic/22_Playback_over_WSA_stereo_speaker.html).
3. Enter the preceding command sequence to select the audio path.

To decide the device node to be selected under `/dev/snd` to represent MultiMedia5, do the following:

1. Check USECASE\_AUDIO\_PLAYBACK\_LOW\_LATENCY in the audio\_platform\_info\_iot.xml file under the pcm\_ids.xml tag.
2. Select the /dev/snd/pcmC0D9p device node that represents MultiMedia5.

**Parent Topic:** [Configure audio settings](https://docs.qualcomm.com/doc/80-88500-3/topic/18_Configure_audio_settings.html)

Last Published: Sep 26, 2023

[Previous Topic
Configure mixer settings for audio capture](https://docs.qualcomm.com/bundle/publicresource/80-88500-3/topics/25_Configure_mixer_settings_for_audio_capture.md) [Next Topic
Multimedia use cases](https://docs.qualcomm.com/bundle/publicresource/80-88500-3/topics/28_Multimedia_use_cases.md)