---
agent:
  instructions: "Use this search API to find relevant content across this site (products with prices and stock, collections, guides, articles, courses, help and pages) with keywords or natural-language queries, instead of crawling individual pages. Replace {query} with your URL-encoded query. Results are returned in Markdown."
  endpoint: "https://piaustralia.com.au/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Sound on a Raspberry Pi

The ways to get sound out of a Raspberry Pi (headphone jack, HDMI, USB and I2S DAC HATs), which boards have which, and how to pick the output in Raspberry Pi OS from the desktop or the command line.

## Your options

| Output | What you need | Good for |
|---|---|---|
| **Headphone jack** | Only on some boards (see below) | Quick tests, alerts, speech |
| **HDMI** | A TV or monitor with speakers | Media players, desktops |
| **USB audio** | A USB sound card, headset or speaker | Any board, and the easy fix for a Pi 5 |
| **I2S DAC HAT** | A HAT on the GPIO header | Hi-fi players, amplifiers, line out to a stereo |
| **Bluetooth** | A Bluetooth speaker or headphones | No cables, on boards with Bluetooth |

## Which boards have a headphone jack

| Board | 3.5 mm jack | HDMI |
|---|---|---|
| Raspberry Pi 5 | **No** | 2 × micro-HDMI |
| Raspberry Pi 500 and 400 | No | 2 × micro-HDMI |
| Raspberry Pi 4 | Yes (also carries composite video) | 2 × micro-HDMI |
| Raspberry Pi 3B, 3B+, 3A+ | Yes (also carries composite video) | 1 × full-size HDMI |
| Raspberry Pi Zero, Zero W, Zero 2 W | No | 1 × mini-HDMI |

The **Raspberry Pi 5 has no headphone jack** at all. For sound from a Pi 5, use HDMI, a USB audio device, a DAC HAT or Bluetooth.

Where there is a jack, its output is basic. It's fine for speech, beeps and testing, but a USB sound card or a DAC HAT sounds noticeably cleaner.

## HDMI audio

Raspberry Pi OS sends sound to the first HDMI display by default, so a TV or monitor with speakers usually just works. If nothing's plugged into HDMI, it falls back to the headphone jack or a USB audio device.

Boards with two HDMI ports (Pi 4, Pi 5, Pi 400 and Pi 500) treat each port as a separate audio output, so make sure you've picked the one your speakers are on. A monitor connected through an HDMI-to-DVI or HDMI-to-VGA adapter won't get sound over that cable; DVI carries no audio.

## USB audio

A USB sound card, USB headset or USB speaker works without any drivers. Plug it in and it appears in the list of outputs. This is the simplest way to add a headphone socket or microphone input to a Pi 5 or a Zero (a Zero needs a micro-USB OTG adapter for it).

## I2S DAC HATs

A DAC (digital-to-analogue converter) HAT sits on the 40-pin header and takes digital audio straight from the processor over I2S, which uses GPIO 18 to 21. Depending on the board you get line-level outputs for an amplifier, a headphone amp, built-in speaker drivers or a microphone input.

Raspberry Pi's own audio HATs (and many others) carry an ID chip, so Raspberry Pi OS sets them up automatically. To check that a HAT has been recognised, run:

```
grep -a . /proc/device-tree/hat/*
```

You should see the maker's name. If you get "No such file or directory", the HAT wasn't detected. In that case, add the HAT's overlay to `/boot/firmware/config.txt` and reboot. For Raspberry Pi's DAC+, for example:

```
dtoverlay=rpi-dacplus
```

For a HAT from another maker, use the overlay its instructions name. To see every sound card the Pi knows about, run:

```
aplay -l
```

On a Pi with no desktop, you can make the HAT the main output by turning off the built-in audio. Put a `#` in front of this line in `config.txt` and reboot:

```
dtparam=audio=on
```

## Choosing the output on the desktop

1. Right-click the speaker (volume) icon at the top right of the screen.
2. Pick the device you want: an HDMI port, the headphone jack, your USB device or your HAT.

Left-click the same icon to change the volume or mute. Bluetooth speakers and headphones are paired from the Bluetooth icon next to it; once connected, they appear in the same list.

The right-click menu also has **Device Profiles**. Leave this on **Digital Stereo** unless you have a reason not to. **Off** silences that device entirely, which is a common cause of "no sound" after experimenting.

## Choosing the output from the command line

On Raspberry Pi OS Lite, or over SSH, list the audio devices:

```
wpctl status
```

Under **Audio**, find the **Sinks** section. Each output has a number beside it, and the current default is marked with `*`. Set a new default using its number. If your device were number 52:

```
wpctl set-default 52
```

Run `wpctl status` again to check the `*` has moved. You can set the volume the same way, for example 70%:

```
wpctl set-volume @DEFAULT_AUDIO_SINK@ 0.7
```

## Testing it

This plays a voice saying "front left" and "front right" in turn, so you can check both speakers. Press Ctrl+C to stop.

```
speaker-test -c2 -t wav
```

No sound? Check the right output is selected, that it isn't muted, that its profile isn't **Off**, and that the TV or amplifier is on the right input with its own volume up.

## Parts in this guide

- [USB Audio Adapter](https://piaustralia.com.au/products/usb-audio-adapter.md)
- [USB Audio Input/Output Dongle](https://piaustralia.com.au/products/usb-audio-input-output-dongle.md)
- [Raspberry Pi USB Free-drive Speaker](https://piaustralia.com.au/products/raspberry-pi-usb-free-drive-speaker.md)
- [Raspberry Pi 5 USB Audio Sound Card Module HAT](https://piaustralia.com.au/products/raspberry-pi-5-usb-audio-sound-card-module-hat.md)
- [HIFI DAC Audio Sound Card Module I2S interface for Raspberry Pi](https://piaustralia.com.au/products/hifi-dac-audio-sound-card-module-i2s-interface-for-raspberry-pi.md)
- [Pirate Audio Speaker for Raspberry Pi](https://piaustralia.com.au/products/pirate-audio-speaker-for-raspberry-pi.md)

Written by Pi Australia from Raspberry Pi OS documentation (playing audio and video), Raspberry Pi's configuration documentation (audio output), Raspberry Pi's Audio HATs documentation, Raspberry Pi 5 product page.
