Bug as described in this Reddit post, pretty much exactly: https://old.reddit.com/r/linuxquestions/comments/qcb9cl/bluez_562_fails_to_connect_mouse_on_first_try/ Patch to temporarily resolve issue (by reverting the suspect commit) is attached. Reproducible: Always Steps to Reproduce: 1. Have existing paired logitech bluetooth mouse 2. Boot or attempt to connect 3. first connection will fail, but disconnecting and reattempting succeeds Actual Results: mouse fails to connect via bluetooth; journalctl shows profiles/input/hog-lib.c:set_report_cb() Error setting Report value: Unexpected error code Expected Results: mouse connects on first attempt
Created attachment 756774 [details, diff] patch to revert the commit that caused this issue
The relevant commit. https://github.com/bluez/bluez/commit/ac2c2e10b3adb432a572b618c6f53cabb6b3c80b
I would suggest reporting this issue upstream.
(In reply to Mike Gilbert from comment #3) > I would suggest reporting this issue upstream. Someone else has already done so, here is the link: https://github.com/bluez/bluez/issues/220
First occurrence in log: November 21 when Bluetooth mouse was connected after long time
(In reply to wbrana from comment #5) > First occurrence in log: November 21 when Bluetooth mouse was connected > after long time ignore, wrong bug
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c56c92516c1f7faa80cf76c5df2938edf50b538f commit c56c92516c1f7faa80cf76c5df2938edf50b538f Author: Pacho Ramos <pacho@gentoo.org> AuthorDate: 2021-12-02 13:31:03 +0000 Commit: Pacho Ramos <pacho@gentoo.org> CommitDate: 2021-12-02 13:31:03 +0000 net-wireless/bluez: Important bugfixes This solves disconnecting due to GattCharacteristic1.MTU and reverts a commit introducing a regression when connecting some mouse models Bug: https://bugs.gentoo.org/827706 Bug: https://bugs.gentoo.org/827911 Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Pacho Ramos <pacho@gentoo.org> net-wireless/bluez/bluez-5.62-r3.ebuild | 294 +++++++++++++++++++++ ...1-Revert-attrib-Make-use-of-bt_att_resend.patch | 188 +++++++++++++ .../bluez/files/bluez-5.62-fix-disconnecting.patch | 54 ++++ 3 files changed, 536 insertions(+)
please retry with latest revision
Yep, r3 is functioning as expected.
I can also confirm that with bluez-5.62-r3 my MX Master 3 mouse is not automatically connected, as it should be, after every boot. With -r2 I had to 1. systemctl restart bluetooth 2. power-cycle the *mouse* after each graphical login to make the mouse work. Note that I had to re-pair the mouse to have this effect.
It is better that you comment that in upstream report: https://github.com/bluez/bluez/issues/220 For now we cannot do much more than reverting the offending change... I wonder if maybe you issue is a bit different... I will track upstream bug anyway :/
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1880ed05a890b2029d038e33eac7f021de787f6 commit e1880ed05a890b2029d038e33eac7f021de787f6 Author: Pacho Ramos <pacho@gentoo.org> AuthorDate: 2022-01-09 19:52:32 +0000 Commit: Pacho Ramos <pacho@gentoo.org> CommitDate: 2022-01-09 19:52:32 +0000 net-wireless/bluez: Bump to 5.63 Also try a less invasive fix for bug #827706. Skip for now test-hog as it fails (#829091) with all the fixes for previous bug. More kernel config options are needed to run the tests. Also fix building with musl Closes: https://bugs.gentoo.org/829091 Thanks-to: Paolo Pedroni Bug: https://bugs.gentoo.org/827706 Thanks-to: Florian Schmaus Closes: https://bugs.gentoo.org/812797 Thanks-to: Jory A. Pratt Closes: https://bugs.gentoo.org/827825 Thanks-to: Agostino Sarubbo Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Pacho Ramos <pacho@gentoo.org> net-wireless/bluez/Manifest | 1 + net-wireless/bluez/bluez-5.63.ebuild | 302 +++++++++++++++++++++ .../bluez/files/bluez-5.63-musl-limits.patch | 24 ++ .../files/bluez-5.63-use-queue_push_tail.patch | 27 ++ 4 files changed, 354 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=277ef13c7bb383657ee4628b45a37b62f66eb20e commit 277ef13c7bb383657ee4628b45a37b62f66eb20e Author: Pacho Ramos <pacho@gentoo.org> AuthorDate: 2022-01-16 09:37:57 +0000 Commit: Pacho Ramos <pacho@gentoo.org> CommitDate: 2022-01-16 09:38:06 +0000 net-wireless/bluez: Sync with upstream fixes For bug #827706 Bug: https://bugs.gentoo.org/827706 Bug: https://bugs.gentoo.org/829091 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Pacho Ramos <pacho@gentoo.org> net-wireless/bluez/bluez-5.63-r1.ebuild | 295 +++++++++++ ...hog-Fix-read-order-of-attributes-rediffed.patch | 542 +++++++++++++++++++++ ...while-uhid-device-has-not-been-c-rediffed.patch | 90 ++++ 3 files changed, 927 insertions(+)
I hate to be that guy, but my Logitech MX Master 3 mouse still doesn't connection automatically, despite running net-wireless/bluez-5.63-r1. I've already reported this upstream as https://github.com/bluez/bluez/issues/275. Could someone please confirm that bluez-5.63-r1 fixes the issue, of confirm my observation?
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa6fc98d5349d89969b3d4707e0884cd71652964 commit aa6fc98d5349d89969b3d4707e0884cd71652964 Author: Pacho Ramos <pacho@gentoo.org> AuthorDate: 2022-03-26 19:23:39 +0000 Commit: Pacho Ramos <pacho@gentoo.org> CommitDate: 2022-03-26 19:24:43 +0000 net-wireless/bluez: Bump to 5.64 Closes: https://bugs.gentoo.org/835627 Closes: https://bugs.gentoo.org/827706 Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Pacho Ramos <pacho@gentoo.org> net-wireless/bluez/Manifest | 1 + net-wireless/bluez/bluez-5.64.ebuild | 291 +++++++++++++++++++++++++++++++++++ 2 files changed, 292 insertions(+)