Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=174eb8e8cb1ec97904ddeaae54366a03789162ef
Commit:     174eb8e8cb1ec97904ddeaae54366a03789162ef
Parent:     78f3b0b672c79df9ffa55399a7d6fc4b173e9b4b
Author:     Heikki Lindholm <[EMAIL PROTECTED]>
AuthorDate: Fri Nov 23 18:59:18 2007 -0300
Committer:  Mauro Carvalho Chehab <[EMAIL PROTECTED]>
CommitDate: Tue Dec 11 18:08:14 2007 -0200

    V4L/DVB (6666): saa7134-alsa: fix period handling
    
    The period handling in saa7134-alsa is broken in two ways. First, the
    minimum number of periods of two does not work, because the dma is setup
    two periods ahead in the irq handler. Fix the minimum to four periods.
    Second, the code assumes that the number of periods is divisible by two,
    which isn't always the case on ALSA. Fix by adding a constraint.
    
    Signed-off-by: Heikki Lindholm  <[EMAIL PROTECTED]>
    Signed-off-by: Mauro Carvalho Chehab <[EMAIL PROTECTED]>
---
 drivers/media/video/saa7134/saa7134-alsa.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/media/video/saa7134/saa7134-alsa.c 
b/drivers/media/video/saa7134/saa7134-alsa.c
index b9c5cf7..ece177d 100644
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@ -457,7 +457,7 @@ static struct snd_pcm_hardware snd_card_saa7134_capture =
        .buffer_bytes_max =     (256*1024),
        .period_bytes_min =     64,
        .period_bytes_max =     (256*1024),
-       .periods_min =          2,
+       .periods_min =          4,
        .periods_max =          1024,
 };
 
@@ -491,7 +491,7 @@ static int snd_card_saa7134_hw_params(struct 
snd_pcm_substream * substream,
 
        snd_assert(period_size >= 0x100 && period_size <= 0x10000,
                   return -EINVAL);
-       snd_assert(periods >= 2, return -EINVAL);
+       snd_assert(periods >= 4, return -EINVAL);
        snd_assert(period_size * periods <= 1024 * 1024, return -EINVAL);
 
        dev = saa7134->dev;
@@ -647,7 +647,14 @@ static int snd_card_saa7134_capture_open(struct 
snd_pcm_substream * substream)
                saa7134_tvaudio_setmute(dev);
        }
 
-       if ((err = snd_pcm_hw_constraint_integer(runtime, 
SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
+       err = snd_pcm_hw_constraint_integer(runtime,
+                                               SNDRV_PCM_HW_PARAM_PERIODS);
+       if (err < 0)
+               return err;
+
+       err = snd_pcm_hw_constraint_step(runtime, 0,
+                                               SNDRV_PCM_HW_PARAM_PERIODS, 2);
+       if (err < 0)
                return err;
 
        return 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to