Skip to content

Commit

Permalink
ALSA: emu10k1: Allow to switch hardware sampe rate on EMU
Browse files Browse the repository at this point in the history
Commit 57e5c63 "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>
  • Loading branch information
Mihail Zenkov authored and Takashi Iwai committed Feb 25, 2013
1 parent 8554ee4 commit d0ec95f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sound/pci/emu10k1/emupcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ static int snd_emu10k1_playback_open(struct snd_pcm_substream *substream)
struct snd_emu10k1_pcm *epcm;
struct snd_emu10k1_pcm_mixer *mix;
struct snd_pcm_runtime *runtime = substream->runtime;
int i, err;
int i, err, sample_rate;

epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
if (epcm == NULL)
Expand All @@ -1146,7 +1146,11 @@ static int snd_emu10k1_playback_open(struct snd_pcm_substream *substream)
kfree(epcm);
return err;
}
err = snd_pcm_hw_rule_noresample(runtime, 48000);
if (emu->card_capabilities->emu_model && emu->emu1010.internal_clock == 0)
sample_rate = 44100;
else
sample_rate = 48000;
err = snd_pcm_hw_rule_noresample(runtime, sample_rate);
if (err < 0) {
kfree(epcm);
return err;
Expand Down

0 comments on commit d0ec95f

Please sign in to comment.