From: Clemens Ladisch <clemens@ladisch.de>
To: "Alexander E. Patrakov" <patrakov@gmail.com>,
alsa-devel@alsa-project.org
Cc: david.henningsson@canonical.com
Subject: Re: Testing rewindability of a pcm
Date: Thu, 24 Apr 2014 14:00:48 +0200 [thread overview]
Message-ID: <5358FCF0.2040701@ladisch.de> (raw)
In-Reply-To: <5356A9B6.9060405@gmail.com>
Alexander E. Patrakov wrote:
> And we don't even have a rewindable resampler implementation!
The rate plugin implements rewinding. (I haven't tested if this
implementation is correct. What is the problem?)
> Should PulseAudio indeed use a complex dance with snd_pcm_rewindable()
> to get the essentially-static bit of information whether a given PCM
> supports full rewinds?
As far as I can tell, ALSA assumes that _every_ device allows random
access to its ring buffer.
In particular, both alsa-lib's internal API and the explug/ioplug APIs,
when writing samples, have no concept of "current position" and write to
an explicitly specified position in the buffer. The implementation
if snd_pcm_rewindable() assumes that the entire buffer is accessible
(the only plugin to change this is the file plugin).
snd_pcm_rewindable/forwardable() are just for determining the possible
amount of movement, not whether it's possible at all.
In other words: any plugin that does not allow random access is, as far
as the ALSA API is concerned, buggy.
> 2) Use snd_pcm_forwardable() with an empty buffer just after setting
> hw_params: works (once the implementation in ioplug/extplug is
> fixed to return 0), doesn't require API additions,
If ALSA is changed to track the information whether a device allows
random access or not, this would be the correct way.
> but David doesn't like it. He thinks that the sets of PCMs that
> support forwarding and rewinding may be different (here I disagree,
> but can't provide arguments).
It's possible to imagine devices that implement forwarding by just
inserting zero samples, but cannot go back in time. (I'm not sure if
implemting that would make any sense.)
> 3) Add a new function to ALSA that gets this bit of static information
> for a given pcm handle, use it.
I guess this will happen.
Regards,
Clemens
next prev parent reply other threads:[~2014-04-24 12:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-22 17:41 Testing rewindability of a pcm Alexander E. Patrakov
2014-04-24 12:00 ` Clemens Ladisch [this message]
2014-04-24 21:01 ` On non-rewindability of resamplers (was: Testing rewindability of a pcm) Alexander E. Patrakov
2014-04-25 6:19 ` On non-rewindability of resamplers David Henningsson
2014-04-25 14:09 ` Alexander E. Patrakov
2014-04-26 1:32 ` Raymond Yau
2014-04-26 10:01 ` Alexander E. Patrakov
2014-04-28 6:57 ` Raymond Yau
2014-04-28 17:31 ` Alexander E. Patrakov
2014-04-29 16:01 ` Raymond Yau
2014-04-29 17:17 ` Alexander E. Patrakov
2014-04-29 17:33 ` Alexander E. Patrakov
2014-05-02 5:39 ` Raymond Yau
2014-05-03 11:09 ` Alexander E. Patrakov
2014-05-10 0:46 ` Raymond Yau
2014-05-10 13:16 ` Alexander E. Patrakov
2014-05-12 3:11 ` Raymond Yau
2014-05-12 4:52 ` Alexander E. Patrakov
2014-05-13 17:21 ` Alexander E. Patrakov
2014-05-23 2:03 ` Raymond Yau
2014-05-23 18:59 ` Alexander E. Patrakov
2014-05-24 5:10 ` Raymond Yau
2014-05-24 7:31 ` Alexander E. Patrakov
2014-05-30 0:59 ` Raymond Yau
2014-05-28 7:58 ` Raymond Yau
2014-05-28 15:38 ` Alexander E. Patrakov
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=5358FCF0.2040701@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=david.henningsson@canonical.com \
--cc=patrakov@gmail.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;
as well as URLs for NNTP newsgroup(s).