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

# Advanced audio features

> Enable advanced audio features including echo cancellation, noise suppression, VoIP, and multi-device playback.

## **Minimize echo and noise**

Echo and noise problems are common in VoIP systems. Speech comes from the far-end speaker and echoes back with a time delay, causing perception problems. Echo cancellation decreases the echo from the far-end speaker during communication. Noise suppression decreases the noise from the microphone channel. The SMECNS echo cancellation and noise suppression (ECNS) algorithm provides stationary and nonstationary noise suppression and echo cancellation.

Acoustic echo is when echoes occur due to the acoustic path (acoustic coupling) between the loudspeaker and microphone of a device. It is important for hands-free and teleconferencing applications.

The following figure shows the acoustic echo path and how acoustic echo occurs between loudspeakers and microphones.

<div className="flex flex-col items-center gap-2">
  <img src="https://mintcdn.com/qualcomm-3/gHCjmHHn0mCw4aoT/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/ecns_overview.svg?fit=max&auto=format&n=gHCjmHHn0mCw4aoT&q=85&s=a4204c9f07ebe588146497daac8b4f2f" alt="Noise and acoustic echo" width="793" height="408" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/ecns_overview.svg" />

  <p className="text-sm text-gray-700">
    Noise and acoustic echo
  </p>
</div>

Near-end speech signalFar-end speech signalNear-end speakerEnvironmental noiseAcoustic echo pathAcoustic echoNear-end speechFar-end speech

Noise and acoustic echo

* **Echo Canceller** – An adaptive filter that self-adjusts coefficients to cancel out echo. Every echo has an echo path, and is characterized by an impulse response. The echo canceller adapts to the network echo path such that it cancels out the echo.
* **Noise Suppression** – Single mic echo canceller and noise suppressor (SMECNS) helps to suppress the surrounding stationary noise when using devices in noisy locations.

### **Enable SMECNS for recording**

When recording, SMECNS keeps speech quality in the recording path by suppressing background noise captured by the microphone.

For single-microphone recordings, only stationary noise suppression is possible. Stationary noise is where the frequency does not change over time, for example, road noise or white noise.

The following figure shows how gains, SMECNS, and postprocessing modules are used to remove outside noise and echo to output clean speech.

<div className="flex flex-col items-center gap-2">
  <img src="https://mintcdn.com/qualcomm-3/gHCjmHHn0mCw4aoT/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/fluence_recording.svg?fit=max&auto=format&n=gHCjmHHn0mCw4aoT&q=85&s=707622ca795f4328e1d16227cfd3414a" alt="SMECNS software block for recording" width="1213" height="379" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/fluence_recording.svg" />

  <p className="text-sm text-gray-700">
    SMECNS software block for recording
  </p>
</div>

SMECNS software block for recording

To enable the SMECNS in the recording path:

1. Use the `wpctl status` command to list available nodes.
   ```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
   ```
2. Run `wpctl set-default` to set the source node to the handset mic.
   ```text theme={null}
   wpctl set-default <sink/source node ID>
   ```
3. Run `pw-record` to start recording. The following example runs in verbose mode and saves the recording to `/opt/test.wav`.
   ```text theme={null}
   pw-record /opt/test.wav -v
   ```

### **Simulate VoIP**

To simulate VoIP using PipeWire:

| **Set record source** |    |
| :-------------------- | :- |

```text theme={null}
pw-record /opt/record_voip.wav -v --target=voip-tx0
```

| **Set playback sink** |    |
| :-------------------- | :- |

```text theme={null}
pw-play /opt/test.wav -v --target=voip-rx0
```

<Note>
  Be sure to push a PCM file (`<FileName>.wav`) to the `/opt/` folder.
</Note>

### **Enable single stream multiple device playback**

Configure the platform to render a single audio stream simultaneously on multiple output devices, such as a built-in speaker and a wired headset. In this mode, the audio is duplicated and the same decoded audio stream is routed to multiple active output devices concurrently, ensuring synchronized playback across all selected endpoints.

1. List available audio nodes.

   ```text theme={null}
   wpctl status
   ```

<div className="flex flex-col items-center gap-2">
  <img src="https://mintcdn.com/qualcomm-3/gHCjmHHn0mCw4aoT/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/wpctl_status.png?fit=max&auto=format&n=gHCjmHHn0mCw4aoT&q=85&s=3d71f091cbb0d36a9a57e0f752a17b00" alt="wpctl status output showing available PAL sink and source nodes" width="803" height="672" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/wpctl_status.png" />

  <p className="text-sm text-gray-700">
    wpctl status output showing available PAL sink and source nodes
  </p>
</div>

2. Set the default node.

   ```text theme={null}
   wpctl set-default <NUMBER for low-latency>
   ```

   * For Low Latency, choose the node with `pal sink combined speaker and headset ll`.
   * For Deep buffer, choose the node with `pal sink combined speaker and headset db`.

3. Start playback.

   ```text theme={null}
   pw-play /tmp/yesterday_48KHz.wav -v
   ```

### **Enable multiple stream multiple device playback**

Configure the platform to render multiple independent audio streams simultaneously on different output devices, such as a built-in speaker and a wired headset. In this mode, each audio stream is managed and routed independently, allowing distinct streams to be delivered concurrently to separate output devices without interference. This enables use cases such as parallel media playback and notification routing across multiple endpoints.

1. List available audio nodes.

   ```text theme={null}
   pw-cli ls Node
   ```

2. Select the audio nodes where you want your multiple streams to play and specify those node names using the `--target` command-line option.

3. Start low latency playback.

   ```text theme={null}
   pw-play --target=pal_sink_speaker_ll /opt/clip1.wav -v
   ```

   ```text theme={null}
   pw-play --target=pal_sink_headset_ll /opt/clip2.wav -v
   ```

### **Dynamic device switch using PipeWire**

Use `wpctl` to trigger a dynamic device switch while audio is active.

1. List all available audio nodes.

   ```text theme={null}
   wpctl status
   ```

2. Start playback on the default device (for example, speaker).

   ```text theme={null}
   pw-play /opt/test.wav -v
   ```

3. While playback is active, switch to a different output device (for example, headset) by setting a new default sink.

   ```text theme={null}
   wpctl set-default <headset sink node ID>
   ```

   WirePlumber re-routes the stream and PAL performs the device switch seamlessly.

## **Enable DP and HDMI audio**

This section applies to QCS6490 (Kodiak) and IQ-9075 (Lemans) platforms (config1).

### **Set up QCS6490 (rb3-gen2-core-kit)**

1. Copy the topology binary to the firmware path.

   ```text theme={null}
   cp \\sphere\CasaBuilds\QLI\Topology\QCS6490\QCS6490-RB3Gen2-tplg.bin /lib/firmware/qcom/qcs6490/
   ```

2. Copy the HiFi configuration file.

   ```text theme={null}
   cp \\sphere\CasaBuilds\QLI\Topology\QCS6490\HiFi.conf.kodiak /usr/share/alsa/ucm2/Qualcomm/qcs6490/QCS6490-RB3Gen2/HiFi.conf
   ```

3. Copy the HDMI format configuration file.

   ```text theme={null}
   cp \\sphere\CasaBuilds\QLI\Topology\QCS6490\51-hdmi-format.conf /usr/share/wireplumber.conf.d/51-hdmi-format.conf
   ```

4. Reboot the device. On boot, ensure DP is connected (typeC to HDMI female + HDMI to HDMI cable).

   ```text theme={null}
   reboot
   ```

**HDMI and DP audio playback (QCS6490)**

| HDMI audio playback                                                               | DP audio playback                                                                 |
| :-------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- |
| `amixer -c 0 cset iface=MIXER,name='SECONDARY_MI2S_RX Audio Mixer MultiMedia3' 1` | `amixer -c 0 cset iface=MIXER,name='DISPLAY_PORT_RX_0 Audio Mixer MultiMedia4' 1` |
| `aplay -D plughw:0,2 /home/test.wav`                                              | `aplay -D plughw:0,3 /home/test.wav`                                              |
| `wpctl set-default <node>`                                                        | `wpctl set-default <node>`                                                        |
| `pw-play -v /home/test.wav`                                                       | `pw-play -v /home/test.wav`                                                       |

### **Set up IQ-9075 (iq-9075-evk)**

1. Copy the topology binary to the firmware path.

   ```text theme={null}
   cp \\sphere\CasaBuilds\QLI\Topology\IQ-9075\LEMANS-EVK-tplg.bin /lib/firmware/qcom/sa8775p/
   ```

2. Copy the HiFi configuration file.

   ```text theme={null}
   cp \\sphere\CasaBuilds\QLI\Topology\IQ-9075\HiFi.conf.lemans /usr/share/alsa/ucm2/Qualcomm/sa8775p/lemans-evk/HiFi.conf
   ```

3. Reboot the device. On boot, ensure DP is connected (eDP to DP cable).

   ```text theme={null}
   reboot
   ```

**DP audio playback (IQ-9075)**

| DP audio playback                                                                 |
| :-------------------------------------------------------------------------------- |
| `amixer -c 0 cset iface=MIXER,name='DISPLAY_PORT_RX_0 Audio Mixer MultiMedia3' 1` |
| `aplay -D plughw:0,2 /home/test.wav`                                              |
| `wpctl set-default <node>`                                                        |
| `pw-play -v /home/test.wav`                                                       |

## **Next steps**

* [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
* [Customize audio graph](customize-audio-graph) — Modify audio graphs and PAL configuration
