> ## 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.

# 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 Fluence 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-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/ecns_overview.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=290d397cd29b4522837f534e94019af8" 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, Fluence 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-prod/PyJ823JBh-_RDtS4/Technologies/Audio/media/qualcomm-linux-iot-audio-voice/fluence_recording.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=36a91f7f980e34a600bc86ab17276055" 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>

GainsSMECNSPostprocessing modulesQualcomm LPAISpeech + Noise + Echo inputClean speech output

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
   ```

### **Enable SMECNS for VoIP**

Fluence reduces noise and eliminates echo in VoIP communication. It also suppresses noise and acoustic echo on the microphone signal.

The SDK supports a PipeWire VoIP source and sink, which you can use when developing applications.

The following figure shows the flow of input speech to output speech when gains, Fluence, and postprocessing modules are applied for VoIP communication.

<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/voip_call_diagram.svg?fit=max&auto=format&n=PyJ823JBh-_RDtS4&q=85&s=bf695a1a648a55e28a2981b8bab4b55e" alt="SMECNS software block for VoIP" width="1003" height="635" data-path="Technologies/Audio/media/qualcomm-linux-iot-audio-voice/voip_call_diagram.svg" />

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

GainsGainsPostprocessing modulesFluenceGainsFluencePostprocessing modulesSpeech outputSpeech inputSpeakerQualcomm LPAITransmission pathReceiving path

SMECNS software block for VoIP

To enable the SMECNS in the VoIP path:

| **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. Set SELinux to permissive mode.
   ```text theme={null}
   setenforce 0
   ```
2. Start the audio daemon.
   ```text theme={null}
   adsprpcd audiopd &
   ```
3. List available audio 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
   ```
4. Set the default for the deep buffer node.
   ```text theme={null}
   wpctl set-default <NUMBER for deep-buffer>
   ```
5. Set the default for the low latency node.
   ```text theme={null}
   wpctl set-default <NUMBER for low-latency>
   ```
6. 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. Start low latency playback.
   ```text theme={null}
   pw-play --target=combined_output_ll /opt/clip1.wav -v
   ```
2. Start deep buffer playback.
   ```text theme={null}
   pw-play --target=combined_output_db /opt/clip2.wav -v
   ```

## **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
