[alsa-devel] ALSA - No sound on MBA2,1
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)
First commit where speaker stops working: commit 3a93897ea37cbb8277f8a4232c12c0c18168a7db Author: Takashi Iwai tiwai@suse.de Date: Fri Oct 28 01:16:55 2011 +0200
ALSA: hda - Manage unsol tags in hda_jack.c
Manage the tags assigned for unsolicited events dynamically together with the jack-detection routines. Basically this is almost same as what we've done in patch_sigmatel.c. Assign the new tag number for each new unsol event, associate with the given NID and the action type, etc.
With this change, now all pins looked over in snd_hda_jack_add_kctls() are actually enabled for detection now even if the pins aren't used for jack-retasking by the driver.
Signed-off-by: Takashi Iwai tiwai@suse.de
First commit where headphone stops working (while speaker already does not work anymore): commit 1a97b7f22774b454531f013638b181803fba470f Author: Takashi Iwai tiwai@suse.de Date: Tue Feb 21 11:11:48 2012 +0100
ALSA: hda/realtek - Remove the last static quirks for ALC882
Resitance is futile. The remaining static model quirks for Apple machines with ALC882-compatible codecs are converted to the auto-parser now. We can remove all alc*_quirks.c finally.
Signed-off-by: Takashi Iwai tiwai@suse.de
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).
Thanks, Bruno
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)
First commit where speaker stops working: commit 3a93897ea37cbb8277f8a4232c12c0c18168a7db Author: Takashi Iwai tiwai@suse.de Date: Fri Oct 28 01:16:55 2011 +0200
ALSA: hda - Manage unsol tags in hda_jack.c Manage the tags assigned for unsolicited events dynamically together with the jack-detection routines. Basically this is almost same as what we've done in patch_sigmatel.c. Assign the new tag number for each new unsol event, associate with the given NID and the action type, etc. With this change, now all pins looked over in snd_hda_jack_add_kctls() are actually enabled for detection now even if the pins aren't used for jack-retasking by the driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
First commit where headphone stops working (while speaker already does not work anymore): commit 1a97b7f22774b454531f013638b181803fba470f Author: Takashi Iwai tiwai@suse.de Date: Tue Feb 21 11:11:48 2012 +0100
ALSA: hda/realtek - Remove the last static quirks for ALC882 Resitance is futile. The remaining static model quirks for Apple machines with ALC882-compatible codecs are converted to the auto-parser now. We can remove all alc*_quirks.c finally. Signed-off-by: Takashi Iwai <tiwai@suse.de>
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
If it still doesn't work, please give alsa-info.sh output with that kernel.
Takashi
Hi Takashi,
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)
If it still doesn't work, please give alsa-info.sh output with that kernel.
`alsa-info --with-devices` is attached.
Bruno
Takashi
At Wed, 4 Dec 2013 11:47:41 +0100, Bruno Prémont wrote:
Hi Takashi,
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?
Takashi
--- 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),
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),
At Wed, 4 Dec 2013 13:42:09 +0100, Bruno Prémont wrote:
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!
OK, I'll queue the patch for upstream.
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)?
You can turn off the auto-mute behavior via "Auto-Mute Mode" mixer enum. The Headphone and Speaker volume/mute can be still controlled manually. And the jack status can be delivered/read via "Headphone Jack" control.
Takashi
On Wed, 04 Dec 2013 13:59:19 +0100 Takashi Iwai wrote:
At Wed, 4 Dec 2013 13:42:09 +0100, Bruno Prémont wrote:
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)?
You can turn off the auto-mute behavior via "Auto-Mute Mode" mixer enum. The Headphone and Speaker volume/mute can be still controlled manually. And the jack status can be delivered/read via "Headphone Jack" control.
Oh, I mis-understood the "Auto-Mute Mode" mixer enum as idle-related thing. Trying it out, it works :)
I've not found the "Headphone Jack" control status within alsamixer though I found it using amixer. If alsamixer does not provide the information it would be a nice feature to add reporting state of such controls. If the information is already available I have not found it.
Thanks for the pointers and your support!
Bruno
Takashi
At Wed, 4 Dec 2013 15:08:40 +0100, Bruno Prémont wrote:
On Wed, 04 Dec 2013 13:59:19 +0100 Takashi Iwai wrote:
At Wed, 4 Dec 2013 13:42:09 +0100, Bruno Prémont wrote:
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)?
You can turn off the auto-mute behavior via "Auto-Mute Mode" mixer enum. The Headphone and Speaker volume/mute can be still controlled manually. And the jack status can be delivered/read via "Headphone Jack" control.
Oh, I mis-understood the "Auto-Mute Mode" mixer enum as idle-related thing. Trying it out, it works :)
I've not found the "Headphone Jack" control status within alsamixer though I found it using amixer.
It's not in MIXER iface space, so it's not visible in alsamixer. It's shown in alsactl or amixer control (no simple control) stuff.
If alsamixer does not provide the information it would be a nice feature to add reporting state of such controls. If the information is already available I have not found it.
It's not documented enough, maybe, as usual :) As a demo, just run: % amixer events
and try to plug/unplug.
Takashi
participants (2)
-
Bruno Prémont
-
Takashi Iwai