alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Macbook Air 2,1 - no mic nor main speakers
@ 2010-02-06 18:27 Reimundo Heluani
  2010-02-22  6:30 ` Reimundo Heluani
  0 siblings, 1 reply; 8+ messages in thread
From: Reimundo Heluani @ 2010-02-06 18:27 UTC (permalink / raw)
  To: alsa-devel

Hello list, this came up a year ago and Takashi's answer was "a broken
bios". I was hoping someone here could point me to documentation to read
in order to diagnose the problem if indeed is a broken bios. I don't
want to start randombly reading the driver's code.

Macbook Air 2,1
2.6.32-gentoo-r3 SMP x86_64
Alsa Driver 1.0.21 libs 1.0.22
nVidia Corporation MCP79 High Definition Audio (rev b1)
HDA NVidia at 0x93380000 irq 19
00:08.0 0403: 10de:0ac0 (rev b1)  Subsystem: 10de:cb79
Codec: Realtek ALC889A

Booting with snd_hda_intel.model=mbp3 get sound on headphones, but not on mainspeakers. The mic never worked.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Macbook Air 2,1 - no mic nor main speakers
  2010-02-06 18:27 Macbook Air 2,1 - no mic nor main speakers Reimundo Heluani
@ 2010-02-22  6:30 ` Reimundo Heluani
  2010-02-22  7:55   ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: Reimundo Heluani @ 2010-02-22  6:30 UTC (permalink / raw)
  To: alsa-devel

On Sat, 2010-02-06 at 10:27 -0800, Reimundo Heluani wrote:
> Hello list, this came up a year ago and Takashi's answer was "a broken
> bios". I was hoping someone here could point me to documentation to read
> in order to diagnose the problem if indeed is a broken bios. I don't
> want to start randombly reading the driver's code.
> 
> Macbook Air 2,1
> 2.6.32-gentoo-r3 SMP x86_64
> Alsa Driver 1.0.21 libs 1.0.22
> nVidia Corporation MCP79 High Definition Audio (rev b1)
> HDA NVidia at 0x93380000 irq 19
> 00:08.0 0403: 10de:0ac0 (rev b1)  Subsystem: 10de:cb79
> Codec: Realtek ALC889A
> 
> Booting with snd_hda_intel.model=mbp3 get sound on headphones, but not on mainspeakers. The mic never worked.
> 

Hello again, I found out that puting the pin in 0x18 as a PIN_OUT I get
sound in the internal speaker. Currently I can change patch_realtek.c to
load the driver using an "mba21" model and I get sound on the main
speaker. One of the (many) problems I have is that I need to use
something like

{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) } 

otherwise it goes into HiZ and I get no audio. Looking at that
patch_realtek.c I don't see anything similar. Anyway, I don't have a
clue about ALSA, I just started reading the HDA specification and looked
over patch_realtek.c and came up with the small change below to have a
working main speaker. I'd appreciate if you had any suggestion for the
mic or to point me towards the right documentation.

Sincerely, 

R.

*** patch_realtek.c.orig	Sun Feb 21 01:23:58 2010
--- patch_realtek.c	Sun Feb 21 19:42:13 2010
***************
*** 205,210 ****
--- 205,211 ----
  	ALC882_ASUS_A7J,
  	ALC882_ASUS_A7M,
  	ALC885_MACPRO,
+ 	ALC885_MBA21,
  	ALC885_MBP3,
  	ALC885_MB5,
  	ALC885_IMAC24,
***************
*** 6749,6754 ****
--- 6750,6766 ----
  	{ 8, alc882_sixstack_ch8_init },
  };
  
+ /* Macbook Air I have no clue how it works yet */
+ 
+ static struct hda_verb alc885_mba21_init[] = {
+ 	{ 0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT },
+ 	{ } /* end */
+ };
+ 
+ static struct hda_channel_mode alc885_mba21_ch_modes[1] = {
+ 	{ 2, alc885_mba21_init },
+ };
+ 
  /*
   * macbook pro ALC885 can switch LineIn to LineOut without losing Mic
   */
***************
*** 7020,7025 ****
--- 7032,7045 ----
  	{ } /* end */
  };
  
+ 
+ static struct snd_kcontrol_new alc885_mba21_mixer[] = {
+ 	HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
+ 	HDA_BIND_MUTE	("Speaker Playback Switch", 0x0c, 0x02, HDA_OUTPUT),
+ 	{ }
+ };
+ 
+ 
  static struct snd_kcontrol_new alc885_mbp3_mixer[] = {
  	HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
  	HDA_BIND_MUTE   ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
***************
*** 7444,7449 ****
--- 7464,7482 ----
  	{ }
  };
  
+ static struct hda_verb alc885_mba21_init_verbs[] = {
+ 	/*Internal Speaker Mixer*/
+ 	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 
+     {0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
+ 	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
+ 	/*Internal Speaker Pin*/
+ 	{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT |
AC_PINCTL_VREF_50) },
+ 	{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+ 	{0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
+ 
+ 	{ }
+ };
+ 
  /* Macbook Pro rev3 */
  static struct hda_verb alc885_mbp3_init_verbs[] = {
  	/* Front mixer: unmute input/output amp left and right (volume = 0)
*/
***************
*** 7546,7551 ****
--- 7579,7593 ----
  	spec->autocfg.speaker_pins[1] = 0x1a;
  }
  
+ /* Macbook Air don't know how this works */
+ static void alc885_mba21_setup (struct hda_codec *codec)
+ {
+ 	struct alc_spec *spec = codec->spec;
+ 
+ 	spec->autocfg.speaker_pins[0] = 0x18;
+ }
+ 
+ 
  static void alc885_mbp3_setup(struct hda_codec *codec)
  {
  	struct alc_spec *spec = codec->spec;
***************
*** 8737,8742 ****
--- 8779,8785 ----
  	[ALC882_ASUS_A7M]	= "asus-a7m",
  	[ALC885_MACPRO]		= "macpro",
  	[ALC885_MB5]		= "mb5",
+ 	[ALC885_MBA21]		= "mba21",
  	[ALC885_MBP3]		= "mbp3",
  	[ALC885_IMAC24]		= "imac24",
  	[ALC883_3ST_2ch_DIG]	= "3stack-2ch-dig",
***************
*** 8969,8974 ****
--- 9012,9032 ----
  		.input_mux = &alc882_capture_source,
  		.dig_out_nid = ALC882_DIGOUT_NID,
  	},
+ 	[ALC885_MBA21] = {
+ 		.mixers = { alc885_mba21_mixer }, 
+ 		.init_verbs = { alc885_mba21_init_verbs, alc880_gpio1_init_verbs },
+ 		.num_dacs = 2,
+ 		.dac_nids = alc882_dac_nids,
+ 		.hp_nid = 0x04,
+ 		.channel_mode = alc885_mba21_ch_modes,
+ 		.num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
+ 		.input_mux = &alc882_capture_source,
+ 		.dig_out_nid = ALC882_DIGOUT_NID,
+ 		.dig_in_nid = ALC882_DIGIN_NID,
+ 		.unsol_event = alc_automute_amp_unsol_event,
+ 		.setup = alc885_mba21_setup,
+ 		.init_hook = alc_automute_amp,
+ 	},
  	[ALC885_MBP3] = {
  		.mixers = { alc885_mbp3_mixer, alc882_chmode_mixer },
  		.init_verbs = { alc885_mbp3_init_verbs,

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Macbook Air 2,1 - no mic nor main speakers
  2010-02-22  6:30 ` Reimundo Heluani
@ 2010-02-22  7:55   ` Takashi Iwai
  2010-02-22  8:02     ` Reimundo Heluani
  2010-02-23  2:12     ` Reimundo Heluani
  0 siblings, 2 replies; 8+ messages in thread
From: Takashi Iwai @ 2010-02-22  7:55 UTC (permalink / raw)
  To: Reimundo Heluani; +Cc: alsa-devel

At Sun, 21 Feb 2010 22:30:58 -0800,
Reimundo Heluani wrote:
> 
> On Sat, 2010-02-06 at 10:27 -0800, Reimundo Heluani wrote:
> > Hello list, this came up a year ago and Takashi's answer was "a broken
> > bios". I was hoping someone here could point me to documentation to read
> > in order to diagnose the problem if indeed is a broken bios. I don't
> > want to start randombly reading the driver's code.
> > 
> > Macbook Air 2,1
> > 2.6.32-gentoo-r3 SMP x86_64
> > Alsa Driver 1.0.21 libs 1.0.22
> > nVidia Corporation MCP79 High Definition Audio (rev b1)
> > HDA NVidia at 0x93380000 irq 19
> > 00:08.0 0403: 10de:0ac0 (rev b1)  Subsystem: 10de:cb79
> > Codec: Realtek ALC889A
> > 
> > Booting with snd_hda_intel.model=mbp3 get sound on headphones, but not on mainspeakers. The mic never worked.
> > 
> 
> Hello again, I found out that puting the pin in 0x18 as a PIN_OUT I get
> sound in the internal speaker. Currently I can change patch_realtek.c to
> load the driver using an "mba21" model and I get sound on the main
> speaker. One of the (many) problems I have is that I need to use
> something like
> 
> {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) } 
> 
> otherwise it goes into HiZ and I get no audio. Looking at that
> patch_realtek.c I don't see anything similar. Anyway, I don't have a
> clue about ALSA, I just started reading the HDA specification and looked
> over patch_realtek.c and came up with the small change below to have a
> working main speaker. I'd appreciate if you had any suggestion for the
> mic or to point me towards the right documentation.

The change looks almost good -- except for one place.

>   
> + /* Macbook Air don't know how this works */
> + static void alc885_mba21_setup (struct hda_codec *codec)
> + {
> + 	struct alc_spec *spec = codec->spec;
> + 
> + 	spec->autocfg.speaker_pins[0] = 0x18;

Does this device have no dedicated headphone output pin?
Usually it's either 0x14 or 0x15.

Also, please make a patch in a unified diff format.

If the patch is ready for merge, please post it (and add me to Cc)
with a proper changelog and your sign-off.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Macbook Air 2,1 - no mic nor main speakers
  2010-02-22  7:55   ` Takashi Iwai
@ 2010-02-22  8:02     ` Reimundo Heluani
  2010-02-22  8:05       ` Takashi Iwai
  2010-02-23  2:12     ` Reimundo Heluani
  1 sibling, 1 reply; 8+ messages in thread
From: Reimundo Heluani @ 2010-02-22  8:02 UTC (permalink / raw)
  To: alsa-devel

On Mon, 2010-02-22 at 08:55 +0100, Takashi Iwai wrote:
> At Sun, 21 Feb 2010 22:30:58 -0800,
> Reimundo Heluani wrote:
> > 
> > On Sat, 2010-02-06 at 10:27 -0800, Reimundo Heluani wrote:
> > > Hello list, this came up a year ago and Takashi's answer was "a broken
> > > bios". I was hoping someone here could point me to documentation to read
> > > in order to diagnose the problem if indeed is a broken bios. I don't
> > > want to start randombly reading the driver's code.
> > > 
> > > Macbook Air 2,1
> > > 2.6.32-gentoo-r3 SMP x86_64
> > > Alsa Driver 1.0.21 libs 1.0.22
> > > nVidia Corporation MCP79 High Definition Audio (rev b1)
> > > HDA NVidia at 0x93380000 irq 19
> > > 00:08.0 0403: 10de:0ac0 (rev b1)  Subsystem: 10de:cb79
> > > Codec: Realtek ALC889A
> > > 
> > > Booting with snd_hda_intel.model=mbp3 get sound on headphones, but not on mainspeakers. The mic never worked.
> > > 
> > 
> > Hello again, I found out that puting the pin in 0x18 as a PIN_OUT I get
> > sound in the internal speaker. Currently I can change patch_realtek.c to
> > load the driver using an "mba21" model and I get sound on the main
> > speaker. One of the (many) problems I have is that I need to use
> > something like
> > 
> > {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) } 
> > 
> > otherwise it goes into HiZ and I get no audio. Looking at that
> > patch_realtek.c I don't see anything similar. Anyway, I don't have a
> > clue about ALSA, I just started reading the HDA specification and looked
> > over patch_realtek.c and came up with the small change below to have a
> > working main speaker. I'd appreciate if you had any suggestion for the
> > mic or to point me towards the right documentation.
> 
> The change looks almost good -- except for one place.
> 
> >   
> > + /* Macbook Air don't know how this works */
> > + static void alc885_mba21_setup (struct hda_codec *codec)
> > + {
> > + 	struct alc_spec *spec = codec->spec;
> > + 
> > + 	spec->autocfg.speaker_pins[0] = 0x18;
> 
> Does this device have no dedicated headphone output pin?
> Usually it's either 0x14 or 0x15.

The headphones are in 0x14 but I couldn't get them to shut the main
speakers off yet when the hp jack is connected. As soon as I understand
how the other examples in patch_realtek.c work and get this working I'll
send you a working patch.

R.
> 
> Also, please make a patch in a unified diff format.
> 
> If the patch is ready for merge, please post it (and add me to Cc)
> with a proper changelog and your sign-off.
> 
> 
> thanks,
> 
> Takashi

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Macbook Air 2,1 - no mic nor main speakers
  2010-02-22  8:02     ` Reimundo Heluani
@ 2010-02-22  8:05       ` Takashi Iwai
  2010-02-22 17:58         ` Reimundo Heluani
  0 siblings, 1 reply; 8+ messages in thread
From: Takashi Iwai @ 2010-02-22  8:05 UTC (permalink / raw)
  To: Reimundo Heluani; +Cc: alsa-devel

At Mon, 22 Feb 2010 00:02:13 -0800,
Reimundo Heluani wrote:
> 
> On Mon, 2010-02-22 at 08:55 +0100, Takashi Iwai wrote:
> > At Sun, 21 Feb 2010 22:30:58 -0800,
> > Reimundo Heluani wrote:
> > > 
> > > On Sat, 2010-02-06 at 10:27 -0800, Reimundo Heluani wrote:
> > > > Hello list, this came up a year ago and Takashi's answer was "a broken
> > > > bios". I was hoping someone here could point me to documentation to read
> > > > in order to diagnose the problem if indeed is a broken bios. I don't
> > > > want to start randombly reading the driver's code.
> > > > 
> > > > Macbook Air 2,1
> > > > 2.6.32-gentoo-r3 SMP x86_64
> > > > Alsa Driver 1.0.21 libs 1.0.22
> > > > nVidia Corporation MCP79 High Definition Audio (rev b1)
> > > > HDA NVidia at 0x93380000 irq 19
> > > > 00:08.0 0403: 10de:0ac0 (rev b1)  Subsystem: 10de:cb79
> > > > Codec: Realtek ALC889A
> > > > 
> > > > Booting with snd_hda_intel.model=mbp3 get sound on headphones, but not on mainspeakers. The mic never worked.
> > > > 
> > > 
> > > Hello again, I found out that puting the pin in 0x18 as a PIN_OUT I get
> > > sound in the internal speaker. Currently I can change patch_realtek.c to
> > > load the driver using an "mba21" model and I get sound on the main
> > > speaker. One of the (many) problems I have is that I need to use
> > > something like
> > > 
> > > {0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) } 
> > > 
> > > otherwise it goes into HiZ and I get no audio. Looking at that
> > > patch_realtek.c I don't see anything similar. Anyway, I don't have a
> > > clue about ALSA, I just started reading the HDA specification and looked
> > > over patch_realtek.c and came up with the small change below to have a
> > > working main speaker. I'd appreciate if you had any suggestion for the
> > > mic or to point me towards the right documentation.
> > 
> > The change looks almost good -- except for one place.
> > 
> > >   
> > > + /* Macbook Air don't know how this works */
> > > + static void alc885_mba21_setup (struct hda_codec *codec)
> > > + {
> > > + 	struct alc_spec *spec = codec->spec;
> > > + 
> > > + 	spec->autocfg.speaker_pins[0] = 0x18;
> > 
> > Does this device have no dedicated headphone output pin?
> > Usually it's either 0x14 or 0x15.
> 
> The headphones are in 0x14 but I couldn't get them to shut the main
> speakers off yet when the hp jack is connected. As soon as I understand
> how the other examples in patch_realtek.c work and get this working I'll
> send you a working patch.

Then check rather whether the pin 0x18 is really the right pin for the
speaker output.  This can be checked easily via hda-verb or so.
The speaker can be 0x15 and/or 0x1a, instead.


Takashi

> 
> R.
> > 
> > Also, please make a patch in a unified diff format.
> > 
> > If the patch is ready for merge, please post it (and add me to Cc)
> > with a proper changelog and your sign-off.
> > 
> > 
> > thanks,
> > 
> > Takashi
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Macbook Air 2,1 - no mic nor main speakers
  2010-02-22  8:05       ` Takashi Iwai
@ 2010-02-22 17:58         ` Reimundo Heluani
  0 siblings, 0 replies; 8+ messages in thread
From: Reimundo Heluani @ 2010-02-22 17:58 UTC (permalink / raw)
  To: alsa-devel

On Mon, 2010-02-22 at 09:05 +0100, Takashi Iwai wrote:
> At Mon, 22 Feb 2010 00:02:13 -0800,
> > 
> > The headphones are in 0x14 but I couldn't get them to shut the main
> > speakers off yet when the hp jack is connected. As soon as I understand
> > how the other examples in patch_realtek.c work and get this working I'll
> > send you a working patch.
> 
> Then check rather whether the pin 0x18 is really the right pin for the
> speaker output.  This can be checked easily via hda-verb or so.
> The speaker can be 0x15 and/or 0x1a, instead.

The patch below is the best I can do without loosing my day job :) with
this patch I get audio on main speaker letting it be 0x18. At the same
time if I put 0x14 to be the hp pin I get it to mute the main speaker
whenever I plug the jack, but I can't get audio from the hp. 

The funny thing is that in mbp3 mode I get audio from hp but not from
main speaker. Interestingly enough, if I start with mbp3 mode and run
hda-analyzer, the switching pin_out in 0x14 decides whether or not
there's output in the hp and switching pin_out in 0x18 decides wether or
not there's output in the main speaker. 

Cheers,

R.

--- patch_realtek.c.orig	2010-02-22 08:40:29.000000000 -0800
+++ patch_realtek.c	2010-02-22 09:49:13.000000000 -0800
@@ -205,6 +205,7 @@
 	ALC882_ASUS_A7J,
 	ALC882_ASUS_A7M,
 	ALC885_MACPRO,
+	ALC885_MBA21,
 	ALC885_MBP3,
 	ALC885_MB5,
 	ALC885_IMAC24,
@@ -6749,6 +6750,12 @@
 	{ 8, alc882_sixstack_ch8_init },
 };
 
+/* Macbook Air I have no clue how it works yet */
+
+static struct hda_channel_mode alc885_mba21_ch_modes[1] = {
+      { 2, NULL },
+};
+
 /*
  * macbook pro ALC885 can switch LineIn to LineOut without losing Mic
  */
@@ -7021,6 +7028,16 @@
 };
 
 
+
+static struct snd_kcontrol_new alc885_mba21_mixer[] = {
+      HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00,
HDA_OUTPUT),
+      HDA_BIND_MUTE   ("Speaker Playback Switch", 0x0c, 0x02,
HDA_OUTPUT),
+      HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0e, 0x00,
HDA_OUTPUT),
+      HDA_BIND_MUTE   ("Headphone Playback Switch", 0x0e, 0x02,
HDA_OUTPUT),
+      { }
+};
+
+
 static struct snd_kcontrol_new alc885_mbp3_mixer[] = {
 	HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
 	HDA_BIND_MUTE   ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
@@ -7445,6 +7462,29 @@
 	{ }
 };
 
+static struct hda_verb alc885_mba21_init_verbs[] = {
+       /*Internal Speaker Mixer*/
+       	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 
+       	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
+       	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
+       	/*Internal Speaker Pin*/
+       	{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT |
AC_PINCTL_VREF_50) },
+       	{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+       	{0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
+ 	/* HP mixer */
+	{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
+	{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(0)},
+	{0x0e, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_MUTE(1)},
+	/* HP Pin: output 0 (0x0e) */
+	{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
+	{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+	{0x14, AC_VERB_SET_CONNECT_SEL, 0x02},
+	{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, ALC880_HP_EVENT | AC_USRSP_EN},
+       	
+	{ }
+ };
+ 
+
 /* Macbook Pro rev3 */
 static struct hda_verb alc885_mbp3_init_verbs[] = {
 	/* Front mixer: unmute input/output amp left and right (volume = 0) */
@@ -7547,6 +7587,17 @@
 	spec->autocfg.speaker_pins[1] = 0x1a;
 }
 
+/* Macbook Air don't know how this works */
+static void alc885_mba21_setup (struct hda_codec *codec)
+{
+       struct alc_spec *spec = codec->spec;
+ 
+       spec->autocfg.hp_pins[0] = 0x14;
+       spec->autocfg.speaker_pins[0] = 0x18;
+}
+ 
+ 
+
 static void alc885_mbp3_setup(struct hda_codec *codec)
 {
 	struct alc_spec *spec = codec->spec;
@@ -8738,6 +8789,7 @@
 	[ALC882_ASUS_A7M]	= "asus-a7m",
 	[ALC885_MACPRO]		= "macpro",
 	[ALC885_MB5]		= "mb5",
+	[ALC885_MBA21]          = "mba21",
 	[ALC885_MBP3]		= "mbp3",
 	[ALC885_IMAC24]		= "imac24",
 	[ALC883_3ST_2ch_DIG]	= "3stack-2ch-dig",
@@ -8970,6 +9022,21 @@
 		.input_mux = &alc882_capture_source,
 		.dig_out_nid = ALC882_DIGOUT_NID,
 	},
+       [ALC885_MBA21] = {
+               .mixers = { alc885_mba21_mixer }, 
+               .init_verbs = { alc885_mba21_init_verbs,
alc880_gpio1_init_verbs },
+               .num_dacs = 2,
+               .dac_nids = alc882_dac_nids,
+               //.hp_nid = 0x04,
+               .channel_mode = alc885_mba21_ch_modes,
+               .num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
+               .input_mux = &alc882_capture_source,
+               //.dig_out_nid = ALC882_DIGOUT_NID,
+               //.dig_in_nid = ALC882_DIGIN_NID,
+               .unsol_event = alc_automute_amp_unsol_event,
+               .setup = alc885_mba21_setup,
+               .init_hook = alc_automute_amp,
+       },
 	[ALC885_MBP3] = {
 		.mixers = { alc885_mbp3_mixer, alc882_chmode_mixer },
 		.init_verbs = { alc885_mbp3_init_verbs,

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Macbook Air 2,1 - no mic nor main speakers
  2010-02-22  7:55   ` Takashi Iwai
  2010-02-22  8:02     ` Reimundo Heluani
@ 2010-02-23  2:12     ` Reimundo Heluani
  2010-02-23  7:18       ` Takashi Iwai
  1 sibling, 1 reply; 8+ messages in thread
From: Reimundo Heluani @ 2010-02-23  2:12 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai

[-- Attachment #1: Type: text/plain, Size: 752 bytes --]

On Mon, 2010-02-22 at 08:55 +0100, Takashi Iwai wrote:
> Also, please make a patch in a unified diff format.
> 
> If the patch is ready for merge, please post it (and add me to Cc)
> with a proper changelog and your sign-off.
> 


Attached is a patch in unified diff format that adds support for Macbook
Air's 2,1 internal speaker and headphone. Only one mixer control for
both, but at least the main speaker mutes when the jack is connected and
the headphones work fine now (at least in my machine). I couldn't find
the mic yet. I do not know what a proper changelog is nor what my
sign-off would be, I do mathematics for a living (or so I thought).

I'll update the bug I opened over a year ago when I didn't know about
hda-analyzer. 

Cheers,

R.



[-- Attachment #2: patch_realtek-headphones-working.patch --]
[-- Type: text/x-patch, Size: 3559 bytes --]

--- patch_realtek.c.orig	2010-02-22 08:40:29.000000000 -0800
+++ patch_realtek.c	2010-02-22 16:26:58.000000000 -0800
@@ -205,6 +205,7 @@
 	ALC882_ASUS_A7J,
 	ALC882_ASUS_A7M,
 	ALC885_MACPRO,
+	ALC885_MBA21,
 	ALC885_MBP3,
 	ALC885_MB5,
 	ALC885_IMAC24,
@@ -6749,6 +6750,13 @@
 	{ 8, alc882_sixstack_ch8_init },
 };
 
+
+/* Macbook Air 2,1 */
+
+static struct hda_channel_mode alc885_mba21_ch_modes[1] = {
+      { 2, NULL },
+};
+
 /*
  * macbook pro ALC885 can switch LineIn to LineOut without losing Mic
  */
@@ -7021,6 +7029,15 @@
 };
 
 
+/* Macbook Air 2,1 same control for HP and internal Speaker */
+
+static struct snd_kcontrol_new alc885_mba21_mixer[] = {
+      HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
+      HDA_BIND_MUTE   ("Speaker Playback Switch", 0x0c, 0x02, HDA_OUTPUT),
+     { }
+};
+
+
 static struct snd_kcontrol_new alc885_mbp3_mixer[] = {
 	HDA_CODEC_VOLUME("Speaker Playback Volume", 0x0c, 0x00, HDA_OUTPUT),
 	HDA_BIND_MUTE   ("Speaker Playback Switch", 0x0c, 0x02, HDA_INPUT),
@@ -7445,6 +7462,29 @@
 	{ }
 };
 
+
+static struct hda_verb alc885_mba21_init_verbs[] = {
+	/*Internal and HP Speaker Mixer*/
+	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO}, 
+	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0)},
+	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(1)},
+	/*Internal Speaker Pin (0x0c)*/
+	{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, (PIN_OUT | AC_PINCTL_VREF_50) },
+	{0x18, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+	{0x18, AC_VERB_SET_CONNECT_SEL, 0x00},
+	/* HP Pin: output 0 (0x0e) */
+	{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc4},
+	{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
+	{0x14, AC_VERB_SET_CONNECT_SEL, 0x00},
+	{0x14, AC_VERB_SET_UNSOLICITED_ENABLE, (ALC880_HP_EVENT | AC_USRSP_EN)},
+	/* Line in (is hp when jack connected)*/
+	{0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, AC_PINCTL_VREF_50},
+	{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_MUTE},
+
+	{ }
+ };
+ 
+
 /* Macbook Pro rev3 */
 static struct hda_verb alc885_mbp3_init_verbs[] = {
 	/* Front mixer: unmute input/output amp left and right (volume = 0) */
@@ -7547,6 +7587,17 @@
 	spec->autocfg.speaker_pins[1] = 0x1a;
 }
 
+/* Macbook Air don't know how this works */
+static void alc885_mba21_setup (struct hda_codec *codec)
+{
+       struct alc_spec *spec = codec->spec;
+ 
+       spec->autocfg.hp_pins[0] = 0x14;
+       spec->autocfg.speaker_pins[0] = 0x18;
+}
+ 
+ 
+
 static void alc885_mbp3_setup(struct hda_codec *codec)
 {
 	struct alc_spec *spec = codec->spec;
@@ -8738,6 +8789,7 @@
 	[ALC882_ASUS_A7M]	= "asus-a7m",
 	[ALC885_MACPRO]		= "macpro",
 	[ALC885_MB5]		= "mb5",
+	[ALC885_MBA21]		= "mba21",
 	[ALC885_MBP3]		= "mbp3",
 	[ALC885_IMAC24]		= "imac24",
 	[ALC883_3ST_2ch_DIG]	= "3stack-2ch-dig",
@@ -8970,6 +9022,18 @@
 		.input_mux = &alc882_capture_source,
 		.dig_out_nid = ALC882_DIGOUT_NID,
 	},
+	   [ALC885_MBA21] = {
+               .mixers = { alc885_mba21_mixer }, 
+               .init_verbs = { alc885_mba21_init_verbs, alc880_gpio1_init_verbs },
+               .num_dacs = 2,
+               .dac_nids = alc882_dac_nids,
+               .channel_mode = alc885_mba21_ch_modes,
+               .num_channel_mode = ARRAY_SIZE(alc885_mba21_ch_modes),
+               .input_mux = &alc882_capture_source,
+               .unsol_event = alc_automute_amp_unsol_event,
+               .setup = alc885_mba21_setup,
+               .init_hook = alc_automute_amp,
+       },
 	[ALC885_MBP3] = {
 		.mixers = { alc885_mbp3_mixer, alc882_chmode_mixer },
 		.init_verbs = { alc885_mbp3_init_verbs,

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Macbook Air 2,1 - no mic nor main speakers
  2010-02-23  2:12     ` Reimundo Heluani
@ 2010-02-23  7:18       ` Takashi Iwai
  0 siblings, 0 replies; 8+ messages in thread
From: Takashi Iwai @ 2010-02-23  7:18 UTC (permalink / raw)
  To: Reimundo Heluani; +Cc: alsa-devel

At Mon, 22 Feb 2010 18:12:23 -0800,
Reimundo Heluani wrote:
> 
> On Mon, 2010-02-22 at 08:55 +0100, Takashi Iwai wrote:
> > Also, please make a patch in a unified diff format.
> > 
> > If the patch is ready for merge, please post it (and add me to Cc)
> > with a proper changelog and your sign-off.
> > 
> 
> 
> Attached is a patch in unified diff format that adds support for Macbook
> Air's 2,1 internal speaker and headphone. Only one mixer control for
> both, but at least the main speaker mutes when the jack is connected and
> the headphones work fine now (at least in my machine). I couldn't find
> the mic yet. I do not know what a proper changelog is nor what my
> sign-off would be, I do mathematics for a living (or so I thought).

Refer to Documentation/SubmittingPatches in linux kernel tree.
A sign-off is needed to merge your patch into the upstream.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-02-23  7:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-06 18:27 Macbook Air 2,1 - no mic nor main speakers Reimundo Heluani
2010-02-22  6:30 ` Reimundo Heluani
2010-02-22  7:55   ` Takashi Iwai
2010-02-22  8:02     ` Reimundo Heluani
2010-02-22  8:05       ` Takashi Iwai
2010-02-22 17:58         ` Reimundo Heluani
2010-02-23  2:12     ` Reimundo Heluani
2010-02-23  7:18       ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).