Skip to contentSkip to conversation

Headphone Mic and PA

DISCUSSION Takashi Iwai 3 participants 6 messages Oct 19, 2015 – Oct 21, 2015

lore
Share & tools
lore
#0 lore raw

Hi David,

I'm currently checking the bug report regarding PA, and this looks like an issue with "Headphone Mic" jack control.

The reported problem is that PA doesn't react properly when both HP and dock line-out jacks are plugged and line-out is unplugged. The machine in question is Dell E7250, and I see that it has only "Headphone Mic Jack" kctl without "Headphone Jack" kctl. Is this the intentional behavior?

I see the code in hda_jack.c:

int snd_hda_jack_add_kctls(struct hda_codec *codec,
const struct auto_pin_cfg *cfg)

{
	const hda_nid_t *p;
	int i, err;

	for (i = 0; i < cfg->num_inputs; i++) {
		/* If we have headphone mics; make sure they get the right name
		   before grabbed by output pins */
		if (cfg->inputs[i].is_headphone_mic) {
			if (auto_cfg_hp_outs(cfg) == 1)
				err = add_jack_kctl(codec, auto_cfg_hp_pins(cfg)[0],
						    cfg, "Headphone Mic");
			else
				err = add_jack_kctl(codec, cfg->inputs[i].pin,
						    cfg, "Headphone Mic");
		} else
			err = add_jack_kctl(codec, cfg->inputs[i].pin, cfg,
					    NULL);

So, the driver seems doing what it was written. Meanwhile, the headphone mic comes from the quirk:

	[ALC293_FIXUP_DELL1_MIC_NO_PRESENCE] = {
		.type = HDA_FIXUP_PINS,
		.v.pins = (const struct hda_pintbl[]) {
			{ 0x18, 0x01a1913d }, /* use as headphone mic, without its own jack detect */
			{ 0x1a, 0x01a1913c }, /* use as headset mic, without its own jack detect */
			{ }
		},
		.chained = true,
		.chain_id = ALC269_FIXUP_HEADSET_MODE
	},

and this appears as if it were supposed to be a phantom jack.

The alsa-info output is found in the bugzilla

	https://bugzilla.suse.com/show_bug.cgi?id=948979

thanks,

Takashi

#1 lore raw
Quoted 10 lines · Takashi Iwai

Hi David,

I'm currently checking the bug report regarding PA, and this looks like an issue with "Headphone Mic" jack control.

The reported problem is that PA doesn't react properly when both HP and dock line-out jacks are plugged and line-out is unplugged. The machine in question is Dell E7250, and I see that it has only "Headphone Mic Jack" kctl without "Headphone Jack" kctl. Is this the intentional behavior?

Yes. The "Headphone Mic Jack" indicates that the jack can be used to indicate either "Headphone" or "Mic". The additional "Headset Mic Phantom Jack" indicates that headset is a third usage for the jack and there is no hardware that can detect which one of them it is. So it looks correct to me.

Also the Dell E7250 is Ubuntu certified, but I don't think docking stations are part of that certification suite (at least not for Dell E7250).

I skimmed through the opensuse bug as well. Two notes:

1) Here's a guide of how to generate a PA log, avoiding the autospawn
problem: https://wiki.ubuntu.com/PulseAudio/Log

2) There is a patch series in the pipeline [2] that Tanu has promised
to review, that makes module-switch-on-port-available more aggressive w r t being able to reroute away from unavailable things. I suspect it would help here, but I'm not completely sure.

Signature · 4 lines
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic

[2] http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/23504
#2 lore raw
Quoted 9 lines · David Henningsson
Quoted 5 lines · Takashi Iwai

Hi David,

I'm currently checking the bug report regarding PA, and this looks like an issue with "Headphone Mic" jack control.

Quoted 8 lines
Quoted 5 lines

The reported problem is that PA doesn't react properly when both HP and dock line-out jacks are plugged and line-out is unplugged. The machine in question is Dell E7250, and I see that it has only "Headphone Mic Jack" kctl without "Headphone Jack" kctl. Is this the intentional behavior?

Yes. The "Headphone Mic Jack" indicates that the jack can be used to indicate either "Headphone" or "Mic".

Hm, OK, that was the trick. But now I wonder whether this was a right choice. Maybe a more straightforward way (from user-space POV) would have been to create two jack ctls (Headphone and Headphone Mic) and notify both of them.

Quoted 5 lines

The additional "Headset Mic
Phantom Jack" indicates that headset is a third usage for the jack and there is no hardware that can detect which one of them it is. So it looks correct to me.

Quoted 7 lines

Also the Dell E7250 is Ubuntu certified, but I don't think docking stations are part of that certification suite (at least not for Dell E7250).

I skimmed through the opensuse bug as well. Two notes:

1) Here's a guide of how to generate a PA log, avoiding the autospawn
problem: https://wiki.ubuntu.com/PulseAudio/Log

Yeah, but I didn't want to let user touching the config, as people often forget to revert :) But maybe it's better to mention it, judging from the people's reaction.

Quoted 4 lines

2) There is a patch series in the pipeline [2] that Tanu has promised
to review, that makes module-switch-on-port-available more aggressive w r t being able to reroute away from unavailable things. I suspect it would help here, but I'm not completely sure.

The last unplug event in the log shows

D: [pulseaudio] module-alsa-card.c: Jack 'Dock Line Out Jack' is now unplugged
D: [pulseaudio] device-port.c: Setting port analog-output-lineout to status no
D: [pulseaudio] device-port.c: Setting port analog-output-speaker to status unknown

and no activation happened to analog-output-speaker. So, yes, your patchset might cure this. But I wonder why this happens only with the dock line-out and not with normal headphones...

Takashi

#3 lore raw
Quoted 17 lines · Takashi Iwai
Quoted 15 lines · David Henningsson
Quoted 10 lines · Takashi Iwai

Hi David,

I'm currently checking the bug report regarding PA, and this looks like an issue with "Headphone Mic" jack control.

The reported problem is that PA doesn't react properly when both HP and dock line-out jacks are plugged and line-out is unplugged. The machine in question is Dell E7250, and I see that it has only "Headphone Mic Jack" kctl without "Headphone Jack" kctl. Is this the intentional behavior?

Quoted 7 lines
Quoted 2 lines

Yes. The "Headphone Mic Jack" indicates that the jack can be used to indicate either "Headphone" or "Mic".

Hm, OK, that was the trick. But now I wonder whether this was a right choice. Maybe a more straightforward way (from user-space POV) would have been to create two jack ctls (Headphone and Headphone Mic) and notify both of them.

Not so sure about that. Then you might get two events, and userspace needs to synchronise them, and then understand that it's about the same jack.

I think the current solution is better.

Quoted 24 lines
Quoted 5 lines

The additional "Headset Mic
Phantom Jack" indicates that headset is a third usage for the jack and there is no hardware that can detect which one of them it is. So it looks correct to me.

Quoted 7 lines

Also the Dell E7250 is Ubuntu certified, but I don't think docking stations are part of that certification suite (at least not for Dell E7250).

I skimmed through the opensuse bug as well. Two notes:

1) Here's a guide of how to generate a PA log, avoiding the autospawn
problem: https://wiki.ubuntu.com/PulseAudio/Log

Yeah, but I didn't want to let user touching the config, as people often forget to revert :) But maybe it's better to mention it, judging from the people's reaction.

Quoted 4 lines

2) There is a patch series in the pipeline [2] that Tanu has promised
to review, that makes module-switch-on-port-available more aggressive w r t being able to reroute away from unavailable things. I suspect it would help here, but I'm not completely sure.

The last unplug event in the log shows

Quoted 7 lines

D: [pulseaudio] module-alsa-card.c: Jack 'Dock Line Out Jack' is now unplugged
D: [pulseaudio] device-port.c: Setting port analog-output-lineout to status no
D: [pulseaudio] device-port.c: Setting port analog-output-speaker to status unknown

and no activation happened to analog-output-speaker. So, yes, your patchset might cure this. But I wonder why this happens only with the dock line-out and not with normal headphones...

Could be just unlucky ordering perhaps? Does the just pushed patch help?

http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=91313e60a81e96ce976f24c522656c57b4ab94ca

Signature · 2 lines
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
#4 lore raw
Quoted 14 lines · David Henningsson
Quoted 14 lines
Quoted 7 lines

2) There is a patch series in the pipeline [2] that Tanu has promised
to review, that makes module-switch-on-port-available more aggressive w r t being able to reroute away from unavailable things. I suspect it would help here, but I'm not completely sure.

The last unplug event in the log shows

D: [pulseaudio] module-alsa-card.c: Jack 'Dock Line Out Jack' is now unplugged
D: [pulseaudio] device-port.c: Setting port analog-output-lineout to status no
D: [pulseaudio] device-port.c: Setting port analog-output-speaker to status unknown

Quoted 7 lines
Quoted 3 lines

and no activation happened to analog-output-speaker. So, yes, your patchset might cure this. But I wonder why this happens only with the dock line-out and not with normal headphones...

Could be just unlucky ordering perhaps? Does the just pushed patch help?

http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=91313e60a81e96ce976f24c522656c57b4ab94ca

That seems fixing the issue indeed!

Takashi

#5 lore raw
In reply to David Henningsson

2015-10-19 下午7:20於 "David Henningsson" <[email protected]>寫道:

Quoted 10 lines · Takashi Iwai
Quoted 6 lines

Hi David,

I'm currently checking the bug report regarding PA, and this looks like an issue with "Headphone Mic" jack control.

Quoted 8 lines
Quoted 5 lines

The reported problem is that PA doesn't react properly when both HP and dock line-out jacks are plugged and line-out is unplugged. The machine in question is Dell E7250, and I see that it has only "Headphone Mic Jack" kctl without "Headphone Jack" kctl. Is this the intentional behavior?

Yes. The "Headphone Mic Jack" indicates that the jack can be used to

indicate either "Headphone" or "Mic". The additional "Headset Mic Phantom Jack" indicates that headset is a third usage for the jack and there is no hardware that can detect which one of them it is. So it looks correct to me.

Quoted 2 lines

Also the Dell E7250 is Ubuntu certified, but I don't think docking

stations are part of that certification suite (at least not for Dell E7250).

Quoted 4 lines

I skimmed through the opensuse bug as well. Two notes:

1) Here's a guide of how to generate a PA log, avoiding the autospawn

problem: https://wiki.ubuntu.com/PulseAudio/Log

Quoted 2 lines

2) There is a patch series in the pipeline [2] that Tanu has promised to

review, that makes module-switch-on-port-available more aggressive w r t being able to reroute away from unavailable things. I suspect it would help here, but I'm not completely sure.

control.13 {
iface MIXER
name 'Capture Source'
value 'Internal Mic'
comment {
access 'read write'
type ENUMERATED
count 1
item.0 'Headphone Mic'
item.1 'Dock Mic'
item.2 'Headset Mic'
item.3 'Internal Mic'
}
}

Do alc_headset mode still work when there is dock mic ?

https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/hda?id=73bdd597823e2231dc882577dbbaf8df92fe1775

hda_nid_t mux_pin = spec->gen.imux_pins[spec->gen.cur_mux[0]]; hda_nid_t hp_pin = spec->gen.autocfg.hp_pins[0];

int new_headset_mode;

if (!snd_hda_jack_detect(codec, hp_pin))
new_headset_mode = ALC_HEADSET_MODE_UNPLUGGED;
else if (mux_pin == spec->headset_mic_pin)
new_headset_mode = ALC_HEADSET_MODE_HEADSET;
else if (mux_pin == spec->headphone_mic_pin)
new_headset_mode = ALC_HEADSET_MODE_MIC;
else
new_headset_mode = ALC_HEADSET_MODE_HEADPHONE;

https://bugzilla.kernel.org/show_bug.cgi?id=104901

The other examples are Dell Alienware 18 which have mic jack, headphone jack and headset jack :
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel