Useless dovetail hacks

Philippe Gerum rpm at
Sun Sep 20 18:52:31 CEST 2020

Philippe Gerum <rpm at> writes:
> SPI, DMA, and GPIOs are a no brainer for this and are already available
> in such form, serial and network need more analysis because their
> execution contexts are either more clumsy/complex. I also got the PCM
> portion of the Alsa stack enabled with a complete I/O path over the
> real-time context, from the user (ioctl) request to send/recv frames to
> some i2s device, via DMA transactions controlled by the PCM core. As
> weird as it may seem, it is actually not that intrusive, and works quite
> well, including at insane acquisition rates for feeding an audio
> pipeline. There is still some work ahead to fix rough edges, but the
> fundamentals look sane.

I pushed more code to illustrate what I have been talking about. The
eight topmost patches of the following branch implement a dual-kernel
aware variant of the Alsa PCM core:

This is a quick forward port (compile-tested only so far) to v5.8 of the
original working implementation based on v5.4. A very limited set of
i.MX audio hardware (sai, wm8904) was enabled for demo purpose so far.

To exploit this in some app, one would need to issue the ioctl request
(SNDRV_PCM_IOCTL_PREPARE_OOB), telling the real-time capable PCM core to
switch a capture/playback (sub)stream to out-of-band mode
(i.e. interrupts, DMA and scheduling controlled end-to-end by the
real-time core, EVL in this case). I plan to hack this into tinyalsa,
which should be just fine for running simply audio pipelines, calling
pcm_readi()/pcm_writei() basically.


More information about the Xenomai mailing list