Alsa-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [alsa-devel] issue with jack detect using rt5645
@ 2019-11-07 22:31 Ross Zwisler
  2019-11-07 23:28 ` Pierre-Louis Bossart
  2019-11-08 13:16 ` Hans de Goede
  0 siblings, 2 replies; 6+ messages in thread
From: Ross Zwisler @ 2019-11-07 22:31 UTC (permalink / raw)
  To: Bard Liao, Hans de Goede, Takashi Iwai, Mark Brown
  Cc: Curtis Malainey, alsa-devel, Jacob Rasmussen, Fletcher Woodruff

We are trying to get a piece of Google hardware which uses the rt5645
driver working correctly with newer kernels (currently one based on
the latest v4.14 stable), and noticed that the following commit:

commit 6b5da66322c5 ("ASoC: rt5645: read jd1_1 status for jd detection")

broke jack support for our device.  Basically with that patch we never
correctly see a jack insertion event, and audio is never routed to the
headphones.

With just that one patch reverted, things work correctly on our
system.  The revert applies cleanly to linus/master.

Here is the series where that patch was originally upstreamed:

https://www.spinics.net/lists/alsa-devel/msg64331.html

If we reverted that patch upstream, would it break other devices (the
"GDP Win" device?) that use the rt5645 driver?  If so, how would you
recommend proceeding?

Does anyone have one of the "GDP Win" devices so we can test that and
our device and make sure whatever solution we end up coming up with
works for everyone?

Thanks,
- Ross
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [alsa-devel] issue with jack detect using rt5645
  2019-11-07 22:31 [alsa-devel] issue with jack detect using rt5645 Ross Zwisler
@ 2019-11-07 23:28 ` Pierre-Louis Bossart
  2019-11-08  0:54   ` Curtis Malainey
  2019-11-08 13:16 ` Hans de Goede
  1 sibling, 1 reply; 6+ messages in thread
From: Pierre-Louis Bossart @ 2019-11-07 23:28 UTC (permalink / raw)
  To: Ross Zwisler, Bard Liao, Hans de Goede, Takashi Iwai, Mark Brown
  Cc: Curtis Malainey, alsa-devel, Jacob Rasmussen, Fletcher Woodruff



On 11/7/19 4:31 PM, Ross Zwisler wrote:
> We are trying to get a piece of Google hardware which uses the rt5645
> driver working correctly with newer kernels (currently one based on
> the latest v4.14 stable), and noticed that the following commit:
> 
> commit 6b5da66322c5 ("ASoC: rt5645: read jd1_1 status for jd detection")
> 
> broke jack support for our device.  Basically with that patch we never
> correctly see a jack insertion event, and audio is never routed to the
> headphones.
> 
> With just that one patch reverted, things work correctly on our
> system.  The revert applies cleanly to linus/master.
> 
> Here is the series where that patch was originally upstreamed:
> 
> https://www.spinics.net/lists/alsa-devel/msg64331.html
> 
> If we reverted that patch upstream, would it break other devices (the
> "GDP Win" device?) that use the rt5645 driver?  If so, how would you
> recommend proceeding?
> 
> Does anyone have one of the "GDP Win" devices so we can test that and
> our device and make sure whatever solution we end up coming up with
> works for everyone?

there are all kinds of DMI quirks in sound/soc/codecs/rt5645.c, 4 
directly applicable to Chromebooks ('buddy', 'strago', 'Google Chrome', 
'Google Setzer')

Can you check if your device is listed in those quirks? it could be that 
either the settings are wrong or that we never supported it.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [alsa-devel] issue with jack detect using rt5645
  2019-11-07 23:28 ` Pierre-Louis Bossart
@ 2019-11-08  0:54   ` Curtis Malainey
  0 siblings, 0 replies; 6+ messages in thread
From: Curtis Malainey @ 2019-11-08  0:54 UTC (permalink / raw)
  To: Pierre-Louis Bossart
  Cc: ALSA development, Jacob Rasmussen, Takashi Iwai, Ross Zwisler,
	Hans de Goede, Mark Brown, Fletcher Woodruff, Bard Liao

On Thu, Nov 7, 2019 at 3:28 PM Pierre-Louis Bossart
<pierre-louis.bossart@linux.intel.com> wrote:
>
>
>
> On 11/7/19 4:31 PM, Ross Zwisler wrote:
> > We are trying to get a piece of Google hardware which uses the rt5645
> > driver working correctly with newer kernels (currently one based on
> > the latest v4.14 stable), and noticed that the following commit:
> >
> > commit 6b5da66322c5 ("ASoC: rt5645: read jd1_1 status for jd detection")
> >
> > broke jack support for our device.  Basically with that patch we never
> > correctly see a jack insertion event, and audio is never routed to the
> > headphones.
> >
> > With just that one patch reverted, things work correctly on our
> > system.  The revert applies cleanly to linus/master.
> >
> > Here is the series where that patch was originally upstreamed:
> >
> > https://www.spinics.net/lists/alsa-devel/msg64331.html
> >
> > If we reverted that patch upstream, would it break other devices (the
> > "GDP Win" device?) that use the rt5645 driver?  If so, how would you
> > recommend proceeding?
> >
> > Does anyone have one of the "GDP Win" devices so we can test that and
> > our device and make sure whatever solution we end up coming up with
> > works for everyone?
>
> there are all kinds of DMI quirks in sound/soc/codecs/rt5645.c, 4
> directly applicable to Chromebooks ('buddy', 'strago', 'Google Chrome',
> 'Google Setzer')
>
> Can you check if your device is listed in those quirks? it could be that
> either the settings are wrong or that we never supported it.

We have been playing with the DMI values with little luck. (in this
case it's Buddy.) When we flip the polarity (level_triggered_irq
field) we only receive disconnect events.
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [alsa-devel] issue with jack detect using rt5645
  2019-11-07 22:31 [alsa-devel] issue with jack detect using rt5645 Ross Zwisler
  2019-11-07 23:28 ` Pierre-Louis Bossart
@ 2019-11-08 13:16 ` Hans de Goede
  2019-11-08 17:28   ` Jacob Rasmussen
  1 sibling, 1 reply; 6+ messages in thread
From: Hans de Goede @ 2019-11-08 13:16 UTC (permalink / raw)
  To: Ross Zwisler, Bard Liao, Takashi Iwai, Mark Brown
  Cc: Curtis Malainey, alsa-devel, Jacob Rasmussen, Fletcher Woodruff

Hi Ross,

On 11/7/19 11:31 PM, Ross Zwisler wrote:
> We are trying to get a piece of Google hardware which uses the rt5645
> driver working correctly with newer kernels (currently one based on
> the latest v4.14 stable), and noticed that the following commit:
> 
> commit 6b5da66322c5 ("ASoC: rt5645: read jd1_1 status for jd detection")
> 
> broke jack support for our device.  Basically with that patch we never
> correctly see a jack insertion event, and audio is never routed to the
> headphones.
> 
> With just that one patch reverted, things work correctly on our
> system.  The revert applies cleanly to linus/master.
> 
> Here is the series where that patch was originally upstreamed:
> 
> https://www.spinics.net/lists/alsa-devel/msg64331.html
> 
> If we reverted that patch upstream, would it break other devices (the
> "GDP Win" device?) that use the rt5645 driver?

Yes likely it will, the commit in question was added to fix jd
issue in the GDP win and other Cherry Trail devices using
standard Intel reference designs.

> If so, how would you
> recommend proceeding?
> 
> Does anyone have one of the "GDP Win" devices so we can test that and
> our device and make sure whatever solution we end up coming up with
> works for everyone?

I have acccess to the following devices with a rt5645 codec:


rt5645:         Spk     Mic     JDmod   UCM
-Acer One S1003 stereo  ana     3       chtrt5645
-Asus T100HA    stereo  dmic1   3 inv   custom
-GPD Pocket     mono    diff    3 inv   chtrt5645-mono-speaker-analog-mic
-GPD win        mono    ana     3 inv   chtrt5645-mono-speaker-analog-mic
-Kazam Vision   stereo  ana     3       chtrt5645
-Lenovo Miix310 stereo  diff    3       chtrt5645
-Lenovo Miix320 stereo  dmic2   3       custom
-Teclast X80Pro mono    ana     3       chtrt5645-mono-speaker-analog-mic

Which all work fine with the current code, have you tried all the
different jdmode values through the quirk moodule param?

If Playing with the quirk settings does not help, then I believe that
the best approach to fix this is to figure out which bit of the
pre 6b5da66322c5 behavior you need and to activate this behind a new
quirk option and set that quirk for the system in question.

Regards,

Hans

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [alsa-devel] issue with jack detect using rt5645
  2019-11-08 13:16 ` Hans de Goede
@ 2019-11-08 17:28   ` Jacob Rasmussen
  2019-11-08 22:51     ` Hans de Goede
  0 siblings, 1 reply; 6+ messages in thread
From: Jacob Rasmussen @ 2019-11-08 17:28 UTC (permalink / raw)
  To: Hans de Goede
  Cc: alsa-devel, Takashi Iwai, Ross Zwisler, Curtis Malainey,
	Mark Brown, Fletcher Woodruff, Bard Liao

Hello Hans,

On Fri, Nov 8, 2019 at 6:16 AM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi Ross,
>
> On 11/7/19 11:31 PM, Ross Zwisler wrote:
> > We are trying to get a piece of Google hardware which uses the rt5645
> > driver working correctly with newer kernels (currently one based on
> > the latest v4.14 stable), and noticed that the following commit:
> >
> > commit 6b5da66322c5 ("ASoC: rt5645: read jd1_1 status for jd detection")
> >
> > broke jack support for our device.  Basically with that patch we never
> > correctly see a jack insertion event, and audio is never routed to the
> > headphones.
> >
> > With just that one patch reverted, things work correctly on our
> > system.  The revert applies cleanly to linus/master.
> >
> > Here is the series where that patch was originally upstreamed:
> >
> > https://www.spinics.net/lists/alsa-devel/msg64331.html
> >
> > If we reverted that patch upstream, would it break other devices (the
> > "GDP Win" device?) that use the rt5645 driver?
>
> Yes likely it will, the commit in question was added to fix jd
> issue in the GDP win and other Cherry Trail devices using
> standard Intel reference designs.
>
> > If so, how would you
> > recommend proceeding?
> >
> > Does anyone have one of the "GDP Win" devices so we can test that and
> > our device and make sure whatever solution we end up coming up with
> > works for everyone?
>
> I have acccess to the following devices with a rt5645 codec:
>
>
> rt5645:         Spk     Mic     JDmod   UCM
> -Acer One S1003 stereo  ana     3       chtrt5645
> -Asus T100HA    stereo  dmic1   3 inv   custom
> -GPD Pocket     mono    diff    3 inv   chtrt5645-mono-speaker-analog-mic
> -GPD win        mono    ana     3 inv   chtrt5645-mono-speaker-analog-mic
> -Kazam Vision   stereo  ana     3       chtrt5645
> -Lenovo Miix310 stereo  diff    3       chtrt5645
> -Lenovo Miix320 stereo  dmic2   3       custom
> -Teclast X80Pro mono    ana     3       chtrt5645-mono-speaker-analog-mic
>
> Which all work fine with the current code, have you tried all the
> different jdmode values through the quirk moodule param?

I've tried setting jdmode to 0-7 through the quirk module param but
none of them fixed the problem.

> If Playing with the quirk settings does not help, then I believe that
> the best approach to fix this is to figure out which bit of the
> pre 6b5da66322c5 behavior you need and to activate this behind a new
> quirk option and set that quirk for the system in question.
>

The part of pre 6b5da66322c5 behavior we need is which register is
being read from to set val in jack_detect_work(). It looks like all
the other devices that use this codec have jd_mode = 3, so I was
thinking we could set buddy's jd_mode to something else and read from
the old register if jd_mode is that something else. Does that seem
reasonable?
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [alsa-devel] issue with jack detect using rt5645
  2019-11-08 17:28   ` Jacob Rasmussen
@ 2019-11-08 22:51     ` Hans de Goede
  0 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2019-11-08 22:51 UTC (permalink / raw)
  To: Jacob Rasmussen
  Cc: alsa-devel, Takashi Iwai, Ross Zwisler, Curtis Malainey,
	Mark Brown, Fletcher Woodruff, Bard Liao

Hi,

On 08-11-2019 18:28, Jacob Rasmussen wrote:
> Hello Hans,
> 
> On Fri, Nov 8, 2019 at 6:16 AM Hans de Goede <hdegoede@redhat.com> wrote:
>>
>> Hi Ross,
>>
>> On 11/7/19 11:31 PM, Ross Zwisler wrote:
>>> We are trying to get a piece of Google hardware which uses the rt5645
>>> driver working correctly with newer kernels (currently one based on
>>> the latest v4.14 stable), and noticed that the following commit:
>>>
>>> commit 6b5da66322c5 ("ASoC: rt5645: read jd1_1 status for jd detection")
>>>
>>> broke jack support for our device.  Basically with that patch we never
>>> correctly see a jack insertion event, and audio is never routed to the
>>> headphones.
>>>
>>> With just that one patch reverted, things work correctly on our
>>> system.  The revert applies cleanly to linus/master.
>>>
>>> Here is the series where that patch was originally upstreamed:
>>>
>>> https://www.spinics.net/lists/alsa-devel/msg64331.html
>>>
>>> If we reverted that patch upstream, would it break other devices (the
>>> "GDP Win" device?) that use the rt5645 driver?
>>
>> Yes likely it will, the commit in question was added to fix jd
>> issue in the GDP win and other Cherry Trail devices using
>> standard Intel reference designs.
>>
>>> If so, how would you
>>> recommend proceeding?
>>>
>>> Does anyone have one of the "GDP Win" devices so we can test that and
>>> our device and make sure whatever solution we end up coming up with
>>> works for everyone?
>>
>> I have acccess to the following devices with a rt5645 codec:
>>
>>
>> rt5645:         Spk     Mic     JDmod   UCM
>> -Acer One S1003 stereo  ana     3       chtrt5645
>> -Asus T100HA    stereo  dmic1   3 inv   custom
>> -GPD Pocket     mono    diff    3 inv   chtrt5645-mono-speaker-analog-mic
>> -GPD win        mono    ana     3 inv   chtrt5645-mono-speaker-analog-mic
>> -Kazam Vision   stereo  ana     3       chtrt5645
>> -Lenovo Miix310 stereo  diff    3       chtrt5645
>> -Lenovo Miix320 stereo  dmic2   3       custom
>> -Teclast X80Pro mono    ana     3       chtrt5645-mono-speaker-analog-mic
>>
>> Which all work fine with the current code, have you tried all the
>> different jdmode values through the quirk moodule param?
> 
> I've tried setting jdmode to 0-7 through the quirk module param but
> none of them fixed the problem.
> 
>> If Playing with the quirk settings does not help, then I believe that
>> the best approach to fix this is to figure out which bit of the
>> pre 6b5da66322c5 behavior you need and to activate this behind a new
>> quirk option and set that quirk for the system in question.
>>
> 
> The part of pre 6b5da66322c5 behavior we need is which register is
> being read from to set val in jack_detect_work(). It looks like all
> the other devices that use this codec have jd_mode = 3, so I was
> thinking we could set buddy's jd_mode to something else and read from
> the old register if jd_mode is that something else. Does that seem
> reasonable?

The QUIRK_JD_MODE macro supports jd_mode 0-7 and we are currently
only using 0-3, so if you call this say mode 4 then yes that sounds
reasonable.

Regards,

Hans

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 22:31 [alsa-devel] issue with jack detect using rt5645 Ross Zwisler
2019-11-07 23:28 ` Pierre-Louis Bossart
2019-11-08  0:54   ` Curtis Malainey
2019-11-08 13:16 ` Hans de Goede
2019-11-08 17:28   ` Jacob Rasmussen
2019-11-08 22:51     ` Hans de Goede

Alsa-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/alsa-devel/0 alsa-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 alsa-devel alsa-devel/ https://lore.kernel.org/alsa-devel \
		alsa-devel@alsa-project.org
	public-inbox-index alsa-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.alsa-project.alsa-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git