alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: pl bossart <bossart.nospam@gmail.com>
To: Jaroslav Kysela <perex@perex.cz>
Cc: ALSA development <alsa-devel@alsa-project.org>,
	Kai Vehmanen <kvehmanen@eca.cx>
Subject: Re: safe support for rewind in ALSA
Date: Mon, 1 Feb 2010 16:40:04 -0600	[thread overview]
Message-ID: <6160a5131002011440p52fb1b2dv9d077681544adb8c@mail.gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1002011840020.25340@eeebox2.perex-int.cz>

> I don't think that there have been no progress. The queued samples can be
> stored to runtime->delay now, so snd_pcm_delay() returns a correct value.
>
> The snd_pcm_rewind() and snd_pcm_forward() functions should operate in the
> ring buffer and it's ok. See the USB driver for an example. Just add support
> for runtime->delay to the lowlevel drivers and use snd_pcm_delay() correctly
> in the user space and everything will work as expected.
>
> In other words - for hardware with large FIFOs, the runtime->delay should be
> used for queued samples and the hw_ptr in the ring buffer should be
> increased as soon as the FIFO is filled with samples from the ring buffer.

Thanks Jaroslav.
I was under the impression that the runtime->delay indicated the time
needed for transmission and D/A. If this is intended to be the queued
samples, then it plays the same role as my 'fifo' proposal. There are
several consequences though:
- This means rewind() can only happen within the ring buffer, and all
samples previously queued will be played as is.
- the 'only' change is to make sure the hw_ptr reported in .pointer is
NOT the number of samples pushed out to the interface. hw_ptr should
really represent the next read position in the ring buffer, this isn't
uniform across drivers. This means for example that the HDAudio
implementation needs to modified so that the LPIB value is increased
with runtime->delay.
- How do you specify the time for transmission and D/A, so that
applications can know when a sample will actually be played. With your
explanation the applications can only know when a sample will be
pushed out, there is an additional latency not accounted for.
Thanks for your feedback.
- Pierre

  reply	other threads:[~2010-02-01 22:40 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-01 17:20 safe support for rewind in ALSA pl bossart
2010-02-01 18:00 ` Jaroslav Kysela
2010-02-01 22:40   ` pl bossart [this message]
2010-02-03  2:20     ` Raymond Yau
2010-02-03 18:03       ` Kai Vehmanen
2010-02-03 20:52     ` Kai Vehmanen
2010-02-03 22:57       ` pl bossart
2010-02-08  1:22         ` Raymond Yau
2010-02-02  2:53   ` Raymond Yau
2010-02-06 11:59   ` Raymond Yau
2010-02-17 15:30     ` Lennart Poettering
2010-02-18  1:31       ` Raymond Yau
2010-02-18  2:33         ` Lennart Poettering
2010-02-18  3:21           ` Raymond Yau
2010-02-01 18:01 ` Mark Brown
2010-02-01 18:05   ` Jaroslav Kysela
2010-02-01 21:28     ` Kai Vehmanen
2010-02-01 21:54       ` Kai Vehmanen
2010-02-08 22:59         ` Raymond Yau
2010-02-09 20:54           ` Kai Vehmanen
2010-02-10 13:19             ` Raymond Yau
2010-02-10 13:36               ` Clemens Ladisch
2010-02-11  6:52                 ` Raymond Yau
2010-02-11  7:20                   ` Clemens Ladisch
2010-02-11  7:27                     ` Jaroslav Kysela
2010-02-15  3:03                       ` Raymond Yau
2010-02-17 15:46                         ` Lennart Poettering
2010-02-21 10:35                         ` Kai Vehmanen
2010-02-22  9:07                           ` Raymond Yau
     [not found]                           ` <20100221203500.GH31800@tango.0pointer.de>
2010-02-22 19:15                             ` semantics of SNDRV_PCM_INFO_BATCH (was: Re: safe support for rewind in ALSA) Kai Vehmanen
2010-02-23  7:02                               ` Raymond Yau
2010-02-23  2:37                           ` safe support for rewind in ALSA Raymond Yau
2010-02-23  2:44                           ` Raymond Yau
2010-02-17 15:42                       ` Lennart Poettering
2010-02-21 10:06                       ` Kai Vehmanen
     [not found]                         ` <20100221202144.GG31800@tango.0pointer.de>
2010-05-04  2:31                           ` Raymond Yau
2010-02-17 15:39                   ` Lennart Poettering
2010-02-17 15:36               ` Lennart Poettering
2010-02-17 15:35           ` Lennart Poettering
2010-02-01 22:10       ` Kai Vehmanen

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=6160a5131002011440p52fb1b2dv9d077681544adb8c@mail.gmail.com \
    --to=bossart.nospam@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=kvehmanen@eca.cx \
    --cc=perex@perex.cz \
    /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).