[LAD] Help with ALSA plugin - adding real time parameter

Bob DeCarlo bobs2002mail at yahoo.com
Tue Aug 2 16:46:34 UTC 2011


Hi,

I am trying to get my own ALSA plug-in to work with some real time controls.  ( Is this the right place to ask?)

I am successful with the PCM part of it.  What I mean is from:

http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_external_plugins.html
External Plugin: Filter-Type Plugin

static snd_pcm_sframes_t
myplg_transfer(snd_pcm_extplug_t *ext,
           const snd_pcm_channel_area_t *dst_areas,
           snd_pcm_uframes_t dst_offset,
           const snd_pcm_channel_area_t *src_areas,
           snd_pcm_uframes_t src_offset,
           snd_pcm_uframes_t size)
{
// my PCM processing works
// I want to add a control parameter that can be set in real time by an app
}

SND_PCM_PLUGIN_DEFINE_FUNC(myplg)
{
// This all works for PCM processing just like the examples
...
err = snd_pcm_extplug_create(&mix->ext, name, root, sconf, stream, mode);
    if (err < 0) {
        free(mix);
        return err;
    }
...
}

SND_PCM_PLUGIN_SYMBOL(myplg);


Now I want to add a simple real time adjustment, an integer value that can be sent by an application to adjust the sound (PCM samples) in real time.  I tried some ways of doing it it but without success, I am not understanding the basics.

I first looked at doing a ctl. I was able  get separately (without PCM processing) get a control to work but that looks like ts only for hardware control?  I can't connect it to my PCM processing.

http://www.alsa-project.org/alsa-doc/alsa-lib/ctl_external_plugins.html

I looked at LADSPA but I'm not sure where that is going to take me.

I am now looking at

http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_external_plugins.html
External Plugin: I/O Plugin

But, I am confused because I also see pcm type callbacks.

So, I do not have a specific coding question (yet) but I just need a general direction. ...
-Should I use ctl_external_plugins and figure out how to use it with my PCM?
-Should  I use a LADSPA example?
-Should I go wth External Plugin: I/O Plugin?
-Something else?

I hope I am clear enough about my question and thanks for any pointers you can provide.

Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20110802/f91127a2/attachment.html>


More information about the Linux-audio-dev mailing list