[alsa-devel] [PATCH] Allow to switch hardware sampe rate on EMU
Commit 57e5c63007955838043e34c732d224b2cbbb128f "emu10k1: allow to disable the SRC" force hardware use only one rate (48000 hz), but EMU have support two hardware sampling rates (44100 and 48000 hz).
Signed-off-by: Mihail Zenkov mihail.zenkov@gmail.com
--- linux-3.8/sound/pci/emu10k1/emupcm.c +++ linux-3.8-1/sound/pci/emu10k1/emupcm.c @@ -1127,7 +1127,7 @@ 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) @@ -1146,7 +1146,11 @@ 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;
At Fri, 22 Feb 2013 17:59:38 +0000, Mihail Zenkov wrote:
Commit 57e5c63007955838043e34c732d224b2cbbb128f "emu10k1: allow to disable the SRC" force hardware use only one rate (48000 hz), but EMU have support two hardware sampling rates (44100 and 48000 hz).
The commit serves for its purpose: it restricts the sample rate only when user specifies to disable h/w resample. Emu chip is driven in 48k rate and other rates are the result of resampling.
In other words, if user doesn't specify the flag, all sample rates are still allowed.
Takashi
Signed-off-by: Mihail Zenkov mihail.zenkov@gmail.com
--- linux-3.8/sound/pci/emu10k1/emupcm.c +++ linux-3.8-1/sound/pci/emu10k1/emupcm.c @@ -1127,7 +1127,7 @@ 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)
@@ -1146,7 +1146,11 @@ 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;
Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Commit 57e5c63007955838043e34c732d224b2cbbb128f "emu10k1: allow to disable the SRC" force hardware use only one rate (48000 hz), but EMU have support two
hardware
sampling rates (44100 and 48000 hz).
The commit serves for its purpose: it restricts the sample rate only when user specifies to disable h/w resample. Emu chip is driven in 48k rate and other rates are the result of resampling.
In other words, if user doesn't specify the flag, all sample rates are still allowed.
I agree that some emu10k1 does not work well with 44100Hz but why 96000Hz are not allowed in Audigy
Does it mean that DSP can not provide accurate pointer for other rate such as 8000Hz playback ?
2013/2/25, Takashi Iwai tiwai@suse.de:
At Fri, 22 Feb 2013 17:59:38 +0000, Mihail Zenkov wrote:
Commit 57e5c63007955838043e34c732d224b2cbbb128f "emu10k1: allow to disable the SRC" force hardware use only one rate (48000 hz), but EMU have support two hardware sampling rates (44100 and 48000 hz).
The commit serves for its purpose: it restricts the sample rate only when user specifies to disable h/w resample. Emu chip is driven in 48k rate and other rates are the result of resampling.
Yes you right, but only for Audigy + Emu chip. EMU 0404/1010/1616 have two crystal oscillators on board. User can switch hardware sample rate (in alsa - with alsamixer). My patch check if we have real EMU and choose correct sample rate to restrict.
At Mon, 25 Feb 2013 09:47:15 +0000, Mihail Zenkov wrote:
2013/2/25, Takashi Iwai tiwai@suse.de:
At Fri, 22 Feb 2013 17:59:38 +0000, Mihail Zenkov wrote:
Commit 57e5c63007955838043e34c732d224b2cbbb128f "emu10k1: allow to disable the SRC" force hardware use only one rate (48000 hz), but EMU have support two hardware sampling rates (44100 and 48000 hz).
The commit serves for its purpose: it restricts the sample rate only when user specifies to disable h/w resample. Emu chip is driven in 48k rate and other rates are the result of resampling.
Yes you right, but only for Audigy + Emu chip. EMU 0404/1010/1616 have two crystal oscillators on board. User can switch hardware sample rate (in alsa - with alsamixer). My patch check if we have real EMU and choose correct sample rate to restrict.
Ah, OK, then your patch would make sense. Could you update the patch description to elaborate a bit more about this?
thanks,
Takashi
2013/2/25, Takashi Iwai tiwai@suse.de:
Ah, OK, then your patch would make sense. Could you update the patch description to elaborate a bit more about this?
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
--- linux-3.8/sound/pci/emu10k1/emupcm.c +++ linux-3.8-1/sound/pci/emu10k1/emupcm.c @@ -1127,7 +1127,7 @@ 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) @@ -1146,7 +1146,11 @@ 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;
At Mon, 25 Feb 2013 10:02:45 +0000, Mihail Zenkov wrote:
2013/2/25, Takashi Iwai tiwai@suse.de:
Ah, OK, then your patch would make sense. Could you update the patch description to elaborate a bit more about this?
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
OK, applied now. Thanks.
Takashi
--- linux-3.8/sound/pci/emu10k1/emupcm.c +++ linux-3.8-1/sound/pci/emu10k1/emupcm.c @@ -1127,7 +1127,7 @@ 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)
@@ -1146,7 +1146,11 @@ 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;
participants (3)
-
Mihail Zenkov
-
Raymond Yau
-
Takashi Iwai