Linux bluetooth mouse lag

Bluetooth Mouse Lag

I have a BlueTooth mouse (Dell WM524). Works like a charm on my notebook with Ubuntu 15, but I have a little issue. Recently I’ve bought a 23′ full HD monitor and started using on notebook, no problems with system performance, Ubuntu crashes, or everything else, except for the BlueTooth mouse, that has a lot of lag Probably is a problem about hardware performance, but all the system is going fine, why the BT needs to lag? Is there a way to increase BT priority on Ubuntu? Important: It’s only BlueTooth mouse that lags, wired mouse doesn’t have any problem. When the monitor is disconnected that problem doesn’t happen. So, can I fix this increasing the BlueTooth priority process, or doing anything else.

1 Answer 1

This could be related to the «Sync To VBlank» setting in «OpenGL», which you can deactivate via the CompizConfig Settings Manager as reported in Mouse lag after upgrading to Ubuntu 14.04.

Note: I say, «could be», because you’re mentioning the monitor, hence it may be graphics related. I have the same problem, though without an external monitor, and the bluetooth mouse (Logitech Ultrathin Touch Mouse) just worked fine before upgrading from 14.04 LTS, and lagging afterwards. Unfortunately, for me the OpenGL setting doesn’t solve the problem.

I tried the approach in Ubuntu 14.04 bluetooth mouse lags time by time, which remediated the mouse lag slightly, almost unnoticeably. The lag is still there. On my system, the problem seems to be that the driver is not loaded:

$ dmesg | grep bluetooth [ 5.159573] bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0a5c-216f.hcd failed with error -2 [ 292.300110] input: Ultrathin Touch Mouse as /devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3:1.0/bluetooth/hci0/hci0:11/0005:046D:B00D.0004/input/input18 

Источник

Bluetooth mouse

This article describes configuration & troubleshooting steps specific to Bluetooth mice. The information here builds on the main Bluetooth article, and assumes the user has already followed any installation, configuration, or troubleshooting from that article.

Configuration

Apple Magic Mouse scroll speed

If the scroll speed is too slow, you can try

# modprobe -r hid_magicmouse # modprobe hid_magicmouse scroll_acceleration=1 scroll_speed=55

Scroll speed can be set from 0 to 63.

If the speed suits you, you can make the change permanent in /etc/modprobe.d/

/etc/modprobe.d/hid_magicmouse.conf
options hid_magicmouse scroll_acceleration=1 scroll_speed=55

Apple Magic Mouse middle click

If you find the middle click to be too finicky, you can disable it

# modprobe -r hid_magicmouse # modprobe hid_magicmouse emulate_3button=0

If this setting suits you, you can make the change permantent in /etc/modprobe.d/

/etc/modprobe.d/hid_magicmouse.conf
options hid_magicmouse emulate_3button=0

Mouse pairing and dual boot

When dual booting Windows and Linux, you may find yourself having to re-pair your Bluetooth mouse again and again. This will happen every time you switch OS, because when you pair your device, your Bluetooth service generates a unique set of pairing keys. And the core reason is that the set of pairing keys cannot be shared between the two OS.

Читайте также:  Передача файлов через bluetooth iphone

First, your computer stores the Bluetooth device’s mac address and pairing key. Second, your Bluetooth device stores your computer’s mac address and the matching key. This usually works fine, but the mac address for your Bluetooth port will be the same on both Linux and Windows (it is set on the hardware level). However, when you re-pair the device in Windows or Linux, it generates a new key. That key overwrites the previously stored key on the Bluetooth device. Windows overwrites the Linux key and vice versa.

To fix the problem, follow the instructions on [1].

if using a Bluetooth LE device use this python script, slightly edited to adapt for arch, originally discussed on [2].

Troubleshooting

Mouse lag

If you experience mouse lag you can try to increase the polling rate. See Mouse polling rate for more information.

You can try to set the minimum/maximum latency for the mouse in BlueZ [3]:

Add or modify the following section in /var/lib/bluetooth/mac-of-your-adapter/mac-of-your-mouse/info (adapt the path accordingly):

[ConnectionParameters] MinInterval=6 MaxInterval=9 Latency=44 Timeout=216

Also, you can use hcitool (in bluez-utils-compat AUR ) to change latency parameters of the device:

# HANDLE="$(hcitool con | grep '' | awk '')" # get the device handle # hcitool lecup --handle $HANDLE --latency 0 --min 6 --max 8

Note that this method is only effective for the current connection. If the mouse gets disconnected, you will need to execute again.

Alternatively, you can change the default latency settings via debugfs. See /sys/kernel/debug/bluetooth/hci0/conn__interval> .

This example will solve the lag problems, but you must un pair and pair the mouse:

# echo 0 > /sys/kernel/debug/bluetooth/hci0/conn_latency # echo 6 > /sys/kernel/debug/bluetooth/hci0/conn_min_interval # echo 7 > /sys/kernel/debug/bluetooth/hci0/conn_max_interval

Problems with the USB dongle

If you have trouble with your USB dongle, you may also want to try:

At this point, you should get an hci0 device with:

Sometimes the device is not active right away. Try starting the interface with:

and searching for devices as shown above.

Mouse always disconnects

If the mouse stops working but works again after restarting bluetooth, or the mouse seemingly keeps «falling asleep» after a couple of seconds of inactivity (which is the case for at least some models of Dell XPS 13 [4] [dead link 2022-09-17 ⓘ] ), you may need to disable USB autosuspend for the selected device.

The issue may also lie in the device timeout and HID settings. See #Thinkpad Bluetooth Laser Mouse problems.

If you are using a Logitech device, this issue may be resolved by following the procedure in #Problems with the Logitech BLE mouse (M557, M590, M720, anywhere mouse 2, etc).

Читайте также:  Bluetooth пульт приложение ios

Thinkpad Bluetooth Laser Mouse problems

If you are experiencing that your Thinkpad Bluetooth Laser Mouse rapidly connects and then (after a few milliseconds) disconnects again every few seconds (when you move the mouse or press a button), try pairing it with the code 0000 instead pairing without a code.

If the above is unhelpful, the issue may be in the device timeout settings. Edit/create the file /etc/bluetooth/input.conf and apply the following changes:

# Configuration file for the input service # This section contains options which are not specific to any # particular interface [General] # Set idle timeout (in minutes) before the connection will # be disconnect (defaults to 0 for no timeout) IdleTimeout=0 #Enable HID protocol handling in userspace input profile #Defaults to false(hidp handled in hidp kernel module) UserspaceHID=true

These changes will prevent device timeout in order to remain connected. The second setting enables userspace HID handling for bluetooth devices. Restart bluetooth.service to test changes. You also may need a reboot and to re-pair the device.

Kensington Expert Wireless Trackball problems

The Kensington Expert Wireless Trackball has default polling rates in the 200ms range, which make it laggy. To fix that, add or modify the [ConnectionParameters] section in /var/lib/bluetooth/mac-of-your-adapter/mac-of-your-mouse/info (adapt the path according to your mouse bluetooth address) as shown above, especially lower the latency to a small number or even 0 .

Problems with the Logitech BLE mouse (M557, M590, M720, anywhere mouse 2, etc)

In some case, the mouse is paired but not moving when used. The device add to be trusted and unblocked. First of all open a terminal and run bluetoothctl

[bluetooth] # remove XX:XX:XX:XX:XX:XX
[bluetooth] # trust XX:XX:XX:XX:XX:XX
[bluetooth] # pair XX:XX:XX:XX:XX:XX
[bluetooth] # connect XX:XX:XX:XX:XX:XX

If the mouse does not work directly, just power off and power on the mouse.

In some cases, it may also be necessary to load the uhid kernel module.

Problems with all BLE mice on kernel 5.9+

See Also

Источник

Bluetooth mouse is laggy (low poll rate. ) in 18.04

My touchpad or other mouse show about 125Hz which is ok for me. I found a few forum/howto explaining how to change «mousepoll» of USBHID. but I still get 0 in /sys/module/usbhid/parameters/mousepoll and still 22Hz. Moreover, I have a bluetooth mouse. not sure if USBHID can influence here? by the way, If I do «rmmod usbhid», I immediatly loose my USB keyboard, USB mouse, but the laptop keyboard, touchpad and my laggy bluetooth mouse still works (and still laggy). I guess it means the mouse is not managed by usbhid. I also found this:

$ systemctl status bluetooth.service ● bluetooth.service - Bluetooth service Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2019-04-11 17:13:11 CEST; 17min ago Docs: man:bluetoothd(8) Main PID: 1507 (bluetoothd) Status: "Running" Tasks: 1 (limit: 4915) CGroup: /system.slice/bluetooth.service └─1507 /usr/lib/bluetooth/bluetoothd avril 11 17:13:36 celestin bluetoothd[1507]: bt_uhid_send: Invalid argument (22) avril 11 17:13:36 celestin bluetoothd[1507]: bt_uhid_send: Invalid argument (22) avril 11 17:13:36 celestin bluetoothd[1507]: bt_uhid_send: Invalid argument (22) avril 11 17:13:36 celestin bluetoothd[1507]: bt_uhid_send: Invalid argument (22) avril 11 17:13:36 celestin bluetoothd[1507]: bt_uhid_send: Invalid argument (22) avril 11 17:13:36 celestin bluetoothd[1507]: bt_uhid_send: Invalid argument (22) avril 11 17:13:45 celestin bluetoothd[1507]: Endpoint unregistered: sender=:1.119 path=/MediaEndpoint/A2DPSource avril 11 17:13:45 celestin bluetoothd[1507]: Endpoint unregistered: sender=:1.119 path=/MediaEndpoint/A2DPSink avril 11 17:13:50 celestin bluetoothd[1507]: Endpoint registered: sender=:1.138 path=/MediaEndpoint/A2DPSource avril 11 17:13:50 celestin bluetoothd[1507]: Endpoint registered: sender=:1.138 path=/MediaEndpoint/A2DPSink 

Источник

Читайте также:  Gathers vxm 128vs блютуз

Lag when using Bluetooth Mouse

After the latest Ubuntu update (using 19.04) I get an extraordinary lag when using my Logitech M720 mouse connected via Bluetooth. When using the USB dongle it works flawless. Any ideas on why this might have occurred? (tried removing it, pairing it again and so forth)

I have exactly the same problem with the same mouse on Kubuntu 18.04. I observed that sometimes (probably a specific uptime/boot, not physical location), it worked via BT at home and needed dongle at work and sometimes the opposite.

4 Answers 4

After trying to downgrade the bluetooth package to see if that made a difference, I decided/realized that while it may have improved somewhat, it did not fix the issue. Continued researching and found: https://ubuntuforums.org/showthread.php?t=2372916.

echo «options iwlwifi bt_coex_active=0» | sudo tee /etc/modprobe.d/iwlopt.conf

Seems to be working substantially better

Do you happen to know what «bluetooth coexistence parameter» means. Or what could be possible side effects of this solution?

Here is a more technical explanation (which might be based on this whitepaper) and a more accessible explanation can be found here. TL;DR: older (2.4Ghz) wifi can sometimes interfere with BT. Those speed/connectivity issues can be mitigated with BT co-existence thing, if both BT devices support it.

The issue you are facing is not related to the Bluetooth timeout but more likely the USB auto suspend feature built into the kernel.

I am running Ubuntu 22.04 LTS and i have a Logitech MX Anywhere 2S

This is how i went about fixing it:

$ lsusb -vt /: Bus 02.Port 1: Dev 1, Driver=xhci_hcd/6p, 10000M ID 1d6b:0003 Linux Foundation 3.0 root hub /: Bus 01.Port 1: Dev 1, Driver=xhci_hcd/12p, 480M ID 1d6b:0002 Linux Foundation 2.0 root hub |__ Port 5: Dev 2, If 0, Specific Class, Driver=, 12M ID 27c6:538d Shenzhen Goodix Technology Co.,Ltd. |__ Port 6: Dev 3, If 0, Driver=uvcvideo, 480M ID 0bda:565a Realtek Semiconductor Corp. |__ Port 6: Dev 3, If 1, Driver=uvcvideo, 480M ID 0bda:565a Realtek Semiconductor Corp. |__ Port 10: Dev 4, If 0, Driver=btusb, 12M ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP) |__ Port 10: Dev 4, If 1, Driver=btusb, 12M ID 8087:0aaa Intel Corp. Bluetooth 9460/9560 Jefferson Peak (JfP) 

The id of my bluetooth module is 8087:0aaa

$ echo 'ACTION=="add", SUBSYSTEM=="usb", ATTR=="8087", ATTR=="0aaa", ATTR="-1"' >> /etc/udev/rules.d/50-usb_power_save.rules 

After this reboot your pc and the lag should go away.

Note that idVendor was set to 8087 and idProduct was set to 0aaa to reflect my bluetooth settings

I used following links for reference.

Источник

Оцените статью
Adblock
detector