This post shows how to update ALSA [1] on Raspberry Pi running Raspbian Stretch. As of writing this post (Dec. 9th 2018) the latest ALSA version is 1.1.7.
Setup (parentheses indicate my environment)
- Raspberry Pi (Raspberry Pi 3 B+) running Raspbian Stretch (Nov. 2018)
- Speaker connected to Raspberry Pi’s 3.5 mm audio jack
Steps
1. Checking Preinstalled ALSA Version
1-1. First, let’s check the current ALSA version.
aplay --version
The result should be like below. In this example (Raspbian Stretch 2018 Nov. version), the preinstalled ALSA version is 1.1.3.
$ aplay --version aplay: version 1.1.3 by Jaroslav Kysela <perex@perex.cz>
2. alsa-lib Installation [2]
2-1. Download alsa-lib.
wget ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.1.7.tar.bz2
2-2. Extract the directory.
tar xvjf alsa-lib-1.1.7.tar.bz2
2-3. Move to the extracted directory.
cd alsa-lib-1.1.7
2-4. Configure.
./configure
2-5. Build and install.
make && sudo make install
3. Curses Library Installation
ALSA requires a curses library.
3-1. Update the package list.
sudo apt-get update
3-2. Install “libncursesw5-dev”.
sudo apt-get install libncursesw5-dev -y
4. alsa-utils Installation [3]
4-1. Download alsa-utils.
wget ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.1.7.tar.bz2
4-2. Extract the directory.
tar xvjf alsa-utils-1.1.7.tar.bz2
4-3. Move to the extracted directory.
cd alsa-utils-1.1.7
4-4. Configure.
./configure --disable-alsaconf --disable-bat --disable-xmlto --with-curses=ncursesw
4-5. Build and install.
make && sudo make install
5. Verification
5-1. Check ALSA version.
aplay --version
The result should be like below. In this example, ALSA was updated from 1.1.3 (see step 1-1) to 1.1.7.
$ aplay --version aplay: version 1.1.7 by Jaroslav Kysela <perex@perex.cz>
5-2. Make sure ALSA is working by using speaker-test [4]. If everything is fine, you should be able to hear the wav sound from the connected speaker.
speaker-test -t wav
5-3. Press ctrl-c to stop the speaker-test.
References
[1] Advanced Linux Sound Architecture (ALSA) project homepage
[2] alsa-lib-1.1.7 – Linux From Scratch!
[3] alsa-utils-1.1.7 – Linux From Scratch!
[4] Using ALSA’s speaker-test utility
Magnificent problem-solver!!!
Thanks a lot for sharing this information.
Glad it worked for you!
Trying to update to 1.2.1 (and 1.2.2) from 1.1.9 but i get this error when i run ./configure on alsa-utils:
checking for snd_tplg_new in -latopology… no
configure: error: No linkable libatopology was found.
Up to version 1.1.9 i can compile with no problems but trying to compile utils from 1.2.1 get me this error. I get no errors compiling alsa-lib. Any help apreciated.
Hi,
Same error on fresh install of raspberry PI 4 :
checking for snd_tplg_new in -latopology… no
configure: error: No linkable libatopology was found.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
Hi guys,
Thanks for sharing your results. I just checked by myself but I don’t see any error and I was able to update from 1.1.8 to 1.2.4 with Raspberry Pi OS Aug. 20th 2020 version on Raspberry Pi 4.
$ aplay --version
aplay: version 1.2.4 by Jaroslav Kysela
Hello Max,
I’m using DietPi (5.10.0-v7+) and I’m getting the exact same problem trying to update from 1.1.8 to 1.2.4
“checking for libatopology (sound headers version > 1.1.9)… yes
checking for snd_ctl_open in -lasound… yes
checking for snd_tplg_new in -latopology… no
configure: error: No linkable libatopology was found.
”
I also can upgrade to 1.1.9
Any help would be appreciated.
Jean
Guys,
It looks there is a problem on ALSA side according to URLs below:
https://lore.kernel.org/alsa-devel/20191204075832.787C8F801EC@alsa1.perex.cz/
https://git.busybox.net/buildroot/commit/?id=b6136ef170d7601c5d61e29eb1eecc15acbc3a94
I hope this helps to resolve your problem.
did you find a solution for this one ?
Running Raspbian Lite / Buster with linux 5.10.11-v7l+
lib compiles and makes great. all libraries accounted in /usr/lib
but still:
same issue over here from 1.1.9 > 1.2.4 utils and/or > 1.2.2 tools
really stumped at finding the source of this problem and the link directives to at least manually point the ./config to libatopology.la so …
links above are possibly outdated / or i am not sure how to resolve with this info.
I solved it by adding –disable-alsatest to the ./configure line. Not sure if I broke something or not by doing this but so far it seems to work. I now have both lib and utils at version 1.2.4.
Thanks for a great guide max!
wonderfull good explanations, thank you a lot
didier delaey
Thanks for your comment!
Everything appeared to progress as I went through the steps, yet the final step of :
make && sudo make install
resulted in:
make: *** No targets specified and no makefile found. Stop.
To self-identify, I am an idiot when it comes to programming this Pi. It does not appear in any of the previous steps that I had any issues or failures. Should I try this command in another directory than:
pi@StretchPi-Raspb:~/alsa-utils-1.1.7 $
My Pi I am attempting to update is:
PRETTY_NAME=”Raspbian GNU/Linux 9 (stretch)”
NAME=”Raspbian GNU/Linux”
VERSION_ID=”9″
VERSION=”9 (stretch)”
VERSION_CODENAME=stretch
ID=raspbian
ID_LIKE=debian
And current ALSA is v1.1.3
Any help/suggestions?
Thanks.