From: Takashi Iwai <tiwai@suse.de>
To: Stas Sergeev <stsp@aknet.ru>
Cc: ALSA devel <alsa-devel@alsa-project.org>
Subject: Re: snd_pcsp locking mess
Date: Tue, 21 Oct 2008 08:27:08 +0200 [thread overview]
Message-ID: <s5h4p36a2f7.wl%tiwai@suse.de> (raw)
In-Reply-To: <48FCFD7D.6000001@aknet.ru>
At Tue, 21 Oct 2008 01:51:57 +0400,
Stas Sergeev wrote:
>
> Hi.
>
> Takashi Iwai wrote:
> > Indeed, the async trigger is nice to have in the common place.
> > However, the change wouldn't be as trivial as it sounds, as you
> > mentioned. By async nature, there can be a transition phase between
> > the XRUN and STOP, which can cause races.
> Could you please elaborate on how my
> proposed patch could possibly affect
> that? It basically doesn't do anything
> at all except providing one more callback
> for what would otherwise had to be done
> in a trigger() callback anyway.
> If there is a race with that patch, then
> I pretty much suspect it was with an old
> code too. I can't imagine any possible
> change. What have changed?
The PCM status is changed immediately after calling trigger(_async)
callback XRUN or SETUP. That is, you can start the stream again soon
after snd_pcm_stop(). In the case of async operation, the hardware
may be likely still running, but the PCM core doesn't know about it
and allows you to restart the stream. So it's racy, at least from the
PCM core viewpoint.
Usually async operation has a way to indicate the pending status,
either setting the state to WORKING/PENDING, or having an additional
flag. In either way, we need the change in the PCM core side.
Takashi
next prev parent reply other threads:[~2008-10-21 6:27 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20080518172258.D0DFB108060@picon.linux-foundation.org>
2008-05-18 18:20 ` snd_pcsp locking mess Stas Sergeev
2008-05-19 5:50 ` Takashi Iwai
2008-05-19 17:01 ` Stas Sergeev
2008-05-21 12:33 ` Takashi Iwai
2008-05-22 20:28 ` Stas Sergeev
2008-05-23 10:51 ` Takashi Iwai
2008-05-27 13:46 ` Stas Sergeev
2008-05-27 13:47 ` Stas Sergeev
2008-05-27 15:50 ` Takashi Iwai
2008-05-27 17:40 ` Stas Sergeev
2008-05-28 10:13 ` Takashi Iwai
2008-05-28 20:08 ` Stas Sergeev
2008-05-29 6:03 ` Takashi Iwai
2008-05-29 17:07 ` Stas Sergeev
2008-06-02 9:36 ` Takashi Iwai
2008-08-21 8:06 ` Stas Sergeev
2008-08-21 9:06 ` Takashi Iwai
2008-08-21 10:25 ` Stas Sergeev
2008-10-20 13:05 ` Takashi Iwai
2008-10-20 21:51 ` Stas Sergeev
2008-10-21 6:27 ` Takashi Iwai [this message]
2008-10-21 7:08 ` Stas Sergeev
2008-10-21 7:16 ` Takashi Iwai
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=s5h4p36a2f7.wl%tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=stsp@aknet.ru \
/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