Archlinux bluetooth dual boot

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.

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].

Читайте также:  Bluetooth наушники samsung galaxy buds pro

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).

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.

Читайте также:  Thinkpad bluetooth enhanced data rate

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

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

fm16191/archlinux-bluetooth-pairing-dualboot

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Читайте также:  Wireless bluetooth headset синхронизация

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

Arch Linux Dual Boot Windows Bluetooth Installation & Configuration

Basically, when you pair your device, your Bluetooth service generates a unique set of pairing keys. 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). Thus, when you re-pair the device in Windows or Linux and it generates a new key, that key overwrites the previously stored key on the Bluetooth device. Windows overwrites the Linux key and vice versa. Mario Olivio Flores

> $ pacman -S bluez bluez-utils pulseaudio-bluetooth chntpw
> rfkill list 0: phy0: Wireless LAN Soft blocked: no Hard blocked: no 1: hci0: Bluetooth Soft blocked: no Hard blocked: no # if blocked : > rfkill unblock all > $ systemctl enable bluetooth.service > $ systemctl start bluetooth.service > pulseaudio --start
> $ mkdir /mnt/win > $ mount /dev/sdXY /mnt/win
> cd Windows/System32/config > chntpw -e SYSTEM > cd CurrentControlSet\Services\BTHPORT\Parameters\Keys # if there is no CurrentControlSet, then try ControlSet001 # Shows your Bluetooth port s MAC address (. )\Services\BTHPORT\Parameters\Keys> ls Node has 1 subkeys and 0 values key name a1234567abcd> > cd a1234567abcd > ls # lists the existing device s MAC addresses Node has 0 subkeys and 1 values 16 3 REG_BINARY 123456abcdef> > hex 123456abcdef :00000 XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX ..ignore.chars.. # XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX is your pairing key
>$ su - $> cd /var/lib/bluetooth/ $> ls # Your PC s MAC address AA:BB:CC:DD:11:22 $> cd AA:BB:CC:DD:11:22 $> ls # Your device s MAC Adress XX:YY:ZZ:77:88:99 . cache settings $> cd XX:YY:ZZ:77:88:99 $> vim info . [LinkKey] Key=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX # Here replace by the pairing key . # Restart bluetooth > $ systemctl restart bluetooth

Connect to your device using bluetoothctl

> bluetoothctl [bluetooth] default-agent [bluetooth] scan on Discovery started [CHG] Controller AA:BB:CC:DD:11:22 Discovering: yes [NEW] Device XX:YY:ZZ:77:88:99 DEVICE_NAME [bluetooth] trust XX:YY:ZZ:77:88:99 Changing XX:YY:ZZ:77:88:99 trust succeeded [bluetooth] connect XX:YY:ZZ:77:88:99 Attempting to connect to XX:YY:ZZ:77:88:99 [CHG] Device XX:YY:ZZ:77:88:99 Connected: yes

Источник

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