At Tue, 11 Dec 2007 12:10:16 -0800 (PST), Ben C wrote:
Hi, I have a newbie question. I'm trying to understand how the external control plugin fits into the picture.
I have an external PCM plugin that does some audio processing before sending it to the slave audio device. And I want to control the behavior of the processing with this control plugin. So before any playback is happening, any setting changes via the control plugin need to be stored somewhere, so when playback happens, it could be used. Also during playback, the control plugin needs to find and talk to the PCM plugin so settings could be changed during playback. Is there some sort of internal mechanism that allows this type of setting storage/retrieval and communication between control & PCM plugins to happen, or do I have to roll my own outside of ALSA?
I've tried to find examples, I've found the pulse control and maemo in the alsa-plugin tarball. But they both seem to use some sort of external server/device. What I'm looking for is ways to control an external PCM plugin that simply runs some audio processing algorithm, there's no additional server or device associated with it (well, just the slave, which would be specified in the config). Currently I have the PCM plugin working, but it can only read the settings from the alsa config file. Once playback starts it'll stick with the original settings. I also have the basics of the external control plugin working, but the controls currently don't do anything, since I don't know how to propagate the changes to the PCM plugin.
I've been searching on the web but haven't found much. I'm willing to buy books too, but I can't seem to find books on ALSA. I would appreciate any explanation, pointers to documents, or even just pointing me to existing source code that has done this.
You can create user-space control elements in the plugin. Then arbitrary control parameters can be passed between plugins and apps. And, these parameters can be stored/restored via alsactl, too.
Takashi