tl;dr
Most likely the Pi is routing the audio through the HDMI port, run the following command to make it use the 3.5mm plug output:
amixer cset name='PCM Playback Route' 1
more detailed answer
Out of the box, the Pi has 2 audio sinks or outputs: HDMI and the 3.5mm plug, if a display is connected the Pi defaults to using HDMI audio. You can change the routing of the audio with amixer
from the alsa-utils package.
The amixer
program can be used to list and edit various audio settings, e.g. listing controls:
amixer controls
Output:
numid=3,iface=MIXER,name='PCM Playback Route'
numid=2,iface=MIXER,name='PCM Playback Switch'
numid=1,iface=MIXER,name='PCM Playback Volume'
numid=5,iface=PCM,name='IEC958 Playback Con Mask'
numid=4,iface=PCM,name='IEC958 Playback Default'
Getting the value of PCM Playback Route
:
amixer cget name='PCM Playback Route'
Output:
numid=3,iface=MIXER,name='PCM Playback Route'
; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
: values=0
Only the bottom line is interesting here. The numbers that values
takes mean the following:
- 0 = auto
- 1 = 3.5mm plug
- 2 = HDMI
So to set the Pi to use the mini-jack plug, run the following command:
amixer cset name='PCM Playback Route' 1
Output:
numid=3,iface=MIXER,name='PCM Playback Route'
; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
: values=1
sudo amixer cset numid=3 1
. – Thor Aug 27 '15 at 10:30