/[pkgs]/rpms/kernel/F-10/alsa-pcm-fix-delta-calc-at-overlap.patch
ViewVC logotype

Contents of /rpms/kernel/F-10/alsa-pcm-fix-delta-calc-at-overlap.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Mon Apr 13 18:21:11 2009 UTC (7 months, 1 week ago) by cebbert
Branch: MAIN
CVS Tags: kernel-2_6_29_1-41_fc10, kernel-2_6_29_3-60_fc10, kernel-2_6_29_6-99_fc10, kernel-2_6_29_1-42_fc10, kernel-2_6_29_6-93_fc10, kernel-2_6_29_2-45_rc1_fc10, kernel-2_6_29_2-48_rc1_fc10, kernel-2_6_29_6-97_fc10, kernel-2_6_29_5-84_fc10, kernel-2_6_29_2-55_fc10, kernel-2_6_29_2-52_fc10, kernel-2_6_29_1-36_fc10, kernel-2_6_29_4-72_fc10, kernel-2_6_29_5-88_fc10, kernel-2_6_29_4-75_fc10, kernel-2_6_29_4-80_fc10, kernel-2_6_29_1-30_fc10, kernel-2_6_29_1-38_fc10, HEAD
File MIME type: text/x-patch
Copy ALSA pulseaudio fixes from F-11.
1 From: Takashi Iwai <tiwai@suse.de>
2 Date: Thu, 19 Mar 2009 09:08:49 +0000 (+0100)
3 Subject: ALSA: pcm - Fix delta calculation at boundary overlap
4 X-Git-Url: http://git.alsa-project.org/?p=alsa-kernel.git;a=commitdiff_plain;h=09a067199b6caa61818fc04f4759048dff13b21c
5
6 ALSA: pcm - Fix delta calculation at boundary overlap
7
8 When the hw_ptr_interrupt reaches the boundary, it must check whether
9 the hw_base was already lapped and corret the delta value appropriately.
10
11 Also, rebasing the hw_ptr needs a correction because buffer_size isn't
12 always aligned to period_size.
13
14 Signed-off-by: Takashi Iwai <tiwai@suse.de>
15 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
16 ---
17
18 diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
19 index 92ed6d8..063c675 100644
20 --- a/sound/core/pcm_lib.c
21 +++ b/sound/core/pcm_lib.c
22 @@ -221,8 +221,11 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
23 new_hw_ptr = hw_base + pos;
24 hw_ptr_interrupt = runtime->hw_ptr_interrupt + runtime->period_size;
25 delta = new_hw_ptr - hw_ptr_interrupt;
26 - if (hw_ptr_interrupt == runtime->boundary)
27 - hw_ptr_interrupt = 0;
28 + if (hw_ptr_interrupt >= runtime->boundary) {
29 + hw_ptr_interrupt %= runtime->boundary;
30 + if (!hw_base) /* hw_base was already lapped; recalc delta */
31 + delta = new_hw_ptr - hw_ptr_interrupt;
32 + }
33 if (delta < 0) {
34 delta += runtime->buffer_size;
35 if (delta < 0) {
36 @@ -233,6 +236,8 @@ static int snd_pcm_update_hw_ptr_interrupt(struct snd_pcm_substream *substream)
37 (long)hw_ptr_interrupt);
38 /* rebase to interrupt position */
39 hw_base = new_hw_ptr = hw_ptr_interrupt;
40 + /* align hw_base to buffer_size */
41 + hw_base -= hw_base % runtime->buffer_size;
42 delta = 0;
43 } else {
44 hw_base += runtime->buffer_size;

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2