<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>
><br>
> Are you sure that it is alsa driver bug since pulseaudio seem not using<br>
> line out jack to mute internal speakers ?<br>
<br>
</div></div>No, I'm not. I set all my jacks to line out and it works now.<br></blockquote><div><br></div></div>Do pulseaudio 2.1 profile select the internal subwoofer or your 5.1 external speaker ?<br><br>diff --git a/sound/pci/hda/hda_auto_parser.c b/sound/pci/hda/hda_auto_parser.c<br>index 03b7399..c9e45e7 100644<br>@@ -952,6 +960,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec,<br> const struct snd_pci_quirk *q;<br> int id = HDA_FIXUP_ID_NOT_SET;<br> const char *name = NULL;<br>+ int i;<br> <br> if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET)<br> return;<br>@@ -966,6 +975,9 @@ void snd_hda_pick_fixup(struct hda_codec *codec,<br> return;<br> }<br> <br>+ if (!snd_hda_get_int_hint(codec, "alt_config", &i))<br>+ codec->alt_config = i;<br>+<br> if (codec->modelname && models) {<br> while (models->name) {<br> if (!strcmp(codec->modelname, models->name)) {<br>diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h<br>index 12837ab..38841db 100644<br>--- a/sound/pci/hda/hda_codec.h<br>+++ b/sound/pci/hda/hda_codec.h<br>@@ -283,6 +283,8 @@ struct hda_codec {<br> <br> /* additional init verbs */<br> struct snd_array verbs;<br>+ int alt_config;<br>+ int combo_jack;<br> };<br> <br> #define dev_to_hda_codec(_dev) container_of(_dev, struct hda_codec, core.dev)<br>diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c<br>index ac0db16..12ee7f7 100644<br>--- a/sound/pci/hda/hda_generic.c<br>+++ b/sound/pci/hda/hda_generic.c<br>@@ -39,7 +39,6 @@<br> #include "hda_beep.h"<br> #include "hda_generic.h"<br> <br>-<br> /**<br> * snd_hda_gen_spec_init - initialize hda_gen_spec struct<br> * @spec: hda_gen_spec object to initialize<br>@@ -180,10 +179,10 @@ static void parse_user_hints(struct hda_codec *codec)<br> /* the following two are just for compatibility */<br> val = snd_hda_get_bool_hint(codec, "add_out_jack_modes");<br> if (val >= 0)<br>- spec->add_jack_modes = !!val;<br>+ spec->add_out_jack_modes = !!val;<br> val = snd_hda_get_bool_hint(codec, "add_in_jack_modes");<br> if (val >= 0)<br>- spec->add_jack_modes = !!val;<br>+ spec->add_in_jack_modes = !!val;<br> val = snd_hda_get_bool_hint(codec, "add_jack_modes");<br> if (val >= 0)<br> spec->add_jack_modes = !!val;<br>@@ -2648,7 +2720,7 @@ static void get_jack_mode_name(struct hda_codec *codec, hda_nid_t pin,<br> static int get_out_jack_num_items(struct hda_codec *codec, hda_nid_t pin)<br> {<br> struct hda_gen_spec *spec = codec->spec;<br>- if (spec->add_jack_modes) {<br>+ if (spec->add_jack_modes || spec->add_out_jack_modes) {<br> unsigned int pincap = snd_hda_query_pin_caps(codec, pin);<br> if ((pincap & AC_PINCAP_OUT) && (pincap & AC_PINCAP_HP_DRV))<br> return 2;<br>@@ -2791,7 +2863,7 @@ static int get_in_jack_num_items(struct hda_codec *codec, hda_nid_t pin)<br> {<br> struct hda_gen_spec *spec = codec->spec;<br> int nitems = 0;<br>- if (spec->add_jack_modes)<br>+ if (spec->add_jack_modes || spec->add_in_jack_modes)<br> nitems = hweight32(get_vref_caps(codec, pin));<br> return nitems ? nitems : 1;<br> }<br>@@ -3287,7 +3359,7 @@ static int create_input_ctls(struct hda_codec *codec)<br> if (err < 0)<br> return err;<br> <br>- if (spec->add_jack_modes) {<br>+ if (spec->add_jack_modes || spec->add_in_jack_modes) {<br> err = create_in_jack_mode(codec, pin);<br> if (err < 0)<br> return err;<br>@@ -4895,13 +4971,13 @@ int snd_hda_gen_parse_auto_config(struct hda_codec *codec,<br> */<br> if (spec->hp_mic_pin &&<br> (spec->auto_mic || spec->input_mux.num_items == 1 ||<br>- spec->add_jack_modes)) {<br>+ spec->add_jack_modes || spec->add_in_jack_modes)) {<br> err = create_hp_mic_jack_mode(codec, spec->hp_mic_pin);<br> if (err < 0)<br> return err;<br> }<br> <br>- if (spec->add_jack_modes) {<br>+ if (spec->add_jack_modes || spec->add_out_jack_modes) {<br> if (cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {<br> err = create_out_jack_modes(codec, cfg->line_outs,<br> cfg->line_out_pins);<br>diff --git a/sound/pci/hda/hda_generic.h b/sound/pci/hda/hda_generic.h<br>index 56e4139..f10c55b 100644<br>--- a/sound/pci/hda/hda_generic.h<br>+++ b/sound/pci/hda/hda_generic.h<br>@@ -227,6 +229,8 @@ struct hda_gen_spec {<br> unsigned int prefer_hp_amp:1; /* enable HP amp for speaker if any */<br> unsigned int add_stereo_mix_input:2; /* add aamix as a capture src */<br> unsigned int add_jack_modes:1; /* add i/o jack mode enum ctls */<br>+ unsigned int add_in_jack_modes:1; /* add in jack mode enum ctls */<br>+ unsigned int add_out_jack_modes:1; /* add out jack mode enum ctls */<br> unsigned int power_down_unused:1; /* power down unused widgets */<br> unsigned int dac_min_mute:1; /* minimal = mute for DACs */<br> <br>diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c<br>index 8e02cdf..b13f588 100644<br>--- a/sound/pci/hda/patch_realtek.c<br>+++ b/sound/pci/hda/patch_realtek.c<br>@@ -1914,6 +1914,62 @@ static void alc889_fixup_mba21_vref(struct hda_codec *codec,<br> alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));<br> }<br> <br>+static const struct snd_pcm_chmap_elem acer_pcm_chmaps[] = {<br>+ { .channels = 2,<br>+ .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },<br>+ { .channels = 4,<br>+ .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,<br>+ SNDRV_CHMAP_LFE, SNDRV_CHMAP_NA } }, /* LFE only on left */<br>+ { .channels = 4,<br>+ .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,<br>+ SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } }, <br>+ { .channels = 6,<br>+ .map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR,<br>+ SNDRV_CHMAP_RL, SNDRV_CHMAP_RR,<br>+ SNDRV_CHMAP_FC, SNDRV_CHMAP_LFE } },<br>+ { }<br>+};<br>+<br>+static void alc888_fixup_acer_aspire_4930g(struct hda_codec *codec,<br>+ const struct hda_fixup *fix, int action)<br>+{<br>+ static const struct hda_pintbl subwoofer_cfg[] = {<br>+ { 0x16, 0x90170111 }, /* internal subwoofer */ <br>+ {}<br>+ };<br>+ static const struct hda_pintbl front_cfg[] = {<br>+ { 0x15, 0x02014010},<br>+ {}<br>+ };<br>+ static const struct hda_pintbl rear_cfg[] = {<br>+ { 0x1a, 0x02014011},<br>+ {}<br>+ };<br>+ static const struct hda_pintbl clfe_cfg[] = {<br>+ { 0x18, 0x02014012},<br>+ {}<br>+ };<br>+ struct alc_spec *spec = codec->spec;<br>+ switch(action){<br>+ case HDA_FIXUP_ACT_PRE_PROBE:<br>+ snd_hda_apply_pincfgs(codec, subwoofer_cfg);<br>+ spec->gen.add_out_jack_modes = true;<br>+ switch(codec->alt_config){<br>+ case 3:<br>+ snd_hda_apply_pincfgs(codec, clfe_cfg);<br>+ case 2:<br>+ snd_hda_apply_pincfgs(codec, rear_cfg);<br>+ case 1:<br>+ snd_hda_apply_pincfgs(codec, front_cfg);<br>+ break;<br>+ }<br>+ break;<br>+ case HDA_FIXUP_ACT_BUILD:<br>+ spec->gen.pcm_rec[0]->stream[0].chmap = acer_pcm_chmaps;<br>+ break;<br>+ }<br>+}<br>+<br> /* Don't take HP output as primary<br> * Strangely, the speaker output doesn't work on Vaio Z and some Vaio<br> * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05<br>@@ -2048,12 +2104,8 @@ static const struct hda_fixup alc882_fixups[] = {<br> .v.func = alc889_fixup_coef,<br> },<br> [ALC882_FIXUP_ACER_ASPIRE_4930G] = {<br>- .type = HDA_FIXUP_PINS,<br>- .v.pins = (const struct hda_pintbl[]) {<br>- { 0x16, 0x99130111 }, /* CLFE speaker */<br>- { 0x17, 0x99130112 }, /* surround speaker */<br>- { }<br>- },<br>+ .type = HDA_FIXUP_FUNC,<br>+ .v.func = alc888_fixup_acer_aspire_4930g,<br> .chained = true,<br> .chain_id = ALC882_FIXUP_GPIO1,<br> },<br><br></div></div>