Skip to content

Commit 3ac2514

Browse files
ossilatortiwai
authored andcommitted
ALSA: emu10k1: add support for 12 kHz capture on Audigy
Fixes a tentative FIXME. Because we can. Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Link: https://lore.kernel.org/r/20230612191325.1315854-9-oswald.buddenhagen@gmx.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent ca53344 commit 3ac2514

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

sound/pci/emu10k1/emupcm.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,22 @@ static unsigned int snd_emu10k1_capture_rate_reg(unsigned int rate)
177177
}
178178
}
179179

180+
static const unsigned int audigy_capture_rates[9] = {
181+
8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000
182+
};
183+
184+
static const struct snd_pcm_hw_constraint_list hw_constraints_audigy_capture_rates = {
185+
.count = 9,
186+
.list = audigy_capture_rates,
187+
.mask = 0
188+
};
189+
180190
static unsigned int snd_emu10k1_audigy_capture_rate_reg(unsigned int rate)
181191
{
182192
switch (rate) {
183193
case 8000: return A_ADCCR_SAMPLERATE_8;
184194
case 11025: return A_ADCCR_SAMPLERATE_11;
185-
case 12000: return A_ADCCR_SAMPLERATE_12; /* really supported? */
195+
case 12000: return A_ADCCR_SAMPLERATE_12;
186196
case 16000: return ADCCR_SAMPLERATE_16;
187197
case 22050: return ADCCR_SAMPLERATE_22;
188198
case 24000: return ADCCR_SAMPLERATE_24;
@@ -209,7 +219,8 @@ static void snd_emu10k1_constrain_capture_rates(struct snd_emu10k1 *emu,
209219
return;
210220
}
211221
snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
212-
&hw_constraints_capture_rates);
222+
emu->audigy ? &hw_constraints_audigy_capture_rates :
223+
&hw_constraints_capture_rates);
213224
}
214225

215226
static void snd_emu1010_constrain_efx_rate(struct snd_emu10k1 *emu,

0 commit comments

Comments
 (0)