Re: [Alsa-user] PCM plugin last

2020-06-01 Thread Clemens Ladisch via Alsa-user
Robert Bielik wrote:
>> It might be possible to run dmix on a virtual loopback sound card and route 
>> that one to the LADSPA plugin
>
> Can this loopback routing be done entirely within a .asoundrc configuration?

No; some program must be running to record from the loopback card and play to 
the actual device.


Regards,
Clemens


___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] PCM plugin last

2020-06-01 Thread Robert Bielik
Hi Clemens,

> 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 
> idea.

Interesting though. Can this loopback routing be done entirely within a 
.asoundrc configuration?

Regards,
/Robert

The information in this email (including any attachments) may contain 
confidential and/or proprietary material. Any review, retransmission or use of 
this information by persons or entities other than the intended, authorized 
recipient is prohibited. If you received this email in error, please notify the 
sender and delete the material. For information regarding how Dirac handles 
personal data, please visit https://www.dirac.com/privacy-policy.

___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] PCM plugin last

2020-05-27 Thread Mark Hills
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
> idea.

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 
combined with:

  $ 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 
5.6.14)

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.
#

pcm.local {
type asym

#
# Mix incoming audio from multiple sources
#

playback.pcm {
type dmix
ipc_key 3187

slave {
rate 48000
channels 2
format S16_LE
buffer_size 4096
period_size 256

pcm {
type hw
card "Loopback"
device 0
subdevice 3
}
}
}

#
# Make it accessable to anyone who wants it
#

capture.pcm {
type dsnoop
ipc_key 23811

slave {
rate 48000
channels 2
format S16_LE
buffer_size 4096
period_size 256

pcm {
type hw
card "Loopback"
device 1
subdevice 3
}
}
}
}

pcm.master {
type ladspa;

...   # your chosen configuration here
}

-- 
Mark___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] PCM plugin last

2020-05-27 Thread Clemens Ladisch via Alsa-user
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
idea.


Regards,
Clemens


___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user