alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: David Henningsson <diwic@ubuntu.com>
To: perex@perex.cz, tiwai@suse.de, alsa-devel@alsa-project.org
Cc: samuel.thibault@ens-lyon.org, David Henningsson <diwic@ubuntu.com>
Subject: [PATCH] pcm_hw: Respect LIBASOUND_THREAD_SAFE env var
Date: Thu,  1 Sep 2016 08:06:50 +0200	[thread overview]
Message-ID: <1472710010-16951-1-git-send-email-diwic@ubuntu.com> (raw)

Without this patch, there no way to revert to the old
behaviour with pcm_hw, so currently there will always
be some extra locking.

This seems to be an oversight?

Reported-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: David Henningsson <diwic@ubuntu.com>
---
 src/pcm/pcm_hw.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/pcm/pcm_hw.c b/src/pcm/pcm_hw.c
index 3a5634c..e6a8a4f 100644
--- a/src/pcm/pcm_hw.c
+++ b/src/pcm/pcm_hw.c
@@ -1514,7 +1514,8 @@ int snd_pcm_hw_open_fd(snd_pcm_t **pcmp, const char *name,
 	pcm->poll_events = info.stream == SND_PCM_STREAM_PLAYBACK ? POLLOUT : POLLIN;
 	pcm->tstamp_type = tstamp_type;
 #ifdef THREAD_SAFE_API
-	pcm->thread_safe = 1;
+	if (pcm->thread_safe != -1)
+		pcm->thread_safe = 1;
 #endif
 
 	ret = snd_pcm_hw_mmap_status(pcm);
-- 
1.9.1

             reply	other threads:[~2016-09-01  6:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01  6:06 David Henningsson [this message]
2016-09-01  6:51 ` [PATCH] pcm_hw: Respect LIBASOUND_THREAD_SAFE env var Takashi Iwai
2016-09-01 12:28   ` Takashi Iwai
2016-09-01 19:40     ` David Henningsson
2016-09-02  6:55       ` Takashi Iwai
2016-09-02  8:19         ` Takashi Iwai
2016-09-02  8:21           ` Samuel Thibault

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=1472710010-16951-1-git-send-email-diwic@ubuntu.com \
    --to=diwic@ubuntu.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=perex@perex.cz \
    --cc=samuel.thibault@ens-lyon.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 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).