All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Bruno Prémont" <bonbons@linux-vserver.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org
Subject: Re: ALSA - No sound on MBA2,1
Date: Wed, 4 Dec 2013 13:42:09 +0100	[thread overview]
Message-ID: <20131204134209.23a374d7@pluto.restena.lu> (raw)
In-Reply-To: <s5h38m86f0p.wl%tiwai@suse.de>

Hi Takashi,

On Wed, 04 Dec 2013 12:18:14 +0100 Takashi Iwai wrote:
> At Wed, 4 Dec 2013 11:47:41 +0100, Bruno Prémont wrote:
> > On Wed, 04 Dec 2013 08:14:18 +0100 Takashi Iwai wrote:
> > > At Tue, 3 Dec 2013 22:54:13 +0100, Bruno Prémont wrote:
> > > > Hi Takashi,
> > > > 
> > > > Since I started using Linux on a MBA2,1 I never had sound working.
> > > > recently searching for some solution to get sound working I saw that
> > > > some users had sound with 3.2.x kernels and reported it stopped working
> > > > somewhere between 3.2 and 3.4.
> > > > 
> > > > Thus I tried bisecting this and found two steps of losing sound support,
> > > > a first one being losing sound output on built-in speaker, a second
> > > > point where sound through headphone jack stopped working.
> > > > 
> > > > Even with 3.2 non of the mute options is working (I did not try recording
> > > > via build-in microphone)
> > > > 
> > > > ...
> > > > 
> > > > Attached is the output of `alsa-info --with-devices` under current 3.12.2
> > > > kernel and under 3.2.53.
> > > > 
> > > > As this all seems related to quirks being replaced with auto-parsing.
> > > > Trying to revert the commits on top of 3.12.x looks unworkable.
> > > > 
> > > > Is there some extra data I should try to provide or a workaround/fix I
> > > > could try out? I'm booting in EFI mode using EFI stub (did backport it
> > > > from 3.3 to 3.2 for bisecting/testing 3.2).
> > > 
> > > You seem to be passing model=3stack, and this must break things.
> > > To be sure, try sound.git tree for-linus branch without any options.
> > >   git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git
> > 
> > I tried your branch (with merged rc2 from Linus) and there is still no
> > sound.
> > (took some time to test as kernel freezes during boot somewhere in
> > nouveau, thus me merging in rc2 in the hope of a fix for that)
> 
> Thanks.  Could you try the patch below?

Wow, that patch does a marvelous job!

Controls listed by alsamixer seem to all work the way they are intended,
MASTER affects both headphone jack and built-in speaker, muting works
per-channel as does volume.

Even the toggle "Headphone/mic jack" seems to perform the operation
indicated by its name (though I did not try recording yet).


So the patch is (Reported-and-)Tested-by: Bruno Prémont <bonbons@linux-vserver.org>

Thanks for your quick response and looking into this!



A rather borderline question/observation:
When plugging in headphone and the jack is configured as headphone
built-in speaker gets muted (seems reasonable default, hardware
triggered).
Is it possible to have that auto-muting reported in mixer and possibly
overridden via mixer if wanted (possibly via
mute-speaker-if-headphone-plugged option)?


Bruno

> ---
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index d510a88dfe0a..59c36de0cdc2 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -1827,6 +1827,7 @@ enum {
>  	ALC889_FIXUP_DAC_ROUTE,
>  	ALC889_FIXUP_MBP_VREF,
>  	ALC889_FIXUP_IMAC91_VREF,
> +	ALC889_FIXUP_MBA21_VREF,
>  	ALC882_FIXUP_INV_DMIC,
>  	ALC882_FIXUP_NO_PRIMARY_HP,
>  	ALC887_FIXUP_ASUS_BASS,
> @@ -1931,17 +1932,13 @@ static void alc889_fixup_mbp_vref(struct hda_codec *codec,
>  	}
>  }
>  
> -/* Set VREF on speaker pins on imac91 */
> -static void alc889_fixup_imac91_vref(struct hda_codec *codec,
> -				     const struct hda_fixup *fix, int action)
> +static void alc889_fixup_mac_pins(struct hda_codec *codec,
> +				  const hda_nid_t *nids, int num_nids)
>  {
>  	struct alc_spec *spec = codec->spec;
> -	static hda_nid_t nids[2] = { 0x18, 0x1a };
>  	int i;
>  
> -	if (action != HDA_FIXUP_ACT_INIT)
> -		return;
> -	for (i = 0; i < ARRAY_SIZE(nids); i++) {
> +	for (i = 0; i < num_nids; i++) {
>  		unsigned int val;
>  		val = snd_hda_codec_get_pin_target(codec, nids[i]);
>  		val |= AC_PINCTL_VREF_50;
> @@ -1950,6 +1947,26 @@ static void alc889_fixup_imac91_vref(struct hda_codec *codec,
>  	spec->gen.keep_vref_in_automute = 1;
>  }
>  
> +/* Set VREF on speaker pins on imac91 */
> +static void alc889_fixup_imac91_vref(struct hda_codec *codec,
> +				     const struct hda_fixup *fix, int action)
> +{
> +	static hda_nid_t nids[2] = { 0x18, 0x1a };
> +
> +	if (action == HDA_FIXUP_ACT_INIT)
> +		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
> +}
> +
> +/* Set VREF on speaker pins on mba21 */
> +static void alc889_fixup_mba21_vref(struct hda_codec *codec,
> +				    const struct hda_fixup *fix, int action)
> +{
> +	static hda_nid_t nids[2] = { 0x18, 0x19 };
> +
> +	if (action == HDA_FIXUP_ACT_INIT)
> +		alc889_fixup_mac_pins(codec, nids, ARRAY_SIZE(nids));
> +}
> +
>  /* Don't take HP output as primary
>   * Strangely, the speaker output doesn't work on Vaio Z and some Vaio
>   * all-in-one desktop PCs (for example VGC-LN51JGB) through DAC 0x05
> @@ -2149,6 +2166,12 @@ static const struct hda_fixup alc882_fixups[] = {
>  		.chained = true,
>  		.chain_id = ALC882_FIXUP_GPIO1,
>  	},
> +	[ALC889_FIXUP_MBA21_VREF] = {
> +		.type = HDA_FIXUP_FUNC,
> +		.v.func = alc889_fixup_mba21_vref,
> +		.chained = true,
> +		.chain_id = ALC889_FIXUP_MBP_VREF,
> +	},
>  	[ALC882_FIXUP_INV_DMIC] = {
>  		.type = HDA_FIXUP_FUNC,
>  		.v.func = alc_fixup_inv_dmic_0x12,
> @@ -2219,7 +2242,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
>  	SND_PCI_QUIRK(0x106b, 0x3000, "iMac", ALC889_FIXUP_MBP_VREF),
>  	SND_PCI_QUIRK(0x106b, 0x3200, "iMac 7,1 Aluminum", ALC882_FIXUP_EAPD),
>  	SND_PCI_QUIRK(0x106b, 0x3400, "MacBookAir 1,1", ALC889_FIXUP_MBP_VREF),
> -	SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBP_VREF),
> +	SND_PCI_QUIRK(0x106b, 0x3500, "MacBookAir 2,1", ALC889_FIXUP_MBA21_VREF),
>  	SND_PCI_QUIRK(0x106b, 0x3600, "Macbook 3,1", ALC889_FIXUP_MBP_VREF),
>  	SND_PCI_QUIRK(0x106b, 0x3800, "MacbookPro 4,1", ALC889_FIXUP_MBP_VREF),
>  	SND_PCI_QUIRK(0x106b, 0x3e00, "iMac 24 Aluminum", ALC885_FIXUP_MACPRO_GPIO),
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2013-12-04 12:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03 21:54 ALSA - No sound on MBA2,1 Bruno Prémont
2013-12-04  7:14 ` Takashi Iwai
2013-12-04 10:47   ` Bruno Prémont
2013-12-04 11:18     ` Takashi Iwai
2013-12-04 12:42       ` Bruno Prémont [this message]
2013-12-04 12:59         ` Takashi Iwai
2013-12-04 14:08           ` Bruno Prémont
2013-12-04 14:41             ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131204134209.23a374d7@pluto.restena.lu \
    --to=bonbons@linux-vserver.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.