public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
* External plugin question
@ 2015-08-07  0:02 Mina Almasry
  2015-08-07  5:26 ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Mina Almasry @ 2015-08-07  0:02 UTC (permalink / raw)
  To: alsa-devel

I'm new to alsa dev and I'm trying to write a very simple external pcm
plugin. I want my pcm plugin to output sound to multiple slave pcms when
sound is being writei'd to it. So:

snd_pcm_myplugin_writei(pcm, buffer, size) {
  foreach slave pcm {
    snd_pcm_writei(slave_pcm, buffer, size);
  }
}

I'm having trouble implementing this plugin because the external plugin sdk
does not allow me to define the writei function for my plugin, but lets me
define the transfer function which has a very different signature than
writei:

transfer(snd_pcm_ioplug_t *io, const snd_pcm_channel_area_t *areas,
snd_pcm_uframes_t offset, snd_pcm_uframes_t size)

how do I extract buffer and size from these arguments? Any tips on how I
write my plugin.

Mina

^ permalink raw reply	[flat|nested] 3+ messages in thread
* External plugin question
@ 2015-08-06 23:57 Mina Almasry
  0 siblings, 0 replies; 3+ messages in thread
From: Mina Almasry @ 2015-08-06 23:57 UTC (permalink / raw)
  To: alsa-devel

I'm new to alsa dev and I'm trying to write a very simple external pcm
plugin. I want my pcm plugin to output sound to multiple slave pcms when
sound is being writei'd to it. So:

snd_pcm_myplugin_writei(pcm, buffer, size) {
  foreach slave pcm {
    snd_pcm_writei(slave_pcm, buffer, size);
  }
}

I'm having trouble implementing this plugin because the external plugin sdk
does not allow me to define the writei function for my plugin, but lets me
define the transfer function which has a very different signature than
writei:

transfer(snd_pcm_ioplug_t
<http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m___i_o_plug.html#ga1038655a4ca74f3aef060282d6df739b>
*io,
const snd_pcm_channel_area_t
<http://www.alsa-project.org/alsa-doc/alsa-lib/structsnd__pcm__channel__area__t.html>
 *areas, snd_pcm_uframes_t
<http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#gab01fcfe9b97382a8d3f2027c664b8b8a>
 offset, snd_pcm_uframes_t
<http://www.alsa-project.org/alsa-doc/alsa-lib/group___p_c_m.html#gab01fcfe9b97382a8d3f2027c664b8b8a>
 size)

how do I extract buffer and size from these arguments? Any tips on how I
write my plugin.

(I'm aware of the multi plugin but I don't wont to use that. I want to
write my own and introduce custom logic later.)

Mina

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-07  5:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-07  0:02 External plugin question Mina Almasry
2015-08-07  5:26 ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2015-08-06 23:57 Mina Almasry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox