2022-02-15 22:22:21

by Andrey Butirsky

[permalink] [raw]
Subject: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

Detailed report is here, basically can't get any event from the mouse:
https://superuser.com/questions/1697648/lenovo-legion-m600-wireless-bluetooth-mouse-connected-and-paired-yet-not-working

Have the same mouse and ready to provide any assistant to solve this.
Any clue?

(If this is a tough problem I would probably have to return the mouse to
store, it's not cheap..)


2022-02-16 07:25:06

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

Hi Andrey,

On Tue, Feb 15, 2022 at 2:22 PM Andrey Butirsky <[email protected]> wrote:
>
> Detailed report is here, basically can't get any event from the mouse:
> https://superuser.com/questions/1697648/lenovo-legion-m600-wireless-bluetooth-mouse-connected-and-paired-yet-not-working
>
> Have the same mouse and ready to provide any assistant to solve this.
> Any clue?
>
> (If this is a tough problem I would probably have to return the mouse to
> store, it's not cheap..)

Please collect the HCI with use of btmon.

--
Luiz Augusto von Dentz

2022-02-16 16:16:08

by Andrey Butirsky

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

On 16.02.2022 02:22, Luiz Augusto von Dentz wrote:
> Hi Andrey,
>
> Please collect the HCI with use of btmon.


Hi Luiz, thanks for your response!

In btmon I see a lot of

> ACL Data RX: Handle 3585 flags 0x02 dlen 14

events when I move the mouse.

Full log is attached in snoop and text formats.

Also I pressed all the buttons present on the mouse.


Attachments:
hcitrace.snoop (30.96 kB)
hcitrace.txt (164.00 kB)
Download all attachments

2022-02-17 01:54:09

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

Hi Andrey,

On Wed, Feb 16, 2022 at 2:36 PM Andrey Butirsky <[email protected]> wrote:
>
> On 17.02.2022 00:08, Luiz Augusto von Dentz wrote:
> >> It's BlueZ Version: 5.60-0ubuntu2.2, Ubuntu 21.10
> > I try upgrading or better yet use the head since we have some fixes like:
> >
> > https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/profiles/input/hog-lib.c?id=0516d2527ea83c8fa209d52c564ce99408a00fbe
>
> Tried BlueZ 5.63 on my Fedora installation, no luck. Will try to build
> head if no better idea..

If that doesn't work I'm afraid you will need a dedicated kernel
driver in order to deal with its HID reports since BlueZ just forwards
the reports to the kernel.

--
Luiz Augusto von Dentz

2022-02-17 03:40:46

by Andrey Butirsky

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

On 17.02.2022 02:10, Luiz Augusto von Dentz wrote:
> Hi Andrey,
>
> On Wed, Feb 16, 2022 at 2:36 PM Andrey Butirsky <[email protected]> wrote:
>> Tried BlueZ 5.63 on my Fedora installation, no luck. Will try to build
>> head if no better idea..
> If that doesn't work I'm afraid you will need a dedicated kernel
> driver in order to deal with its HID reports since BlueZ just forwards
> the reports to the kernel.

That doesn't seem to work (meaning mouse doesn't move) .

Do you know where to get dedicated driver installation instructions?

2022-02-17 10:37:36

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

Hi Andrey,

On Wed, Feb 16, 2022 at 8:03 AM Andrey Butirsky <[email protected]> wrote:
>
> On 16.02.2022 02:22, Luiz Augusto von Dentz wrote:
> > Hi Andrey,
> >
> > Please collect the HCI with use of btmon.
>
>
> Hi Luiz, thanks for your response!
>
> In btmon I see a lot of
>
> > ACL Data RX: Handle 3585 flags 0x02 dlen 14
>
> events when I move the mouse.
>
> Full log is attached in snoop and text formats.
>
> Also I pressed all the buttons present on the mouse.

So we are receiving the reports:

> ACL Data RX: Handle 3585 flags 0x02 dlen 14
ATT: Handle Value Notification (0x1b) len 9
Handle: 0x002c
Data: 01000000020000

So I suspect there is something in the HID/uHID not working then, what
version of BlueZ are you using?

--
Luiz Augusto von Dentz

2022-02-17 11:55:28

by Andrey Butirsky

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

On 17.02.2022 00:08, Luiz Augusto von Dentz wrote:
>> It's BlueZ Version: 5.60-0ubuntu2.2, Ubuntu 21.10
> I try upgrading or better yet use the head since we have some fixes like:
>
> https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/profiles/input/hog-lib.c?id=0516d2527ea83c8fa209d52c564ce99408a00fbe

Tried BlueZ 5.63 on my Fedora installation, no luck. Will try to build
head if no better idea..

2022-02-17 12:57:56

by Andrey Butirsky

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

On 16.02.2022 23:26, Luiz Augusto von Dentz wrote:
> So we are receiving the reports:
>> ACL Data RX: Handle 3585 flags 0x02 dlen 14
> ATT: Handle Value Notification (0x1b) len 9
> Handle: 0x002c
> Data: 01000000020000
>
> So I suspect there is something in the HID/uHID not working then, what
> version of BlueZ are you using?
>
It's BlueZ Version: 5.60-0ubuntu2.2, Ubuntu 21.10

2022-02-17 13:19:21

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

Hi Andrey,

On Wed, Feb 16, 2022 at 12:32 PM Andrey Butirsky <[email protected]> wrote:
>
> On 16.02.2022 23:26, Luiz Augusto von Dentz wrote:
> > So we are receiving the reports:
> >> ACL Data RX: Handle 3585 flags 0x02 dlen 14
> > ATT: Handle Value Notification (0x1b) len 9
> > Handle: 0x002c
> > Data: 01000000020000
> >
> > So I suspect there is something in the HID/uHID not working then, what
> > version of BlueZ are you using?
> >
> It's BlueZ Version: 5.60-0ubuntu2.2, Ubuntu 21.10

I try upgrading or better yet use the head since we have some fixes like:

https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/profiles/input/hog-lib.c?id=0516d2527ea83c8fa209d52c564ce99408a00fbe

--
Luiz Augusto von Dentz

2022-02-17 13:31:19

by Andrey Butirsky

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

On 17.02.2022 02:10, Luiz Augusto von Dentz wrote:
> Hi Andrey,
>
> On Wed, Feb 16, 2022 at 2:36 PM Andrey Butirsky <[email protected]> wrote:
>> Tried BlueZ 5.63 on my Fedora installation, no luck. Will try to build
>> head if no better idea..
> If that doesn't work I'm afraid you will need a dedicated kernel
> driver in order to deal with its HID reports since BlueZ just forwards
> the reports to the kernel.

Could you clarify do you mean usual BlueZ dedicated driver just built
from bluetooth-next for my kernel or some non-existent driver one yet
had to write?

In the latter case, do you have some sample drivers maybe one could easy
to adopt?


2022-02-18 19:59:39

by Andrey Butirsky

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

On 17.02.2022 02:10, Luiz Augusto von Dentz wrote:
> Hi Andrey,
>
> On Wed, Feb 16, 2022 at 2:36 PM Andrey Butirsky <[email protected]> wrote:
>> Tried BlueZ 5.63 on my Fedora installation, no luck. Will try to build
>> head if no better idea..
> If that doesn't work I'm afraid you will need a dedicated kernel
> driver in order to deal with its HID reports since BlueZ just forwards
> the reports to the kernel.

Important addition: the mouse does work on Android 8.10.

Does it mean Android has that special HID driver that missed on Linux?
8.10 came out long before the mouse even existed..

Do you have explanation?

2022-02-19 00:58:46

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

Hi Andrey,

On Fri, Feb 18, 2022 at 3:55 AM Andrey Butirsky <[email protected]> wrote:
>
> On 17.02.2022 02:10, Luiz Augusto von Dentz wrote:
> > Hi Andrey,
> >
> > On Wed, Feb 16, 2022 at 2:36 PM Andrey Butirsky <[email protected]> wrote:
> >> Tried BlueZ 5.63 on my Fedora installation, no luck. Will try to build
> >> head if no better idea..
> > If that doesn't work I'm afraid you will need a dedicated kernel
> > driver in order to deal with its HID reports since BlueZ just forwards
> > the reports to the kernel.
>
> Important addition: the mouse does work on Android 8.10.
>
> Does it mean Android has that special HID driver that missed on Linux?
> 8.10 came out long before the mouse even existed..
>
> Do you have explanation?

No, in fact android seems to also be using UHID, does it uses a vendor
app to set it up?

--
Luiz Augusto von Dentz

2022-02-19 17:57:59

by Andrey Butirsky

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

Hi Luiz,

On 2/19/2022 12:15 AM, Luiz Augusto von Dentz wrote:
> Hi Andrey,
>
> On Fri, Feb 18, 2022 at 3:55 AM Andrey Butirsky <[email protected]> wrote:
>>
>> Important addition: the mouse does work on Android 8.10.
>>
>> Does it mean Android has that special HID driver that missed on Linux?
>> 8.10 came out long before the mouse even existed..
>>
>> Do you have explanation?
> No, in fact android seems to also be using UHID, does it uses a vendor
> app to set it up?

No, it just works right away after connecting from Settings.

Also, the mouse works on Windows, without additional software. It's
detected as "Bluetooth Low Energy GATT compliant HID device" there.

2022-02-20 15:20:53

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

Hi Andrey,

On Fri, Feb 18, 2022 at 1:26 PM Andrey Butirsky <[email protected]> wrote:
>
> Hi Luiz,
>
> On 2/19/2022 12:15 AM, Luiz Augusto von Dentz wrote:
> > Hi Andrey,
> >
> > On Fri, Feb 18, 2022 at 3:55 AM Andrey Butirsky <[email protected]> wrote:
> >>
> >> Important addition: the mouse does work on Android 8.10.
> >>
> >> Does it mean Android has that special HID driver that missed on Linux?
> >> 8.10 came out long before the mouse even existed..
> >>
> >> Do you have explanation?
> > No, in fact android seems to also be using UHID, does it uses a vendor
> > app to set it up?
>
> No, it just works right away after connecting from Settings.
>
> Also, the mouse works on Windows, without additional software. It's
> detected as "Bluetooth Low Energy GATT compliant HID device" there.

Did you manage to test with latest git? Note that windows does seem to
handle composite HoG device:

https://github.com/bluez/bluez/issues/258

Btw, it could be due to:

https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=aa699cb762a02ec7409940ddcfe65b788de8270d

There were some systems (afaik 32bits) with a problem with the header
copy we had.

--
Luiz Augusto von Dentz

2022-02-20 20:53:18

by Andrey Butirsky

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

Hi Luiz,

On 19.02.2022 00:38, Luiz Augusto von Dentz wrote:
> Hi Andrey,
> Did you manage to test with latest git? Note that windows does seem to
> handle composite HoG device:
>
> https://github.com/bluez/bluez/issues/258

I built bluetooth kernel modules from bluetooth-next, tag v5.13. Not
sure if it made any sense or my distro kernel already included them..

Anyway, there was no any difference in mouse behavior.


> Btw, it could be due to:
>
> https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=aa699cb762a02ec7409940ddcfe65b788de8270d
>
> There were some systems (afaik 32bits) with a problem with the header
> copy we had.
Can I check it somehow?

2022-02-20 23:58:21

by Andrey Butirsky

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

On 2/19/2022 12:38 AM, Luiz Augusto von Dentz wrote:
> Hi Andrey,
>
> On Fri, Feb 18, 2022 at 1:26 PM Andrey Butirsky <[email protected]> wrote:
>> Hi Luiz,
>>
>> On 2/19/2022 12:15 AM, Luiz Augusto von Dentz wrote:
>>> Hi Andrey,
>>>
>>> On Fri, Feb 18, 2022 at 3:55 AM Andrey Butirsky <[email protected]> wrote:
>>>> Important addition: the mouse does work on Android 8.10.
>>>>
>>>> Does it mean Android has that special HID driver that missed on Linux?
>>>> 8.10 came out long before the mouse even existed..
>>>>
>>>> Do you have explanation?
>>> No, in fact android seems to also be using UHID, does it uses a vendor
>>> app to set it up?
>> No, it just works right away after connecting from Settings.
>>
>> Also, the mouse works on Windows, without additional software. It's
>> detected as "Bluetooth Low Energy GATT compliant HID device" there.
> Did you manage to test with latest git? Note that windows does seem to
> handle composite HoG device:
>
> https://github.com/bluez/bluez/issues/258
Thanks, updated the issue with info. My device is probably composite
indeed, as these ones:

https://github.com/kyokenn/rogdrv#rogdrv

I tried BlueZ master but userspace only.


> Btw, it could be due to:
>
> https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=aa699cb762a02ec7409940ddcfe65b788de8270d
>
> There were some systems (afaik 32bits) with a problem with the header
> copy we had.
My system is 64-bit. Do you think it's still worth to try to update
BlueZ kernel part? If so, what is the procedure?
Didn't find how to build BlueZ out-of-tree kernel modules or something..

2022-02-21 08:58:54

by Andrey Butirsky

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working


On 20.02.2022 02:18, Andrey Butirsky wrote:
>> Btw, it could be due to:
>>
>> https://git.kernel.org/pub/scm/bluetooth/bluez.git/commit/?id=aa699cb762a02ec7409940ddcfe65b788de8270d
>>
>>
>> There were some systems (afaik 32bits) with a problem with the header
>> copy we had.
> Can I check it somehow?

Oh, I built BlueZ from master so shouldn't be the case.

2022-03-08 12:59:53

by Bastien Nocera

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

On Sat, 2022-02-19 at 00:26 +0300, Andrey Butirsky wrote:
> Hi Luiz,
>
> On 2/19/2022 12:15 AM, Luiz Augusto von Dentz wrote:
> > Hi Andrey,
> >
> > On Fri, Feb 18, 2022 at 3:55 AM Andrey Butirsky
> > <[email protected]> wrote:
> > >
> > > Important addition: the mouse does work on Android 8.10.
> > >
> > > Does it mean Android has that special HID driver that missed on
> > > Linux?
> > > 8.10 came out long before the mouse even existed..
> > >
> > > Do you have explanation?
> > No, in fact android seems to also be using UHID, does it uses a
> > vendor
> > app to set it up?
>
> No, it just works right away after connecting from Settings.
>
> Also, the mouse works on Windows, without additional software. It's
> detected as "Bluetooth Low Energy GATT compliant HID device" there.
>

Can you please try using "hid-recorder" to capture the HID output out
of the device? It would show us whether we're receiving any events from
the device, and allow us to test whether there are problems at the HID
level on other machines.

Cheers

2022-03-09 16:11:15

by Andrey Butirsky

[permalink] [raw]
Subject: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

On March 8, 2022 1:30:00 PM GMT+03:00, Bastien Nocera
<[email protected]> wrote:

Can you please try using "hid-recorder" to capture the HID output out
of the device? It would show us whether we're receiving any events from
the device, and allow us to test whether there are problems at the HID
level on other machines.

Sorry I had to return the mouse to store.
It's a pity because the hardware itself is rather good, but I had only
14 days to decide.

2022-03-22 06:17:55

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: Re: Lenovo Legion M600 wireless bluetooth mouse connected and paired yet not working

Hi Bastien,

On Tue, Mar 8, 2022 at 2:30 AM Bastien Nocera <[email protected]> wrote:
>
> On Sat, 2022-02-19 at 00:26 +0300, Andrey Butirsky wrote:
> > Hi Luiz,
> >
> > On 2/19/2022 12:15 AM, Luiz Augusto von Dentz wrote:
> > > Hi Andrey,
> > >
> > > On Fri, Feb 18, 2022 at 3:55 AM Andrey Butirsky
> > > <[email protected]> wrote:
> > > >
> > > > Important addition: the mouse does work on Android 8.10.
> > > >
> > > > Does it mean Android has that special HID driver that missed on
> > > > Linux?
> > > > 8.10 came out long before the mouse even existed..
> > > >
> > > > Do you have explanation?
> > > No, in fact android seems to also be using UHID, does it uses a
> > > vendor
> > > app to set it up?
> >
> > No, it just works right away after connecting from Settings.
> >
> > Also, the mouse works on Windows, without additional software. It's
> > detected as "Bluetooth Low Energy GATT compliant HID device" there.
> >
>
> Can you please try using "hid-recorder" to capture the HID output out
> of the device? It would show us whether we're receiving any events from
> the device, and allow us to test whether there are problems at the HID
> level on other machines.

Looks like there are others models affected as well:

https://github.com/bluez/bluez/issues/320

It is very weird that it would work with Android and doesn't with
Linux since afaik the very same interface is used with uHID, are there
anything on the kernel side we can switch on to see why reports would
be discarded, because from the looks of it we do receive them but they
just don't have any effect.

--
Luiz Augusto von Dentz