Skip to content

Commit

Permalink
audio: slide improvements
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Belloni <[email protected]>
  • Loading branch information
alexandrebelloni committed Sep 14, 2023
1 parent ca2a963 commit fe59a42
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 49 deletions.
45 changes: 4 additions & 41 deletions slides/audio-alsa-lib/audio-alsa-lib.tex
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ \subsection{alsa-lib}
\item The main way to interact with ALSA devices is to use alsa-lib.
\item \url{https://github.com/alsa-project/alsa-lib.git}
\item It provides mainly access to the devices but also goes further
and allows handling audio in userspace
and allows handling audio in userspace.
\item The library itself is actually named \code{libasound}
\item The include file is \code{alsa/asoundlib.h}
\end{itemize}
Expand Down Expand Up @@ -43,9 +43,10 @@ \subsection{alsa-lib}
\item This can be specified as a hardware device. The three
arguments (in order: CARD,DEV,SUBDEV) specify card number or
identifier, device number and subdevice number (-1 means any). For
example: \code{hw:0} or \code{hw:1,0}
example: \code{hw:0} or \code{hw:1,0}. Instea of the index, the
card name can be used: \code{hw:STM32MP15DK,0}
\item Or through the \code{plug} plugin: \code{plug:mypcmdef},
\code{plug:hw:0,0}
\code{plug:hw:0,0}.
\item The list of available names can be generated using
\code{snd_card_next} to iterate over all the physical cards. See
\code{device_list} in \code{aplay}.
Expand Down Expand Up @@ -296,44 +297,6 @@ \subsection{alsa-lib}
\end{itemize}
\end{frame}

\begin{frame}[fragile]{alsa-lib API - controls}
\begin{itemize}
\item
\begin{block}{}
\fontsize{9}{9}\selectfont
\begin{minted}{c}
void snd_ctl_elem_value_set_id(snd_ctl_elem_value_t *obj, const snd_ctl_elem_id_t *ptr)
\end{minted}
\end{block}
\item Links the value with the control id.
\item
\begin{block}{}
\fontsize{9}{9}\selectfont
\begin{minted}{c}
void snd_ctl_elem_value_set_boolean(snd_ctl_elem_value_t *obj, unsigned int idx, long val)
void snd_ctl_elem_value_set_integer(snd_ctl_elem_value_t *obj, unsigned int idx, long val)
void snd_ctl_elem_value_set_integer64(snd_ctl_elem_value_t *obj, unsigned int idx,
long long val)
void snd_ctl_elem_value_set_enumerated(snd_ctl_elem_value_t *obj, unsigned int idx,
unsigned int val)
void snd_ctl_elem_value_set_byte(snd_ctl_elem_value_t *obj, unsigned int idx,
unsigned char val)
void snd_ctl_elem_set_bytes(snd_ctl_elem_value_t *obj, void *data, size_t size)
\end{minted}
\end{block}
\item Set the value in \code{snd_ctl_elem_value_t}.
\item
\begin{block}{}
\fontsize{9}{9}\selectfont
\begin{minted}{c}
int snd_ctl_elem_write(snd_ctl_t *ctl, snd_ctl_elem_value_t *data)
\end{minted}
\end{block}
\item Actually set the control.
\end{itemize}
\end{frame}


\begin{frame}{Going further}
\begin{itemize}
\item UCM: The ALSA Use Case Configuration:
Expand Down
4 changes: 2 additions & 2 deletions slides/audio-asoc-codec/audio-asoc-codec.tex
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ \subsection{CODEC driver}
CODEC.
\item \code{struct snd_soc_dapm_widget *dapm_widgets} is an array of
power management controls so ASoC can power down the routes that
are not currently used
are not currently used.
\item \code{struct snd_soc_dapm_route *dapm_routes} is an array
describing those routes
describing those routes.
\end{itemize}
\end{frame}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ \subsection{ASoC component callbacks}
\begin{frame}{\code{set_tdm_slot}}
\begin{itemize}
\item This callback configures the DAI for TDM operation.
\item \code{slot} is the total number of slots of the TDM stream and
\item \code{slots} is the total number of slots of the TDM stream and
\code{slot_width} the width of each slot in bit clock cycles.
\item \code{tx_mask} and \code{rx_mask} are bitmasks specifying the
active slots of the TDM stream for the specified DAI, i.e. which slots the
Expand Down
2 changes: 1 addition & 1 deletion slides/audio-asoc-cpu/audio-asoc-cpu.tex
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ \subsection{CPU DAI driver}
\item When a peripheral DMA controller is used, this is more
complex.
\item The driver will have to handle all th aspects of the PCM
stream life cycle
stream life cycle.
\item Understandable example in \kfile{sound/soc/atmel/atmel-pcm-pdc.c}
\end{itemize}
\end{frame}
Expand Down
6 changes: 3 additions & 3 deletions slides/audio-auxiliary/audio-auxiliary.tex
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ \subsection{Auxiliary devices}
\begin{itemize}
\item There may be a muxer on the analog input lines.
\item If controlled using a gpio, the \code{simple-mux} driver is
available
available.
\item It exposes two inputs: "IN1" and "IN2" and one output, "OUT".
\item The device tree binding allows to provide a prefix to make the
routes specific.
Expand All @@ -120,9 +120,9 @@ \subsection{Auxiliary devices}
\begin{itemize}
\item This exposes routes between \code{Mic Mux IN1} and \code{Mic
Mux IN2} to \code{Mic Mux OUT}.
\item This route is controlled by \code{gpio5 5}
\item This route is controlled by \code{gpio5 5}.
\item A control named \code{Mic Mux Muxer} will be exposed to
userspace
userspace.
\end{itemize}
\end{frame}

Expand Down
2 changes: 1 addition & 1 deletion slides/audio-hardware/audio-hardware.tex
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ \subsection{SoC Digital Audio Interface}
\begin{frame}{SoC}
\begin{itemize}
\item The SoC also has a dedicated synchronous serial interface.
\item Some are generic serial interfaces others ar dedicated to audio
\item Some are generic serial interfaces others are dedicated to audio
formats.
\item It has a DMA controller or a peripheral DMA controller (PDC)
able to copy samples from memory to the serial interface registers
Expand Down

0 comments on commit fe59a42

Please sign in to comment.