ConnorRigby

ConnorRigby

Nerves Core Team

Preamble

As we don’t have “stickies” or “FAQs” sections yet, I’m posting this in “Discussions”.

Audio on Nerves Raspberry Pi

We’ve received a few questions about enabling/using audio on raspberry pi devices. We’ve had an issue on the RPI3 nerves_system open since late 2017, and we will likely at some point enable these features in the default systems in the future, but for anyone looking for a way to get started today can follow along here.

Setup

First We will need to follow the Customizing a Nerves System guide.

Raspberry Pi Kernel changes

Nerves currently enabled sound kernel modules on all the Raspberry Pi models. You should not need to modify anything here.

Raspberry Pi config.txt changes

We will need to follow the Boot partition overwrite guide for this step. We will be overwriting the config.txt file. You can read more about that file and its supported values here.

Find the lines

dtparam=i2c_arm=on,spi=on

and change the last to:

dtparam=i2c_arm=on,spi=on,audio=on

User packages for audio

Now we can simply enable any audio programs in Buildroot. Let’s setup espeak and alsa-utils for example.

Open the Buildroot configuration utility:

make menuconfig

You can use / to open the search menu. Look for espeak. Once found it can simply be enabled.
Do the same for aplay.

after saved we will end up with some new lines in nerves_defconfig:

BR2_PACKAGE_ALSA_UTILS=y
BR2_PACKAGE_ALSA_UTILS_AMIXER=y
BR2_PACKAGE_ALSA_UTILS_APLAY=y
BR2_PACKAGE_ALSA_UTILS_SPEAKER_TEST=y
BR2_PACKAGE_ESPEAK=y
BR2_PACKAGE_ESPEAK_AUDIO_BACKEND_ALSA=y

FIN

And that’s it. This is more an exercise in finding/enabling packages in Buildroot. Hopefully this will be useful to some.
This guide does apply to more than simply Raspberry Pi devices, but the config.txt part is Raspberry Pi specific.

Showing Posts 1 to 4

dnsbty

dnsbty

I’ve been hoping for a guide for this for over a year now. Thank you very much!

fhunleth

fhunleth

Co-author of Nerves

I’ve heard from so many people on this topic. Thanks for all of the comments. My plan had been to update the official Raspberry Pi Nerves systems to Linux 4.14 (they’re still on 4.4) and then integrate at least aplay and make a release. Little did I know that we’d run into two fairly big issues with Linux 4.14. One is a flakiness with wired Ethernet on the 3 B+ (see Pi3b+: "kevent 4 may have been dropped" with lan78xx · Issue #2447 · raspberrypi/linux · GitHub). It seems fixed for me now, but… The other was a big change with Linux 4.14 on the BBB with how device tree overlays work, and that delayed work on the RPi. It’s working, but needs better docs. In better news, Google’s AIY voice kit’s audio hat only works with 4.14 and it’s been working well. Thanks everyone for the patience. I’ll post again soon.

Frank

AndyFrew

AndyFrew

Hello… I have plugged a regular stereo speaker into PI audio port and nothing is coming out. Also I used a single 3.5mm cable to connect PI to audio input in LCD HDTV and still not audio, NO audio also from HDMI cable connection.

ConnorRigby

ConnorRigby OP

Nerves Core Team

@AndyFrew Can you elaborate a bit? how are you trying to get audio out? aplay? espeak? Do you see any errors in your console? What rpi variant are you using? Audio goes through the 3.5mm connector by default, i think you can enable HDMI audio out in config.txt but i’ve never done it before.

— All posts loaded —

Where Next? Top

Trending in Discussions Top

cblavier
Hey there, It’s been more than a year since we started using LiveView as our main UI library and building a whole library of UI componen...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
achempion
I’ve been using Emacs as my main code editor for more than a two years. It’s a custom build version although I’ve tried doom emacs and sp...
New
axelson
Hi there! :wave: @frigidcode and I (but mostly him) have been running an Elixir Book club, we’re almost done with Designing Elixir Syste...
New
budgie
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with. But I don’t use it anymore. Serverless was the promis...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
georgeguimaraes
Just published claude-code-elixir, a plugin marketplace for Claude Code with Elixir support. These are the plugins I’ve been using for my...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews