> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Enable audio

> Configure audio hardware and verify basic playback and capture use cases on Qualcomm Linux platforms.

This section shows how to configure hardware for microphone and speaker connections and gives steps to verify basic audio use cases.

## **Hardware setup**

<Tabs>
  <Tab title="QCS6490">
    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/getting-started-flow.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=cd5f377bd80e68cccb513baaaf6fb376" alt="Setup Flow" width="954" height="269" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/getting-started-flow.svg" />

      <p className="text-sm text-gray-700">
        Setup Flow
      </p>
    </div>

    **Prerequisites**

    * Set up your infrastructure as described in the [Qualcomm Linux Build Guide](https://dragonwingdocs.qualcomm.com/Key-Documents/Flash-Guide/obtain-prebuilts)
    * Flash the latest software release to the development board.
    * Set up an SSH connection:
      1. Enable SSH in Permissive mode. For instructions, see [Use SSH](https://docs.qualcomm.com/doc/80-80021-254/topic/how_to.html#use-ssh).
      2. Connect to the device by running the following command:
         ```text theme={null}
         ssh root@<device_IP_address>
         ```
         For example, if the IP address of the device is 10.92.160.222, run the following command:
         ```text theme={null}
         ssh root@10.92.160.222
         ```

    **Set up audio hardware**

    1. To activate the digital microphone interface (DMIC) on the board, use DIP Switch PIN 2 to the ON position.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/dip_pin2_on.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=a2ef8da0ccab017e3a8ee54cb1412f6f" alt="Setup Flow" width="616" height="368" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/dip_pin2_on.svg" />

      <p className="text-sm text-gray-700">
        Setup Flow
      </p>
    </div>

    2. Connect the speaker to the board as follows.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/connect_speakers_6490.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=e99313584379e2cf53422fcb60309b84" alt="Setup Flow" width="272" height="417" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/connect_speakers_6490.svg" />

      <p className="text-sm text-gray-700">
        Setup Flow
      </p>
    </div>
  </Tab>

  <Tab title="IQ-9075">
    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/getting-started-flow.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=cd5f377bd80e68cccb513baaaf6fb376" alt="Setup Flow" width="954" height="269" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/getting-started-flow.svg" />

      <p className="text-sm text-gray-700">
        Setup Flow
      </p>
    </div>

    **Prerequisites**

    * Set up your infrastructure as described in the [Qualcomm Linux Build Guide](https://dragonwingdocs.qualcomm.com/Key-Documents/Flash-Guide/obtain-prebuilts)
    * Flash the latest software release to the development board.
    * Set up an SSH connection:
      1. Enable SSH in Permissive mode. For instructions, see [Use SSH](https://docs.qualcomm.com/doc/80-80021-254/topic/how_to.html#use-ssh)
      2. Connect to the device by running the following command:
         ```text theme={null}
         ssh root@<device_IP_address>
         ```
         For example, if the IP address of the device is 10.92.160.222, run the following command:
         ```text theme={null}
         ssh root@10.92.160.222
         ```

    **Set up audio hardware**

    Connect the speaker to the board as follows.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/connect-speakers-9075.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=beb65cacd87569f24a61ad3977464d7a" alt="Setup Flow" width="617" height="369" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/connect-speakers-9075.svg" />

      <p className="text-sm text-gray-700">
        Setup Flow
      </p>
    </div>

    <Note>
      EVT boards need hardware rework for audio functions to work.
    </Note>
  </Tab>

  <Tab title="IQ-8275">
    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/getting-started-flow.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=cd5f377bd80e68cccb513baaaf6fb376" alt="Setup Flow" width="954" height="269" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/getting-started-flow.svg" />

      <p className="text-sm text-gray-700">
        Setup Flow
      </p>
    </div>

    **Prerequisites**

    * Set up your infrastructure as described in the [Qualcomm Linux Build Guide](https://dragonwingdocs.qualcomm.com/Key-Documents/Flash-Guide/obtain-prebuilts)
    * Flash the latest software release to the development board.
    * Set up an SSH connection.
      1. Enable SSH in Permissive mode. For instructions, see [Use SSH](https://docs.qualcomm.com/doc/80-80021-254/topic/how_to.html#use-ssh)
      2. Connect to the device by running the following command:
         ```text theme={null}
         ssh root@<device_IP_address>
         ```
         For example, if the IP address of the device is 10.92.160.222, run the following command:
         ```text theme={null}
         ssh root@10.92.160.222
         ```

    **Set up audio hardware**

    Connect the speaker to the board as follows.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/playback_connection.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=fb5122928cf62f3c69355110083ee0d2" alt="Setup Flow" width="792" height="386" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/playback_connection.svg" />

      <p className="text-sm text-gray-700">
        Setup Flow
      </p>
    </div>

    \\
  </Tab>

  <Tab title="QCS615">
    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/getting-started-flow.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=cd5f377bd80e68cccb513baaaf6fb376" alt="Setup Flow" width="954" height="269" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/getting-started-flow.svg" />

      <p className="text-sm text-gray-700">
        Setup Flow
      </p>
    </div>

    **Prerequisites**

    * Set up your infrastructure as described in the [Qualcomm Linux Build Guide](https://dragonwingdocs.qualcomm.com/Key-Documents/Flash-Guide/obtain-prebuilts)
    * Flash the latest software release to the development board.
    * Set up an SSH connection:
      1. Enable SSH in Permissive mode. For instructions, see [Use SSH](https://docs.qualcomm.com/doc/80-80021-254/topic/how_to.html#use-ssh).
      2. Connect to the device by running the following command:
         ```text theme={null}
         ssh root@<device_IP_address>
         ```
         For example, if the IP address of the device is 10.92.160.222, run the following command:
         ```text theme={null}
         ssh root@10.92.160.222
         ```

    **Set up audio hardware**

    1. Connect the audio hardware to the board as follows.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/615-hw-connections.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=ce093cd1dfae29a299bae34fc0e4d3cb" alt="Setup Flow" width="832" height="556" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/615-hw-connections.svg" />

      <p className="text-sm text-gray-700">
        Setup Flow
      </p>
    </div>

    2. Connect the 3.5 mm headset to the board as follows.

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/615-headset-connection.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=fe246520387f58cf1059ae222a6165c5" alt="Setup Flow" width="637" height="568" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/615-headset-connection.svg" />

      <p className="text-sm text-gray-700">
        Setup Flow
      </p>
    </div>

    3. Connect WiFi as follows. Ensure that:
       * SW 12 is set to OFF
       * SW 14 is set to ON

    <div className="flex flex-col items-center gap-2">
      <img src="https://mintcdn.com/qualcomm-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/615-wifi-setup.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=bf7be4fe427b635c6e22fddaa2383fef" alt="Setup Flow" width="505" height="442" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/615-wifi-setup.svg" />

      <p className="text-sm text-gray-700">
        Setup Flow
      </p>
    </div>
  </Tab>
</Tabs>

## **Enable audio with GStreamer**

To decode audio using GStreamer apps, see the following.

* [Audio decode example](https://docs.qualcomm.com/doc/80-80021-50/topic/gst-audio-decode-sample.html)

To encode audio using GStreamer apps, use the following instructions.

* Set the default input device for PipeWire.
  Use the `wpctl status` command to list available nodes. Run `wpctl set-default` to set the source node to the handset mic.
  ```text theme={null}
  systemctl stop pipewire wireplumber pipewire.socket pipewire-manager.socket
  ```
  ```text theme={null}
  chmod 777 /dev/dma_heap/system
  ```
  ```text theme={null}
  systemctl start pipewire wireplumber
  ```
  ```text theme={null}
  wpctl status
  ```
  ```text theme={null}
  wpctl set-default <sink/source node ID>
  ```
* [Audio encode example](https://docs.qualcomm.com/doc/80-80021-50/topic/gst-audio-encode-example-without-flac.html)

<Note>
  To check the GStreamer app for different chipsets, see [Source information for multimedia sample applications](https://docs.qualcomm.com/doc/80-80021-50/topic/example-applications.html#multimedia-sample-applications).
</Note>

GStreamer is an open source multimedia framework. Qualcomm provides GStreamer plug-ins as part of the Qualcomm IM SDK.

### **GStreamer plug-ins**

* GStreamer plug-ins for audio decoder and encoder are part of Qualcomm IM SDK. Download the entire Qualcomm IM SDK to use [pulsesrc](https://docs.qualcomm.com/doc/80-80021-50/topic/pulsesrc.html) and [pulsesink](https://docs.qualcomm.com/doc/80-80021-50/topic/pulsesink.html).
* The [Qualcomm IM SDK Quick Start Guide](https://docs.qualcomm.com/doc/80-80021-51/topic/introduction.html) describes how to download and build the Qualcomm IM SDK.

### **GStreamer sample apps**

[Sample GStreamer apps for audio](https://docs.qualcomm.com/doc/80-80021-50/topic/audio-sample-applications.html) use cases are part of the Qualcomm IM SDK. Before running sample apps, meet these [prerequisites](https://docs.qualcomm.com/doc/80-80021-50/topic/mm_sample_apps_prerequisites.html).

Run audio use cases with either command line or the GST app.

#### **Play and record audio with the GStreamer app**

Use the reference GST commands mentioned in [audio playback/capture](https://docs.qualcomm.com/doc/80-80021-50/topic/audio-use-cases.html).

## **Enable audio with PipeWire**

PipeWire is a graph-based processing framework that handles multimedia data. Find the source code for PipeWire at `build-qcom-wayland/workspace/sources/pipewire`.

For more information, see the [PipeWire open source documentation](https://docs.pipewire.org/page_api.html) for detailed APIs available.

<Note>
  The `pw-play` and `pw-record` utilities in this guide demonstrate .wav file usage. PipeWire as a framework supports additional formats depending on available codecs and plugins.
</Note>

### **PipeWire record**

1. Set up PipeWire recording:
   Use the `wpctl status` command to list available nodes. Run `wpctl set-default` to set the source node to the handset mic.
   ```text theme={null}
   systemctl stop pipewire wireplumber pipewire.socket pipewire-manager.socket
   ```
   ```text theme={null}
   chmod 777 /dev/dma_heap/system
   ```
   ```text theme={null}
   systemctl start pipewire wireplumber
   ```
   ```text theme={null}
   wpctl status
   ```
   ```text theme={null}
   wpctl set-default <sink/source node ID>
   ```
   ```text theme={null}
   pw-record --rate=48000 --format=s16 --channels=2 /opt/test.wav -v
   ```
   The command shell should resemble the following:
2. Select **Ctrl + C** to stop the recording.
   Supported formats are s16le, s24le, s32le, rate can be 8000, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, 176400, 192000, 352800, 384000, 705600, and 768000, and channels can range from 1 to a maximum of 8.

### **Volume settings for recording**

1. Start audio capture using the `pw-record` utility.
2. Open a new command prompt in parallel. Open `ssh root@ip-addr` and run the following command to set the volume level:
   ```text theme={null}
   wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 0.8
   ```
   In the above command, a value of 0.8 represents 80% volume. Adjust this value according to the desired volume level.

### **PipeWire playback**

1. Push the .wav audio file to the device for playback:
   ```text theme={null}
   scp test.wav root@[ip-addr]:/opt/
   ```
2. After pushing the test.wav file, enter the device shell using `ssh root@ip-addr`.
3. Set the default sink mode for playback using the below command and choose between two sink modes: one for low latency (LL) and another for deep buffer (DB).
   ```text theme={null}
   systemctl stop pipewire wireplumber pipewire.socket pipewire-manager.socket
   ```
   ```text theme={null}
   chmod 777 /dev/dma_heap/system
   ```
   ```text theme={null}
   systemctl start pipewire wireplumber
   ```
   ```text theme={null}
   wpctl status
   ```
   ```text theme={null}
   wpctl set-default <sink/source node ID>
   ```
4. Use the following command to start playback:
   ```text theme={null}
   pw-play /opt/test.wav -v
   ```
   The command shell should resemble the following:

### **Volume settings for playback**

1. Start audio playback on the speakers using the `pw-play` utility.
2. Open a new command prompt in parallel. Open `ssh root@ip-addr` and run the following commands to set the volume level:
   ```text theme={null}
   wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.8
   ```
   In the above command, a value of 0.8 represents 80% volume. Adjust this value according to the desired volume level.

## **Next steps**

* [Customize audio graph](customize-audio-graph) — Customize audio use cases at the PAL level
* [Advanced audio features](advanced-audio-features) — Enable echo cancellation, noise suppression, and multi-device playback
* [Audio Addendum](../audio-addendum-overview) — Use QACT and QXDM for calibration and diagnostics
* [Troubleshoot audio](troubleshoot-audio) — Capture and analyze audio logs to resolve issues
