18 April 2016

Setup Raspberry Pi 3 Sound - on Fedora 23 Minimal version

This article explains how to properly setup Raspberry Pi 3 Sound, on Fedora 23 Minimal version (but it should be usable for other distribution).
If you need to install or complete your Raspberry Pi 3 installation on Fedora 23 Minimal version, for the most lightweight, you can read part 1, and part 2 of my articles.

Update the /boot/config.txt configuration file, to update the Device Tree
sudo echo "dtparam=audio=on" >> /boot/config.txt

Ensure Sound module is loaded at boot time
sudo cat <<EOF > /etc/modules-load.d/sound_bcm2835.conf
# Loads Raspberry Pi 3 sound module at boot time.

Add your no-root user in audio group (adapt user name)
usermod -aG audio bsquare

Reboot the Raspberry Pi 3.

Install some more packages
sudo dnf install alsa-utils gcc

Test sound on analog output
cd /opt/vc/src/hello_pi
sudo make -C libs/ilclient
cd hello_audio
sudo make
sudo ./hello_audio.bin

Test sound on HDMI output (after previous instructions)
sudo ./hello_audio.bin 1

All the following instructions can/should be executed by the no-root user.

List availables soundcards
aplay -L

List available sound controls
amixer scontrols

Define the analog as default output (possible values: 0=auto, 1=analog, 2=hdmi)
amixer -c 0 cset numid=3 1

Define the volume (adapt to your needs)
amixer -c 0 sset 'PCM' 95%

Check sound is working properly
speaker-test -t sine -f 600

Check sound is working properly - alternative
speaker-test -t wav -c 2

Check sound is working properly - alternative
aplay /usr/share/sounds/alsa/Front_Center.wav

That's it, your Raspberry Pi 3 Sound hardware is now fully operationnal.

1 comment:

  1. Thanks for making this! I've been meaning to put Fedora on an idle Raspberry Pi of mine for some time, and it's great to have resources like this available for getting it up an running quickly.


Thank you for your visit, let's share your point of view: