All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Schoenleitner <dev.c0debabe@gmail.com>
To: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: io plugin: playback and capture over a socket
Date: Thu, 03 Dec 2009 13:07:02 +0100	[thread overview]
Message-ID: <4B17A9E6.8080307@gmail.com> (raw)

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

                 reply	other threads:[~2009-12-03 12:07 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B17A9E6.8080307@gmail.com \
    --to=dev.c0debabe@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.