On Wed, 27 May 2020, Clemens Ladisch via Alsa-user wrote:
> Robert Bielik wrote:
> > I’d like to know if there is any way to get the following sound chain
> > through ALSA:
> > Mediaplayer -> dmix -> LADSPA -> plughw:0,0
> The dmix plugin plays shared-memory tricks with the ring buffer and therefore
> requires to run on top of a hw device.
> It might be possible to run dmix on a virtual loopback sound card and route
> that one to the LADSPA plugin, but I guess using PulseAudio would be a better
It's possible, and I don't see anything wrong with the idea except at the
moment it seems to be frightfully buggy.
Here's a snipped of .asoundrc that creates a "local" audio bus which is
$ modprobe snd-aloop
$ echo "0,0,0" > /proc/asound/Loopback/timer_source # your soundcard
$ alsaloop -C local -P plug:master
$ aplay -D plug:local music.wav
You'll need to define your "master" device with the LADSPA plugin.
The problems I am having are the "alsaloop" program terminates
unexpectedly, gets in 100% CPU spin and won't exit, or some lock is taken
in the kernel that hangs X11 and prevents process termination (kernel
I couldn't make head nor tail of alsaloop flow, so I wrote my own code to
copy audio from one device to another which so far seems much more
reliable for my case.
# The bus for local audio so it can be routed to other applications
# Pin the sample rate and format so that the Loopback device isn't
# affected by whichever side is first to open and with which parameters.
# Mix incoming audio from multiple sources
# Make it accessable to anyone who wants it
... # your chosen configuration here
Alsa-user mailing list