All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Josh Green <josh@resonance.org>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: Intel Azalia problems (some progress)
Date: Tue, 19 Apr 2005 14:50:03 +0200	[thread overview]
Message-ID: <s5hekd70w3o.wl@alsa2.suse.de> (raw)
In-Reply-To: <1113594593.28862.18.camel@SillyPuddy.localdomain>

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

At Fri, 15 Apr 2005 12:49:53 -0700,
Josh Green wrote:
> 
> It basically has two jacks, one labeled S/PDIF which is S/PDIF and
> headphone out combined, and the other seems to be mic input.  There is
> also a built in mic at the top of the LCD screen.
> 
> I just figured out that this notebook is based on the Z71V ASUS platform
> which should help a lot.  Yes, "Front" volume works as expected and
> controls internal speaker volume.

OK, the below is an experimental (untested) patch to add Z71V-specific
configuration.  Pass model=z71v.  To set this model default, define
the PCI subsystem vendor/device IDs in alc880_cfg_tbl list (you can
find the string XXX there).  Note that it's "subsystem" ID, which is
shown via lspci -nv.

I don't know how the headphone and SPDIF are shared.  At least, ALC880
codec itself has no such mechanism, so it must be implemented in the
device itself.  Possibly, turning on/off the SPDIF pin/amp control
(and the corresponding HP amp control) does the job, and this might be
the reason of click noises.


Takashi

[-- Attachment #2: Type: text/plain, Size: 6242 bytes --]

Index: alsa-kernel/pci/hda/patch_realtek.c
===================================================================
RCS file: /home/iwai/cvs/alsa/alsa-kernel/pci/hda/patch_realtek.c,v
retrieving revision 1.8
diff -u -r1.8 patch_realtek.c
--- alsa-kernel/pci/hda/patch_realtek.c	22 Mar 2005 20:51:50 -0000	1.8
+++ alsa-kernel/pci/hda/patch_realtek.c	19 Apr 2005 12:45:51 -0000
@@ -39,6 +39,7 @@
 	ALC880_5ST,
 	ALC880_5ST_DIG,
 	ALC880_W810,
+	ALC880_Z71V,
 };
 
 struct alc_spec {
@@ -90,6 +91,11 @@
 	0x02, 0x03, 0x04
 };
 
+static hda_nid_t alc880_z71v_dac_nids[1] = {
+	/* front only? */
+	0x02
+};
+
 static hda_nid_t alc880_adc_nids[3] = {
 	/* ADC0-2 */
 	0x07, 0x08, 0x09,
@@ -284,6 +290,10 @@
 	{ 6, NULL }
 };
 
+static struct alc_channel_mode alc880_z71v_modes[1] = {
+	{ 2, NULL }
+};
+
 /*
  */
 static int alc880_ch_mode_info(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t *uinfo)
@@ -475,6 +485,31 @@
 	{ } /* end */
 };
 
+static snd_kcontrol_new_t alc880_z71v_mixer[] = {
+	HDA_CODEC_VOLUME("Front Playback Volume", 0x0c, 0x0, HDA_OUTPUT),
+	HDA_CODEC_MUTE("Front Playback Switch", 0x14, 0x0, HDA_OUTPUT),
+	HDA_CODEC_VOLUME("Headphone Playback Volume", 0x0d, 0x0, HDA_OUTPUT),
+	HDA_CODEC_MUTE("Headphone Playback Switch", 0x15, 0x0, HDA_OUTPUT),
+	HDA_CODEC_VOLUME("Capture Volume", 0x07, 0x0, HDA_INPUT),
+	HDA_CODEC_MUTE("Capture Switch", 0x07, 0x0, HDA_INPUT),
+	HDA_CODEC_VOLUME_IDX("Capture Volume", 1, 0x08, 0x0, HDA_INPUT),
+	HDA_CODEC_MUTE_IDX("Capture Switch", 1, 0x08, 0x0, HDA_INPUT),
+	{
+		.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+		/* The multiple "Capture Source" controls confuse alsamixer
+		 * So call somewhat different..
+		 * FIXME: the controls appear in the "playback" view!
+		 */
+		/* .name = "Capture Source", */
+		.name = "Input Source",
+		.count = 2,
+		.info = alc_mux_enum_info,
+		.get = alc_mux_enum_get,
+		.put = alc_mux_enum_put,
+	},
+	{ } /* end */
+};
+
 /*
  */
 static int alc_build_controls(struct hda_codec *codec)
@@ -719,6 +754,58 @@
 	{ }
 };
 
+static struct hda_verb alc880_z71v_init_verbs[] = {
+	/* front channel selector/amp: input 0: DAC: unmuted, (no volume selection) */
+	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
+	/* front channel selector/amp: input 1: capture mix: muted, (no volume selection) */
+	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0x7180},
+	/* front channel selector/amp: output 0: unmuted, max volume */
+	{0x0c, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
+	/* front out pin: muted, (no volume selection)  */
+	{0x14, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
+	/* front out pin: NOT headphone enable, out enable, vref disabled */
+	{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x40},
+	/* headphone channel selector/amp: input 0: DAC: unmuted, (no volume selection) */
+	{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
+	/* headphone channel selector/amp: input 1: capture mix: muted, (no volume selection) */
+	{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, 0x7180},
+	/* headphone channel selector/amp: output 0: unmuted, max volume */
+	{0x0d, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
+	/* headphone out pin: muted, (no volume selection)  */
+	{0x15, AC_VERB_SET_AMP_GAIN_MUTE, 0xb080},
+	/* headpohne out pin: headphone enable, out enable, vref disabled */
+	{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
+
+	/* Line In pin widget for input */
+	{0x1a, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
+	/* CD pin widget for input */
+	{0x1c, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x20},
+	/* Mic1 (rear panel) pin widget for input and vref at 80% */
+	{0x18, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
+	/* Mic2 (front panel) pin widget for input and vref at 80% */
+	{0x1b, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24},
+	/* unmute amp left and right */
+	{0x07, AC_VERB_SET_AMP_GAIN_MUTE, 0x7000},
+	/* set connection select to line in (default select for this ADC) */
+	{0x07, AC_VERB_SET_CONNECT_SEL, 0x02},
+
+	/* Unmute input amps (CD, Line In, Mic 1 & Mic 2) for mixer
+	 * widget(nid=0x0B) to support the input path of analog loopback
+	 */
+	/* Note: PASD motherboards uses the Line In 2 as the input for front panel mic (mic 2) */
+	/* Amp Indexes: CD = 0x04, Line In 1 = 0x02, Mic 1 = 0x00 & Line In 2 = 0x03*/
+	/* unmute CD */
+	{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x04 << 8))},
+	/* unmute Line In */
+	{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x02 << 8))},
+	/* unmute Mic 1 */
+	{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x00 << 8))},
+	/* unmute Line In 2 (for PASD boards Mic 2) */
+	{0x0b, AC_VERB_SET_AMP_GAIN_MUTE, (0x7000 | (0x03 << 8))},
+
+	{ }
+};
+
 static int alc_init(struct hda_codec *codec)
 {
 	struct alc_spec *spec = codec->spec;
@@ -993,6 +1080,9 @@
 	{ .modelname = "w810", .config = ALC880_W810 },
 	{ .pci_vendor = 0x161f, .pci_device = 0x203d, .config = ALC880_W810 },
 
+	{ .modelname = "z71v", .config = ALC880_Z71V },
+	// { .pci_vendor = XXXX, .pci_device = XXXX, .config = ALC880_Z71V },
+
 	{}
 };
 
@@ -1023,6 +1113,10 @@
 		spec->mixers[spec->num_mixers] = alc880_five_stack_mixer;
 		spec->num_mixers++;
 		break;
+	case ALC880_Z71V:
+		spec->mixers[spec->num_mixers] = alc880_z71v_mixer;
+		spec->num_mixers++;
+		break;
 	default:
 		spec->mixers[spec->num_mixers] = alc880_base_mixer;
 		spec->num_mixers++;
@@ -1033,6 +1127,7 @@
 	case ALC880_3ST_DIG:
 	case ALC880_5ST_DIG:
 	case ALC880_W810:
+	case ALC880_Z71V:
 		spec->multiout.dig_out_nid = ALC880_DIGOUT_NID;
 		break;
 	default:
@@ -1063,6 +1158,11 @@
 		spec->channel_mode = alc880_w810_modes;
 		spec->num_channel_mode = ARRAY_SIZE(alc880_w810_modes);
 		break;
+	case ALC880_Z71V:
+		spec->init_verbs = alc880_z71v_init_verbs;
+		spec->channel_mode = alc880_z71v_modes;
+		spec->num_channel_mode = ARRAY_SIZE(alc880_z71v_modes);
+		break;
 	default:
 		spec->init_verbs = alc880_init_verbs_three_stack;
 		spec->channel_mode = alc880_threestack_modes;
@@ -1086,6 +1186,11 @@
 		spec->multiout.dac_nids = alc880_w810_dac_nids;
 		// No dedicated headphone socket - it's shared with built-in speakers.
 		break;
+	case ALC880_Z71V:
+		spec->multiout.num_dacs = ARRAY_SIZE(alc880_z71v_dac_nids);
+		spec->multiout.dac_nids = alc880_z71v_dac_nids;
+		spec->multiout.hp_nid = 0x03;
+		break;
 	default:
 		spec->multiout.num_dacs = ARRAY_SIZE(alc880_dac_nids);
 		spec->multiout.dac_nids = alc880_dac_nids;

  reply	other threads:[~2005-04-19 12:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-13 12:07 Intel Azalia problems Josh Green
2005-04-13 14:33 ` Takashi Iwai
2005-04-15  8:40   ` Josh Green
2005-04-15 12:12   ` Intel Azalia problems (some progress) Josh Green
2005-04-15 12:41     ` Takashi Iwai
2005-04-15 19:49       ` Josh Green
2005-04-19 12:50         ` Takashi Iwai [this message]
2005-04-15 22:15       ` Josh Green
2005-04-19 12:11         ` Takashi Iwai
2005-04-19 12:18           ` 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=s5hekd70w3o.wl@alsa2.suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=josh@resonance.org \
    /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.