Skip to main content

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)

  1. Click the Raspberry menu (top-left corner)
  2. Go to Preferences → Audio Device Settings
  3. In the Output Device dropdown, choose: HDMI or HDMI 1 (depending on your Pi model)
  4. Click Select Controls if needed to unmute or adjust volume
  5. 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

  1. sudo raspi-config
  2. Navigate to: 1. System Options → S2 Audio
  3. Choose: 1 HDMI (or HDMI 1 if you see multiple)
  4. Press Enter, then Finish

Test the Audio

  1. You can test it with: speaker-test -t sine -f 440 -c 2
  2. Or play a WAV sound file: aplay /home/pi/Music/youOwnSoundFile.wav
  3. Or play a MP3 sound file: cvlc /home/pi/Music/youOwnSoundFile.mp3