]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[ALSA] pcxhr - Fix the sample rate changes
authorTakashi Iwai <tiwai@suse.de>
Tue, 10 Jan 2006 10:14:49 +0000 (11:14 +0100)
committerJaroslav Kysela <perex@suse.cz>
Sun, 22 Jan 2006 15:24:02 +0000 (16:24 +0100)
Modules: Digigram PCXHR driver

Fix the hardware set up when the sample rate is changed multiple times.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/pcxhr/pcxhr.c

index b8c0853a8278167b15f68976d4ad2c4b27229808..57fe9538f5a489a4ca495fc8e600b5e213ed0099 100644 (file)
@@ -744,13 +744,14 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs)
                /* only the first stream can choose the sample rate */
                /* the further opened streams will be limited to its frequency (see open) */
                /* set the clock only once (first stream) */
-               if (mgr->sample_rate == 0) {
+               if (mgr->sample_rate != subs->runtime->rate) {
                        err = pcxhr_set_clock(mgr, subs->runtime->rate);
                        if (err)
                                break;
+                       if (mgr->sample_rate == 0)
+                               /* start the DSP-timer */
+                               err = pcxhr_hardware_timer(mgr, 1);
                        mgr->sample_rate = subs->runtime->rate;
-
-                       err = pcxhr_hardware_timer(mgr, 1);     /* start the DSP-timer */
                }
        } while(0);     /* do only once (so we can use break instead of goto) */