All of lore.kernel.org
 help / color / mirror / Atom feed
* io plugin: playback and capture over a socket
@ 2009-12-03 12:07 Stefan Schoenleitner
  0 siblings, 0 replies; only message in thread
From: Stefan Schoenleitner @ 2009-12-03 12:07 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org

Hi,

I'm having difficulties writing a simple alsa plugin that plays and
captures from a socket.

The background is that there should be a "server" application that
processes PCM data.
In order to "connect" ALSA to that application I would like to use a socket.

I looked at the bluez bluetooth audio plugin which seems to do a similar
task.

Basically the idea is that the alsa plugin transfer callback function
just sends and receives PCM samples in periods to/from the socket
(depending on whether the plugin is used for playback or capture).

To control the timing and to increment the hw_ptr a separate thread in
the alsa plugin is used.
Basically for each period the thread will increment the hw_ptr and
signal to the alsa plugin that the next period can be written.

This signaling is done by using a pipe.
As the plugin code is poll-based I guess it needs to poll both the
socket and the pipe (which is used to communicate with the "timing" thread).

For this reason the alsa plugin would only write to the socket if the
socket is ready for writing _and_ the time for writing the next period
has come (which will be signaled by a write to the pipe by the timing
thread).

Would such a implementation work so far ?

At the moment I'm having some real difficulties as for some reason the
start callback function that would start the thread is not called at all.
My code is pretty much the same as in the bluez bluetooth audio plugin.

cheers,
stefan

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-03 12:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-03 12:07 io plugin: playback and capture over a socket Stefan Schoenleitner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.