rpms/kernel/F-10 alsa-pcm-core-avoid-jiffies-check.patch, NONE, 1.1 kernel.spec, 1.1357, 1.1358

Chuck Ebbert cebbert at fedoraproject.org
Sat May 9 03:08:37 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv15141

Modified Files:
	kernel.spec 
Added Files:
	alsa-pcm-core-avoid-jiffies-check.patch 
Log Message:
ALSA: Avoid jiffies check for devices with BATCH flag

alsa-pcm-core-avoid-jiffies-check.patch:

--- NEW FILE alsa-pcm-core-avoid-jiffies-check.patch ---
From: Takashi Iwai <tiwai at suse.de>
Date: Tue, 28 Apr 2009 10:07:08 +0000 (+0200)
Subject: ALSA: pcm core - Avoid jiffies check for devices with BATCH flag
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=3e5b50165fd0be080044586f43fcdd460ed27610

ALSA: pcm core - Avoid jiffies check for devices with BATCH flag

The hardware devices with SNDRV_PCM_INFO_BATCH flag can't give the
precise current position.  And such hardwares have often big FIFO
in addition to the ring buffer, and it screws up the jiffies check
in pcm_lib.c.

This patch adds a simple check of info flag so that the driver skips
the jiffies check in snd_pcm_period_elapsed() when BATCH flag is set.

Signed-off-by: Takashi Iwai <tiwai at suse.de>
---

diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 63d088f..a2a792c 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -249,6 +249,12 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
 			new_hw_ptr = hw_base + pos;
 		}
 	}
+	/* Skip the jiffies check for hardwares with BATCH flag.
+	 * Such hardware usually just increases the position at each IRQ,
+	 * thus it can't give any strange position.
+	 */
+	if (runtime->hw.info & SNDRV_PCM_INFO_BATCH)
+		goto no_jiffies_check;
 	hdelta = new_hw_ptr - old_hw_ptr;
 	jdelta = jiffies - runtime->hw_ptr_jiffies;
 	if (((hdelta * HZ) / runtime->rate) > jdelta + HZ/100) {
@@ -272,6 +278,7 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
 		hw_base -= hw_base % runtime->buffer_size;
 		delta = 0;
 	}
+ no_jiffies_check:
 	if (delta > runtime->period_size + runtime->period_size / 2) {
 		hw_ptr_error(substream,
 			     "Lost interrupts? "


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-10/kernel.spec,v
retrieving revision 1.1357
retrieving revision 1.1358
diff -u -p -r1.1357 -r1.1358
--- kernel.spec	8 May 2009 14:44:40 -0000	1.1357
+++ kernel.spec	9 May 2009 03:08:07 -0000	1.1358
@@ -641,6 +641,7 @@ Patch608: alsa-pcm-midlevel-add-more-str
 Patch609: alsa-hda_intel-prealloc-4mb-dmabuffer.patch
 Patch610: alsa-add-subdevice_mask-to-quirk-entries.patch
 Patch611: alsa-hda-update-quirks.patch
+Patch612: alsa-pcm-core-avoid-jiffies-check.patch
 
 Patch670: linux-2.6-ata-quirk.patch
 
@@ -1254,6 +1255,7 @@ ApplyPatch alsa-pcm-midlevel-add-more-st
 ApplyPatch alsa-hda_intel-prealloc-4mb-dmabuffer.patch
 ApplyPatch alsa-add-subdevice_mask-to-quirk-entries.patch
 ApplyPatch alsa-hda-update-quirks.patch
+ApplyPatch alsa-pcm-core-avoid-jiffies-check.patch
 
 # Networking
 
@@ -1938,6 +1940,9 @@ fi
 %kernel_variant_files -k vmlinux %{with_kdump} kdump
 
 %changelog
+* Fri May 08 2009 Chuck Ebbert <cebbert at redhat.com> 2.6.29.2-58
+- ALSA: Avoid jiffies check for devices with BATCH flag
+
 * Fri May 08 2009 Kyle McMartin <kyle at redhat.com> 2.6.29.2-57
 - Fix build error in "mm: evict streaming I/O pages before other pages"
 




More information about the scm-commits mailing list