1 From: Takashi Iwai <tiwai@suse.de>
2 Subject: ALSA: Fix sample rate of Lenovo Ideapad to 44.1kHz
6 Noises can be heard on analog outputs of (some model of) Lenovo
7 Ideapad due to the hardware problem, and the only workaround right now
8 is to fix the sample rate to 44.1kHz.
10 Signed-off-by: Takashi Iwai <tiwai@suse.de>
11 Acked-by: Takashi Iwai <tiwai@suse.de>
14 sound/pci/hda/patch_realtek.c | 34 +++++++++++++++++++++++++++++++---
15 1 file changed, 31 insertions(+), 3 deletions(-)
17 --- a/sound/pci/hda/patch_realtek.c
18 +++ b/sound/pci/hda/patch_realtek.c
19 @@ -12339,6 +12339,27 @@ static int alc269_auto_create_analog_inp
20 #define alc269_pcm_digital_playback alc880_pcm_digital_playback
21 #define alc269_pcm_digital_capture alc880_pcm_digital_capture
23 +static struct hda_pcm_stream alc269_44k_pcm_analog_playback = {
27 + .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
28 + /* NID is set in alc_build_pcms */
30 + .open = alc880_playback_pcm_open,
31 + .prepare = alc880_playback_pcm_prepare,
32 + .cleanup = alc880_playback_pcm_cleanup
36 +static struct hda_pcm_stream alc269_44k_pcm_analog_capture = {
40 + .rates = SNDRV_PCM_RATE_44100, /* fixed rate */
41 + /* NID is set in alc_build_pcms */
45 * BIOS auto configuration
47 @@ -12540,9 +12561,16 @@ static int patch_alc269(struct hda_codec
48 setup_preset(spec, &alc269_presets[board_config]);
50 spec->stream_name_analog = "ALC269 Analog";
51 - spec->stream_analog_playback = &alc269_pcm_analog_playback;
52 - spec->stream_analog_capture = &alc269_pcm_analog_capture;
54 + if (codec->subsystem_id == 0x17aa3bf8) {
55 + /* Due to a hardware problem on Lenovo Ideadpad, we need to
56 + * fix the sample rate of analog I/O to 44.1kHz
58 + spec->stream_analog_playback = &alc269_44k_pcm_analog_playback;
59 + spec->stream_analog_capture = &alc269_44k_pcm_analog_capture;
61 + spec->stream_analog_playback = &alc269_pcm_analog_playback;
62 + spec->stream_analog_capture = &alc269_pcm_analog_capture;
64 spec->stream_name_digital = "ALC269 Digital";
65 spec->stream_digital_playback = &alc269_pcm_digital_playback;
66 spec->stream_digital_capture = &alc269_pcm_digital_capture;