From: Clemens Ladisch <clemens@ladisch.de>
To: Dylan Reid <dgreid@chromium.org>, alsa-devel@alsa-project.org
Cc: tiwai@suse.de
Subject: Re: [RFC] ALSA: Reduce delay for a blocking pcm_drain.
Date: Mon, 30 Sep 2013 10:45:52 +0200 [thread overview]
Message-ID: <52493A40.3010809@ladisch.de> (raw)
In-Reply-To: <1380340785-30427-1-git-send-email-dgreid@chromium.org>
Dylan Reid wrote:
> This patch addresses two issues related to calling snd_pcm_drain.
>
> If no_period_wakeup is set, then snd_pcm_drain would wait
> MAX_SCHEDULE_TIMEOUT jiffies, without a wakeup pending this will leave
> the calling task blocked indefinitely.
no_period_wakeup is used by applications that do _not_ want to use any
of ALSA's blocking functions (and thus want to avoid the interrupt
overhead) and use their own timers instead. This also applies to
snd_pcm_drain.
Is there any actual application that tries to use snd_pcm_drain together
with no_period_wakeup?
> Also if the stream is running with period wakeups but with a long
> period, the delay could be seconds. If only a small part of the
> buffer is being used, this is unnecessary.
Wakeup at period boundaries is part of the ALSA API. (This is all what
periods are for.)
> Instead wait for the remaining samples to play out, plus one
> millisecond.
The device's clock and the Linux system clock might have larger
differences. The only reliable synchronization source is the period
interrupt.
Regards,
Clemens
next prev parent reply other threads:[~2013-09-30 8:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-28 3:59 [RFC] ALSA: Reduce delay for a blocking pcm_drain Dylan Reid
2013-09-30 8:26 ` Takashi Iwai
2013-09-30 8:45 ` Clemens Ladisch [this message]
2013-09-30 16:20 ` Dylan Reid
[not found] ` <CAN8cciamcg3wqiDV75oZ6dms-aNtN2o-QMWg0n59otibpmfV7A@mail.gmail.com>
[not found] ` <CAN8ccia8VzuubtiOZETTN5DAm_LjmQdaxqDHQQ6iv8S_NvtSBg@mail.gmail.com>
2013-09-30 13:26 ` Raymond Yau
2013-09-30 14:13 ` Clemens Ladisch
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=52493A40.3010809@ladisch.de \
--to=clemens@ladisch.de \
--cc=alsa-devel@alsa-project.org \
--cc=dgreid@chromium.org \
--cc=tiwai@suse.de \
/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.