How to set the sound output in Raspberry Pi
Audio Setting
Most Raspberry Pis have a 3.5mm audio jack for outputting audio, but you can also output audio via HDMI as well. The below will show you two different ways to set the output device.
Method 1: Use Raspberry Pi Configuration (GUI)
- Click the Raspberry menu (top-left corner)
- Go to Preferences → Audio Device Settings
- In the Output Device dropdown, choose:
HDMI
orHDMI 1
(depending on your Pi model) - Click Select Controls if needed to unmute or adjust volume
- Click Close
You may not see the exact thing on your pi based on the operating system you used.
Method 2: Terminal Command
For example, setting HDMI as default audio output:
amixer cset numid=3 2
The 2
at the end indicates HDMI.
- 0 = Auto
- 1 = Analog (3.5mm jack)
- 2 = HDMI
Method 3: Use raspi-config
-
sudo raspi-config
- Navigate to:
1. System Options → S2 Audio
- Choose:
1 HDMI
(or HDMI 1 if you see multiple) - Press Enter, then Finish
Test the Audio
- You can test it with:
speaker-test -t sine -f 440 -c 2
- Or play a WAV sound file:
aplay /home/pi/Music/youOwnSoundFile.wav
- Or play a MP3 sound file:
cvlc /home/pi/Music/youOwnSoundFile.mp3