diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-05-03 16:51:56 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-05-03 16:51:56 +0200 |
commit | 8bd172dc96fba8ba5a7560afdc1ff7461c278e86 (patch) | |
tree | 3e116afc5055bd0b54b4e0ae065c33c1f3e97e47 /sound/pci/lola/lola_pcm.c | |
parent | 972505ccde9a3bdc8455f4cf3d3f37d17f8f10a3 (diff) |
ALSA: lola - Allow granularity changes
Add some sanity checks.
Change PCM parameters appropriately per granularity.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/lola/lola_pcm.c')
-rw-r--r-- | sound/pci/lola/lola_pcm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sound/pci/lola/lola_pcm.c b/sound/pci/lola/lola_pcm.c index dc2e811dcb3..4bb5b5bd637 100644 --- a/sound/pci/lola/lola_pcm.c +++ b/sound/pci/lola/lola_pcm.c @@ -178,14 +178,16 @@ static int lola_pcm_open(struct snd_pcm_substream *substream) str->opened = 1; runtime->hw = lola_pcm_hw; runtime->hw.channels_max = pcm->num_streams - str->index; + runtime->hw.rate_min = chip->sample_rate_min; + runtime->hw.rate_max = chip->sample_rate_max; snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); /* period size = multiple of chip->granularity (8, 16 or 32 frames) * use LOLA_GRANULARITY_MAX = 32 for instance */ snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, - LOLA_GRANULARITY_MAX); + chip->granularity); snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, - LOLA_GRANULARITY_MAX); + chip->granularity); mutex_unlock(&chip->open_mutex); return 0; } |