Skip to contentSkip to conversation

Digital-Out (Toslink) on HDA-Intal (AD1986A)?

DISCUSSION Martin Egge 2 participants 40 messages Jan 22, 2008 – Feb 12, 2008

lore
Share & tools
lore
#0 lore raw

Hi,

is there any way to use the digital output via toslink on my Samsung P50 notebook?

It has an integrated Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller. The soundchip is supported via HDA-Intel and the codec is Analog Devices AD1986A.

If the digital output is not supported at the moment, I'd like to help the developers with information, testing an even coding.

You can find all alsa related information about my system at [1]

Regards
Martin

[1] http://pastebin.ca/852506

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#1 lore raw

At Tue, 22 Jan 2008 21:20:49 +0100,

Quoted 6 lines · Martin Egge

Hi,

is there any way to use the digital output via toslink on my Samsung P50 notebook?

Quoted 8 lines

It has an integrated Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller. The soundchip is supported via HDA-Intel and the codec is Analog Devices AD1986A.

If the digital output is not supported at the moment, I'd like to help the developers with information, testing an even coding.

You can find all alsa related information about my system at [1]

The SPDIF is disabled intentionally for your model because no one could test it. Does the patch below work?

Takashi

---

pci/hda/patch_analog.c +11 -2
diff -r 8ba16b4a9e2d pci/hda/patch_analog.c
@@ -921,6 +921,13 @@ static struct hda_amp_list ad1986a_loopb
 };
 #endif
 
+static int is_jack_available(struct hda_codec *codec, hda_nid_t nid)
+{
+	unsigned int conf = snd_hda_codec_read(codec, nid, 0,
+					       AC_VERB_GET_CONFIG_DEFAULT, 0);
+	return get_defcfg_connect(conf) != AC_JACK_PORT_NONE;
+}
+
 static int patch_ad1986a(struct hda_codec *codec)
 {
 	struct ad198x_spec *spec;
@@ -980,7 +987,8 @@ static int patch_ad1986a(struct hda_code
 		spec->multiout.max_channels = 2;
 		spec->multiout.num_dacs = 1;
 		spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
-		spec->multiout.dig_out_nid = 0;
+		if (!is_jack_available(codec, 0x25))
+			spec->multiout.dig_out_nid = 0;
 		spec->input_mux = &ad1986a_laptop_eapd_capture_source;
 		break;
 	case AD1986A_LAPTOP_AUTOMUTE:
@@ -991,7 +999,8 @@ static int patch_ad1986a(struct hda_code
 		spec->multiout.max_channels = 2;
 		spec->multiout.num_dacs = 1;
 		spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
-		spec->multiout.dig_out_nid = 0;
+		if (!is_jack_available(codec, 0x25))
+			spec->multiout.dig_out_nid = 0;
 		spec->input_mux = &ad1986a_laptop_eapd_capture_source;
 		codec->patch_ops.unsol_event = ad1986a_hp_unsol_event;
 		codec->patch_ops.init = ad1986a_hp_init;
#2 lore raw

Hi Takashi,

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

The SPDIF is disabled intentionally for your model because no one could test it. Does the patch below work?

Thanks for the patch. I'll test it later. Which version of ALSA-Drivers should I apply the patch on?

Greetz
Martin

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw

At Wed, 23 Jan 2008 12:34:42 +0100,

Quoted 9 lines · Martin Egge

Hi Takashi,

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

The SPDIF is disabled intentionally for your model because no one could test it. Does the patch below work?

Thanks for the patch. I'll test it later. Which version of ALSA-Drivers should I apply the patch on?

For testing, always try ALSA HG version unless explicitly specified. 1.0.16rc1 should be OK for now, though.

Takashi

#4 lore raw

Hi Takashi

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

For testing, always try ALSA HG version unless explicitly specified. 1.0.16rc1 should be OK for now, though.

I cannot compile neither of them. I always get a compiler error. See [1] for details. Can you help me?

Regards
Martin

[1] http://pastebin.ca/869770

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#5 lore raw

At Wed, 23 Jan 2008 15:44:38 +0100,

Quoted 9 lines · Martin Egge

Hi Takashi

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

For testing, always try ALSA HG version unless explicitly specified. 1.0.16rc1 should be OK for now, though.

I cannot compile neither of them. I always get a compiler error. See [1] for details. Can you help me?

Already fixed today. Pull the latest HG repo from hg.alsa-project.org. hg-mirror seems out of sync.

Takashi

#6 lore raw

Hi again,

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 11 lines

At Wed, 23 Jan 2008 15:44:38 +0100,

Quoted 6 lines · Martin Egge

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

For testing, always try ALSA HG version unless explicitly specified. 1.0.16rc1 should be OK for now, though.

I cannot compile neither of them. I always get a compiler error. See [1] for details. Can you help me?

Already fixed today. Pull the latest HG repo from hg.alsa-project.org. hg-mirror seems out of sync.

Sorry, but I cannot confirm that. I downloaded alsa-driver and alsa-kernel from hg.alsa-project.org. But compiling with hgcompile resulted in the same error. I'll try it again tomorrow.

Regards,
Martin

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#7 lore raw

At Wed, 23 Jan 2008 22:58:49 +0100,

Quoted 13 lines · Martin Egge

Hi again,

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 9 lines

At Wed, 23 Jan 2008 15:44:38 +0100,

Quoted 6 lines · Martin Egge

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

For testing, always try ALSA HG version unless explicitly specified. 1.0.16rc1 should be OK for now, though.

I cannot compile neither of them. I always get a compiler error. See [1] for details. Can you help me?

Quoted 6 lines
Quoted 2 lines

Already fixed today. Pull the latest HG repo from hg.alsa-project.org. hg-mirror seems out of sync.

Sorry, but I cannot confirm that. I downloaded alsa-driver and alsa-kernel from hg.alsa-project.org. But compiling with hgcompile resulted in the same error. I'll try it again tomorrow.

Did you run hgcompile again?
If still doesn't work, check init_utsname in config.log. You must have a compile error there.

Takashi

#8 lore raw

At Thu, 24 Jan 2008 11:42:46 +0100,

Quoted 19 lines · I wrote:

At Wed, 23 Jan 2008 22:58:49 +0100,

Quoted 16 lines · Martin Egge

Hi again,

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 11 lines

At Wed, 23 Jan 2008 15:44:38 +0100,

Quoted 6 lines · Martin Egge

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

For testing, always try ALSA HG version unless explicitly specified. 1.0.16rc1 should be OK for now, though.

I cannot compile neither of them. I always get a compiler error. See [1] for details. Can you help me?

Already fixed today. Pull the latest HG repo from hg.alsa-project.org. hg-mirror seems out of sync.

Quoted 7 lines
Quoted 3 lines

Sorry, but I cannot confirm that. I downloaded alsa-driver and alsa-kernel from hg.alsa-project.org. But compiling with hgcompile resulted in the same error. I'll try it again tomorrow.

Did you run hgcompile again?
If still doesn't work, check init_utsname in config.log. You must have a compile error there.

OK, found another problem which is gcc-version specific. Now fixed again on HG tree. Give it a try.

Takashi

#9 lore raw
In reply to Takashi Iwai

Hi,

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

The SPDIF is disabled intentionally for your model because no one could test it. Does the patch below work?

I tried this patch on the newest hg-version a few minutes ago. Digital-Out still does not work, even though there is a IEC958 in the alsamixer now. By the way the digital-out is shared with the analog one (green 3,5mm jack). I only get an analog stereo signal whatever the state of the IEC958 is.

Regards,
Martin

P.S.: There is also the not so demanding problem that the internal mic has never been working

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#10 lore raw

At Fri, 25 Jan 2008 15:57:55 +0100,

Quoted 11 lines · Martin Egge

Hi,

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

The SPDIF is disabled intentionally for your model because no one could test it. Does the patch below work?

I tried this patch on the newest hg-version a few minutes ago. Digital-Out still does not work, even though there is a IEC958 in the alsamixer now. By the way the digital-out is shared with the analog one (green 3,5mm jack). I only get an analog stereo signal whatever the state of the IEC958 is.

Is it an optical SPDIF out shared with the headphone jack? Then you can see the red light when the SPDIF is turned on. Make sure that you turned on "IEC958 Playback Switch".

Quoted 2 lines

P.S.: There is also the not so demanding problem that the internal mic has never been working

Details please?

Takashi

#11 lore raw

Hi,

Am Freitag, 25. Januar 2008 schrieb Takashi Iwai:

Quoted 1 line

Is it an optical SPDIF out shared with the headphone jack?

Yes it is.

Quoted 2 lines

Then you can see the red light when the SPDIF is turned on. Make sure that you turned on "IEC958 Playback Switch".

The red light is never turned on.

Quoted 4 lines
Quoted 2 lines

P.S.: There is also the not so demanding problem that the internal mic has never been working

Details please?

There are two sliders and switches for mics:
1. Mic
2. Internal Mic
There is on MicBoost slider.

An external microphone (connect to the pink microphone jack) works completely and can be controlled via the Mic slider and switch. The internal mic is unusable, I can neither hear (playback) nor capture it. The Intenal Mic slider and switch don't change anything.

Regards
Martin

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#12 lore raw

At Fri, 25 Jan 2008 16:27:28 +0100,

Quoted 4 lines · Martin Egge

Hi,

Am Freitag, 25. Januar 2008 schrieb Takashi Iwai:

Quoted 8 lines
Quoted 1 line

Is it an optical SPDIF out shared with the headphone jack?

Yes it is.

Quoted 2 lines

Then you can see the red light when the SPDIF is turned on. Make sure that you turned on "IEC958 Playback Switch".

The red light is never turned on.

OK, then please attach the content of /proc/asound/card0/codec#* and the generated file via "alsactl -f somefile store".

Quoted 10 lines
Quoted 4 lines
Quoted 2 lines

P.S.: There is also the not so demanding problem that the internal mic has never been working

Details please?

There are two sliders and switches for mics:
1. Mic
2. Internal Mic
There is on MicBoost slider.

Quoted 4 lines

An external microphone (connect to the pink microphone jack) works completely and can be controlled via the Mic slider and switch. The internal mic is unusable, I can neither hear (playback) nor capture it. The Intenal Mic slider and switch don't change anything.

This sounds like that the pin mapping is different from the currently used preset. I'd need to check codec proc file also for this, too.

Takashi

#13 lore raw

Hi,

Am Freitag, 25. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

OK, then please attach the content of /proc/asound/card0/codec#* and the generated file via "alsactl -f somefile store".

Done

Regards
Martin

state.Intel {
	control.1 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 31'
		comment.dbmin -4650
		comment.dbmax 0
		iface MIXER
		name 'Master Playback Volume'
		value.0 19
		value.1 19
	}
	control.2 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Master Playback Switch'
		value.0 true
		value.1 true
	}
	control.3 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 31'
		comment.dbmin -3450
		comment.dbmax 1200
		iface MIXER
		name 'PCM Playback Volume'
		value.0 31
		value.1 31
	}
	control.4 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'PCM Playback Switch'
		value.0 true
		value.1 true
	}
	control.5 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 31'
		comment.dbmin -3450
		comment.dbmax 1200
		iface MIXER
		name 'Internal Mic Playback Volume'
		value.0 31
		value.1 31
	}
	control.6 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Internal Mic Playback Switch'
		value.0 true
		value.1 true
	}
	control.7 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 31'
		comment.dbmin -3450
		comment.dbmax 1200
		iface MIXER
		name 'Mic Playback Volume'
		value.0 0
		value.1 0
	}
	control.8 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Mic Playback Switch'
		value.0 false
		value.1 false
	}
	control.9 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 3'
		comment.dbmin 0
		comment.dbmax 3000
		iface MIXER
		name 'Mic Boost'
		value.0 3
		value.1 3
	}
	control.10 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 15'
		comment.dbmin 0
		comment.dbmax 2250
		iface MIXER
		name 'Capture Volume'
		value.0 15
		value.1 15
	}
	control.11 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Capture Switch'
		value.0 true
		value.1 true
	}
	control.12 {
		comment.access 'read write'
		comment.type ENUMERATED
		comment.count 1
		comment.item.0 Mic
		comment.item.1 'Internal Mic'
		comment.item.2 Mix
		iface MIXER
		name 'Capture Source'
		value 'Internal Mic'
	}
	control.13 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'External Amplifier'
		value false
	}
	control.14 {
		comment.access read
		comment.type IEC958
		comment.count 1
		iface MIXER
		name 'IEC958 Playback Con Mask'
		value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
	}
	control.15 {
		comment.access read
		comment.type IEC958
		comment.count 1
		iface MIXER
		name 'IEC958 Playback Pro Mask'
		value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
	}
	control.16 {
		comment.access 'read write'
		comment.type IEC958
		comment.count 1
		iface MIXER
		name 'IEC958 Playback Default'
		value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
	}
	control.17 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'IEC958 Playback Switch'
		value true
	}
	control.18 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Off-hook Switch'
		value true
	}
	control.19 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Caller ID Switch'
		value false
	}
	control.20 {
		comment.access 'read write user'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 120'
		comment.tlv '0000000100000008fffff44800000032'
		comment.dbmin -3000
		comment.dbmax 3000
		iface MIXER
		name 'Digital Capture Volume'
		value.0 0
		value.1 0
	}
}

Codec: Analog Devices AD1986A
Address: 0
Vendor Id: 0x11d41986
Subsystem Id: 0x144dc024
Revision Id: 0x100500
No Modem Function Group found
Default PCM:

    rates [0x7f]: 8000 11025 16000 22050 32000 44100 48000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM

Default Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Default Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1
GPIO: io=0, o=1, i=0, unsolicited=0, wake=0
Node 0x02 [Audio Output] wcaps 0x30311: Stereo Digital
Converter: stream=0, channel=0
Digital: Enabled
Digital category: 0x0
PCM:

    rates [0x60]: 44100 48000
    bits [0x2]: 16
    formats [0x5]: PCM AC3
  Delay: 3 samples
  Connection: 2
     0x01* 0x06

Node 0x03 [Audio Output] wcaps 0x44d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x1f 0x1f]
Converter: stream=0, channel=0
Power: setting=D0, actual=D0
Processing caps: benign=1, ncoeff=70
Node 0x04 [Audio Output] wcaps 0x40d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Converter: stream=0, channel=0
Power: setting=D0, actual=D0
Node 0x05 [Audio Output] wcaps 0x40d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Converter: stream=0, channel=0
Power: setting=D0, actual=D0
Node 0x06 [Audio Input] wcaps 0x100511: Stereo
Converter: stream=0, channel=0
SDI-Select: 0
PCM:

    rates [0x7f]: 8000 11025 16000 22050 32000 44100 48000
    bits [0x6]: 16 20
    formats [0x1]: PCM
  Power: setting=D0, actual=D0
  Connection: 1
     0x12
Node 0x07 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 8
     0x03 0x09 0x13 0x14 0x15 0x16 0x17 0x18
Node 0x08 [Audio Mixer] wcaps 0x200100: Mono
  Connection: 1
     0x07

Node 0x09 [Audio Mixer] wcaps 0x20010e: Mono Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-In vals: [0x80] [0x80]
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80]
Connection: 2

     0x04 0x05
Node 0x0a [Audio Selector] wcaps 0x300101: Stereo
  Connection: 3
     0x07* 0x04 0x05
Node 0x0b [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x07* 0x04
Node 0x0c [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x04* 0x07
Node 0x0d [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x05* 0x08
Node 0x0e [Audio Selector] wcaps 0x300100: Mono
  Connection: 2
     0x08* 0x11

Node 0x0f [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-Out vals: [0x03 0x03]
Connection: 8

     0x1f* 0x20 0x1d 0x1d 0x27 0x28 0x29 0x2a
Node 0x10 [Audio Selector] wcaps 0x300101: Stereo
  Connection: 3
     0x20* 0x1c 0x1f
Node 0x11 [Audio Selector] wcaps 0x300941: Stereo R/L
  Connection: 2
     0x0f* 0x2b

Processing caps: benign=1, ncoeff=0
Node 0x12 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x0f, stepsize=0x05, mute=1 Amp-Out vals: [0x0f 0x0f]
Connection: 8

     0x11 0x22 0x00 0x21 0x10* 0x07 0x08 0x23

Node 0x13 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x11

Node 0x14 [Audio Selector] wcaps 0x30010c: Mono Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80]
Connection: 1

     0x23

Node 0x15 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x22

Node 0x16 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x21

Node 0x17 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x1f 0x1f]
Connection: 1

     0x10

Node 0x18 [Audio Selector] wcaps 0x30010c: Mono Amp-Out
Amp-Out caps: ofs=0x0f, nsteps=0x0f, stepsize=0x0b, mute=1 Amp-Out vals: [0x8f]
Connection: 2

     0x19* 0x24

Node 0x19 [Beep Generator Widget] wcaps 0x700000: Mono Node 0x1a [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x13 0x13]
Pincap 0x081f: OUT HP Detect Trigger ImpSense Pin Default 0x02214021: [Jack] HP Out at Ext Front
Conn = 1/8, Color = Green
DefAssociation = 0x2, Sequence = 0x1
Pin-ctls: 0xc0: OUT HP
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0a

Node 0x1b [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x13 0x13]
Pincap 0x081001f: OUT HP EAPD Detect Trigger ImpSense EAPD 0x2: EAPD
Pin Default 0x01014011: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Green
DefAssociation = 0x1, Sequence = 0x1
Pin-ctls: 0x40: OUT
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0b

Node 0x1c [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x0837: IN OUT Detect Trigger ImpSense Pin Default 0x41013012: [N/A] Line Out at Ext Rear
Conn = 1/8, Color = Blue
DefAssociation = 0x1, Sequence = 0x2
Pin-ctls: 0x40: OUT
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0c

Node 0x1d [Pin Complex] wcaps 0x400985: Stereo Amp-Out R/L
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x081737: IN OUT Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x01019015: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Pink
DefAssociation = 0x1, Sequence = 0x5
Pin-ctls: 0x40: OUT VREF_HIZ
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0d

Node 0x1e [Pin Complex] wcaps 0x400104: Mono Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80]
Pincap 0x0810: OUT
Pin Default 0x511710f0: [N/A] Speaker at Int Rear
Conn = Analog, Color = Black
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x40: OUT
Connection: 1

     0x0e

Node 0x1f [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x081727: IN Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x02a190f0: [Jack] Mic at Ext Front
Conn = 1/8, Color = Pink
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x24: IN VREF_80
Unsolicited: tag=00, enabled=0
Node 0x20 [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x081727: IN Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x018130f0: [Jack] Line In at Ext Rear
Conn = 1/8, Color = Blue
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN VREF_HIZ
Unsolicited: tag=00, enabled=0
Node 0x21 [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x0827: IN Detect Trigger ImpSense Pin Default 0x5997e0f0: [N/A] Aux at Int ATAPI
Conn = Analog, Color = White DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Unsolicited: tag=00, enabled=0
Node 0x22 [Pin Complex] wcaps 0x400001: Stereo
Pincap 0x0820: IN
Pin Default 0x593310f0: [N/A] CD at Int ATAPI
Conn = ATAPI, Color = Black DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Node 0x23 [Pin Complex] wcaps 0x400000: Mono
Pincap 0x0820: IN
Pin Default 0x59b770f0: [N/A] Telephony at Int ATAPI
Conn = Analog, Color = Yellow DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Node 0x24 [Pin Complex] wcaps 0x400000: Mono
Pincap 0x0820: IN
Pin Default 0x91f710f0: [Fixed] Other at Int Rear
Conn = Analog, Color = Black DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Node 0x25 [Pin Complex] wcaps 0x400301: Stereo Digital
Pincap 0x0810: OUT
Pin Default 0x0145f0f0: [Jack] SPDIF Out at Ext Rear
Conn = Optical, Color = Other DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x40: OUT
Connection: 1

     0x02
Node 0x26 [Power Widget] wcaps 0x500500: Mono
  Power: setting=D0, actual=D0
  Connection: 8
     0x07* 0x08 0x13 0x14 0x15 0x16 0x17 0x18
Node 0x27 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1f 0x1d
Node 0x28 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1f 0x20
Node 0x29 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1d 0x20
Node 0x2a [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 3
     0x1f 0x1d 0x20
Node 0x2b [Audio Mixer] wcaps 0x200100: Mono
  Connection: 1
     0x0f

Codec: Generic 11c1 Si3054
Address: 1
Vendor Id: 0x11c13026
Subsystem Id: 0x2117144d
Revision Id: 0x100700
Modem Function Group: 0x1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#14 lore raw

At Fri, 25 Jan 2008 16:44:52 +0100,

Quoted 8 lines · Martin Egge

Hi,

Am Freitag, 25. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

OK, then please attach the content of /proc/asound/card0/codec#* and the generated file via "alsactl -f somefile store".

Done

Thanks. I couldn't find any missing setup for the SPDIF. I thought the similar setup worked well on other machines with AD1986A, but I'm not sure whether it's still OK with the recent version...

Anyay, the patch below is to change the mic input behavior. With the patch, the mic input is toggled automatically via jack plug. It assumes that you didn't change the model preset
(i.e. model=laptop-eapd).

Give it a try.

Takashi

---

pci/hda/patch_analog.c +45 -4
diff -r b0d97ac73e0f pci/hda/patch_analog.c
@@ -609,13 +609,19 @@ static struct hda_input_mux ad1986a_lapt
 	},
 };
 
+static struct hda_input_mux ad1986a_automic_capture_source = {
+	.num_items = 2,
+	.items = {
+		{ "Mic", 0x0 },
+		{ "Mix", 0x5 },
+	},
+};
+
 static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
 	HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
 	HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
 	HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
 	HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
-	HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x0, HDA_OUTPUT),
-	HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x0, HDA_OUTPUT),
 	HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
 	HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
 	HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
@@ -638,6 +644,32 @@ static struct snd_kcontrol_new ad1986a_l
 	},
 	{ } /* end */
 };
+
+/* re-connect the mic boost input according to the jack sensing */
+static void ad1986a_automic(struct hda_codec *codec)
+{
+	unsigned int present;
+	present = snd_hda_codec_read(codec, 0x1f, 0, AC_VERB_GET_PIN_SENSE, 0);
+	snd_hda_codec_write(codec, 0x0f, 0, AC_VERB_SET_CONNECT_SEL,
+			    (present & AC_PINSENSE_PRESENCE) ? 0 : 1);
+}
+
+#define AD1986A_MIC_EVENT		0x36
+
+static void ad1986a_automic_unsol_event(struct hda_codec *codec,
+					    unsigned int res)
+{
+	if ((res >> 26) != AD1986A_MIC_EVENT)
+		return;
+	ad1986a_automic(codec);
+}
+
+static int ad1986a_automic_init(struct hda_codec *codec)
+{
+	ad198x_init(codec);
+	ad1986a_automic(codec);
+	return 0;
+}
 
 /* laptop-automute - 2ch only */
 
@@ -842,6 +874,12 @@ static struct hda_verb ad1986a_eapd_init
 	{}
 };
 
+static struct hda_verb ad1986a_automic_verbs[] = {
+	{0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
+	{0x1f, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1986A_MIC_EVENT},
+	{}
+};
+
 /* Ultra initialization */
 static struct hda_verb ad1986a_ultra_init[] = {
 	/* eapd initialization */
@@ -977,13 +1015,16 @@ static int patch_ad1986a(struct hda_code
 		break;
 	case AD1986A_LAPTOP_EAPD:
 		spec->mixers[0] = ad1986a_laptop_eapd_mixers;
-		spec->num_init_verbs = 2;
+		spec->num_init_verbs = 3;
 		spec->init_verbs[1] = ad1986a_eapd_init_verbs;
+		spec->init_verbs[2] = ad1986a_automic_verbs;
 		spec->multiout.max_channels = 2;
 		spec->multiout.num_dacs = 1;
 		spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
 		spec->multiout.dig_out_nid = 0;
-		spec->input_mux = &ad1986a_laptop_eapd_capture_source;
+		spec->input_mux = &ad1986a_automic_capture_source;
+		codec->patch_ops.unsol_event = ad1986a_automic_unsol_event;
+		codec->patch_ops.init = ad1986a_automic_init;
 		break;
 	case AD1986A_LAPTOP_AUTOMUTE:
 		spec->mixers[0] = ad1986a_laptop_automute_mixers;
#15 lore raw

Hi,

Am Freitag, 25. Januar 2008 schrieb Takashi Iwai:

Quoted 4 lines

Thanks. I couldn't find any missing setup for the SPDIF. I thought the similar setup worked well on other machines with AD1986A, but I'm not sure whether it's still OK with the recent version...

Is there anything I can do, to help you to get it working?

Quoted 2 lines

Anyay, the patch below is to change the mic input behavior. With the patch, the mic input is toggled automatically via jack plug.

The external mic input is toggled via jack plug now. But the internal mic still is not working.

Quoted 2 lines

It assumes that you didn't change the model preset (i.e. model=laptop-eapd).

What does this mean? Do I have to insert
options snd_hda_intel model=laptop-eapd
in my /etc/modprobe.d/alsa-base or not?

Regards,
Martin

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#16 lore raw

Hi,

Am Freitag, 25. Januar 2008 schrieb Martin Egge:

Quoted 6 lines

Am Freitag, 25. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

Anyay, the patch below is to change the mic input behavior. With the patch, the mic input is toggled automatically via jack plug.

The external mic input is toggled via jack plug now. But the internal mic still is not working.

I've got some information that might help you. If I set model=3stack the internal and external mic are working in parallel. There is no jack-sense which disables the internal mic when an external mic is connected.

HTH
Martin

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#17 lore raw

At Sun, 27 Jan 2008 23:15:03 +0100,

Quoted 8 lines · Martin Egge

Hi,

Am Freitag, 25. Januar 2008 schrieb Martin Egge:

Quoted 4 lines

Am Freitag, 25. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

Anyay, the patch below is to change the mic input behavior. With the patch, the mic input is toggled automatically via jack plug.

Quoted 6 lines
Quoted 2 lines

The external mic input is toggled via jack plug now. But the internal mic still is not working.

I've got some information that might help you. If I set model=3stack the internal and external mic are working in parallel. There is no jack-sense which disables the internal mic when an external mic is connected.

Then get codec#* proc dump for both working and non-working states to compare.

Takashi

#18 lore raw

Hi,

Am Montag, 28. Januar 2008 schrieb Takashi Iwai:

Quoted 8 lines

At Sun, 27 Jan 2008 23:15:03 +0100,

Quoted 3 lines · Martin Egge

I've got some information that might help you. If I set model=3stack the internal and external mic are working in parallel. There is no jack-sense which disables the internal mic when an external mic is connected.

Then get codec#* proc dump for both working and non-working states to compare.

See the attachments. The naming of the files should be comprehensible. I've updated to latest hg before dumping the codecs yesterday evening.

Regards,
Martin

Codec: Analog Devices AD1986A
Address: 0
Vendor Id: 0x11d41986
Subsystem Id: 0x144dc024
Revision Id: 0x100500
No Modem Function Group found
Default PCM:

    rates [0x7f]: 8000 11025 16000 22050 32000 44100 48000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM

Default Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Default Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1
GPIO: io=0, o=1, i=0, unsolicited=0, wake=0
Node 0x02 [Audio Output] wcaps 0x30311: Stereo Digital
Converter: stream=0, channel=0
Digital: Enabled
Digital category: 0x0
PCM:

    rates [0x60]: 44100 48000
    bits [0x2]: 16
    formats [0x5]: PCM AC3
  Delay: 3 samples
  Connection: 2
     0x01* 0x06

Node 0x03 [Audio Output] wcaps 0x44d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x18 0x18]
Converter: stream=0, channel=0
Power: setting=D0, actual=D0
Processing caps: benign=1, ncoeff=70
Node 0x04 [Audio Output] wcaps 0x40d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Converter: stream=0, channel=0
Power: setting=D0, actual=D0
Node 0x05 [Audio Output] wcaps 0x40d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Converter: stream=0, channel=0
Power: setting=D0, actual=D0
Node 0x06 [Audio Input] wcaps 0x100511: Stereo
Converter: stream=0, channel=0
SDI-Select: 0
PCM:

    rates [0x7f]: 8000 11025 16000 22050 32000 44100 48000
    bits [0x6]: 16 20
    formats [0x1]: PCM
  Power: setting=D0, actual=D0
  Connection: 1
     0x12
Node 0x07 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 8
     0x03 0x09 0x13 0x14 0x15 0x16 0x17 0x18
Node 0x08 [Audio Mixer] wcaps 0x200100: Mono
  Connection: 1
     0x07

Node 0x09 [Audio Mixer] wcaps 0x20010e: Mono Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-In vals: [0x80] [0x80]
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80]
Connection: 2

     0x04 0x05
Node 0x0a [Audio Selector] wcaps 0x300101: Stereo
  Connection: 3
     0x07* 0x04 0x05
Node 0x0b [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x07* 0x04
Node 0x0c [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x04* 0x07
Node 0x0d [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x05* 0x08
Node 0x0e [Audio Selector] wcaps 0x300100: Mono
  Connection: 2
     0x08* 0x11

Node 0x0f [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-Out vals: [0x00 0x00]
Connection: 8

     0x1f* 0x20 0x1d 0x1d 0x27 0x28 0x29 0x2a
Node 0x10 [Audio Selector] wcaps 0x300101: Stereo
  Connection: 3
     0x20* 0x1c 0x1f
Node 0x11 [Audio Selector] wcaps 0x300941: Stereo R/L
  Connection: 2
     0x0f* 0x2b

Processing caps: benign=1, ncoeff=0
Node 0x12 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x0f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 8

     0x11* 0x22 0x00 0x21 0x10 0x07 0x08 0x23

Node 0x13 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x11

Node 0x14 [Audio Selector] wcaps 0x30010c: Mono Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80]
Connection: 1

     0x23

Node 0x15 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x22

Node 0x16 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x21

Node 0x17 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x10

Node 0x18 [Audio Selector] wcaps 0x30010c: Mono Amp-Out
Amp-Out caps: ofs=0x0f, nsteps=0x0f, stepsize=0x0b, mute=1 Amp-Out vals: [0x8f]
Connection: 2

     0x19* 0x24

Node 0x19 [Beep Generator Widget] wcaps 0x700000: Mono Node 0x1a [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x0f 0x0f]
Pincap 0x081f: OUT HP Detect Trigger ImpSense Pin Default 0x02214021: [Jack] HP Out at Ext Front
Conn = 1/8, Color = Green
DefAssociation = 0x2, Sequence = 0x1
Pin-ctls: 0xc0: OUT HP
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0a

Node 0x1b [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x0f 0x0f]
Pincap 0x081001f: OUT HP EAPD Detect Trigger ImpSense EAPD 0x0:
Pin Default 0x01014011: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Green
DefAssociation = 0x1, Sequence = 0x1
Pin-ctls: 0x40: OUT
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0b

Node 0x1c [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x0837: IN OUT Detect Trigger ImpSense Pin Default 0x41013012: [N/A] Line Out at Ext Rear
Conn = 1/8, Color = Blue
DefAssociation = 0x1, Sequence = 0x2
Pin-ctls: 0x40: OUT
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0c

Node 0x1d [Pin Complex] wcaps 0x400985: Stereo Amp-Out R/L
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x081737: IN OUT Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x01019015: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Pink
DefAssociation = 0x1, Sequence = 0x5
Pin-ctls: 0x40: OUT VREF_HIZ
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0d

Node 0x1e [Pin Complex] wcaps 0x400104: Mono Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80]
Pincap 0x0810: OUT
Pin Default 0x511710f0: [N/A] Speaker at Int Rear
Conn = Analog, Color = Black
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x40: OUT
Connection: 1

     0x0e

Node 0x1f [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x081727: IN Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x02a190f0: [Jack] Mic at Ext Front
Conn = 1/8, Color = Pink
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x24: IN VREF_80
Unsolicited: tag=00, enabled=0
Node 0x20 [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x081727: IN Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x018130f0: [Jack] Line In at Ext Rear
Conn = 1/8, Color = Blue
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN VREF_HIZ
Unsolicited: tag=00, enabled=0
Node 0x21 [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x0827: IN Detect Trigger ImpSense Pin Default 0x5997e0f0: [N/A] Aux at Int ATAPI
Conn = Analog, Color = White DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Unsolicited: tag=00, enabled=0
Node 0x22 [Pin Complex] wcaps 0x400001: Stereo
Pincap 0x0820: IN
Pin Default 0x593310f0: [N/A] CD at Int ATAPI
Conn = ATAPI, Color = Black DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Node 0x23 [Pin Complex] wcaps 0x400000: Mono
Pincap 0x0820: IN
Pin Default 0x59b770f0: [N/A] Telephony at Int ATAPI
Conn = Analog, Color = Yellow DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Node 0x24 [Pin Complex] wcaps 0x400000: Mono
Pincap 0x0820: IN
Pin Default 0x91f710f0: [Fixed] Other at Int Rear
Conn = Analog, Color = Black DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Node 0x25 [Pin Complex] wcaps 0x400301: Stereo Digital
Pincap 0x0810: OUT
Pin Default 0x0145f0f0: [Jack] SPDIF Out at Ext Rear
Conn = Optical, Color = Other DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x40: OUT
Connection: 1

     0x02
Node 0x26 [Power Widget] wcaps 0x500500: Mono
  Power: setting=D0, actual=D0
  Connection: 8
     0x07* 0x08 0x13 0x14 0x15 0x16 0x17 0x18
Node 0x27 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1f 0x1d
Node 0x28 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1f 0x20
Node 0x29 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1d 0x20
Node 0x2a [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 3
     0x1f 0x1d 0x20
Node 0x2b [Audio Mixer] wcaps 0x200100: Mono
  Connection: 1
     0x0f

Codec: Analog Devices AD1986A
Address: 0
Vendor Id: 0x11d41986
Subsystem Id: 0x144dc024
Revision Id: 0x100500
No Modem Function Group found
Default PCM:

    rates [0x7f]: 8000 11025 16000 22050 32000 44100 48000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM

Default Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Default Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1
GPIO: io=0, o=1, i=0, unsolicited=0, wake=0
Node 0x02 [Audio Output] wcaps 0x30311: Stereo Digital
Converter: stream=0, channel=0
Digital: Enabled
Digital category: 0x0
PCM:

    rates [0x60]: 44100 48000
    bits [0x2]: 16
    formats [0x5]: PCM AC3
  Delay: 3 samples
  Connection: 2
     0x01* 0x06

Node 0x03 [Audio Output] wcaps 0x44d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x18 0x18]
Converter: stream=0, channel=0
Power: setting=D0, actual=D0
Processing caps: benign=1, ncoeff=70
Node 0x04 [Audio Output] wcaps 0x40d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x18 0x18]
Converter: stream=0, channel=0
Power: setting=D0, actual=D0
Node 0x05 [Audio Output] wcaps 0x40d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x18 0x18]
Converter: stream=0, channel=0
Power: setting=D0, actual=D0
Node 0x06 [Audio Input] wcaps 0x100511: Stereo
Converter: stream=0, channel=0
SDI-Select: 0
PCM:

    rates [0x7f]: 8000 11025 16000 22050 32000 44100 48000
    bits [0x6]: 16 20
    formats [0x1]: PCM
  Power: setting=D0, actual=D0
  Connection: 1
     0x12
Node 0x07 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 8
     0x03 0x09 0x13 0x14 0x15 0x16 0x17 0x18
Node 0x08 [Audio Mixer] wcaps 0x200100: Mono
  Connection: 1
     0x07

Node 0x09 [Audio Mixer] wcaps 0x20010e: Mono Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-In vals: [0x80] [0x80]
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80]
Connection: 2

     0x04 0x05
Node 0x0a [Audio Selector] wcaps 0x300101: Stereo
  Connection: 3
     0x07* 0x04 0x05
Node 0x0b [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x07* 0x04
Node 0x0c [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x04* 0x07
Node 0x0d [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x05* 0x08
Node 0x0e [Audio Selector] wcaps 0x300100: Mono
  Connection: 2
     0x08* 0x11

Node 0x0f [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-Out vals: [0x00 0x00]
Connection: 8

     0x1f 0x20 0x1d 0x1d 0x27* 0x28 0x29 0x2a
Node 0x10 [Audio Selector] wcaps 0x300101: Stereo
  Connection: 3
     0x20 0x1c* 0x1f
Node 0x11 [Audio Selector] wcaps 0x300941: Stereo R/L
  Connection: 2
     0x0f* 0x2b

Processing caps: benign=1, ncoeff=0
Node 0x12 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x0f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 8

     0x11* 0x22 0x00 0x21 0x10 0x07 0x08 0x23

Node 0x13 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x9f 0x9f]
Connection: 1

     0x11

Node 0x14 [Audio Selector] wcaps 0x30010c: Mono Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80]
Connection: 1

     0x23

Node 0x15 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x19 0x19]
Connection: 1

     0x22

Node 0x16 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x21

Node 0x17 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x10

Node 0x18 [Audio Selector] wcaps 0x30010c: Mono Amp-Out
Amp-Out caps: ofs=0x0f, nsteps=0x0f, stepsize=0x0b, mute=1 Amp-Out vals: [0x8f]
Connection: 2

     0x19* 0x24

Node 0x19 [Beep Generator Widget] wcaps 0x700000: Mono Node 0x1a [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x0e 0x0e]
Pincap 0x081f: OUT HP Detect Trigger ImpSense Pin Default 0x02214021: [Jack] HP Out at Ext Front
Conn = 1/8, Color = Green
DefAssociation = 0x2, Sequence = 0x1
Pin-ctls: 0xc0: OUT HP
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0a

Node 0x1b [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x11 0x11]
Pincap 0x081001f: OUT HP EAPD Detect Trigger ImpSense EAPD 0x2: EAPD
Pin Default 0x01014011: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Green
DefAssociation = 0x1, Sequence = 0x1
Pin-ctls: 0x40: OUT
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0b

Node 0x1c [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x0837: IN OUT Detect Trigger ImpSense Pin Default 0x41013012: [N/A] Line Out at Ext Rear
Conn = 1/8, Color = Blue
DefAssociation = 0x1, Sequence = 0x2
Pin-ctls: 0x20: IN
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0c

Node 0x1d [Pin Complex] wcaps 0x400985: Stereo Amp-Out R/L
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x081737: IN OUT Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x01019015: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Pink
DefAssociation = 0x1, Sequence = 0x5
Pin-ctls: 0x24: IN VREF_80
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0d

Node 0x1e [Pin Complex] wcaps 0x400104: Mono Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80]
Pincap 0x0810: OUT
Pin Default 0x511710f0: [N/A] Speaker at Int Rear
Conn = Analog, Color = Black
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x40: OUT
Connection: 1

     0x0e

Node 0x1f [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x081727: IN Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x02a190f0: [Jack] Mic at Ext Front
Conn = 1/8, Color = Pink
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x24: IN VREF_80
Unsolicited: tag=00, enabled=0
Node 0x20 [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x081727: IN Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x018130f0: [Jack] Line In at Ext Rear
Conn = 1/8, Color = Blue
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN VREF_HIZ
Unsolicited: tag=00, enabled=0
Node 0x21 [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x0827: IN Detect Trigger ImpSense Pin Default 0x5997e0f0: [N/A] Aux at Int ATAPI
Conn = Analog, Color = White DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Unsolicited: tag=00, enabled=0
Node 0x22 [Pin Complex] wcaps 0x400001: Stereo
Pincap 0x0820: IN
Pin Default 0x593310f0: [N/A] CD at Int ATAPI
Conn = ATAPI, Color = Black DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Node 0x23 [Pin Complex] wcaps 0x400000: Mono
Pincap 0x0820: IN
Pin Default 0x59b770f0: [N/A] Telephony at Int ATAPI
Conn = Analog, Color = Yellow DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Node 0x24 [Pin Complex] wcaps 0x400000: Mono
Pincap 0x0820: IN
Pin Default 0x91f710f0: [Fixed] Other at Int Rear
Conn = Analog, Color = Black DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Node 0x25 [Pin Complex] wcaps 0x400301: Stereo Digital
Pincap 0x0810: OUT
Pin Default 0x0145f0f0: [Jack] SPDIF Out at Ext Rear
Conn = Optical, Color = Other DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x40: OUT
Connection: 1

     0x02
Node 0x26 [Power Widget] wcaps 0x500500: Mono
  Power: setting=D0, actual=D0
  Connection: 8
     0x07* 0x08 0x13 0x14 0x15 0x16 0x17 0x18
Node 0x27 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1f 0x1d
Node 0x28 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1f 0x20
Node 0x29 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1d 0x20
Node 0x2a [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 3
     0x1f 0x1d 0x20
Node 0x2b [Audio Mixer] wcaps 0x200100: Mono
  Connection: 1
     0x0f

Codec: Generic 11c1 Si3054
Address: 1
Vendor Id: 0x11c13026
Subsystem Id: 0x2117144d
Revision Id: 0x100700
Modem Function Group: 0x1

Codec: Generic 11c1 Si3054
Address: 1
Vendor Id: 0x11c13026
Subsystem Id: 0x2117144d
Revision Id: 0x100700
Modem Function Group: 0x1

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#19 lore raw

At Tue, 29 Jan 2008 11:06:24 +0100,

Quoted 10 lines · Martin Egge

Hi,

Am Montag, 28. Januar 2008 schrieb Takashi Iwai:

Quoted 6 lines

At Sun, 27 Jan 2008 23:15:03 +0100,

Quoted 3 lines · Martin Egge

I've got some information that might help you. If I set model=3stack the internal and external mic are working in parallel. There is no jack-sense which disables the internal mic when an external mic is connected.

Quoted 5 lines
Quoted 2 lines

Then get codec#* proc dump for both working and non-working states to compare.

See the attachments. The naming of the files should be comprehensible. I've updated to latest hg before dumping the codecs yesterday evening.

Thanks. That both mics are working in parallel means they are recorded at the same time, or you can switch them via "Capture Source"? In the latter case, which input as internal mic?

Unfortuantely the BIOS sets pretty useless information so it's hard to guess which pin is really correctly assigned.

Takashi

#20 lore raw

At Tue, 29 Jan 2008 15:55:24 +0100,

Quoted 19 lines · I wrote:

At Tue, 29 Jan 2008 11:06:24 +0100,

Quoted 10 lines · Martin Egge

Hi,

Am Montag, 28. Januar 2008 schrieb Takashi Iwai:

Quoted 6 lines

At Sun, 27 Jan 2008 23:15:03 +0100,

Quoted 3 lines · Martin Egge

I've got some information that might help you. If I set model=3stack the internal and external mic are working in parallel. There is no jack-sense which disables the internal mic when an external mic is connected.

Quoted 5 lines
Quoted 2 lines

Then get codec#* proc dump for both working and non-working states to compare.

See the attachments. The naming of the files should be comprehensible. I've updated to latest hg before dumping the codecs yesterday evening.

Quoted 6 lines

Thanks. That both mics are working in parallel means they are recorded at the same time, or you can switch them via "Capture Source"? In the latter case, which input as internal mic?

Unfortuantely the BIOS sets pretty useless information so it's hard to guess which pin is really correctly assigned.

The patch below adds the automatic mic switch for Samsung. Give it a try.

Takashi

pci/hda/patch_analog.c +50 -4
diff -r e9318a2cceaf pci/hda/patch_analog.c
@@ -612,13 +612,19 @@ static struct hda_input_mux ad1986a_lapt
 	},
 };
 
+static struct hda_input_mux ad1986a_automic_capture_source = {
+	.num_items = 2,
+	.items = {
+		{ "Mic", 0x0 },
+		{ "Mix", 0x5 },
+	},
+};
+
 static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
 	HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
 	HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
 	HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
 	HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
-	HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x0, HDA_OUTPUT),
-	HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x0, HDA_OUTPUT),
 	HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
 	HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
 	HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
@@ -641,6 +647,34 @@ static struct snd_kcontrol_new ad1986a_l
 	},
 	{ } /* end */
 };
+
+/* re-connect the mic boost input according to the jack sensing */
+static void ad1986a_automic(struct hda_codec *codec)
+{
+	unsigned int present;
+	present = snd_hda_codec_read(codec, 0x1f, 0, AC_VERB_GET_PIN_SENSE, 0);
+	snd_hda_codec_write(codec, 0x1d, 0,
+			    AC_VERB_SET_PIN_WIDGET_CONTROL,
+			    ((present & AC_PINSENSE_PRESENCE) ?
+			     0 : PIN_VREF80));
+}
+
+#define AD1986A_MIC_EVENT		0x36
+
+static void ad1986a_automic_unsol_event(struct hda_codec *codec,
+					    unsigned int res)
+{
+	if ((res >> 26) != AD1986A_MIC_EVENT)
+		return;
+	ad1986a_automic(codec);
+}
+
+static int ad1986a_automic_init(struct hda_codec *codec)
+{
+	ad198x_init(codec);
+	ad1986a_automic(codec);
+	return 0;
+}
 
 /* laptop-automute - 2ch only */
 
@@ -845,6 +879,15 @@ static struct hda_verb ad1986a_eapd_init
 	{}
 };
 
+static struct hda_verb ad1986a_automic_verbs[] = {
+	{0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
+	{0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
+	/*{0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},*/
+	{0x0f, AC_VERB_SET_CONNECT_SEL, 0x4},
+	{0x1f, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1986A_MIC_EVENT},
+	{}
+};
+
 /* Ultra initialization */
 static struct hda_verb ad1986a_ultra_init[] = {
 	/* eapd initialization */
@@ -987,14 +1030,17 @@ static int patch_ad1986a(struct hda_code
 		break;
 	case AD1986A_LAPTOP_EAPD:
 		spec->mixers[0] = ad1986a_laptop_eapd_mixers;
-		spec->num_init_verbs = 2;
+		spec->num_init_verbs = 3;
 		spec->init_verbs[1] = ad1986a_eapd_init_verbs;
+		spec->init_verbs[2] = ad1986a_automic_verbs;
 		spec->multiout.max_channels = 2;
 		spec->multiout.num_dacs = 1;
 		spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
 		if (!is_jack_available(codec, 0x25))
 			spec->multiout.dig_out_nid = 0;
-		spec->input_mux = &ad1986a_laptop_eapd_capture_source;
+		spec->input_mux = &ad1986a_automic_capture_source;
+		codec->patch_ops.unsol_event = ad1986a_automic_unsol_event;
+		codec->patch_ops.init = ad1986a_automic_init;
 		break;
 	case AD1986A_LAPTOP_AUTOMUTE:
 		spec->mixers[0] = ad1986a_laptop_automute_mixers;
#21 lore raw

Hi,

Am Donnerstag, 7. Februar 2008 schrieb Takashi Iwai:

Quoted 2 lines

The patch below adds the automatic mic switch for Samsung. Give it a try.

I gave it a try on the latest HG. You almost got the hang on it. The internal mic works for the first time with model=laptop-eapd. But the jack sense (autmatic switch to external mic when connected) does not work. Both mics are recorded at the same time.

Regards,
Martin

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#22 lore raw

At Thu, 7 Feb 2008 22:55:40 +0100,

Quoted 11 lines · Martin Egge

Hi,

Am Donnerstag, 7. Februar 2008 schrieb Takashi Iwai:

Quoted 2 lines

The patch below adds the automatic mic switch for Samsung. Give it a try.

I gave it a try on the latest HG. You almost got the hang on it. The internal mic works for the first time with model=laptop-eapd. But the jack sense (autmatic switch to external mic when connected) does not work. Both mics are recorded at the same time.

Do you see in codec# proc file between mic-plugged and unplugged states?

Takashi

#23 lore raw

At Fri, 08 Feb 2008 11:59:48 +0100,

Quoted 10 lines · I wrote:

At Thu, 7 Feb 2008 22:55:40 +0100,

Quoted 7 lines · Martin Egge

Hi,

Am Donnerstag, 7. Februar 2008 schrieb Takashi Iwai:

Quoted 2 lines

The patch below adds the automatic mic switch for Samsung. Give it a try.

Quoted 6 lines
Quoted 4 lines

I gave it a try on the latest HG. You almost got the hang on it. The internal mic works for the first time with model=laptop-eapd. But the jack sense (autmatic switch to external mic when connected) does not work. Both mics are recorded at the same time.

Do you see in codec# proc file between mic-plugged and unplugged

            ^
            any difference
Quoted 1 line

states?

Anyway, the patch below might work better. Give it a try.

Takashi

pci/hda/patch_analog.c +50 -4
diff -r e9318a2cceaf pci/hda/patch_analog.c
@@ -612,13 +612,19 @@ static struct hda_input_mux ad1986a_lapt
 	},
 };
 
+static struct hda_input_mux ad1986a_automic_capture_source = {
+	.num_items = 2,
+	.items = {
+		{ "Mic", 0x0 },
+		{ "Mix", 0x5 },
+	},
+};
+
 static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
 	HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
 	HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
 	HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
 	HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
-	HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x0, HDA_OUTPUT),
-	HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x0, HDA_OUTPUT),
 	HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
 	HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
 	HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
@@ -641,6 +647,34 @@ static struct snd_kcontrol_new ad1986a_l
 	},
 	{ } /* end */
 };
+
+/* re-connect the mic boost input according to the jack sensing */
+static void ad1986a_automic(struct hda_codec *codec)
+{
+	unsigned int present;
+	present = snd_hda_codec_read(codec, 0x1d, 0, AC_VERB_GET_PIN_SENSE, 0);
+	snd_hda_codec_write(codec, 0x1f, 0,
+			    AC_VERB_SET_PIN_WIDGET_CONTROL,
+			    ((present & AC_PINSENSE_PRESENCE) ?
+			     0 : PIN_VREF80));
+}
+
+#define AD1986A_MIC_EVENT		0x36
+
+static void ad1986a_automic_unsol_event(struct hda_codec *codec,
+					    unsigned int res)
+{
+	if ((res >> 26) != AD1986A_MIC_EVENT)
+		return;
+	ad1986a_automic(codec);
+}
+
+static int ad1986a_automic_init(struct hda_codec *codec)
+{
+	ad198x_init(codec);
+	ad1986a_automic(codec);
+	return 0;
+}
 
 /* laptop-automute - 2ch only */
 
@@ -845,6 +879,15 @@ static struct hda_verb ad1986a_eapd_init
 	{}
 };
 
+static struct hda_verb ad1986a_automic_verbs[] = {
+	{0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
+	{0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
+	/*{0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},*/
+	{0x0f, AC_VERB_SET_CONNECT_SEL, 0x4},
+	{0x1d, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1986A_MIC_EVENT},
+	{}
+};
+
 /* Ultra initialization */
 static struct hda_verb ad1986a_ultra_init[] = {
 	/* eapd initialization */
@@ -987,14 +1030,17 @@ static int patch_ad1986a(struct hda_code
 		break;
 	case AD1986A_LAPTOP_EAPD:
 		spec->mixers[0] = ad1986a_laptop_eapd_mixers;
-		spec->num_init_verbs = 2;
+		spec->num_init_verbs = 3;
 		spec->init_verbs[1] = ad1986a_eapd_init_verbs;
+		spec->init_verbs[2] = ad1986a_automic_verbs;
 		spec->multiout.max_channels = 2;
 		spec->multiout.num_dacs = 1;
 		spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
 		if (!is_jack_available(codec, 0x25))
 			spec->multiout.dig_out_nid = 0;
-		spec->input_mux = &ad1986a_laptop_eapd_capture_source;
+		spec->input_mux = &ad1986a_automic_capture_source;
+		codec->patch_ops.unsol_event = ad1986a_automic_unsol_event;
+		codec->patch_ops.init = ad1986a_automic_init;
 		break;
 	case AD1986A_LAPTOP_AUTOMUTE:
 		spec->mixers[0] = ad1986a_laptop_automute_mixers;
#24 lore raw

Hi,

Am Freitag, 8. Februar 2008 schrieb Takashi Iwai:

Quoted 15 lines

At Fri, 08 Feb 2008 11:59:48 +0100,

Quoted 13 lines · I wrote:

At Thu, 7 Feb 2008 22:55:40 +0100,

Quoted 8 lines · Martin Egge

Am Donnerstag, 7. Februar 2008 schrieb Takashi Iwai:

Quoted 2 lines

The patch below adds the automatic mic switch for Samsung. Give it a try.

I gave it a try on the latest HG. You almost got the hang on it. The internal mic works for the first time with model=laptop-eapd. But the jack sense (autmatic switch to external mic when connected) does not work. Both mics are recorded at the same time.

Do you see any difference in codec# proc file between mic-plugged and unplugged states?

Yes there is a difference:

With mic plugged I get the following in lines 161 to 172 of codec#0:
------------------------------------------------------------
Node 0x1d [Pin Complex] wcaps 0x400985: Stereo Amp-Out R/L
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x081737: IN OUT Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x01019015: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Pink
DefAssociation = 0x1, Sequence = 0x5
Pin-ctls: 0x00: VREF_HIZ
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0d

------------------------------------------------------------

With mic unplugged I get the following in lines 161 to 172 of codec#0:
------------------------------------------------------------
Node 0x1d [Pin Complex] wcaps 0x400985: Stereo Amp-Out R/L
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x081737: IN OUT Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x01019015: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Pink
DefAssociation = 0x1, Sequence = 0x5
Pin-ctls: 0x24: IN VREF_80
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0d

------------------------------------------------------------

Quoted 1 line

Anyway, the patch below might work better. Give it a try.

This patch does not work. The external mic is always disabled and there are not differences in the codec# proc files.

Regards,
Martin

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#25 lore raw

At Sat, 9 Feb 2008 13:01:18 +0100,

Quoted 51 lines · Martin Egge

Hi,

Am Freitag, 8. Februar 2008 schrieb Takashi Iwai:

Quoted 15 lines

At Fri, 08 Feb 2008 11:59:48 +0100,

Quoted 13 lines · I wrote:

At Thu, 7 Feb 2008 22:55:40 +0100,

Quoted 8 lines · Martin Egge

Am Donnerstag, 7. Februar 2008 schrieb Takashi Iwai:

Quoted 2 lines

The patch below adds the automatic mic switch for Samsung. Give it a try.

I gave it a try on the latest HG. You almost got the hang on it. The internal mic works for the first time with model=laptop-eapd. But the jack sense (autmatic switch to external mic when connected) does not work. Both mics are recorded at the same time.

Do you see any difference in codec# proc file between mic-plugged and unplugged states?

Yes there is a difference:

With mic plugged I get the following in lines 161 to 172 of codec#0:
------------------------------------------------------------
Node 0x1d [Pin Complex] wcaps 0x400985: Stereo Amp-Out R/L
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x081737: IN OUT Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x01019015: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Pink
DefAssociation = 0x1, Sequence = 0x5
Pin-ctls: 0x00: VREF_HIZ
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0d

------------------------------------------------------------

With mic unplugged I get the following in lines 161 to 172 of codec#0:
------------------------------------------------------------
Node 0x1d [Pin Complex] wcaps 0x400985: Stereo Amp-Out R/L
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x081737: IN OUT Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x01019015: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Pink
DefAssociation = 0x1, Sequence = 0x5
Pin-ctls: 0x24: IN VREF_80
Unsolicited: tag=00, enabled=0
Connection: 1

Quoted 2 lines
     0x0d

------------------------------------------------------------

Interesting. So, the pin ctl of the widget 0x1d plays no role, apparently.

How about the patch below? If it still doesn't work, please show the whole codec#* proc file again.

Also, what about another spdif-share-switch patch?

Takashi

---

pci/hda/patch_analog.c +49 -4
diff -r 6db3c028922a pci/hda/patch_analog.c
@@ -612,13 +612,19 @@ static struct hda_input_mux ad1986a_lapt
 	},
 };
 
+static struct hda_input_mux ad1986a_automic_capture_source = {
+	.num_items = 2,
+	.items = {
+		{ "Mic", 0x0 },
+		{ "Mix", 0x5 },
+	},
+};
+
 static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
 	HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
 	HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
 	HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
 	HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
-	HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0x0, HDA_OUTPUT),
-	HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0x0, HDA_OUTPUT),
 	HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
 	HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
 	HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
@@ -641,6 +647,33 @@ static struct snd_kcontrol_new ad1986a_l
 	},
 	{ } /* end */
 };
+
+/* re-connect the mic boost input according to the jack sensing */
+static void ad1986a_automic(struct hda_codec *codec)
+{
+	unsigned int present;
+	present = snd_hda_codec_read(codec, 0x1f, 0, AC_VERB_GET_PIN_SENSE, 0);
+	/* 0 = 0x1f, 2 = 0x1d, 4 = mixed */
+	snd_hda_codec_write(codec, 0x0f, 0, AC_VERB_SET_CONNECT_SEL,
+			    (present & AC_PINSENSE_PRESENCE) ? 0 : 2);
+}
+
+#define AD1986A_MIC_EVENT		0x36
+
+static void ad1986a_automic_unsol_event(struct hda_codec *codec,
+					    unsigned int res)
+{
+	if ((res >> 26) != AD1986A_MIC_EVENT)
+		return;
+	ad1986a_automic(codec);
+}
+
+static int ad1986a_automic_init(struct hda_codec *codec)
+{
+	ad198x_init(codec);
+	ad1986a_automic(codec);
+	return 0;
+}
 
 /* laptop-automute - 2ch only */
 
@@ -845,6 +878,15 @@ static struct hda_verb ad1986a_eapd_init
 	{}
 };
 
+static struct hda_verb ad1986a_automic_verbs[] = {
+	{0x1d, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
+	{0x1f, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},
+	/*{0x20, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_VREF80},*/
+	{0x0f, AC_VERB_SET_CONNECT_SEL, 0x0},
+	{0x1f, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1986A_MIC_EVENT},
+	{}
+};
+
 /* Ultra initialization */
 static struct hda_verb ad1986a_ultra_init[] = {
 	/* eapd initialization */
@@ -987,14 +1029,17 @@ static int patch_ad1986a(struct hda_code
 		break;
 	case AD1986A_LAPTOP_EAPD:
 		spec->mixers[0] = ad1986a_laptop_eapd_mixers;
-		spec->num_init_verbs = 2;
+		spec->num_init_verbs = 3;
 		spec->init_verbs[1] = ad1986a_eapd_init_verbs;
+		spec->init_verbs[2] = ad1986a_automic_verbs;
 		spec->multiout.max_channels = 2;
 		spec->multiout.num_dacs = 1;
 		spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
 		if (!is_jack_available(codec, 0x25))
 			spec->multiout.dig_out_nid = 0;
-		spec->input_mux = &ad1986a_laptop_eapd_capture_source;
+		spec->input_mux = &ad1986a_automic_capture_source;
+		codec->patch_ops.unsol_event = ad1986a_automic_unsol_event;
+		codec->patch_ops.init = ad1986a_automic_init;
 		break;
 	case AD1986A_LAPTOP_AUTOMUTE:
 		spec->mixers[0] = ad1986a_laptop_automute_mixers;
#26 lore raw

Hi,

Am Montag, 11. Februar 2008 schrieb Takashi Iwai:

Quoted 2 lines

How about the patch below? If it still doesn't work, please show the whole codec#* proc file again.

Hey, after some hard work you've solved the problem: Internal, external mic and jack sensing are working perfectly.

Thanks a lot!
Martin

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#27 lore raw

At Mon, 11 Feb 2008 19:13:06 +0100,

Quoted 9 lines · Martin Egge

Hi,

Am Montag, 11. Februar 2008 schrieb Takashi Iwai:

Quoted 2 lines

How about the patch below? If it still doesn't work, please show the whole codec#* proc file again.

Hey, after some hard work you've solved the problem: Internal, external mic and jack sensing are working perfectly.

OK, the patch is committed to HG tree now.

thanks,

Takashi

#28 lore raw
In reply to Takashi Iwai

Hi Takashi,

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

The SPDIF is disabled intentionally for your model because no one could test it. Does the patch below work?

As I already have written: this patch does not work with the code from hg. But I've applied it successfully on 1.0.15. The digital output is working and can be disabled with the IEC958 switch.

Using the code from hg the digital output is not working as well when I set model=3stack. This has has been working with the original code from 1.0.15 and 1.0.14. So there must be a general problem with IEC958 in the hg code.

I've another question regarding the digital output. Is there a way to control the volume of the digital output? Neither the Master nor the PCM control have any effect on the volume of the digital output. In addition the output can't be switched off by muting PCM or Master.

Regards,
Martin

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#29 lore raw

At Sun, 27 Jan 2008 23:03:20 +0100,

Quoted 7 lines · Martin Egge

Hi Takashi,

Am Mittwoch, 23. Januar 2008 schrieb Takashi Iwai:

Quoted 2 lines

The SPDIF is disabled intentionally for your model because no one could test it. Does the patch below work?

Quoted 7 lines

As I already have written: this patch does not work with the code from hg. But I've applied it successfully on 1.0.15. The digital output is working and can be disabled with the IEC958 switch.

Using the code from hg the digital output is not working as well when I set model=3stack. This has has been working with the original code from 1.0.15 and 1.0.14. So there must be a general problem with IEC958 in the hg code.

OK, then again, get the codec dump to compare.

Quoted 4 lines

I've another question regarding the digital output. Is there a way to control the volume of the digital output? Neither the Master nor the PCM control have any effect on the volume of the digital output. In addition the output can't be switched off by muting PCM or Master.

No, this signal route has no volume control.

Takashi

#30 lore raw

Hi,

Am Montag, 28. Januar 2008 schrieb Takashi Iwai:

Quoted 6 lines

At Sun, 27 Jan 2008 23:03:20 +0100,

Quoted 4 lines · Martin Egge

As I already have written: this patch does not work with the code from hg. But I've applied it successfully on 1.0.15. The digital output is working and can be disabled with the IEC958 switch.

Quoted 6 lines
Quoted 4 lines

Using the code from hg the digital output is not working as well when I set model=3stack. This has has been working with the original code from 1.0.15 and 1.0.14. So there must be a general problem with IEC958 in the hg code.

OK, then again, get the codec dump to compare.

See the attachments. The naming of the files should be comprehensible. I've updated to latest hg before dumping the codecs yesterday evening.

Regards,
Martin

Codec: Analog Devices AD1986A
Address: 0
Vendor Id: 0x11d41986
Subsystem Id: 0x144dc024
Revision Id: 0x100500
No Modem Function Group found
Default PCM:

    rates [0x7f]: 8000 11025 16000 22050 32000 44100 48000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM

Default Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Default Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Node 0x02 [Audio Output] wcaps 0x30311: Stereo Digital
PCM:

    rates [0x60]: 44100 48000
    bits [0x2]: 16
    formats [0x5]: PCM AC3
  Connection: 2
     0x01* 0x06

Node 0x03 [Audio Output] wcaps 0x44d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x18 0x18]
Power: 0x0
Node 0x04 [Audio Output] wcaps 0x40d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Power: 0x0
Node 0x05 [Audio Output] wcaps 0x40d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Power: 0x0
Node 0x06 [Audio Input] wcaps 0x100511: Stereo
PCM:

    rates [0x7f]: 8000 11025 16000 22050 32000 44100 48000
    bits [0x6]: 16 20
    formats [0x1]: PCM
  Power: 0x0
  Connection: 1
     0x12
Node 0x07 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 8
     0x03 0x09 0x13 0x14 0x15 0x16 0x17 0x18
Node 0x08 [Audio Mixer] wcaps 0x200100: Mono
  Connection: 1
     0x07

Node 0x09 [Audio Mixer] wcaps 0x20010e: Mono Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-In vals: [0x80] [0x80]
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80]
Connection: 2

     0x04 0x05
Node 0x0a [Audio Selector] wcaps 0x300101: Stereo
  Connection: 3
     0x07* 0x04 0x05
Node 0x0b [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x07* 0x04
Node 0x0c [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x04* 0x07
Node 0x0d [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x05* 0x08
Node 0x0e [Audio Selector] wcaps 0x300100: Mono
  Connection: 2
     0x08* 0x11

Node 0x0f [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-Out vals: [0x00 0x00]
Connection: 8

     0x1f* 0x20 0x1d 0x1d 0x27 0x28 0x29 0x2a
Node 0x10 [Audio Selector] wcaps 0x300101: Stereo
  Connection: 3
     0x20* 0x1c 0x1f
Node 0x11 [Audio Selector] wcaps 0x300941: Stereo
  Connection: 2
     0x0f* 0x2b

Node 0x12 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x0f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 8

     0x11* 0x22 0x00 0x21 0x10 0x07 0x08 0x23

Node 0x13 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x11

Node 0x14 [Audio Selector] wcaps 0x30010c: Mono Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80]
Connection: 1

     0x23

Node 0x15 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x22

Node 0x16 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x21

Node 0x17 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x10

Node 0x18 [Audio Selector] wcaps 0x30010c: Mono Amp-Out
Amp-Out caps: ofs=0x0f, nsteps=0x0f, stepsize=0x0b, mute=1 Amp-Out vals: [0x8f]
Connection: 2

     0x19* 0x24

Node 0x19 [Beep Generator Widget] wcaps 0x700000: Mono Node 0x1a [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x0f 0x0f]
Pincap 0x081f: OUT HP Detect
Pin Default 0x02214021: [Jack] HP Out at Ext Front
Conn = 1/8, Color = Green
Pin-ctls: 0xc0: OUT HP
Connection: 1

     0x0a

Node 0x1b [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x0f 0x0f]
Pincap 0x081001f: OUT HP EAPD Detect
Pin Default 0x01014011: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Green
Pin-ctls: 0x40: OUT
Connection: 1

     0x0b

Node 0x1c [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x0837: IN OUT Detect
Pin Default 0x41013012: [N/A] Line Out at Ext Rear
Conn = 1/8, Color = Blue
Pin-ctls: 0x40: OUT
Connection: 1

     0x0c

Node 0x1d [Pin Complex] wcaps 0x400985: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x081737: IN OUT Detect
Pin Default 0x01019015: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Pink
Pin-ctls: 0x40: OUT
Connection: 1

     0x0d

Node 0x1e [Pin Complex] wcaps 0x400104: Mono Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80]
Pincap 0x0810: OUT
Pin Default 0x511710f0: [N/A] Speaker at Int Rear
Conn = Analog, Color = Black
Pin-ctls: 0x40: OUT
Connection: 1

     0x0e

Node 0x1f [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x081727: IN Detect
Pin Default 0x02a190f0: [Jack] Mic at Ext Front
Conn = 1/8, Color = Pink
Pin-ctls: 0x24: IN
Node 0x20 [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x081727: IN Detect
Pin Default 0x018130f0: [Jack] Line In at Ext Rear
Conn = 1/8, Color = Blue
Pin-ctls: 0x20: IN
Node 0x21 [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x0827: IN Detect
Pin Default 0x5997e0f0: [N/A] Aux at Int ATAPI
Conn = Analog, Color = White
Pin-ctls: 0x20: IN
Node 0x22 [Pin Complex] wcaps 0x400001: Stereo
Pincap 0x0820: IN
Pin Default 0x593310f0: [N/A] CD at Int ATAPI
Conn = ATAPI, Color = Black
Pin-ctls: 0x20: IN
Node 0x23 [Pin Complex] wcaps 0x400000: Mono
Pincap 0x0820: IN
Pin Default 0x59b770f0: [N/A] Telephony at Int ATAPI
Conn = Analog, Color = Yellow
Pin-ctls: 0x20: IN
Node 0x24 [Pin Complex] wcaps 0x400000: Mono
Pincap 0x0820: IN
Pin Default 0x91f710f0: [Fixed] Other at Int Rear
Conn = Analog, Color = Black
Pin-ctls: 0x20: IN
Node 0x25 [Pin Complex] wcaps 0x400301: Stereo Digital
Pincap 0x0810: OUT
Pin Default 0x0145f0f0: [Jack] SPDIF Out at Ext Rear
Conn = Optical, Color = Other
Pin-ctls: 0x40: OUT
Connection: 1

     0x02
Node 0x26 [Power Widget] wcaps 0x500500: Mono
  Power: 0x0
  Connection: 8
     0x07* 0x08 0x13 0x14 0x15 0x16 0x17 0x18
Node 0x27 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1f 0x1d
Node 0x28 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1f 0x20
Node 0x29 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1d 0x20
Node 0x2a [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 3
     0x1f 0x1d 0x20
Node 0x2b [Audio Mixer] wcaps 0x200100: Mono
  Connection: 1
     0x0f

Codec: Generic 11c1 Si3054
Address: 1
Vendor Id: 0x11c13026
Subsystem Id: 0x2117144d
Revision Id: 0x100700
Modem Function Group: 0x1

Codec: Generic 11c1 Si3054
Address: 1
Vendor Id: 0x11c13026
Subsystem Id: 0x2117144d
Revision Id: 0x100700
Modem Function Group: 0x1

Codec: Analog Devices AD1986A
Address: 0
Vendor Id: 0x11d41986
Subsystem Id: 0x144dc024
Revision Id: 0x100500
No Modem Function Group found
Default PCM:

    rates [0x7f]: 8000 11025 16000 22050 32000 44100 48000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM

Default Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Default Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1
GPIO: io=0, o=1, i=0, unsolicited=0, wake=0
Node 0x02 [Audio Output] wcaps 0x30311: Stereo Digital
Converter: stream=0, channel=0
Digital: Enabled
Digital category: 0x0
PCM:

    rates [0x60]: 44100 48000
    bits [0x2]: 16
    formats [0x5]: PCM AC3
  Delay: 3 samples
  Connection: 2
     0x01* 0x06

Node 0x03 [Audio Output] wcaps 0x44d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x18 0x18]
Converter: stream=0, channel=0
Power: setting=D0, actual=D0
Processing caps: benign=1, ncoeff=70
Node 0x04 [Audio Output] wcaps 0x40d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Converter: stream=0, channel=0
Power: setting=D0, actual=D0
Node 0x05 [Audio Output] wcaps 0x40d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Converter: stream=0, channel=0
Power: setting=D0, actual=D0
Node 0x06 [Audio Input] wcaps 0x100511: Stereo
Converter: stream=0, channel=0
SDI-Select: 0
PCM:

    rates [0x7f]: 8000 11025 16000 22050 32000 44100 48000
    bits [0x6]: 16 20
    formats [0x1]: PCM
  Power: setting=D0, actual=D0
  Connection: 1
     0x12
Node 0x07 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 8
     0x03 0x09 0x13 0x14 0x15 0x16 0x17 0x18
Node 0x08 [Audio Mixer] wcaps 0x200100: Mono
  Connection: 1
     0x07

Node 0x09 [Audio Mixer] wcaps 0x20010e: Mono Amp-In Amp-Out
Amp-In caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-In vals: [0x80] [0x80]
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x80]
Connection: 2

     0x04 0x05
Node 0x0a [Audio Selector] wcaps 0x300101: Stereo
  Connection: 3
     0x07* 0x04 0x05
Node 0x0b [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x07* 0x04
Node 0x0c [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x04* 0x07
Node 0x0d [Audio Selector] wcaps 0x300101: Stereo
  Connection: 2
     0x05* 0x08
Node 0x0e [Audio Selector] wcaps 0x300100: Mono
  Connection: 2
     0x08* 0x11

Node 0x0f [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0 Amp-Out vals: [0x00 0x00]
Connection: 8

     0x1f* 0x20 0x1d 0x1d 0x27 0x28 0x29 0x2a
Node 0x10 [Audio Selector] wcaps 0x300101: Stereo
  Connection: 3
     0x20* 0x1c 0x1f
Node 0x11 [Audio Selector] wcaps 0x300941: Stereo R/L
  Connection: 2
     0x0f* 0x2b

Processing caps: benign=1, ncoeff=0
Node 0x12 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x00, nsteps=0x0f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 8

     0x11* 0x22 0x00 0x21 0x10 0x07 0x08 0x23

Node 0x13 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x11

Node 0x14 [Audio Selector] wcaps 0x30010c: Mono Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80]
Connection: 1

     0x23

Node 0x15 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x22

Node 0x16 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x21

Node 0x17 [Audio Selector] wcaps 0x30010d: Stereo Amp-Out
Amp-Out caps: ofs=0x17, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Connection: 1

     0x10

Node 0x18 [Audio Selector] wcaps 0x30010c: Mono Amp-Out
Amp-Out caps: ofs=0x0f, nsteps=0x0f, stepsize=0x0b, mute=1 Amp-Out vals: [0x8f]
Connection: 2

     0x19* 0x24

Node 0x19 [Beep Generator Widget] wcaps 0x700000: Mono Node 0x1a [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x0f 0x0f]
Pincap 0x081f: OUT HP Detect Trigger ImpSense Pin Default 0x02214021: [Jack] HP Out at Ext Front
Conn = 1/8, Color = Green
DefAssociation = 0x2, Sequence = 0x1
Pin-ctls: 0xc0: OUT HP
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0a

Node 0x1b [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x0f 0x0f]
Pincap 0x081001f: OUT HP EAPD Detect Trigger ImpSense EAPD 0x0:
Pin Default 0x01014011: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Green
DefAssociation = 0x1, Sequence = 0x1
Pin-ctls: 0x40: OUT
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0b

Node 0x1c [Pin Complex] wcaps 0x400185: Stereo Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x0837: IN OUT Detect Trigger ImpSense Pin Default 0x41013012: [N/A] Line Out at Ext Rear
Conn = 1/8, Color = Blue
DefAssociation = 0x1, Sequence = 0x2
Pin-ctls: 0x40: OUT
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0c

Node 0x1d [Pin Complex] wcaps 0x400985: Stereo Amp-Out R/L
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80 0x80]
Pincap 0x081737: IN OUT Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x01019015: [Jack] Line Out at Ext Rear
Conn = 1/8, Color = Pink
DefAssociation = 0x1, Sequence = 0x5
Pin-ctls: 0x40: OUT VREF_HIZ
Unsolicited: tag=00, enabled=0
Connection: 1

     0x0d

Node 0x1e [Pin Complex] wcaps 0x400104: Mono Amp-Out
Amp-Out caps: ofs=0x1f, nsteps=0x1f, stepsize=0x05, mute=1 Amp-Out vals: [0x80]
Pincap 0x0810: OUT
Pin Default 0x511710f0: [N/A] Speaker at Int Rear
Conn = Analog, Color = Black
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x40: OUT
Connection: 1

     0x0e

Node 0x1f [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x081727: IN Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x02a190f0: [Jack] Mic at Ext Front
Conn = 1/8, Color = Pink
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x24: IN VREF_80
Unsolicited: tag=00, enabled=0
Node 0x20 [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x081727: IN Detect Trigger ImpSense
Vref caps: HIZ 50 GRD 80
Pin Default 0x018130f0: [Jack] Line In at Ext Rear
Conn = 1/8, Color = Blue
DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN VREF_HIZ
Unsolicited: tag=00, enabled=0
Node 0x21 [Pin Complex] wcaps 0x400081: Stereo
Pincap 0x0827: IN Detect Trigger ImpSense Pin Default 0x5997e0f0: [N/A] Aux at Int ATAPI
Conn = Analog, Color = White DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Unsolicited: tag=00, enabled=0
Node 0x22 [Pin Complex] wcaps 0x400001: Stereo
Pincap 0x0820: IN
Pin Default 0x593310f0: [N/A] CD at Int ATAPI
Conn = ATAPI, Color = Black DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Node 0x23 [Pin Complex] wcaps 0x400000: Mono
Pincap 0x0820: IN
Pin Default 0x59b770f0: [N/A] Telephony at Int ATAPI
Conn = Analog, Color = Yellow DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Node 0x24 [Pin Complex] wcaps 0x400000: Mono
Pincap 0x0820: IN
Pin Default 0x91f710f0: [Fixed] Other at Int Rear
Conn = Analog, Color = Black DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x20: IN
Node 0x25 [Pin Complex] wcaps 0x400301: Stereo Digital
Pincap 0x0810: OUT
Pin Default 0x0145f0f0: [Jack] SPDIF Out at Ext Rear
Conn = Optical, Color = Other DefAssociation = 0xf, Sequence = 0x0
Pin-ctls: 0x40: OUT
Connection: 1

     0x02
Node 0x26 [Power Widget] wcaps 0x500500: Mono
  Power: setting=D0, actual=D0
  Connection: 8
     0x07* 0x08 0x13 0x14 0x15 0x16 0x17 0x18
Node 0x27 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1f 0x1d
Node 0x28 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1f 0x20
Node 0x29 [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 2
     0x1d 0x20
Node 0x2a [Audio Mixer] wcaps 0x200101: Stereo
  Connection: 3
     0x1f 0x1d 0x20
Node 0x2b [Audio Mixer] wcaps 0x200100: Mono
  Connection: 1
     0x0f

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#31 lore raw

At Tue, 29 Jan 2008 11:05:36 +0100,

Quoted 15 lines · Martin Egge

Hi,

Am Montag, 28. Januar 2008 schrieb Takashi Iwai:

Quoted 11 lines

At Sun, 27 Jan 2008 23:03:20 +0100,

Quoted 8 lines · Martin Egge

As I already have written: this patch does not work with the code from hg. But I've applied it successfully on 1.0.15. The digital output is working and can be disabled with the IEC958 switch.

Using the code from hg the digital output is not working as well when I set model=3stack. This has has been working with the original code from 1.0.15 and 1.0.14. So there must be a general problem with IEC958 in the hg code.

Quoted 4 lines
Quoted 1 line

OK, then again, get the codec dump to compare.

See the attachments. The naming of the files should be comprehensible. I've updated to latest hg before dumping the codecs yesterday evening.

Thanks. It's weird that there is really no significant difference in these proc files. So it should be something else.

Could you try HG bisect? It'd be greatly helpful.

Takashi

#33 lore raw

At Tue, 29 Jan 2008 19:19:48 +0100,

Quoted 10 lines · Martin Egge

Hi,

Am Dienstag, 29. Januar 2008 schrieb Takashi Iwai:

Quoted 4 lines

Thanks. It's weird that there is really no significant difference in these proc files. So it should be something else.

Could you try HG bisect? It'd be greatly helpful.

What does HG bisect mean?

Run "hg bisect -h". It's a method to track down the regression point during changesets. A brief instruction is below:

- First, initizliaze
% hg bisect init
- Go to the broken point (usually the latest changeset, tip) % hg update -rtip
- Mark it as bad
% hg bisect bad
- Go to the changeset that is known to work (e.g. v1.0.15)

	% hg update -rv1.0.15

- Mark it as good
% hg bisect good
then the bisect will move to a next changeset to try.
- Try this changeset, and mark either good or bad.
- Repeat until the problematic changeset is found.
- Reset bisect
% hg bisect reset

Note that when you need an additonal patch, you have to apply the patch at each time, and revert it (hg revert --all) before marking good/bad.

Takashi

#34 lore raw
In reply to Takashi Iwai

Hi,

Am Dienstag, 29. Januar 2008 schrieb Takashi Iwai:

Quoted 1 line

Could you try HG bisect? It'd be greatly helpful.

I've tried HG bisect this evening. It took me some time to discover that the problem is not within alsa-driver or alsa-kernel but within alsa-lib. This is the result of HG bisect:

The first bad revision is:

changeset:   2397:d1e9a2f92e7b
user:        tiwai
date:        Fri Jan 18 13:42:51 2008 +0100
summary:     dmix - Enable auto format detection as default

Regards,
Martin

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#35 lore raw

Hi, sorry for the late reply.
At the next time, please add my address to Cc so that I don't miss your post...

At Fri, 1 Feb 2008 22:02:51 +0100,

Quoted 10 lines · Martin Egge

Hi,

Am Dienstag, 29. Januar 2008 schrieb Takashi Iwai:

Quoted 1 line

Could you try HG bisect? It'd be greatly helpful.

I've tried HG bisect this evening. It took me some time to discover that the problem is not within alsa-driver or alsa-kernel but within alsa-lib. This is the result of HG bisect:

Quoted 5 lines

The first bad revision is:

changeset:   2397:d1e9a2f92e7b
user:        tiwai
date:        Fri Jan 18 13:42:51 2008 +0100
summary:     dmix - Enable auto format detection as default

Thanks for checkign this. Now the thing gets a bit clearer. The problem is explained like this: via "default" PCM, 32bit format is chosen now because the analog audio-out widget supports. But the SPDIF out widget doesn't support that format. Thus it's not played properly.

If my guess is correct, you can propbably get SPDIF output via "spdif" output. What happens with the below?

% aplay -Dplug:spdif foo.wav

Takashi

#36 lore raw

Hi,

Am Donnerstag, 7. Februar 2008 schrieb Takashi Iwai:

Quoted 1 line

Hi, sorry for the late reply.

No problem.

Quoted 2 lines

At the next time, please add my address to Cc so that I don't miss your post...

I'll try to keep this in mind.

Quoted 15 lines

At Fri, 1 Feb 2008 22:02:51 +0100,

Quoted 7 lines · Martin Egge

Am Dienstag, 29. Januar 2008 schrieb Takashi Iwai:

Quoted 1 line

Could you try HG bisect? It'd be greatly helpful.

I've tried HG bisect this evening. It took me some time to discover that the problem is not within alsa-driver or alsa-kernel but within alsa-lib. This is the result of HG bisect:

Quoted 5 lines

The first bad revision is:

changeset:   2397:d1e9a2f92e7b
user:        tiwai
date:        Fri Jan 18 13:42:51 2008 +0100
summary:     dmix - Enable auto format detection as default
Quoted 5 lines

Thanks for checkign this. Now the thing gets a bit clearer. The problem is explained like this: via "default" PCM, 32bit format is chosen now because the analog audio-out widget supports. But the SPDIF out widget doesn't support that format. Thus it's not played properly.

Oh I see, but why has this behavior changed since 1.0.15?

Quoted 4 lines

If my guess is correct, you can propbably get SPDIF output via "spdif" output. What happens with the below?

% aplay -Dplug:spdif foo.wav

You are right. Choosing plug:spdif plays the sound cia the SDIF-Out. Of course this does not play the sound via the internal speakers when no SPDIF is connected.

But I'd prefer the old behavior from 1.0.15 where the default device was playing sound via SPDIF when connected and via internal speakers when SDIF is not connected.

Regards,
Martin

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#37 lore raw

At Thu, 7 Feb 2008 23:04:00 +0100,

Quoted 16 lines · Martin Egge
Quoted 16 lines

At Fri, 1 Feb 2008 22:02:51 +0100,

Quoted 12 lines · Martin Egge

Am Dienstag, 29. Januar 2008 schrieb Takashi Iwai:

Quoted 1 line

Could you try HG bisect? It'd be greatly helpful.

I've tried HG bisect this evening. It took me some time to discover that the problem is not within alsa-driver or alsa-kernel but within alsa-lib. This is the result of HG bisect:

The first bad revision is:

changeset:   2397:d1e9a2f92e7b
user:        tiwai
date:        Fri Jan 18 13:42:51 2008 +0100
summary:     dmix - Enable auto format detection as default
Quoted 7 lines
Quoted 5 lines

Thanks for checkign this. Now the thing gets a bit clearer. The problem is explained like this: via "default" PCM, 32bit format is chosen now because the analog audio-out widget supports. But the SPDIF out widget doesn't support that format. Thus it's not played properly.

Oh I see, but why has this behavior changed since 1.0.15?

Because we want to use the best quality of format as default. In the older version, it was fixed to S16 although the device supports 32bit.

You can set the following in your ~/.asoundrc to use S16 again
defaults.pcm.dmix.format S16

Quoted 5 lines
Quoted 4 lines

If my guess is correct, you can propbably get SPDIF output via "spdif" output. What happens with the below?

% aplay -Dplug:spdif foo.wav

Quoted 7 lines

You are right. Choosing plug:spdif plays the sound cia the SDIF-Out. Of course this does not play the sound via the internal speakers when no SPDIF is connected.

But I'd prefer the old behavior from 1.0.15 where the default device was playing sound via SPDIF when connected and via internal speakers when SDIF is not connected.

Try the patch below. This adds the mixer switch "Analog To SPDIF". If this is on, the supported format is more limited so that the default PCM can route to SPDIF. If this switch is off, dmix will choose 32bit automatically.

Takashi

pci/hda/hda_codec.c +68 -3
diff -r 7c1928ffe1f3 pci/hda/hda_codec.c
@@ -1527,6 +1527,43 @@ int snd_hda_create_spdif_out_ctls(struct
 }
 
 /*
+ * SPDIF sharing with analog output
+ */
+static int spdif_share_sw_get(struct snd_kcontrol *kcontrol,
+			      struct snd_ctl_elem_value *ucontrol)
+{
+	struct hda_multi_out *mout = snd_kcontrol_chip(kcontrol);
+	ucontrol->value.integer.value[0] = mout->share_spdif;
+	return 0;
+}
+
+static int spdif_share_sw_put(struct snd_kcontrol *kcontrol,
+			      struct snd_ctl_elem_value *ucontrol)
+{
+	struct hda_multi_out *mout = snd_kcontrol_chip(kcontrol);
+	mout->share_spdif = !!ucontrol->value.integer.value[0];
+	return 0;
+}
+
+static struct snd_kcontrol_new spdif_share_sw = {
+	.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+	.name = "Analog To SPDIF Playback Switch",
+	.info = snd_ctl_boolean_mono_info,
+	.get = spdif_share_sw_get,
+	.put = spdif_share_sw_put,
+};
+
+int snd_hda_create_spdif_share_sw(struct hda_codec *codec,
+				  struct hda_multi_out *mout)
+{
+	if (!mout->dig_out_nid)
+		return 0;
+	/* ATTENTION: here mout is passed as private_data, instead of codec */
+	return snd_ctl_add(codec->bus->card,
+			   snd_ctl_new1(&spdif_share_sw, mout));
+}
+
+/*
  * SPDIF input
  */
 
@@ -2551,9 +2588,36 @@ int snd_hda_multi_out_dig_close(struct h
  */
 int snd_hda_multi_out_analog_open(struct hda_codec *codec,
 				  struct hda_multi_out *mout,
-				  struct snd_pcm_substream *substream)
+				  struct snd_pcm_substream *substream,
+				  struct hda_pcm_stream *hinfo)
 {
-	substream->runtime->hw.channels_max = mout->max_channels;
+	struct snd_pcm_runtime *runtime = substream->runtime;
+	runtime->hw.channels_max = mout->max_channels;
+	if (mout->dig_out_nid) {
+		if (!mout->analog_rates) {
+			mout->analog_rates = hinfo->rates;
+			mout->analog_formats = hinfo->formats;
+			mout->analog_maxbps = hinfo->maxbps;
+		} else {
+			runtime->hw.rates = mout->analog_rates;
+			runtime->hw.formats = mout->analog_formats;
+			hinfo->maxbps = mout->analog_maxbps;
+		}
+		if (!mout->spdif_rates) {
+			snd_hda_query_supported_pcm(codec, mout->dig_out_nid,
+						    &mout->spdif_rates,
+						    &mout->spdif_formats,
+						    &mout->spdif_maxbps);
+		}
+		mutex_lock(&codec->spdif_mutex);
+		if (mout->share_spdif) {
+			runtime->hw.rates &= mout->spdif_rates;
+			runtime->hw.formats &= mout->spdif_formats;
+			if (mout->spdif_maxbps < hinfo->maxbps)
+				hinfo->maxbps = mout->spdif_maxbps;
+		}
+	}
+	mutex_unlock(&codec->spdif_mutex);
 	return snd_pcm_hw_constraint_step(substream->runtime, 0,
 					  SNDRV_PCM_HW_PARAM_CHANNELS, 2);
 }
@@ -2573,7 +2637,8 @@ int snd_hda_multi_out_analog_prepare(str
 	int i;
 
 	mutex_lock(&codec->spdif_mutex);
-	if (mout->dig_out_nid && mout->dig_out_used != HDA_DIG_EXCLUSIVE) {
+	if (mout->dig_out_nid && mout->share_spdif &&
+	    mout->dig_out_used != HDA_DIG_EXCLUSIVE) {
 		if (chs == 2 &&
 		    snd_hda_is_supported_format(codec, mout->dig_out_nid,
 						format) &&
pci/hda/hda_local.h +12 -1
diff -r 7c1928ffe1f3 pci/hda/hda_local.h
@@ -228,8 +228,18 @@ struct hda_multi_out {
 	int max_channels;	/* currently supported analog channels */
 	int dig_out_used;	/* current usage of digital out (HDA_DIG_XXX) */
 	int no_share_stream;	/* don't share a stream with multiple pins */
+	int share_spdif;	/* share SPDIF pin */
+	/* PCM information for both analog and SPDIF DACs */
+	unsigned int analog_rates;
+	unsigned int analog_maxbps;
+	u64 analog_formats;
+	unsigned int spdif_rates;
+	unsigned int spdif_maxbps;
+	u64 spdif_formats;
 };
 
+int snd_hda_create_spdif_share_sw(struct hda_codec *codec,
+				  struct hda_multi_out *mout);
 int snd_hda_multi_out_dig_open(struct hda_codec *codec,
 			       struct hda_multi_out *mout);
 int snd_hda_multi_out_dig_close(struct hda_codec *codec,
@@ -241,7 +251,8 @@ int snd_hda_multi_out_dig_prepare(struct
 				  struct snd_pcm_substream *substream);
 int snd_hda_multi_out_analog_open(struct hda_codec *codec,
 				  struct hda_multi_out *mout,
-				  struct snd_pcm_substream *substream);
+				  struct snd_pcm_substream *substream,
+				  struct hda_pcm_stream *hinfo);
 int snd_hda_multi_out_analog_prepare(struct hda_codec *codec,
 				     struct hda_multi_out *mout,
 				     unsigned int stream_tag,
pci/hda/patch_analog.c +7 -1
diff -r 7c1928ffe1f3 pci/hda/patch_analog.c
@@ -171,6 +171,11 @@ static int ad198x_build_controls(struct 
 		err = snd_hda_create_spdif_out_ctls(codec, spec->multiout.dig_out_nid);
 		if (err < 0)
 			return err;
+		err = snd_hda_create_spdif_share_sw(codec,
+						    &spec->multiout);
+		if (err < 0)
+			return err;
+		spec->multiout.share_spdif = 1;
 	} 
 	if (spec->dig_in_nid) {
 		err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
@@ -217,7 +222,8 @@ static int ad198x_playback_pcm_open(stru
 				    struct snd_pcm_substream *substream)
 {
 	struct ad198x_spec *spec = codec->spec;
-	return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream);
+	return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream,
+					     hinfo);
 }
 
 static int ad198x_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
pci/hda/patch_cmedia.c +7 -1
diff -r 7c1928ffe1f3 pci/hda/patch_cmedia.c
@@ -329,6 +329,11 @@ static int cmi9880_build_controls(struct
 		err = snd_hda_create_spdif_out_ctls(codec, spec->multiout.dig_out_nid);
 		if (err < 0)
 			return err;
+		err = snd_hda_create_spdif_share_sw(codec,
+						    &spec->multiout);
+		if (err < 0)
+			return err;
+		spec->multiout.share_spdif = 1;
 	}
 	if (spec->dig_in_nid) {
 		err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
@@ -432,7 +437,8 @@ static int cmi9880_playback_pcm_open(str
 				     struct snd_pcm_substream *substream)
 {
 	struct cmi_spec *spec = codec->spec;
-	return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream);
+	return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream,
+					     hinfo);
 }
 
 static int cmi9880_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
pci/hda/patch_conexant.c +7 -1
diff -r 7c1928ffe1f3 pci/hda/patch_conexant.c
@@ -98,7 +98,8 @@ static int conexant_playback_pcm_open(st
 				      struct snd_pcm_substream *substream)
 {
 	struct conexant_spec *spec = codec->spec;
-	return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream);
+	return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream,
+					     hinfo);
 }
 
 static int conexant_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
@@ -372,6 +373,11 @@ static int conexant_build_controls(struc
 						    spec->multiout.dig_out_nid);
 		if (err < 0)
 			return err;
+		err = snd_hda_create_spdif_share_sw(codec,
+						    &spec->multiout);
+		if (err < 0)
+			return err;
+		spec->multiout.share_spdif = 1;
 	} 
 	if (spec->dig_in_nid) {
 		err = snd_hda_create_spdif_in_ctls(codec,spec->dig_in_nid);
pci/hda/patch_realtek.c +7 -1
diff -r 7c1928ffe1f3 pci/hda/patch_realtek.c
@@ -1517,6 +1517,11 @@ static int alc_build_controls(struct hda
 						    spec->multiout.dig_out_nid);
 		if (err < 0)
 			return err;
+		err = snd_hda_create_spdif_share_sw(codec,
+						    &spec->multiout);
+		if (err < 0)
+			return err;
+		spec->multiout.share_spdif = 1;
 	}
 	if (spec->dig_in_nid) {
 		err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
@@ -2319,7 +2324,8 @@ static int alc880_playback_pcm_open(stru
 				    struct snd_pcm_substream *substream)
 {
 	struct alc_spec *spec = codec->spec;
-	return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream);
+	return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream,
+					     hinfo);
 }
 
 static int alc880_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
pci/hda/patch_sigmatel.c +7 -1
diff -r 7c1928ffe1f3 pci/hda/patch_sigmatel.c
@@ -916,6 +916,11 @@ static int stac92xx_build_controls(struc
 		err = snd_hda_create_spdif_out_ctls(codec, spec->multiout.dig_out_nid);
 		if (err < 0)
 			return err;
+		err = snd_hda_create_spdif_share_sw(codec,
+						    &spec->multiout);
+		if (err < 0)
+			return err;
+		spec->multiout.share_spdif = 1;
 	}
 	if (spec->dig_in_nid) {
 		err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
@@ -1748,7 +1753,8 @@ static int stac92xx_playback_pcm_open(st
 				      struct snd_pcm_substream *substream)
 {
 	struct sigmatel_spec *spec = codec->spec;
-	return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream);
+	return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream,
+					     hinfo);
 }
 
 static int stac92xx_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
pci/hda/patch_via.c +7 -1
diff -r 7c1928ffe1f3 pci/hda/patch_via.c
@@ -357,7 +357,8 @@ static int via_playback_pcm_open(struct 
 				 struct snd_pcm_substream *substream)
 {
 	struct via_spec *spec = codec->spec;
-	return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream);
+	return snd_hda_multi_out_analog_open(codec, &spec->multiout, substream,
+					     hinfo);
 }
 
 static int via_playback_pcm_prepare(struct hda_pcm_stream *hinfo,
@@ -493,6 +494,11 @@ static int via_build_controls(struct hda
 						    spec->multiout.dig_out_nid);
 		if (err < 0)
 			return err;
+		err = snd_hda_create_spdif_share_sw(codec,
+						    &spec->multiout);
+		if (err < 0)
+			return err;
+		spec->multiout.share_spdif = 1;
 	}
 	if (spec->dig_in_nid) {
 		err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
#38 lore raw

Hi,

Am Freitag, 8. Februar 2008 schrieb Takashi Iwai:

Quoted 12 lines

At Thu, 7 Feb 2008 23:04:00 +0100,

Quoted 10 lines · Martin Egge

Am Donnerstag, 7. Februar 2008 schrieb Takashi Iwai:

Quoted 4 lines

If my guess is correct, you can propbably get SPDIF output via "spdif" output. What happens with the below?

% aplay -Dplug:spdif foo.wav

You are right. Choosing plug:spdif plays the sound cia the SDIF-Out. Of course this does not play the sound via the internal speakers when no SPDIF is connected.

Quoted 8 lines
Quoted 3 lines

But I'd prefer the old behavior from 1.0.15 where the default device was playing sound via SPDIF when connected and via internal speakers when SDIF is not connected.

Try the patch below. This adds the mixer switch "Analog To SPDIF". If this is on, the supported format is more limited so that the default PCM can route to SPDIF. If this switch is off, dmix will choose 32bit automatically.

The patch works perfectly for me. I like this new switch. Perhaps you should rename it to "Analog to IEC958 Output". I've seen this name on some other cards with ALSA.

Regards,
Martin

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#39 lore raw

At Mon, 11 Feb 2008 19:22:19 +0100,

Quoted 20 lines · Martin Egge

Hi,

Am Freitag, 8. Februar 2008 schrieb Takashi Iwai:

Quoted 16 lines

At Thu, 7 Feb 2008 23:04:00 +0100,

Quoted 13 lines · Martin Egge

Am Donnerstag, 7. Februar 2008 schrieb Takashi Iwai:

Quoted 4 lines

If my guess is correct, you can propbably get SPDIF output via "spdif" output. What happens with the below?

% aplay -Dplug:spdif foo.wav

You are right. Choosing plug:spdif plays the sound cia the SDIF-Out. Of course this does not play the sound via the internal speakers when no SPDIF is connected.

But I'd prefer the old behavior from 1.0.15 where the default device was playing sound via SPDIF when connected and via internal speakers when SDIF is not connected.

Quoted 8 lines
Quoted 4 lines

Try the patch below. This adds the mixer switch "Analog To SPDIF". If this is on, the supported format is more limited so that the default PCM can route to SPDIF. If this switch is off, dmix will choose 32bit automatically.

The patch works perfectly for me. I like this new switch. Perhaps you should rename it to "Analog to IEC958 Output". I've seen this name on some other cards with ALSA.

This name is a bit difficult to define. Usually "Analog To IEC958 Output" is the mixer switch for the loopback from the analog inputs like mic-in or line-in. In your case, it's a switch that allows the signal duplication to SPDIF for the default PCM output. So actually my naming is also pretty confusing.

How about "IEC958 Default PCM Playback Switch"? Then it's a bit clearer. On the mixer, it apperas in the playback view as "IEC958 Default PCM". If you turn it on, SPDIF plays with the default PCM.

Takashi