RetroPie is a great multi-emulator project for the Raspberry Pi, but I noticed that its auto-detect for which audio device to use seems a bit erratic. I’ve speakers plugged into the 3.5mm jack, as the HDMI cable runs to a speaker-less monitor, and usually (but not always) RetroPie defaulted to squirting sound out the HDMI port.
There’s two ways of fixing this. Firstly, you can change the audio output for the current session (i.e. until you reboot it) by issuing this command to force the output to the 3.5mm jack:
amixer cset numid=3 1
or this command to force it down the HDMI cable:
amixer cset numid=3 2
To run this command, either switch to another terminal session (e.g. Ctrl-Alt-F2), and log in as user pi, password raspberry (defaults, unless you’ve changed them), then Ctrl-Alt-F1 to switch back to the GUI.
Alternatively, from another machine, you can SSH into your Pi and run the command in the shell there.
To make this a permanent change, you need to run RetroPie-Setup. Get into a terminal using either of the above two methods (Ctrl-Alt-F2 or SSH) and enter:
This will bring up the config screen. Choose option 8, “Configure audio settings”.
Then choose either Headphones (for the 3.5mm jack) or HDMI as necessary.
Choose OK, then reboot!