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

# Audio

The IQ-9075 audio subsystem is powered by Low Power AI (LPAI) and delivers advanced voice UI and audio experiences via PipeWire.

## Key Features

* **Low Power AI (LPAI)** subsystem for efficient audio processing
* **PipeWire** multimedia server for low-latency audio routing
* **Hardware-accelerated** encoding/decoding
* **Fluence ECNS** — advanced echo cancellation and noise suppression
* **Multiple audio interfaces** — I2S, TDM, SoundWire

## Hardware Configuration

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/audio-components.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=18d211565b4e113db93f7a043f262186" width="1208" height="526" data-path="Ubuntu/images/peripheral-interfaces/audio-components.png" />

* **Speakers:** Onboard MAX98357 I2S amplifiers; connect the two supplied mini speakers to hear output. HS0\_MI2S is shared between left and right for stereo.
* **Microphone:** Single onboard microphone (MMICT5848) on HS2\_MI2S, configured to left channel by default

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/IQ9075_Audio_configuration_interface.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=6273361b2d2a6387b777ac4c6b867d11" width="1235" height="807" data-path="Ubuntu/images/peripheral-interfaces/IQ9075_Audio_configuration_interface.png" />

**Speaker connection:**

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/IQ9075_Audio_speakers_connection.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=2817d2b32c2ed9bbcccc7fbad03496fa" width="1078" height="412" data-path="Ubuntu/images/peripheral-interfaces/IQ9075_Audio_speakers_connection.png" />

**Microphone location:**

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/IQ9075_MIC.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=e67d71efb0128480bf0841ef94c8e167" width="798" height="727" data-path="Ubuntu/images/peripheral-interfaces/IQ9075_MIC.png" />

<img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/IQ9075_MIC_location_from_Top.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=a00b88ef0f4672f6b4484e12e8f80fff" width="361" height="167" data-path="Ubuntu/images/peripheral-interfaces/IQ9075_MIC_location_from_Top.png" />

## Architecture

<img src="https://mintcdn.com/qualcomm-prod/tRWO8v_Df_ujnDuD/Ubuntu/images/peripheral-interfaces/Audio_architecture.png?fit=max&auto=format&n=tRWO8v_Df_ujnDuD&q=85&s=ddb96acde9da3ddd6d888b47f259e2cb" width="1376" height="899" data-path="Ubuntu/images/peripheral-interfaces/Audio_architecture.png" />

| Component       | Description                                                                       |
| --------------- | --------------------------------------------------------------------------------- |
| **PipeWire**    | Multimedia server; replaces PulseAudio; low-latency, flexible media handling      |
| **WirePlumber** | Session/policy manager; handles default sink/source, auto-connect rules           |
| **PAL**         | Platform Abstraction Layer; provides audio-specific APIs and DSP graph operations |
| **AGM**         | Audio Graph Manager; ALSA-based mixer controls and PCM/compressed plug-ins        |
| **ARGS/GSL**    | AudioReach Graph Service; handles initialization and creation of audio graphs     |
| **SPF**         | Signal Processing Framework; modular framework on LPAI DSP                        |

## Configuration Files

| Component              | Location                            |
| ---------------------- | ----------------------------------- |
| ALSA card registration | `/proc/asound/cards`                |
| UCM2 profiles          | `/usr/share/alsa/ucm2/<card-name>/` |
| PipeWire config        | `/etc/pipewire/`                    |
| WirePlumber rules      | `/usr/share/wireplumber/`           |

### Verify Audio Stack

```bash theme={null}
cat /proc/asound/cards                                   # List registered ALSA sound cards
aplay -l                                                 # List playback (output) devices
arecord -l                                               # List capture (input) devices
systemctl --user status pipewire wireplumber --no-pager  # Confirm the audio services are active
wpctl status                                             # Show the default sink/source and routing
pw-top                                                   # Live view of the audio graph (Ctrl+C to exit)
pw-cli ls Node                                           # List PipeWire nodes
```

**Expected:** `/proc/asound/cards` lists at least one card, and `aplay -l` and `arecord -l` each show a device. For example:

```text theme={null}
 0 [<card-name>     ]: <driver> - <card description>
                       <card long name>

**** List of PLAYBACK Hardware Devices ****
card 0: <card-name> [<card description>], device 0: <pcm-name> []
  Subdevices: 1/1
```

`wpctl status` should list a default **Sink** and **Source** (each marked with `*`). If `/proc/asound/cards` is empty or `wpctl status` shows no default sink or source, the audio stack did not come up: see the Troubleshooting section below.

## Audio Playback and Capture

### PipeWire Playback

<Steps>
  <Step title="Push audio file to device">
    Copy a short test clip to the device so you have something to play. `test.wav` is any small PCM WAV file (48 kHz, 16-bit stereo works well): use one from the host, or create one with `ffmpeg -f lavfi -i "sine=frequency=440:duration=5" -ar 48000 -ac 2 test.wav`.

    ```bash theme={null}
    scp test.wav ubuntu@<ip-addr>:/home/ubuntu/
    ```
  </Step>

  <Step title="Set default sink and volume">
    ```bash theme={null}
    wpctl status   # Find sink node marked with *
    wpctl set-default <sink-node>   # If not already set
    wpctl set-volume @DEFAULT_AUDIO_SINK@ 1.0
    ```
  </Step>

  <Step title="Play audio">
    ```bash theme={null}
    pw-play /home/ubuntu/test.wav -v
    ```

    You should hear the clip play through the connected speakers, and `pw-play` prints a progress and peak-level readout while it runs:

    <img src="https://mintcdn.com/qualcomm-prod/P0rmO3AZfXx7cgqQ/Ubuntu/images/peripheral-interfaces/IQ9075_pipewire_playback.png?fit=max&auto=format&n=P0rmO3AZfXx7cgqQ&q=85&s=fe1c721bcf49aefb9e95837e8ee11b07" width="1078" height="743" data-path="Ubuntu/images/peripheral-interfaces/IQ9075_pipewire_playback.png" />

    Press `Ctrl+C` to stop.
  </Step>
</Steps>

### PipeWire Record

<Steps>
  <Step title="Set default source and volume">
    ```bash theme={null}
    wpctl status   # Find mic node marked with *
    wpctl set-default <mic-node>   # If not already set
    wpctl set-volume @DEFAULT_AUDIO_SOURCE@ 1.0
    ```
  </Step>

  <Step title="Start recording">
    ```bash theme={null}
    pw-record /home/ubuntu/record.wav -v
    ```

    Press `Ctrl+C` to stop.
  </Step>
</Steps>

<Note>
  A value of `1.0` represents 100% volume.
</Note>

### GStreamer Audio

<Tabs>
  <Tab title="Capture">
    ```bash theme={null}
    # PCM capture
    gst-launch-1.0 -v pulsesrc volume=10 ! audioconvert ! wavenc ! \
      filesink location=/home/ubuntu/audio.wav

    # FLAC capture
    gst-launch-1.0 -v pulsesrc volume=10 ! audioconvert ! flacenc ! \
      filesink location=/home/ubuntu/audio.flac
    ```
  </Tab>

  <Tab title="Playback">
    ```bash theme={null}
    # WAV playback
    gst-launch-1.0 -e filesrc location=/home/ubuntu/audio.wav ! \
      wavparse ! audioconvert ! pulsesink volume=10

    # MP3 playback
    gst-launch-1.0 -e filesrc location=/home/ubuntu/audio.mp3 ! \
      mpegaudioparse ! mpg123audiodec ! pulsesink volume=10

    # FLAC playback
    gst-launch-1.0 -e filesrc location=/home/ubuntu/audio.flac ! \
      flacparse ! flacdec ! pulsesink volume=10
    ```
  </Tab>
</Tabs>

## Log Capture

```bash theme={null}
# PipeWire logs
journalctl --user -u pipewire
journalctl --user -u wireplumber

# Live debugging
journalctl --user -u pipewire -f

# Kernel audio driver logs
sudo dmesg
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="No Audio Output During Playback">
    ```bash theme={null}
    wpctl status
    wpctl set-volume @DEFAULT_AUDIO_SINK@ 1.0
    systemctl --user restart wireplumber
    aplay -l
    ```

    * Verify speakers are connected properly
    * Increase volume if at 0%
    * Restart WirePlumber if PipeWire is not routing correctly
  </Accordion>

  <Accordion title="No Audio Capture from Microphone">
    ```bash theme={null}
    # Check ALSA capture devices
    arecord -l
    dmesg | grep -i "snd\|audio\|asoc"

    # Test raw ALSA recording (bypass PipeWire)
    arecord -D hw:0,0 -f S16_LE -r 48000 test.wav
    aplay test.wav

    # Check PipeWire capture nodes
    pw-cli ls Node | grep -i source

    # Check services
    systemctl --user status pipewire pipewire-pulse wireplumber
    ```

    If ALSA capture fails → kernel/DT is the first place to check.
  </Accordion>

  <Accordion title="Audio Playback Stuttering or Crackling">
    ```bash theme={null}
    # Check CPU load
    top

    # Check PAL media config (expect rate=48000, ch=2, fmt=2)
    grep "setDeviceMediaConfig" /var/log/syslog

    # Check for underruns
    dmesg | grep -i -e underrun -e xrun -e lpass -e audio

    # Check PipeWire quantum
    pw-metadata -n settings

    # Monitor real-time
    pw-top
    ```

    **Fix — increase PipeWire buffer:**

    ```bash theme={null}
    mkdir -p ~/.config/pipewire/pipewire.conf.d
    cat > ~/.config/pipewire/pipewire.conf.d/99-custom-buffer.conf << 'EOF'
    context.properties = {
        default.clock.quantum = 1024
        default.clock.min-quantum = 1024
    }
    EOF
    systemctl --user restart pipewire wireplumber
    ```

    **Fix — convert audio to 48 kHz 16-bit stereo:**

    ```bash theme={null}
    ffmpeg -i input.wav -ar 48000 -ac 2 -sample_fmt s16 output.wav
    ```
  </Accordion>

  <Accordion title="PipeWire Service Not Starting">
    ```bash theme={null}
    systemctl --user status pipewire pipewire-pulse wireplumber
    journalctl --user -u pipewire -u wireplumber -b

    # Reset configuration
    rm -rf ~/.config/pipewire ~/.config/wireplumber
    systemctl --user daemon-reload
    systemctl --user restart pipewire pipewire-pulse wireplumber

    # Reinstall if needed
    sudo apt install --reinstall pipewire wireplumber pipewire-pulse
    ```
  </Accordion>
</AccordionGroup>

## Advanced Features

### Echo Cancellation (ECNS) for VoIP

```bash theme={null}
# VoIP record
pw-record /home/ubuntu/record_voip.wav -v --target=voip-tx0

# VoIP playback
pw-play /home/ubuntu/record_voip.wav -v --target=voip-rx0
```

Features: adaptive echo cancellation, stationary and non-stationary noise suppression, acoustic echo path cancellation.

## Resources

* [PipeWire Documentation](https://docs.pipewire.org/)
* [AudioReach GitHub](https://github.com/audioreach)
* [AudioReach Documentation](https://audioreach.github.io/)
