[alsa-devel] External PCM IO Plugin development

Takashi Iwai tiwai at suse.de
Thu Apr 17 12:44:04 CEST 2008


At Thu, 17 Apr 2008 12:23:38 +0200,
I wrote:
> 
> At Wed, 2 Apr 2008 18:27:13 +0300,
> Alexander Indenbaum wrote:
> > 
> > Takashi & alsa-devel,
> > 
> > I am playing with embedded Linux box based on kernel 2.4.36. Our box
> > is equipped with proprietary chip which allows PCM playback using user
> > space DMA pool API.  My target is to enable audio playback for ALSA
> > clients by redirecting PCM stream into proprietary chip. I did a
> > little RTFM and with a lot of help from this list discovered that
> > fortunately ALSA expendable architecture allows such things as a part
> > of PCM External Plugin SDK.
> > 
> > So I downloaded and installed following ALSA 1.0.16 distribution components:
> > - driver configured with "./configure  --with-cards=seq-dummy,dummy
> > --with-kernel=/path/to/my/linux-2.4.36"
> > - lib configured with "./configure --with-pcm-plugins=all"
> > 
> > I looked at Jack IO plugin at plugins and started with skeleton plugin
> > of my own: pcm_sigma.c (attached).
> > I hope to redirect PCM into my plugin using following /etc/asound.conf
> > =============
> > pcm.!default {
> >         type sigma
> > }
> > =============
> > 
> > What I see when I fire ALSA client ( friefox with YouTube flash ) that ALSA
> > 1. loads/links my module: ALSA lib dlmisc.c:51:(snd_dlopen) snd_dlopen
> > name = (/usr/lib/alsa-lib/libasound_module_pcm_sigma.so)
> > 2. calls open interface of the module: _snd_pcm_sigma_open @ pcm_sigma.c:118
> > 
> > snd_pcm_sigma_open @ pcm_sigma.c:86
> > 3. calls close interface of the module: snd_pcm_sigma_close @ pcm_sigma.c:23
> > 4. goto 2
> > 
> > So basically what I see is an infinite open/close loop without any
> > call to other interfaces of the module. I hoped to get my hands on PCM
> > stream and start to push it into our proprietary chip :(.
> > 
> > QUESTIONS:
> > Is my PCM IO Plugin approach correct?
> 
> I think yes.
> 
> > Is my configuration (/etc/asound.conf) correct?
> 
> If the plugin object gets called anyhow, it should be correct.
> 
> > Is my implemention of PCM IO plugin interface correct? Should I
> > implement additional methods?
> 
> Did you try any other program such as aplay?
> Flashplayer is the hardest thing to debug...

Looking more closely to your code, I found that the h/w constraints
are completely missing.  You'd need to define the acceptable
parameters (access type, format, etc) via snd_pcm_ioplug_set_param*()
calls after creating the instance.

In the case jack plugin, it's jack_set_hw_constraint().


Takashi


More information about the Alsa-devel mailing list