ALSA: hda - Fix Dock Headphone on Thinkpad X250 seen as a Line Out
diff mbox

Message ID 1435135593-6176-1-git-send-email-david.henningsson@canonical.com
State New
Headers show

Commit Message

David Henningsson June 24, 2015, 8:46 a.m. UTC
Thinkpad X250, when attached to a dock, has two headphone outs but
no line out. Make sure we don't try to turn this into one headphone
and one line out (since that disables the headphone amp on the dock).

Alsa-info at http://www.alsa-project.org/db/?f=36f8764e1d782397928feec715d0ef90dfddd4c1

Cc: stable@vger.kernel.org
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
---
 sound/pci/hda/patch_realtek.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Takashi Iwai June 24, 2015, 9 a.m. UTC | #1
At Wed, 24 Jun 2015 10:46:33 +0200,
David Henningsson wrote:
> 
> Thinkpad X250, when attached to a dock, has two headphone outs but
> no line out. Make sure we don't try to turn this into one headphone
> and one line out (since that disables the headphone amp on the dock).
> 
> Alsa-info at http://www.alsa-project.org/db/?f=36f8764e1d782397928feec715d0ef90dfddd4c1
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: David Henningsson <david.henningsson@canonical.com>

This is one of fixes I had in mind (and asked for testing in bugzilla
kernel.org report).  One drawback by this is that the auto-mute
*between* the headphones won't work like before.  If one has expected
it, then this can be seen as a regression.

Another fix was to change this as a proper line-out.  This will keep
the current auto-mute behavior.

OTOH, dealing both jacks equally is also not bad, per se.


Takashi

> ---
>  sound/pci/hda/patch_realtek.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
> index 431a20b..8e02cdf 100644
> --- a/sound/pci/hda/patch_realtek.c
> +++ b/sound/pci/hda/patch_realtek.c
> @@ -4511,6 +4511,7 @@ enum {
>  	ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
>  	ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
>  	ALC292_FIXUP_TPT440_DOCK,
> +	ALC292_FIXUP_TPT440_DOCK2,
>  	ALC283_FIXUP_BXBT2807_MIC,
>  	ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED,
>  	ALC282_FIXUP_ASPIRE_V5_PINS,
> @@ -4960,6 +4961,12 @@ static const struct hda_fixup alc269_fixups[] = {
>  		.chain_id = ALC269_FIXUP_HEADSET_MODE
>  	},
>  	[ALC292_FIXUP_TPT440_DOCK] = {
> +		.type = HDA_FIXUP_FUNC,
> +		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
> +		.chained = true,
> +		.chain_id = ALC292_FIXUP_TPT440_DOCK2
> +	},
> +	[ALC292_FIXUP_TPT440_DOCK2] = {
>  		.type = HDA_FIXUP_PINS,
>  		.v.pins = (const struct hda_pintbl[]) {
>  			{ 0x16, 0x21211010 }, /* dock headphone */
> -- 
> 1.9.1
>
David Henningsson June 24, 2015, 11:06 a.m. UTC | #2
On 2015-06-24 11:00, Takashi Iwai wrote:
> At Wed, 24 Jun 2015 10:46:33 +0200,
> David Henningsson wrote:
>>
>> Thinkpad X250, when attached to a dock, has two headphone outs but
>> no line out. Make sure we don't try to turn this into one headphone
>> and one line out (since that disables the headphone amp on the dock).
>>
>> Alsa-info at http://www.alsa-project.org/db/?f=36f8764e1d782397928feec715d0ef90dfddd4c1
>>
>> Cc: stable@vger.kernel.org
>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
>
> This is one of fixes I had in mind (and asked for testing in bugzilla
> kernel.org report).

Sorry, I'm missing context. What report?

> One drawback by this is that the auto-mute
> *between* the headphones won't work like before.  If one has expected
> it, then this can be seen as a regression.

Fair enough, we can drop stable from the patch since this could be seen 
as behavioural change rather than bug fix.

> Another fix was to change this as a proper line-out.  This will keep
> the current auto-mute behavior.
>
> OTOH, dealing both jacks equally is also not bad, per se.

The tricky thing about routing is that everyone wants it different, so 
pleasing everyone seems to be an impossible equation :-/

I would choose the default behaviour (headphone or line out) based on 
the icon on the jack. I should double-check that with someone who has 
the hardware. And then, if someone wants another behaviour then 
hdajackretask can be used. Or we can add a jack mode kcontrol for that 
jack, if you prefer, although I'd have to check how PulseAudio handles 
that (not that well, is my gut feeling).
Raymond Yau June 24, 2015, 11:23 a.m. UTC | #3
>>>
>>> Thinkpad X250, when attached to a dock, has two headphone outs but
>>> no line out. Make sure we don't try to turn this into one headphone
>>> and one line out (since that disables the headphone amp on the dock).
>>>
>>> Alsa-info at
http://www.alsa-project.org/db/?f=36f8764e1d782397928feec715d0ef90dfddd4c1
>>>
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
>>
>>
>> This is one of fixes I had in mind (and asked for testing in bugzilla
>> kernel.org report).
>
>
> Sorry, I'm missing context. What report?

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

T440 support headset and thinkpad pro dock combo jack has headset icon

If headset mic has higher priority than dock headset mic, it is strange
that headset don't auto mute dock headset
David Henningsson June 24, 2015, 11:40 a.m. UTC | #4
On 2015-06-24 13:23, Raymond Yau wrote:
>
>  >>>
>  >>> Thinkpad X250, when attached to a dock, has two headphone outs but
>  >>> no line out. Make sure we don't try to turn this into one headphone
>  >>> and one line out (since that disables the headphone amp on the dock).
>  >>>
>  >>> Alsa-info at
> http://www.alsa-project.org/db/?f=36f8764e1d782397928feec715d0ef90dfddd4c1
>  >>>
>  >>> Cc: stable@vger.kernel.org <mailto:stable@vger.kernel.org>
>  >>> Signed-off-by: David Henningsson <david.henningsson@canonical.com
> <mailto:david.henningsson@canonical.com>>
>  >>
>  >>
>  >> This is one of fixes I had in mind (and asked for testing in bugzilla
>  >> kernel.org <http://kernel.org> report).
>  >
>  >
>  > Sorry, I'm missing context. What report?
>
> https://bugzilla.kernel.org/show_bug.cgi?id=99721

Thanks.

> T440 support headset and thinkpad pro dock combo jack has headset icon
>
> If headset mic has higher priority than dock headset mic, it is strange
> that headset don't auto mute dock headset

So headphones should automute between each other if and only if both of 
them are combined headset jacks? Or what do you suggest?
Takashi Iwai June 24, 2015, 12:10 p.m. UTC | #5
At Wed, 24 Jun 2015 13:06:05 +0200,
David Henningsson wrote:
> 
> 
> 
> On 2015-06-24 11:00, Takashi Iwai wrote:
> > At Wed, 24 Jun 2015 10:46:33 +0200,
> > David Henningsson wrote:
> >>
> >> Thinkpad X250, when attached to a dock, has two headphone outs but
> >> no line out. Make sure we don't try to turn this into one headphone
> >> and one line out (since that disables the headphone amp on the dock).
> >>
> >> Alsa-info at http://www.alsa-project.org/db/?f=36f8764e1d782397928feec715d0ef90dfddd4c1
> >>
> >> Cc: stable@vger.kernel.org
> >> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
> >
> > This is one of fixes I had in mind (and asked for testing in bugzilla
> > kernel.org report).
> 
> Sorry, I'm missing context. What report?
> 
> > One drawback by this is that the auto-mute
> > *between* the headphones won't work like before.  If one has expected
> > it, then this can be seen as a regression.
> 
> Fair enough, we can drop stable from the patch since this could be seen 
> as behavioural change rather than bug fix.
> 
> > Another fix was to change this as a proper line-out.  This will keep
> > the current auto-mute behavior.
> >
> > OTOH, dealing both jacks equally is also not bad, per se.
> 
> The tricky thing about routing is that everyone wants it different, so 
> pleasing everyone seems to be an impossible equation :-/
> 
> I would choose the default behaviour (headphone or line out) based on 
> the icon on the jack. I should double-check that with someone who has 
> the hardware. And then, if someone wants another behaviour then 
> hdajackretask can be used. Or we can add a jack mode kcontrol for that 
> jack, if you prefer, although I'd have to check how PulseAudio handles 
> that (not that well, is my gut feeling).

I have no preference in this regard.  My only slight concern was the
behavior change by this patch.  It has both sides, one can see as an
improvement while another as a regression.

Currently I'm inclined to take this patch as is, since this would make
things working in a little obstacle.  Once when we get a real
regression report due to the lack of exclusive mute control, we may
provide another model option as a compromise.

But, I'm open about this, really.  So, if anyone has a good argument,
let me know.


thanks,

Takashi
David Henningsson June 24, 2015, 12:33 p.m. UTC | #6
On 2015-06-24 14:10, Takashi Iwai wrote:
> At Wed, 24 Jun 2015 13:06:05 +0200,
> David Henningsson wrote:
>>
>>
>>
>> On 2015-06-24 11:00, Takashi Iwai wrote:
>>> At Wed, 24 Jun 2015 10:46:33 +0200,
>>> David Henningsson wrote:
>>>>
>>>> Thinkpad X250, when attached to a dock, has two headphone outs but
>>>> no line out. Make sure we don't try to turn this into one headphone
>>>> and one line out (since that disables the headphone amp on the dock).
>>>>
>>>> Alsa-info at http://www.alsa-project.org/db/?f=36f8764e1d782397928feec715d0ef90dfddd4c1
>>>>
>>>> Cc: stable@vger.kernel.org
>>>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
>>>
>>> This is one of fixes I had in mind (and asked for testing in bugzilla
>>> kernel.org report).
>>
>> Sorry, I'm missing context. What report?
>>
>>> One drawback by this is that the auto-mute
>>> *between* the headphones won't work like before.  If one has expected
>>> it, then this can be seen as a regression.
>>
>> Fair enough, we can drop stable from the patch since this could be seen
>> as behavioural change rather than bug fix.
>>
>>> Another fix was to change this as a proper line-out.  This will keep
>>> the current auto-mute behavior.
>>>
>>> OTOH, dealing both jacks equally is also not bad, per se.
>>
>> The tricky thing about routing is that everyone wants it different, so
>> pleasing everyone seems to be an impossible equation :-/
>>
>> I would choose the default behaviour (headphone or line out) based on
>> the icon on the jack. I should double-check that with someone who has
>> the hardware. And then, if someone wants another behaviour then
>> hdajackretask can be used. Or we can add a jack mode kcontrol for that
>> jack, if you prefer, although I'd have to check how PulseAudio handles
>> that (not that well, is my gut feeling).
>
> I have no preference in this regard.  My only slight concern was the
> behavior change by this patch.  It has both sides, one can see as an
> improvement while another as a regression.
>
> Currently I'm inclined to take this patch as is, since this would make
> things working in a little obstacle.  Once when we get a real
> regression report due to the lack of exclusive mute control, we may
> provide another model option as a compromise.
>
> But, I'm open about this, really.  So, if anyone has a good argument,
> let me know.

Anyhow, it looks like the current behaviour is not good, because we have 
a "Dock Headphone Jack" on the same node as "Dock Line Out Playback 
Switch". This makes me wonder if the HP -> LO fixup should be removed 
altogether. Are there any machines these days that needs this fixup? In 
case there were just a few of them in the past, maybe they should have 
pin fixups instead?
Takashi Iwai June 24, 2015, 1:23 p.m. UTC | #7
At Wed, 24 Jun 2015 14:33:52 +0200,
David Henningsson wrote:
> 
> 
> 
> On 2015-06-24 14:10, Takashi Iwai wrote:
> > At Wed, 24 Jun 2015 13:06:05 +0200,
> > David Henningsson wrote:
> >>
> >>
> >>
> >> On 2015-06-24 11:00, Takashi Iwai wrote:
> >>> At Wed, 24 Jun 2015 10:46:33 +0200,
> >>> David Henningsson wrote:
> >>>>
> >>>> Thinkpad X250, when attached to a dock, has two headphone outs but
> >>>> no line out. Make sure we don't try to turn this into one headphone
> >>>> and one line out (since that disables the headphone amp on the dock).
> >>>>
> >>>> Alsa-info at http://www.alsa-project.org/db/?f=36f8764e1d782397928feec715d0ef90dfddd4c1
> >>>>
> >>>> Cc: stable@vger.kernel.org
> >>>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
> >>>
> >>> This is one of fixes I had in mind (and asked for testing in bugzilla
> >>> kernel.org report).
> >>
> >> Sorry, I'm missing context. What report?
> >>
> >>> One drawback by this is that the auto-mute
> >>> *between* the headphones won't work like before.  If one has expected
> >>> it, then this can be seen as a regression.
> >>
> >> Fair enough, we can drop stable from the patch since this could be seen
> >> as behavioural change rather than bug fix.
> >>
> >>> Another fix was to change this as a proper line-out.  This will keep
> >>> the current auto-mute behavior.
> >>>
> >>> OTOH, dealing both jacks equally is also not bad, per se.
> >>
> >> The tricky thing about routing is that everyone wants it different, so
> >> pleasing everyone seems to be an impossible equation :-/
> >>
> >> I would choose the default behaviour (headphone or line out) based on
> >> the icon on the jack. I should double-check that with someone who has
> >> the hardware. And then, if someone wants another behaviour then
> >> hdajackretask can be used. Or we can add a jack mode kcontrol for that
> >> jack, if you prefer, although I'd have to check how PulseAudio handles
> >> that (not that well, is my gut feeling).
> >
> > I have no preference in this regard.  My only slight concern was the
> > behavior change by this patch.  It has both sides, one can see as an
> > improvement while another as a regression.
> >
> > Currently I'm inclined to take this patch as is, since this would make
> > things working in a little obstacle.  Once when we get a real
> > regression report due to the lack of exclusive mute control, we may
> > provide another model option as a compromise.
> >
> > But, I'm open about this, really.  So, if anyone has a good argument,
> > let me know.
> 
> Anyhow, it looks like the current behaviour is not good, because we have 
> a "Dock Headphone Jack" on the same node as "Dock Line Out Playback 
> Switch". This makes me wonder if the HP -> LO fixup should be removed 
> altogether. Are there any machines these days that needs this fixup? In 
> case there were just a few of them in the past, maybe they should have 
> pin fixups instead?

Yes, this is one good step forward.  We should check through hda-emu.

Though, for the problem of Thinkpads, I prefer a patch with a smaller
impact like yours.


Takashi
Takashi Iwai June 25, 2015, 7 a.m. UTC | #8
At Wed, 24 Jun 2015 15:23:24 +0200,
Takashi Iwai wrote:
> 
> At Wed, 24 Jun 2015 14:33:52 +0200,
> David Henningsson wrote:
> > 
> > 
> > 
> > On 2015-06-24 14:10, Takashi Iwai wrote:
> > > At Wed, 24 Jun 2015 13:06:05 +0200,
> > > David Henningsson wrote:
> > >>
> > >>
> > >>
> > >> On 2015-06-24 11:00, Takashi Iwai wrote:
> > >>> At Wed, 24 Jun 2015 10:46:33 +0200,
> > >>> David Henningsson wrote:
> > >>>>
> > >>>> Thinkpad X250, when attached to a dock, has two headphone outs but
> > >>>> no line out. Make sure we don't try to turn this into one headphone
> > >>>> and one line out (since that disables the headphone amp on the dock).
> > >>>>
> > >>>> Alsa-info at http://www.alsa-project.org/db/?f=36f8764e1d782397928feec715d0ef90dfddd4c1
> > >>>>
> > >>>> Cc: stable@vger.kernel.org
> > >>>> Signed-off-by: David Henningsson <david.henningsson@canonical.com>
> > >>>
> > >>> This is one of fixes I had in mind (and asked for testing in bugzilla
> > >>> kernel.org report).
> > >>
> > >> Sorry, I'm missing context. What report?
> > >>
> > >>> One drawback by this is that the auto-mute
> > >>> *between* the headphones won't work like before.  If one has expected
> > >>> it, then this can be seen as a regression.
> > >>
> > >> Fair enough, we can drop stable from the patch since this could be seen
> > >> as behavioural change rather than bug fix.
> > >>
> > >>> Another fix was to change this as a proper line-out.  This will keep
> > >>> the current auto-mute behavior.
> > >>>
> > >>> OTOH, dealing both jacks equally is also not bad, per se.
> > >>
> > >> The tricky thing about routing is that everyone wants it different, so
> > >> pleasing everyone seems to be an impossible equation :-/
> > >>
> > >> I would choose the default behaviour (headphone or line out) based on
> > >> the icon on the jack. I should double-check that with someone who has
> > >> the hardware. And then, if someone wants another behaviour then
> > >> hdajackretask can be used. Or we can add a jack mode kcontrol for that
> > >> jack, if you prefer, although I'd have to check how PulseAudio handles
> > >> that (not that well, is my gut feeling).
> > >
> > > I have no preference in this regard.  My only slight concern was the
> > > behavior change by this patch.  It has both sides, one can see as an
> > > improvement while another as a regression.
> > >
> > > Currently I'm inclined to take this patch as is, since this would make
> > > things working in a little obstacle.  Once when we get a real
> > > regression report due to the lack of exclusive mute control, we may
> > > provide another model option as a compromise.
> > >
> > > But, I'm open about this, really.  So, if anyone has a good argument,
> > > let me know.
> > 
> > Anyhow, it looks like the current behaviour is not good, because we have 
> > a "Dock Headphone Jack" on the same node as "Dock Line Out Playback 
> > Switch". This makes me wonder if the HP -> LO fixup should be removed 
> > altogether. Are there any machines these days that needs this fixup? In 
> > case there were just a few of them in the past, maybe they should have 
> > pin fixups instead?
> 
> Yes, this is one good step forward.  We should check through hda-emu.
> 
> Though, for the problem of Thinkpads, I prefer a patch with a smaller
> impact like yours.

FYI, I applied the patch now.  Let's continue working on top of it.

thanks,


Takashi

Patch
diff mbox

diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 431a20b..8e02cdf 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -4511,6 +4511,7 @@  enum {
 	ALC255_FIXUP_HEADSET_MODE_NO_HP_MIC,
 	ALC293_FIXUP_DELL1_MIC_NO_PRESENCE,
 	ALC292_FIXUP_TPT440_DOCK,
+	ALC292_FIXUP_TPT440_DOCK2,
 	ALC283_FIXUP_BXBT2807_MIC,
 	ALC255_FIXUP_DELL_WMI_MIC_MUTE_LED,
 	ALC282_FIXUP_ASPIRE_V5_PINS,
@@ -4960,6 +4961,12 @@  static const struct hda_fixup alc269_fixups[] = {
 		.chain_id = ALC269_FIXUP_HEADSET_MODE
 	},
 	[ALC292_FIXUP_TPT440_DOCK] = {
+		.type = HDA_FIXUP_FUNC,
+		.v.func = alc269_fixup_pincfg_no_hp_to_lineout,
+		.chained = true,
+		.chain_id = ALC292_FIXUP_TPT440_DOCK2
+	},
+	[ALC292_FIXUP_TPT440_DOCK2] = {
 		.type = HDA_FIXUP_PINS,
 		.v.pins = (const struct hda_pintbl[]) {
 			{ 0x16, 0x21211010 }, /* dock headphone */