All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tobin Davis <tdavis@dsl-only.net>
To: Shaw Terwilliger <sterwill@teamprise.com>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Intel HDA on Mac Pro
Date: Thu, 07 Dec 2006 15:46:40 -0800	[thread overview]
Message-ID: <1165535200.7530.63.camel@razman> (raw)
In-Reply-To: <457828D7.4020908@teamprise.com>


[-- Attachment #1.1: Type: text/plain, Size: 1704 bytes --]

I've been looking over the spec for the Realtek ALC885 and comparing it
with an earlier patch for the Mac Mini in the Sigmatel code.  I'm
wondering if Apple is using the same GPIO mute function as on the Mini.
Attached is a patch to test that theory.  It essentially sets the system
up as a 3 stack audio (which may be wrong as it is), but also unmutes
the gpio registers.

To test it, start with either the alsa-driver-hg20061130.tar.bz2 or
download the recent 1.0.14rc1 and follow these instructions:
tar -jxvf alsa-driver-<version>.tar.bz2   # <version> == hg20061130 or
1.0.14rc1
cd alsa-driver-<version>/alsa-kernel
patch -p1 <macpro.patch.1
cd ..
./configure --with-cards=hda-intel --with-debug=detect ; make ; make
install
dmesg -c
modprobe -r snd-hda-intel
modprobe snd-hda-intel model=macpro
dmesg >dmesg.out

Send me a copy of dmesg.out along with any differences that you see.  I
may need to tweak which pins get enabled.

Tobin


On Thu, 2006-12-07 at 08:44 -0600, Shaw Terwilliger wrote:

> Shaw Terwilliger wrote:
> >> This is actually good info.  Interesting that sound is coming out from
> >> the Surround channels.  The low volume could mean that EAPD still needs
> >> to be set.
> >>
> >> I'll look more into this tomorrow.  Hopefully I can get a patch for you
> >> to test.
> > 
> > Thanks for all your help.  I'm happy to test any patches you come up with.
> 
> Have you had a chance too cook up any patches for the Mac Pro HDA
> hardware?  I fooled around with different models yesterday, and the
> "auto" model detects very few output channels (PCM, Front, Line-in), but
> correctly assigns the front channel.  It's still incredibly quiet.
> 

-- 
Tobin Davis <tdavis@dsl-only.net>

[-- Attachment #1.2: Type: text/html, Size: 2641 bytes --]

[-- Attachment #2: macpro.patch.1 --]
[-- Type: text/x-patch, Size: 2517 bytes --]

diff -r b201c63fc4b3 pci/hda/patch_realtek.c
--- a/pci/hda/patch_realtek.c	Mon Dec 04 18:03:53 2006 +0100
+++ b/pci/hda/patch_realtek.c	Thu Dec 07 15:37:34 2006 -0800
@@ -112,6 +112,7 @@ enum {
 	ALC882_6ST_DIG,
 	ALC882_ARIMA,
 	ALC882_AUTO,
+	ALC885_MACPRO,
 	ALC882_MODEL_LAST,
 };
 
@@ -4507,6 +4508,39 @@ static struct hda_verb alc882_eapd_verbs
 	{ } 
 };
 
+/* Mac Pro test */
+static void alc882_gpio_mute(struct hda_codec *codec, int pin, int muted)
+{
+	unsigned int gpiostate, gpiomask, gpiodir;
+
+	gpiostate = snd_hda_codec_read(codec, codec->afg, 0,
+				       AC_VERB_GET_GPIO_DATA, 0);
+
+	if (!muted)
+		gpiostate |= (1 << pin);
+	else
+		gpiostate &= ~(1 << pin);
+
+	gpiomask = snd_hda_codec_read(codec, codec->afg, 0,
+				      AC_VERB_GET_GPIO_MASK, 0);
+	gpiomask |= (1 << pin);
+
+	gpiodir = snd_hda_codec_read(codec, codec->afg, 0,
+				     AC_VERB_GET_GPIO_DIRECTION, 0);
+	gpiodir |= (1 << pin);
+
+
+	snd_hda_codec_write(codec, codec->afg, 0,
+			    AC_VERB_SET_GPIO_MASK, gpiomask);
+	snd_hda_codec_write(codec, codec->afg, 0,
+			    AC_VERB_SET_GPIO_DIRECTION, gpiodir);
+
+	msleep(1);
+
+	snd_hda_codec_write(codec, codec->afg, 0,
+			    AC_VERB_SET_GPIO_DATA, gpiostate);
+}
+
 /*
  * generic initialization of ADC, input mixers and output mixers
  */
@@ -4633,6 +4667,7 @@ static const char *alc882_models[ALC882_
 	[ALC882_3ST_DIG]	= "3stack-dig",
 	[ALC882_6ST_DIG]	= "6stack-dig",
 	[ALC882_ARIMA]		= "arima",
+	[ALC885_MACPRO]		= "macpro",
 	[ALC882_AUTO]		= "auto",
 };
 
@@ -4675,6 +4710,17 @@ static struct alc_config_preset alc882_p
 		.dac_nids = alc882_dac_nids,
 		.num_channel_mode = ARRAY_SIZE(alc882_sixstack_modes),
 		.channel_mode = alc882_sixstack_modes,
+		.input_mux = &alc882_capture_source,
+	},
+	[ALC885_MACPRO] = {
+		.mixers = { alc882_base_mixer },
+		.init_verbs = { alc882_init_verbs },
+		.num_dacs = ARRAY_SIZE(alc882_dac_nids),
+		.dac_nids = alc882_dac_nids,
+		.dig_out_nid = ALC882_DIGOUT_NID,
+		.dig_in_nid = ALC882_DIGIN_NID,
+		.num_channel_mode = ARRAY_SIZE(alc882_ch_modes),
+		.channel_mode = alc882_ch_modes,
 		.input_mux = &alc882_capture_source,
 	},
 };
@@ -4803,6 +4849,11 @@ static int patch_alc882(struct hda_codec
 
 	if (board_config != ALC882_AUTO)
 		setup_preset(spec, &alc882_presets[board_config]);
+
+	if (board_config == ALC885_MACPRO) {
+		alc882_gpio_mute(codec, 0, 0);
+		alc882_gpio_mute(codec, 1, 0);
+	}
 
 	spec->stream_name_analog = "ALC882 Analog";
 	spec->stream_analog_playback = &alc882_pcm_analog_playback;

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

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- Attachment #4: Type: text/plain, Size: 161 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

  parent reply	other threads:[~2006-12-07 23:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-04 20:34 Intel HDA on Mac Pro Shaw Terwilliger
2006-12-04 20:51 ` Tobin Davis
2006-12-04 21:02   ` Shaw Terwilliger
2006-12-04 23:45     ` Tobin Davis
2006-12-05  0:19       ` Shaw Terwilliger
2006-12-05  0:30         ` Tobin Davis
2006-12-05  4:02           ` Shaw Terwilliger
     [not found]             ` <457828D7.4020908@teamprise.com>
2006-12-07 14:51               ` Tobin Davis
2006-12-07 23:46               ` Tobin Davis [this message]
2006-12-08 19:39                 ` Shaw Terwilliger
2006-12-10 16:16                   ` Tobin Davis
2006-12-11 14:43                     ` Shaw Terwilliger
2006-12-11 16:33                       ` Tobin Davis
2006-12-11 16:52                         ` Shaw Terwilliger
2006-12-11 17:05                           ` Tobin Davis
2006-12-11 17:13                             ` Shaw Terwilliger
2006-12-11 17:43                               ` Tobin Davis
2006-12-11 19:09                                 ` Shaw Terwilliger
2006-12-11 22:10                 ` Richard
2006-12-11 22:55                   ` Tobin Davis
     [not found]                     ` <f0d712d60612111704x14717093p6e038641fc6e94e6@mail.gmail.com>
2006-12-13 15:22                       ` Tobin Davis
2006-12-13 16:36                         ` Shaw Terwilliger
2006-12-13 17:11                           ` Tobin Davis
2006-12-14  7:01                           ` Tobin Davis
2006-12-14 15:10                             ` Shaw Terwilliger
2006-12-14 16:51                               ` Tobin Davis
2006-12-14 21:24                                 ` Shaw Terwilliger
2006-12-15  2:28                                   ` Tobin Davis

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=1165535200.7530.63.camel@razman \
    --to=tdavis@dsl-only.net \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=sterwill@teamprise.com \
    /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.