[bootlin/training-materials updates] master: labs/sysdev-thirdparty: fix alsa-lib instructions (fe02bbad)
Thomas Petazzoni
thomas.petazzoni at bootlin.com
Wed Sep 28 16:44:23 CEST 2022
Repository : https://github.com/bootlin/training-materials
On branch : master
Link : https://github.com/bootlin/training-materials/commit/fe02bbad63713c8717e6da8a5dc08e7f0272a26e
>---------------------------------------------------------------
commit fe02bbad63713c8717e6da8a5dc08e7f0272a26e
Author: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
Date: Wed Sep 28 16:42:59 2022 +0200
labs/sysdev-thirdparty: fix alsa-lib instructions
First, the ALSA config files should be installed as part of the
alsa-lib step, not the alsa-utils step, because they are part of
alsa-lib, not alsa-utils.
Second, instead of cherry-picking a random set of config files, which
leads to a "speaker-test" working but still spitting out a bunch of
error messages, we copy the full set of configuration files (simpler)
and adjust the one thing that causes problem. We now have simpler
instructions, and a speaker-test that doesn't spit out weird error
messages.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
>---------------------------------------------------------------
fe02bbad63713c8717e6da8a5dc08e7f0272a26e
labs/sysdev-thirdparty/sysdev-thirdparty.tex | 38 +++++++++++++++++-----------
1 file changed, 23 insertions(+), 15 deletions(-)
diff --git a/labs/sysdev-thirdparty/sysdev-thirdparty.tex b/labs/sysdev-thirdparty/sysdev-thirdparty.tex
index 993ff5f6..52b75fee 100644
--- a/labs/sysdev-thirdparty/sysdev-thirdparty.tex
+++ b/labs/sysdev-thirdparty/sysdev-thirdparty.tex
@@ -328,6 +328,19 @@ Finally, let's install the library in the {\em target} space:
were saved?
\end{enumerate}
+Then, we need to install the {\em alsa-lib} configuration files:
+
+\begin{bashinput}
+$ mkdir -p target/usr/share
+$ cp -a staging/usr/share/alsa target/usr/share
+\end{bashinput}
+
+Now, we need to adjust one small detail in one of the configuration
+files. Indeed, \code{/usr/share/alsa/alsa.conf} assumes a Unix group
+called \code{audio} exists, which is not the case on our very small
+system. So edit this file, and replace \code{defaults.pcm.ipc_gid
+audio} by \code{defaults.pcm.ipc_gid 0} instead.
+
And we're done with {\em alsa-lib}!
\section{Alsa-utils}
@@ -559,19 +572,12 @@ Now, let's make the installation in the {\em staging} space:
\bashcmd{$ make DESTDIR=$HOME/__SESSION_NAME__-labs/thirdparty/staging/ install}
Then, let's manually install only the necessary files in the {\em target}
-space. We are only interested in \code{speaker-test} and the files it
-requires:
+space. We are only interested in \code{speaker-test}:
\begin{bashinput}
$ cd ..
$ cp -a staging/usr/bin/speaker-test target/usr/bin/
$ arm-linux-strip target/usr/bin/speaker-test
-$ mkdir -p target/usr/share/alsa/pcm
-$ mkdir -p target/usr/share/alsa/ctl
-$ cp -a staging/usr/share/alsa/alsa.conf* target/usr/share/alsa/
-$ cp -a staging/usr/share/alsa/cards target/usr/share/alsa/
-$ cp -a staging/usr/share/alsa/pcm/default.conf target/usr/share/alsa/pcm/
-$ cp -a staging/usr/share/alsa/ctl/default.conf target/usr/share/alsa/ctl/
\end{bashinput}
And we're finally done with {\em alsa-utils}!
@@ -581,14 +587,16 @@ your board, with the headset provided by your instructor plugged
in. You may need to add the missing libraries from the toolchain
install directory.
-{\bf Caution}: don't copy the \code{dmix.conf} file. \code{speaker-test}
-will tell you that it cannot find this file, but it won't work if you
-copy this file from the staging area.
+Now you can use:
-The sound you get will be mainly noise (as what you would get by
-running \code{speaker-test} on your PCs). This is a way to test
-all possible frequencies, but is not really meant for a human
-to listen to. We will play real sound tracks in the next labs.
+\begin{itemize}
+
+\item \code{speaker-test} with no arguments to generate {\em pink noise}
+
+\item \code{speaker-test -t sine} to generate a {\em sine wave},
+optionally with \code{-f <freq>} for a specific frequency
+
+\end{itemize}
There you are: you build and ran your first program depending
on a library different from the C library.
More information about the training-materials-updates
mailing list