aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorMihail Zenkov <mihail.zenkov@gmail.com>2013-02-22 12:59:38 -0500
committerTakashi Iwai <tiwai@suse.de>2013-02-25 07:39:51 -0500
commitd0ec95fe6a8d9c7da6f9ff885cecbe7e328e2a2e (patch)
tree47b30cc91cac2da330d0d9c5ad9b276b1f6ff822 /sound/pci
parent8554ee405713f8572ed2e8b7d711f4884f253181 (diff)
ALSA: emu10k1: Allow to switch hardware sampe rate on EMU
Commit 57e5c63007955838043e34c732d224b2cbbb128f "emu10k1: allow to disable the SRC" force hardware use only one rate (48000 hz). EMU 0404/1010/1616 have support two hardware sampling rates (44100 and 48000 hz). This patch add check if we have EMU 0404/1010/1616 and choose correct sample rate to restrict. Signed-off-by: Mihail Zenkov <mihail.zenkov@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/emu10k1/emupcm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
index 748a286277eb..5ae1d045bdcb 100644
--- a/sound/pci/emu10k1/emupcm.c
+++ b/sound/pci/emu10k1/emupcm.c
@@ -1127,7 +1127,7 @@ static int snd_emu10k1_playback_open(struct snd_pcm_substream *substream)
1127 struct snd_emu10k1_pcm *epcm; 1127 struct snd_emu10k1_pcm *epcm;
1128 struct snd_emu10k1_pcm_mixer *mix; 1128 struct snd_emu10k1_pcm_mixer *mix;
1129 struct snd_pcm_runtime *runtime = substream->runtime; 1129 struct snd_pcm_runtime *runtime = substream->runtime;
1130 int i, err; 1130 int i, err, sample_rate;
1131 1131
1132 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL); 1132 epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
1133 if (epcm == NULL) 1133 if (epcm == NULL)
@@ -1146,7 +1146,11 @@ static int snd_emu10k1_playback_open(struct snd_pcm_substream *substream)
1146 kfree(epcm); 1146 kfree(epcm);
1147 return err; 1147 return err;
1148 } 1148 }
1149 err = snd_pcm_hw_rule_noresample(runtime, 48000); 1149 if (emu->card_capabilities->emu_model && emu->emu1010.internal_clock == 0)
1150 sample_rate = 44100;
1151 else
1152 sample_rate = 48000;
1153 err = snd_pcm_hw_rule_noresample(runtime, sample_rate);
1150 if (err < 0) { 1154 if (err < 0) {
1151 kfree(epcm); 1155 kfree(epcm);
1152 return err; 1156 return err;