From: Clemens Ladisch <clemens@ladisch.de>
To: louis@museresearch.com
Cc: alsa-devel@alsa-project.org
Subject: Re: Timing of linked devices
Date: Mon, 15 Jun 2009 15:31:58 +0200 [thread overview]
Message-ID: <4A364D4E.3020908@ladisch.de> (raw)
In-Reply-To: <49237.65.105.226.50.1244847123.squirrel@master.museresearch.com>
louis@museresearch.com wrote:
> I am developing an application which opens both inputs and outputs for
> digital and s/pdif (so, 4 devices). The sync IDs all match. However,
> under certain conditions, I am receiving partial buffers from the input.
> So, I have a few questions:
>
> Does linking input and output devices, from a programmer's perspective,
> mean that input is ready at precisely the same time that the device is
> ready to output a buffer?
No; linking just means that ALSA tries to start the streams at the same
time. If the sync IDs match, the hardware actually supports this.
> Or, does it only mean that the ins and outs will be synchronized for
> each given buffer?
Not even that. Linking streams does not guarantee that they run at the
same speed.
If two streams are handled by the same DMA controller and are using the
same clock, they should be perfectly synchronous. In the case of S/PDIF
recording, the clock is determined by the sending device, so it is
likely to be different from the other stream.
> And, in the case that I am doing a non-blocking read (pcm_read) from a
> buffer which is not yet ready, should I receive an outdated buffer, a
> blank buffer, or one which has both partially new and partially old data?
You get no data and error code -EAGAIN.
HTH
Clemens
prev parent reply other threads:[~2009-06-15 13:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-12 22:52 Timing of linked devices louis
2009-06-15 13:31 ` Clemens Ladisch [this message]
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=4A364D4E.3020908@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=louis@museresearch.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox