linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] UCLogic: Filtering unsupported HUION tablets
@ 2022-07-18 17:29 José Expósito
  2022-07-19  9:57 ` Nikolai Kondrashov
  2022-07-21  9:39 ` Bastien Nocera
  0 siblings, 2 replies; 11+ messages in thread
From: José Expósito @ 2022-07-18 17:29 UTC (permalink / raw)
  To: spbnick; +Cc: jikos, benjamin.tissoires, linux-input, linux-kernel

Hi!

No code yet, just a kind request for comments and hopefully some wisdom
and experience from Nikolai dealing with HUION devices.

HUION keeps reusing the same vendor and product IDs for their devices.
This makes it really difficult to differentiate between devices and
handle them in the kernel and also in user space.

Reusing IDs could introduce a problem:

If HUION, or other vendor following the same practices, releases a new
tablet with a duplicated product ID, the UCLogic driver would handle it.
The device might work with the existing code or it might fail because of
a new feature or a whole different firmware.

As far as I know, at the moment there is not a mechanism in place to
avoid this situation.
I think that it'd be better to ignore those devices in UCLogic and let
the HID generic driver handle them because using HID generic would
provide a basic user experience while using UCLogic might fail to probe
the tablet.

DIGImend's web already provides a nice list of supported devices:
http://digimend.github.io/tablets/

So, I wonder:

 - Do you think it makes sense to ignore untested devices?
 - If the answer is yes, do we have a better option than checking the
   device name against an allow-list? It'd be great to hear other
   people's ideas.

Best wishes,
José Expósito


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

* Re: [RFC] UCLogic: Filtering unsupported HUION tablets
  2022-07-18 17:29 [RFC] UCLogic: Filtering unsupported HUION tablets José Expósito
@ 2022-07-19  9:57 ` Nikolai Kondrashov
  2022-07-20 17:36   ` José Expósito
  2022-07-21  9:39 ` Bastien Nocera
  1 sibling, 1 reply; 11+ messages in thread
From: Nikolai Kondrashov @ 2022-07-19  9:57 UTC (permalink / raw)
  To: José Expósito
  Cc: jikos, benjamin.tissoires, linux-input, linux-kernel

Hi José,

First of all, thanks a lot for all the work you're doing with the tablets!

Yes, this situation is unfortunate, but there's really not much we could do.
The tablet database at http://digimend.github.io/tablets/ hasn't been updated 
in ages, and it has never been exhaustive to start with.

There are tons of tablet modifications, including of the same (marketed) 
model, and those can differ not only in the reported name, but probably even 
the VID:PID, as could've happened when Huion switched from v1 to v2 protocol.

So, I think a "whitelist" would be a maintenance nightmare.

Moreover, I think it's better to disable the tablet completely in case we 
failed initialization (e.g. got an invalid response to configuration, or 
failed to find some interfaces and such), after producing a comprehensive 
error message. Configuring a tablet partially, and then handing it over to the 
generic driver could mess things up more.

It's less confusing for the user, and stops them from trying to fix the 
problem up the stack with various settings, often getting into a worse 
situation. It's also much easier for the maintainer, since they don't need to 
investigate all the higher layers.

A "blacklist" would work better here, if you can find the tablets to include.

Nick

On 7/18/22 20:29, José Expósito wrote:
> Hi!
> 
> No code yet, just a kind request for comments and hopefully some wisdom
> and experience from Nikolai dealing with HUION devices.
> 
> HUION keeps reusing the same vendor and product IDs for their devices.
> This makes it really difficult to differentiate between devices and
> handle them in the kernel and also in user space.
> 
> Reusing IDs could introduce a problem:
> 
> If HUION, or other vendor following the same practices, releases a new
> tablet with a duplicated product ID, the UCLogic driver would handle it.
> The device might work with the existing code or it might fail because of
> a new feature or a whole different firmware.
> 
> As far as I know, at the moment there is not a mechanism in place to
> avoid this situation.
> I think that it'd be better to ignore those devices in UCLogic and let
> the HID generic driver handle them because using HID generic would
> provide a basic user experience while using UCLogic might fail to probe
> the tablet.
> 
> DIGImend's web already provides a nice list of supported devices:
> http://digimend.github.io/tablets/
> 
> So, I wonder:
> 
>   - Do you think it makes sense to ignore untested devices?
>   - If the answer is yes, do we have a better option than checking the
>     device name against an allow-list? It'd be great to hear other
>     people's ideas.
> 
> Best wishes,
> José Expósito
> 


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

* Re: [RFC] UCLogic: Filtering unsupported HUION tablets
  2022-07-19  9:57 ` Nikolai Kondrashov
@ 2022-07-20 17:36   ` José Expósito
  2022-07-20 17:45     ` Nikolai Kondrashov
  0 siblings, 1 reply; 11+ messages in thread
From: José Expósito @ 2022-07-20 17:36 UTC (permalink / raw)
  To: Nikolai Kondrashov; +Cc: jikos, benjamin.tissoires, linux-input, linux-kernel

Hi Nikolai,

Thanks a lot for the quick response.

On Tue, Jul 19, 2022 at 12:57:09PM +0300, Nikolai Kondrashov wrote:
> Hi José,
> 
> First of all, thanks a lot for all the work you're doing with the tablets!
> 
> Yes, this situation is unfortunate, but there's really not much we could do.
> The tablet database at http://digimend.github.io/tablets/ hasn't been
> updated in ages, and it has never been exhaustive to start with.
> 
> There are tons of tablet modifications, including of the same (marketed)
> model, and those can differ not only in the reported name, but probably even
> the VID:PID, as could've happened when Huion switched from v1 to v2
> protocol.
> 
> So, I think a "whitelist" would be a maintenance nightmare.
> 
> Moreover, I think it's better to disable the tablet completely in case we
> failed initialization (e.g. got an invalid response to configuration, or
> failed to find some interfaces and such), after producing a comprehensive
> error message. Configuring a tablet partially, and then handing it over to
> the generic driver could mess things up more.
> 
> It's less confusing for the user, and stops them from trying to fix the
> problem up the stack with various settings, often getting into a worse
> situation. It's also much easier for the maintainer, since they don't need
> to investigate all the higher layers.
> 
> A "blacklist" would work better here, if you can find the tablets to include.
> 
> Nick

That makes sense, thanks for the pointers.

It is unfortunate that we don't have the required information about the
supported tablets. Excluding the unsupported tablets (when fixing them
is not possible for reasons) seems like a reasonable approach.

I don't know about any broken device handled by the driver, so there is
no need to add new code yet :)
I'll try to keep an eye on DIGImend's issue tracker now that the code
present in the upstream kernel is being released by many distros.

Cheers,
Jose

> On 7/18/22 20:29, José Expósito wrote:
> > Hi!
> > 
> > No code yet, just a kind request for comments and hopefully some wisdom
> > and experience from Nikolai dealing with HUION devices.
> > 
> > HUION keeps reusing the same vendor and product IDs for their devices.
> > This makes it really difficult to differentiate between devices and
> > handle them in the kernel and also in user space.
> > 
> > Reusing IDs could introduce a problem:
> > 
> > If HUION, or other vendor following the same practices, releases a new
> > tablet with a duplicated product ID, the UCLogic driver would handle it.
> > The device might work with the existing code or it might fail because of
> > a new feature or a whole different firmware.
> > 
> > As far as I know, at the moment there is not a mechanism in place to
> > avoid this situation.
> > I think that it'd be better to ignore those devices in UCLogic and let
> > the HID generic driver handle them because using HID generic would
> > provide a basic user experience while using UCLogic might fail to probe
> > the tablet.
> > 
> > DIGImend's web already provides a nice list of supported devices:
> > http://digimend.github.io/tablets/
> > 
> > So, I wonder:
> > 
> >   - Do you think it makes sense to ignore untested devices?
> >   - If the answer is yes, do we have a better option than checking the
> >     device name against an allow-list? It'd be great to hear other
> >     people's ideas.
> > 
> > Best wishes,
> > José Expósito
> > 
> 

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

* Re: [RFC] UCLogic: Filtering unsupported HUION tablets
  2022-07-20 17:36   ` José Expósito
@ 2022-07-20 17:45     ` Nikolai Kondrashov
  2022-07-20 17:54       ` José Expósito
  0 siblings, 1 reply; 11+ messages in thread
From: Nikolai Kondrashov @ 2022-07-20 17:45 UTC (permalink / raw)
  To: José Expósito
  Cc: jikos, benjamin.tissoires, linux-input, linux-kernel

On 7/20/22 20:36, José Expósito wrote:
> Hi Nikolai,
> 
> Thanks a lot for the quick response.
> 
> On Tue, Jul 19, 2022 at 12:57:09PM +0300, Nikolai Kondrashov wrote:
>> Hi José,
>>
>> First of all, thanks a lot for all the work you're doing with the tablets!
>>
>> Yes, this situation is unfortunate, but there's really not much we could do.
>> The tablet database at http://digimend.github.io/tablets/ hasn't been
>> updated in ages, and it has never been exhaustive to start with.
>>
>> There are tons of tablet modifications, including of the same (marketed)
>> model, and those can differ not only in the reported name, but probably even
>> the VID:PID, as could've happened when Huion switched from v1 to v2
>> protocol.
>>
>> So, I think a "whitelist" would be a maintenance nightmare.
>>
>> Moreover, I think it's better to disable the tablet completely in case we
>> failed initialization (e.g. got an invalid response to configuration, or
>> failed to find some interfaces and such), after producing a comprehensive
>> error message. Configuring a tablet partially, and then handing it over to
>> the generic driver could mess things up more.
>>
>> It's less confusing for the user, and stops them from trying to fix the
>> problem up the stack with various settings, often getting into a worse
>> situation. It's also much easier for the maintainer, since they don't need
>> to investigate all the higher layers.
>>
>> A "blacklist" would work better here, if you can find the tablets to include.
>>
>> Nick
> 
> That makes sense, thanks for the pointers.
> 
> It is unfortunate that we don't have the required information about the
> supported tablets. Excluding the unsupported tablets (when fixing them
> is not possible for reasons) seems like a reasonable approach.
> 
> I don't know about any broken device handled by the driver, so there is
> no need to add new code yet :)
> I'll try to keep an eye on DIGImend's issue tracker now that the code
> present in the upstream kernel is being released by many distros.

If you have the time, backporting your changes to digimend-kernel-drivers 
would get you feedback much faster :)

I can do a release once we get the code in.

Nick

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

* Re: [RFC] UCLogic: Filtering unsupported HUION tablets
  2022-07-20 17:45     ` Nikolai Kondrashov
@ 2022-07-20 17:54       ` José Expósito
  2022-07-20 18:13         ` Nikolai Kondrashov
  0 siblings, 1 reply; 11+ messages in thread
From: José Expósito @ 2022-07-20 17:54 UTC (permalink / raw)
  To: Nikolai Kondrashov; +Cc: jikos, benjamin.tissoires, linux-input, linux-kernel

Hi!

On Wed, Jul 20, 2022 at 08:45:55PM +0300, Nikolai Kondrashov wrote:
> On 7/20/22 20:36, José Expósito wrote:
> > I don't know about any broken device handled by the driver, so there is
> > no need to add new code yet :)
> > I'll try to keep an eye on DIGImend's issue tracker now that the code
> > present in the upstream kernel is being released by many distros.
> 
> If you have the time, backporting your changes to digimend-kernel-drivers
> would get you feedback much faster :)
> 
> I can do a release once we get the code in.

I already opened a PR a few months ago:
https://github.com/DIGImend/digimend-kernel-drivers/pull/598

But more code has been merged since then. I'll try to backport the
latest changes this weekend and ping you on GitHub once it is
ready for review again.

Best wishes,
Jose

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

* Re: [RFC] UCLogic: Filtering unsupported HUION tablets
  2022-07-20 17:54       ` José Expósito
@ 2022-07-20 18:13         ` Nikolai Kondrashov
  2022-07-24 11:05           ` José Expósito
  0 siblings, 1 reply; 11+ messages in thread
From: Nikolai Kondrashov @ 2022-07-20 18:13 UTC (permalink / raw)
  To: José Expósito
  Cc: jikos, benjamin.tissoires, linux-input, linux-kernel

On 7/20/22 20:54, José Expósito wrote:
> Hi!
> 
> On Wed, Jul 20, 2022 at 08:45:55PM +0300, Nikolai Kondrashov wrote:
>> On 7/20/22 20:36, José Expósito wrote:
>>> I don't know about any broken device handled by the driver, so there is
>>> no need to add new code yet :)
>>> I'll try to keep an eye on DIGImend's issue tracker now that the code
>>> present in the upstream kernel is being released by many distros.
>>
>> If you have the time, backporting your changes to digimend-kernel-drivers
>> would get you feedback much faster :)
>>
>> I can do a release once we get the code in.
> 
> I already opened a PR a few months ago:
> https://github.com/DIGImend/digimend-kernel-drivers/pull/598
> 
> But more code has been merged since then. I'll try to backport the
> latest changes this weekend and ping you on GitHub once it is
> ready for review again.

Ah, sorry, I rarely look at DIGImend notifications 🙈

Could you send me an email once you got something ready for review?

Thank you!
Nick

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

* Re: [RFC] UCLogic: Filtering unsupported HUION tablets
  2022-07-18 17:29 [RFC] UCLogic: Filtering unsupported HUION tablets José Expósito
  2022-07-19  9:57 ` Nikolai Kondrashov
@ 2022-07-21  9:39 ` Bastien Nocera
  2022-07-24 11:14   ` José Expósito
  1 sibling, 1 reply; 11+ messages in thread
From: Bastien Nocera @ 2022-07-21  9:39 UTC (permalink / raw)
  To: José Expósito, spbnick
  Cc: jikos, benjamin.tissoires, linux-input, linux-kernel

On Mon, 2022-07-18 at 19:29 +0200, José Expósito wrote:
> Hi!
> 
> No code yet, just a kind request for comments and hopefully some
> wisdom
> and experience from Nikolai dealing with HUION devices.
> 
> HUION keeps reusing the same vendor and product IDs for their
> devices.
> This makes it really difficult to differentiate between devices and
> handle them in the kernel and also in user space.
> 
> Reusing IDs could introduce a problem:
> 
> If HUION, or other vendor following the same practices, releases a
> new
> tablet with a duplicated product ID, the UCLogic driver would handle
> it.
> The device might work with the existing code or it might fail because
> of
> a new feature or a whole different firmware.
> 
> As far as I know, at the moment there is not a mechanism in place to
> avoid this situation.
> I think that it'd be better to ignore those devices in UCLogic and
> let
> the HID generic driver handle them because using HID generic would
> provide a basic user experience while using UCLogic might fail to
> probe
> the tablet.
> 
> DIGImend's web already provides a nice list of supported devices:
> http://digimend.github.io/tablets/
> 
> So, I wonder:
> 
>  - Do you think it makes sense to ignore untested devices?
>  - If the answer is yes, do we have a better option than checking the
>    device name against an allow-list? It'd be great to hear other
>    people's ideas.

I don't think it makes sense to ignore untested devices, unless you
know for a fact they won't work.

But if the name is part of detecting the device, it would certainly
make sense to use that as part of the identifier for the device, rather
than just the USB VIP:PID.

You should be able to add the product strings in the .driver_data, and
check them in probe().

Cheers

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

* Re: [RFC] UCLogic: Filtering unsupported HUION tablets
  2022-07-20 18:13         ` Nikolai Kondrashov
@ 2022-07-24 11:05           ` José Expósito
  2022-08-08  7:44             ` Nikolai Kondrashov
  0 siblings, 1 reply; 11+ messages in thread
From: José Expósito @ 2022-07-24 11:05 UTC (permalink / raw)
  To: Nikolai Kondrashov; +Cc: jikos, benjamin.tissoires, linux-input, linux-kernel

On Wed, Jul 20, 2022 at 09:13:39PM +0300, Nikolai Kondrashov wrote:
> On 7/20/22 20:54, José Expósito wrote:
> > Hi!
> > 
> > On Wed, Jul 20, 2022 at 08:45:55PM +0300, Nikolai Kondrashov wrote:
> > > On 7/20/22 20:36, José Expósito wrote:
> > > > I don't know about any broken device handled by the driver, so there is
> > > > no need to add new code yet :)
> > > > I'll try to keep an eye on DIGImend's issue tracker now that the code
> > > > present in the upstream kernel is being released by many distros.
> > > 
> > > If you have the time, backporting your changes to digimend-kernel-drivers
> > > would get you feedback much faster :)
> > > 
> > > I can do a release once we get the code in.
> > 
> > I already opened a PR a few months ago:
> > https://github.com/DIGImend/digimend-kernel-drivers/pull/598
> > 
> > But more code has been merged since then. I'll try to backport the
> > latest changes this weekend and ping you on GitHub once it is
> > ready for review again.
> 
> Ah, sorry, I rarely look at DIGImend notifications 🙈
> 
> Could you send me an email once you got something ready for review?
> 
> Thank you!
> Nick

Sure, the PR is ready:
https://github.com/DIGImend/digimend-kernel-drivers/pull/598

I included the patches present in "for-5.20/uclogic" but not the
patches I sent during the last couple of weeks to the mailing list,
just in case changes are requested.

In addition, I created another PR adding the XP-Pen Deco L tablet to
the web:
https://github.com/DIGImend/tablets/pull/52

Jose

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

* Re: [RFC] UCLogic: Filtering unsupported HUION tablets
  2022-07-21  9:39 ` Bastien Nocera
@ 2022-07-24 11:14   ` José Expósito
  0 siblings, 0 replies; 11+ messages in thread
From: José Expósito @ 2022-07-24 11:14 UTC (permalink / raw)
  To: Bastien Nocera
  Cc: spbnick, jikos, benjamin.tissoires, linux-input, linux-kernel

On Thu, Jul 21, 2022 at 11:39:06AM +0200, Bastien Nocera wrote:
> On Mon, 2022-07-18 at 19:29 +0200, José Expósito wrote:
> > Hi!
> > 
> > No code yet, just a kind request for comments and hopefully some
> > wisdom
> > and experience from Nikolai dealing with HUION devices.
> > 
> > HUION keeps reusing the same vendor and product IDs for their
> > devices.
> > This makes it really difficult to differentiate between devices and
> > handle them in the kernel and also in user space.
> > 
> > Reusing IDs could introduce a problem:
> > 
> > If HUION, or other vendor following the same practices, releases a
> > new
> > tablet with a duplicated product ID, the UCLogic driver would handle
> > it.
> > The device might work with the existing code or it might fail because
> > of
> > a new feature or a whole different firmware.
> > 
> > As far as I know, at the moment there is not a mechanism in place to
> > avoid this situation.
> > I think that it'd be better to ignore those devices in UCLogic and
> > let
> > the HID generic driver handle them because using HID generic would
> > provide a basic user experience while using UCLogic might fail to
> > probe
> > the tablet.
> > 
> > DIGImend's web already provides a nice list of supported devices:
> > http://digimend.github.io/tablets/
> > 
> > So, I wonder:
> > 
> >  - Do you think it makes sense to ignore untested devices?
> >  - If the answer is yes, do we have a better option than checking the
> >    device name against an allow-list? It'd be great to hear other
> >    people's ideas.
> 
> I don't think it makes sense to ignore untested devices, unless you
> know for a fact they won't work.
> 
> But if the name is part of detecting the device, it would certainly
> make sense to use that as part of the identifier for the device, rather
> than just the USB VIP:PID.

Agreed, I also think that adding the name to the vendor/product IDs
pair would be a better identifier. However, at this point, we don't 
have that information for all supported tablets, so I guess that we
will have to fix new tablets reusing the VIP:PID as they are
released.

It is unfortunate, but we'll have to deal with it.

Thanks a lot for your comments!
Jose

> You should be able to add the product strings in the .driver_data, and
> check them in probe().
> 
> Cheers

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

* Re: [RFC] UCLogic: Filtering unsupported HUION tablets
  2022-07-24 11:05           ` José Expósito
@ 2022-08-08  7:44             ` Nikolai Kondrashov
  2022-08-08 16:15               ` José Expósito
  0 siblings, 1 reply; 11+ messages in thread
From: Nikolai Kondrashov @ 2022-08-08  7:44 UTC (permalink / raw)
  To: José Expósito
  Cc: jikos, benjamin.tissoires, linux-input, linux-kernel

On 7/24/22 14:05, José Expósito wrote:
> On Wed, Jul 20, 2022 at 09:13:39PM +0300, Nikolai Kondrashov wrote:
>> Could you send me an email once you got something ready for review?
>>
>> Thank you!
>> Nick
> 
> Sure, the PR is ready:
> https://github.com/DIGImend/digimend-kernel-drivers/pull/598
> 
> I included the patches present in "for-5.20/uclogic" but not the
> patches I sent during the last couple of weeks to the mailing list,
> just in case changes are requested.
> 
> In addition, I created another PR adding the XP-Pen Deco L tablet to
> the web:
> https://github.com/DIGImend/tablets/pull/52

Thank you, José!

I finally made the release:
https://github.com/DIGImend/digimend-kernel-drivers/releases/tag/v11

Nick

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

* Re: [RFC] UCLogic: Filtering unsupported HUION tablets
  2022-08-08  7:44             ` Nikolai Kondrashov
@ 2022-08-08 16:15               ` José Expósito
  0 siblings, 0 replies; 11+ messages in thread
From: José Expósito @ 2022-08-08 16:15 UTC (permalink / raw)
  To: Nikolai Kondrashov; +Cc: jikos, benjamin.tissoires, linux-input, linux-kernel

On Mon, Aug 08, 2022 at 10:44:29AM +0300, Nikolai Kondrashov wrote:
> On 7/24/22 14:05, José Expósito wrote:
> > On Wed, Jul 20, 2022 at 09:13:39PM +0300, Nikolai Kondrashov wrote:
> > > Could you send me an email once you got something ready for review?
> > > 
> > > Thank you!
> > > Nick
> > 
> > Sure, the PR is ready:
> > https://github.com/DIGImend/digimend-kernel-drivers/pull/598
> > 
> > I included the patches present in "for-5.20/uclogic" but not the
> > patches I sent during the last couple of weeks to the mailing list,
> > just in case changes are requested.
> > 
> > In addition, I created another PR adding the XP-Pen Deco L tablet to
> > the web:
> > https://github.com/DIGImend/tablets/pull/52
> 
> Thank you, José!
> 
> I finally made the release:
> https://github.com/DIGImend/digimend-kernel-drivers/releases/tag/v11
> 
> Nick

Thanks a lot Nickolai :) I'll keep an eye on the bug tracker just in
case.

Jose

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

end of thread, other threads:[~2022-08-08 16:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 17:29 [RFC] UCLogic: Filtering unsupported HUION tablets José Expósito
2022-07-19  9:57 ` Nikolai Kondrashov
2022-07-20 17:36   ` José Expósito
2022-07-20 17:45     ` Nikolai Kondrashov
2022-07-20 17:54       ` José Expósito
2022-07-20 18:13         ` Nikolai Kondrashov
2022-07-24 11:05           ` José Expósito
2022-08-08  7:44             ` Nikolai Kondrashov
2022-08-08 16:15               ` José Expósito
2022-07-21  9:39 ` Bastien Nocera
2022-07-24 11:14   ` José Expósito

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).