rpms/kernel/devel alsa-tell-user-that-stream-to-be-rewound-is-suspended.patch, NONE, 1.1 kernel.spec, 1.1688, 1.1689

Kyle McMartin kyle at fedoraproject.org
Tue Aug 4 15:18:24 UTC 2009


Author: kyle

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14036

Modified Files:
	kernel.spec 
Added Files:
	alsa-tell-user-that-stream-to-be-rewound-is-suspended.patch 
Log Message:
* Tue Aug 04 2009 Kyle McMartin <kyle at redhat.com>
- alsa-tell-user-that-stream-to-be-rewound-is-suspended.patch: apply patch
  destined for 2.6.32, requested by Lennart.


alsa-tell-user-that-stream-to-be-rewound-is-suspended.patch:
 pcm_native.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

--- NEW FILE alsa-tell-user-that-stream-to-be-rewound-is-suspended.patch ---
>From 7402d155b5ba6551241cdde9724c2c49dd6cc7ea Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak at v3.sk>
Date: Sun, 2 Aug 2009 17:41:28 +0200
Subject: [PATCH] Tell user that stream to be rewound is suspended

Return STRPIPE instead of EBADF when userspace attempts to rewind
of forward a stream that was suspended in meanwhile, so that it
can be recovered by snd_pcm_recover().

This was causing Pulseaudio to unload the ALSA sink module under a race
condition when it attempted to rewind the stream right after resume from
suspend, before writing to the stream which would cause it to revive the
stream otherwise. Tested to work with Pulseaudio patched to attempt to
snd_pcm_recover() upon receiving an error from snd_pcm_rewind().

Signed-off-by: Lubomir Rintel <lkundrak at v3.sk>
---
 sound/core/pcm_native.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index ac2150e..d89c816 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -2208,6 +2208,9 @@ static snd_pcm_sframes_t snd_pcm_playback_rewind(struct snd_pcm_substream *subst
 	case SNDRV_PCM_STATE_XRUN:
 		ret = -EPIPE;
 		goto __end;
+	case SNDRV_PCM_STATE_SUSPENDED:
+		ret = -ESTRPIPE;
+		goto __end;
 	default:
 		ret = -EBADFD;
 		goto __end;
@@ -2253,6 +2256,9 @@ static snd_pcm_sframes_t snd_pcm_capture_rewind(struct snd_pcm_substream *substr
 	case SNDRV_PCM_STATE_XRUN:
 		ret = -EPIPE;
 		goto __end;
+	case SNDRV_PCM_STATE_SUSPENDED:
+		ret = -ESTRPIPE;
+		goto __end;
 	default:
 		ret = -EBADFD;
 		goto __end;
@@ -2299,6 +2305,9 @@ static snd_pcm_sframes_t snd_pcm_playback_forward(struct snd_pcm_substream *subs
 	case SNDRV_PCM_STATE_XRUN:
 		ret = -EPIPE;
 		goto __end;
+	case SNDRV_PCM_STATE_SUSPENDED:
+		ret = -ESTRPIPE;
+		goto __end;
 	default:
 		ret = -EBADFD;
 		goto __end;
@@ -2345,6 +2354,9 @@ static snd_pcm_sframes_t snd_pcm_capture_forward(struct snd_pcm_substream *subst
 	case SNDRV_PCM_STATE_XRUN:
 		ret = -EPIPE;
 		goto __end;
+	case SNDRV_PCM_STATE_SUSPENDED:
+		ret = -ESTRPIPE;
+		goto __end;
 	default:
 		ret = -EBADFD;
 		goto __end;
-- 
1.6.2.5



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/kernel.spec,v
retrieving revision 1.1688
retrieving revision 1.1689
diff -u -p -r1.1688 -r1.1689
--- kernel.spec	4 Aug 2009 06:46:47 -0000	1.1688
+++ kernel.spec	4 Aug 2009 15:18:23 -0000	1.1689
@@ -646,6 +646,7 @@ Patch580: linux-2.6-sparc-selinux-mprote
 Patch600: linux-2.6-defaults-alsa-hda-beep-off.patch
 Patch601: linux-2.6-alsa-improve-hda-powerdown.patch
 Patch610: hda_intel-prealloc-4mb-dmabuffer.patch
+Patch611: alsa-tell-user-that-stream-to-be-rewound-is-suspended.patch
 
 Patch670: linux-2.6-ata-quirk.patch
 
@@ -1212,6 +1213,7 @@ ApplyPatch linux-2.6-defaults-aspm.patch
 ApplyPatch linux-2.6-defaults-alsa-hda-beep-off.patch
 ApplyPatch linux-2.6-alsa-improve-hda-powerdown.patch
 ApplyPatch hda_intel-prealloc-4mb-dmabuffer.patch
+ApplyPatch alsa-tell-user-that-stream-to-be-rewound-is-suspended.patch
 
 # Networking
 
@@ -1944,6 +1946,10 @@ fi
 # and build.
 
 %changelog
+* Tue Aug 04 2009 Kyle McMartin <kyle at redhat.com>
+- alsa-tell-user-that-stream-to-be-rewound-is-suspended.patch: apply patch
+  destined for 2.6.32, requested by Lennart.
+
 * Tue Aug 04 2009 Ben Skeggs <bskeggs at redhat.com>
 - nouveau: more code share between nv50/<nv50 kms, bug fixes
 




More information about the scm-commits mailing list