Arch linux bluetooth mouse

Содержание
  1. Bluetooth mouse
  2. Contents
  3. Configuration
  4. Apple Magic Mouse scroll speed
  5. Apple Magic Mouse middle click
  6. Mouse pairing and dual boot
  7. Troubleshooting
  8. Mouse lag
  9. Problems with the USB dongle
  10. Mouse always disconnects
  11. Thinkpad Bluetooth Laser Mouse problems
  12. Kensington Expert Wireless Trackball problems
  13. Problems with the Logitech BLE mouse (M557, M590, anywhere mouse 2, etc)
  14. Logitech MX Master
  15. Contents
  16. Usage
  17. Mappings for extra buttons
  18. Logiops
  19. Examples
  20. Xbindkeys
  21. Power
  22. Smart shift
  23. Logiops
  24. Solaar
  25. Bluetooth
  26. Contents
  27. Installation
  28. Front-ends
  29. Console
  30. Graphical
  31. Pairing
  32. Dual boot pairing
  33. Setup
  34. For Windows
  35. For macOS
  36. Finishing up
  37. Configuration
  38. Auto power-on after boot
  39. Discoverable on startup
  40. Wake from suspend
  41. Audio
  42. PulseAudio
  43. PipeWire
  44. Bluetooth serial
  45. Troubleshooting
  46. Debugging
  47. Deprecated BlueZ tools
  48. gnome-bluetooth
  49. Bluetooth USB Dongle
  50. Audio devices start to skip at short distance from dongle
  51. CSR Dongle 0a12:0001
  52. Logitech Bluetooth USB Dongle
  53. hcitool scan: Device not found
  54. bluetoothctl: No default controller available
  55. systemd: Condition check resulted in Bluetooth service being skipped
  56. rfkill unblock: Do not unblock
  57. Computer is not visible
  58. Foxconn / Hon Hai / Lite-On Broadcom device
  59. Intel combined WiFi and Bluetooth cards
  60. Device connects, then disconnects after a few moments
  61. Device does not connect with an error in journal
  62. Device does not show up in scan
  63. Cannot receive transferred files due to symlink
  64. Interference between Headphones and Mouse
  65. Bluetooth mouse laggy movements
  66. Adapter disappears after suspend/resume
  67. Problems with all BLE devices on kernel 5.9+
  68. Problems with some Bluetooth drivers in kernel 5.10

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.

Contents

Configuration

Apple Magic Mouse scroll speed

If the scroll speed is too slow, you can try

Scroll speed can be set from 0 to 63.

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

Apple Magic Mouse middle click

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

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

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

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

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

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:

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]), 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, 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:

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, 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

  1. Power off the bluetooth:
  2. Power on the bluetooth, then enable the pairing method on the mouse if needed:
  3. List the available bluetooth devices, you have to copy the mouse device ID XX:XX:XX:XX:XX:XX:
  4. Unpair the device if already paired:
  5. Put device in pairing mode (typically by long pressing a button, or a key combination on some keyboards). It will be detected by scan and displayed. Mind that the device ID may have changed (slightly), so copy the device ID shown by the scan.
  6. Trust the device:
  7. Pair the mouse with the computer:
  8. Connect the computer with the mouse:
  9. Unblock the device control:
  10. Power the bluetooth off and on.

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.

Источник

Logitech MX Master

Contents

Usage

The mouse should work with no special configuration if using the unified receiver USB dongle. Plug in the dongle, then press the connect button on the mouse.

To use Bluetooth, change the channel on the bottom of the mouse, and click the connect button. Now, search for the mouse with a bluetooth manager of your choice and pair. In future it should connect as soon as you switch to that channel when your bluetooth is active. If you have problems with the mouse not showing when scanning, see Bluetooth LE device does not show up in scan

The mouse exists in 3 versions:

The functionalities are the same.

Mappings for extra buttons

Install logiops AUR or logiops-git AUR to customize mouse settings:

  • Easy programmable buttons.
  • DPI selection.
  • Smartshift (hyperfast and click-to-click wheel mode).
  • HiresScroll.
  • Gestures.

It is possible to use just #Xbindkeys and tweak the desktop shortcuts to obtain some customization, but with some caveats (look notes below).

Logiops

It can be executed as application via command line by running

Or as a service by systemd.

The configuration lives in /etc/logid.cfg . But the package comes with no configuration. One needs to create this specifying the name of the device to be used. To obtain that name launching from cli

The name of the detected device is printed.

Читайте также:  Intel hd graphics 4600 mac os mojave

Then you can create the configuration file.

Examples

This minimal configuration file simply makes each button work as a normal mouse button, ignoring gestures. It will allow the extra buttons to be used normally, such as in games and by Xbindkeys (see below).

For a more fully-featured configuration, see the example config or this one:

Xbindkeys

List of events sent by mouse:

Physical action detected as With minimal logid
config above
Left button button 1 button 1
Press to wheel button 2 button 2
Right button button 3 button 3
Scroll wheel up button 4 button 4
Scroll wheel down button 5 button 5
Scroll hor_wheel right (up) button 6 button 6
Scroll hor_wheel left (down) button 7 button 7
Side-bottom button button 8 button 8
Side-top button button 9 button 9
Thumb button Ctrl+Alt+Tab button 10
Press «i» button under wheel Not detected by xbindkeys button 11
  • It is impossible to move mouse cursor while thumb button is pressed, but possible to use any other actions (pressing buttons and scrolling wheels). Ctrl+Alt+Tab event is sent only after releasing thumb button. Using logid to reassign this button removes this limitation.
  • If you wish, you can get experience of thumb button like in Windows or Mac. In kde go to System settings → Shortcuts → Global Shortcuts → KWin → Show all windows from all desktops. It is set to ctrl+f10 by default. Set ctrl+alt+tab for this action and apply settings.
  • «I» button under wheel is undetectable in Linux by default, but works as switching wheel between free and rattle mode. With logid it can be reassigned for use.
  • Logitech gestures (moving mouse up/down/left/right while thumb pressed) are not detected in Linux, but are implemented in software by logid.

The vertical wheel and the two buttons near it should work right away, however the thumb button requires some special treatment, and you might want to remap the rest.

To remap the buttons of the mouse you can use the packages xbindkeys and xautomation .

xbindkeys will redirect the buttons and xte (which is included in xautomation) will execute the custom key presses. To do so, create a config file named .xbindkeysrc in your home directory.

Here is a sample configuration for the vertical scroll wheel and the two buttons near it:

If using PulseAudio (more info here):

If you prefer to get a visual feedback on how the volume level changes you could use the following lines instead (Tested in GNOME and KDE)

Now start xbindkeys , preferably add that to the autostart list of your desktop environment.

The thumb button is special. With the Logitech software available for Windows and Mac, you would be able to map up to 5 actions to it: by pressing the button or by pressing the button and moving the mouse in one of four directions. As of November 2015, there is no way to enable the direction feature using Arch.

If you look at the keys the button triggers you will notice that it sends a series of keys, confusing xbindkeys. You need to add a short sleep here so xbindkeys will only react on the first keys send so we can at least map one action to it:

Remember that all changes to

/.xbindkeysrc require a restart of the xbindkeys process:

Power

Battery status can be read as described on Logitech Unifying Receiver. e.g. Solaar ( solaar ) has a system tray utility.

Smart shift

Smart shift is where the scroll wheel switches from click-to-click to smooth scrolling automatically, based on the speed at which it is being spun.

Logiops

Any mouse button can be assigned to switch between modes. The default settings are with the smart-shift threshold around 20 and the top button (just below the wheel) used to toggle between always-smooth and smart-shift (clicky when scrolling slowly only). Increasing the threshold number requires the wheel to be spun faster before it will switch into smooth-scrolling mode.

To reproduce the default settings, use this snippet in the config file as shown above:

Change the threshold or use a different button (cid) as needed.

Solaar

Instead of logid, Solaar can also be used to change the sensitivity of changing the mouse wheel mode (between hyperfast and click-to-click), install solaar . A slider appears that can be set somewhere between 0 and 50 (inclusive). 0 means always in hyperfast mode, 50 means always in click-to-click mode.

To change the sensitivity, change this value somewhere between 0 and 50.

Источник

Bluetooth

Bluetooth is a standard for the short-range wireless interconnection of cellular phones, computers, and other electronic devices. In Linux, the canonical implementation of the Bluetooth protocol stack is BlueZ.

Contents

Installation

  1. Install the bluez package, providing the Bluetooth protocol stack.
  2. Install the bluez-utils package, providing the bluetoothctl utility. Alternatively install bluez-utils-compatAUR to additionally have the deprecated BlueZ tools.
  3. The generic Bluetooth driver is the btusb kernel module. Check whether that module is loaded. If it’s not, then load the module.
  4. Start/enable bluetooth.service .

Front-ends

Console

  • bluetoothctl — Pairing a device from the shell is one of the simplest and most reliable options.

http://www.bluez.org/ || bluez-utils

Graphical

The following packages allow for a graphical interface to customize Bluetooth.

  • GNOME Bluetooth — GNOME’s Bluetooth tool.
    • gnome-bluetooth provides the back-end
    • gnome-shell provides the status monitor applet
    • gnome-control-center provides the configuration front-end GUI that can be accessed by typing Bluetooth on the Activities overview, or with the gnome-control-center bluetooth command.
    • You can also launch the bluetooth-sendto command directly to send files to a remote device.
    • nautilus-bluetoothAUR adds a «Send via Bluetooth» entry to Nautilus’ right-click menu
    • To receive files, open the Bluetooth settings panel; you can only receive whilst the Bluetooth panel is open.
    • To add a Bluetooth entry to the Send To menu in Thunar’s file properties menu, see instructions here. (The command that needs to be configured is bluetooth-sendto %F ).

https://wiki.gnome.org/Projects/GnomeBluetooth ||

  • Bluedevil — KDE’s Bluetooth tool. If there is no Bluetooth icon visible in Dolphin and in the system tray, enable it in the system tray options or add a widget. You can configure Bluedevil and detect Bluetooth devices by clicking the icon. An interface is also available from the KDE System Settings.

https://invent.kde.org/plasma/bluedevil || bluedevil

  • Blueberry — Linux Mint’s spin-off of GNOME Bluetooth, which works in all desktop environments. Blueberry does not support receiving files through Obex Object Push.

https://github.com/linuxmint/blueberry || blueberry

  • Blueman — A full featured Bluetooth manager.

https://github.com/blueman-project/blueman || blueman

  • ObexFTP — A tool for transferring files to/from any OBEX enabled device.

http://dev.zuckschwerdt.org/openobex/wiki/ObexFtp || obexftpAUR

Pairing

This section describes directly configuring bluez5 via the bluetoothctl CLI, which might not be necessary if you are using an alternative front-end tool (such as GNOME Bluetooth).

The exact procedure depends on the devices involved and their input functionality. What follows is a general outline of pairing a device using bluetoothctl .

Start the bluetoothctl interactive command. Input help to get a list of available commands.

  1. (optional) Select a default controller with select MAC_address .
  2. Enter power on to turn the power to the controller on. It is off by default and will turn off again each reboot, see #Auto power-on after boot.
  3. Enter devices to get the MAC Address of the device with which to pair.
  4. Enter device discovery mode with scan on command if device is not yet on the list.
  5. Turn the agent on with agent on or choose a specific agent: if you press tab twice after agent you should see a list of available agents. A bluetooth agent is what manages the Bluetooth ‘pairing code’. It can either respond to a ‘pairing code’ coming in, or can send one out. The default-agent should be appropriate in most cases.[1]
  6. Enter pair MAC_address to do the pairing (tab completion works).
  7. If using a device without a PIN, one may need to manually trust the device before it can reconnect successfully. Enter trust MAC_address to do so.
  8. Enter connect MAC_address to establish a connection.

An example session may look this way:

Dual boot pairing

To pair devices on dual boot setups you need to change the pairing keys manually on your Linux install, so that they match in both systems.

Setup

To do this, first pair your device on your Arch Linux install. Then reboot into the other OS and pair the device. Now you need to extract the pairing keys, but first switch off the Bluetooth devices to prevent any connection attempts.

Читайте также:  Как работает проверка подлинности windows

For Windows

Extracting on Windows

The factual accuracy of this article or section is disputed.

The registry key containing the link keys may only be accessed by the SYSTEM account, which cannot be logged into. Therefore, you will need Microsoft’s PsExec tool from the official Windows Sysinternals site in order to run regedit.exe as SYSTEM .

Download PsTools, and extract PsExe64.exe .

In an administrator instance of a command shell, from the location of the extracted EXE, launch the registry editor:

In the registry editor, navigate to the following registry key:

Within this key is a key for each Bluetooth adapter, by MAC address. If there are multiple keys, and you are unsure of which to use, follow this guide to find the MAC address for the desired Bluetooth adapter.

Within the desired device adapter key, there is a binary value for each paired device, by MAC address in the same way.

For each paired device that you wish to share between the installations, right click on the whole key and export it as a .reg file. Alternatively, you may double click on a binary value, and copy the device key in hex.

If there are LTK , ERand , and EDIV values present, this is a Bluetooth 5.1 device, and these too must be saved.

Extracting on Linux

Reboot into Arch. Install chntpw . Mount your windows system drive.

Inside the chntpw environment, run

Then get your Bluetooth adapter’s MAC address and enter its folder

Do the same for your paired devices:

Now get your device’s key through hex :

The «XX»s are the pairing key. Make note of which keys map to which MAC addresses.

In a BT5.1 Mouse, you might see this output:

Of these values, you must save LTK , ERand , and EDIV .

Preparing Bluetooth 5.1 Keys

If there were LTK , ERand , and EDIV values in the registry for the desired device, they must be converted for use with Linux. LTK corrsponds to LongTermKey.Key , ERand to Rand , EDIV to EDiv . The ERand value shound be reversed and converted to decimal. For example:

  • An LTK of 48 4D AF CD 0F 92 22 88 0A 52 9A F4 76 DA 8B 94 makes for a LongTermKey.Key of 484DAFCD0F9222880A529AF476DA8B94 .
  • An ERand of 63 02 84 B8 5D 40 44 DF makes for a Rand of 16088054540146049635 .
  • An EDIV of 37520 makes for an EDiv of 37520 .

For macOS

Boot into macOS, then open a terminal.

  • If you are on Sierra or older, run
  • If you are on High Sierra or newer, run

For older versions of macOS (High Sierra and older) you will have to reverse the keys. For example, 98 54 2f aa bb cc dd ee ff gg hh ii jj kk ll mm becomes MM LL KK JJ GG FF EE DD CC BB AA 2F 54 98 .

Copy the bt_keys.txt file to a drive that can be read from Arch Linux. Reboot into Arch Linux.

Finishing up

Now that you have the keys change user to root, then continue with:

Here you will find folders for each paired Bluetooth device. For each device you want to pair with Arch and your dual boot, do the following:

Edit the info file and change the key under [LinkKey] . E.g.:

Then restart bluetooth.service and pulseaudio (with pulseaudio -k && pulseaudio —start ).

You should be able to connect to your device now.

Configuration

Auto power-on after boot

By default, the Bluetooth adapter does not power on after a reboot, you need to add the line AutoEnable=true in the configuration file /etc/bluetooth/main.conf at the bottom in the [Policy] section:

Discoverable on startup

If the device should always be visible and directly connectable:

Wake from suspend

To allow bluetooth keyboards, mice, etc. to wake the system from suspend. First, check the bios settings and make sure that wake from USB is not disabled. In many cases, bluetooth from the motherboard is a USB device.

Find the vendor code and device ID for the bluetooth adapter

Add a new udev rule for the vendor code and device ID to enable wake from suspend

Audio

You will typically need to take an additional step to integrate the audio server with Bluetooth. This is detailed in the below sections.

See the Bluetooth headset page for more information about Bluetooth audio and Bluetooth headsets.

PulseAudio

In order to be able to use audio equipment like Bluetooth headphones or speakers, you need to install the additional pulseaudio-bluetooth package. Make sure to restart pulseaudio to make the installation take effect: pulseaudio -k . With a default PulseAudio installation you should immediately be able to stream audio from a Bluetooth device to your speakers.

If you have a system-wide PulseAudio setup make sure the user running the daemon (usually pulse ) is in the lp group and you load the Bluetooth modules in your PulseAudio config:

PipeWire

PipeWire as of v0.3.19 enables its Bluetooth support by default, see Config Bluetooth.

First, ensure that your Bluetooth audio device is correctly paired and connected to the system.

Then, install bluez-alsa-git AUR , start (and enable) the bluealsa service, and add your user to the audio group.

Run the following command to check if everything is working as intended (replace XX:XX:XX:XX:XX:XX and FILE.wav below):

Finally, add the following lines to your

You can now use the bluealsa device to reach your Bluetooth audio device. Volume management is conducted normally via alsamixer with the option -D bluealsa .

Bluetooth serial

To get Bluetooth serial communication working on Bluetooth-to-Serial modules (HC-05, HC-06) do the following steps:

Pair your Bluetooth device using bluetoothctl as described above.

Install bluez-rfcomm AUR and bluez-utils-compat AUR , as they provide certain functionality which is missing from newer tools.

Bind paired device MAC address to tty terminal:

Now you can open /dev/rfcomm0 for serial communication:

Troubleshooting

This article or section is out of date.

Debugging

In order to debug, first stop bluetooth.service .

And then start it with the -d parameter:

Another option is via the btmon tool.

Deprecated BlueZ tools

Eight BlueZ tools were deprecated and removed from bluez-utils , although not all of them were superseded by newer tools. The bluez-utils-compat AUR package provides an alternative version of bluez-utils with the deprecated tools.

Deprecated tool Most likely replacement
gatttool btgatt-client, D-Bus Gatt API
hciattach btattach
hciconfig btmgmt (and bluetoothctl?)
hcidump btmon (and btsnoop)
hcitool missing, D-Bus Device API available
rfcomm missing, implement with D-Bus Profile1 API?
ciptool
sdptool missing, functionality seems to be scattered over different D-Bus objects: Profile, Advertising, and the UUIDs arrays in device and adapter.

gnome-bluetooth

If you see this when trying to enable receiving files in bluetooth-properties:

Then make sure that the XDG user directories exist.

Bluetooth USB Dongle

If you are using a USB dongle, you should check that your Bluetooth dongle is recognized. You can do that by running journalctl -f as root when you have plugged in the USB dongle (or inspecting /var/log/messages.log ). It should look something like the following (look out for hci):

If you only get the first two lines, you may see that it found the device but you need to bring it up. Example:

To verify that the device was detected you can use btmgmt which is part of the bluez-utils . You can get a list of available devices and their identifiers and their MAC address by issuing:

It is possible to check the Bluetooth version as mapped to the HCI version according to the table in the official specification. For example, in the previous output, HCI version 6 is Bluetooth version 4.0.

More detailed information about the device can be retrieved by using the deprecated hciconfig . ( bluez-utils-compat AUR )

Audio devices start to skip at short distance from dongle

If other devices share the same USB host, they can interrupt communication with audio devices. Make sure it is the only device attached to its bus. For example:

CSR Dongle 0a12:0001

The device ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode) has a regression bug, and currently only works in the kernel version ≤ 3.9.11. There is a patch available for newer versions. For more information, see Kernel Bug 60824.

Читайте также:  Контекстное меню windows form

Logitech Bluetooth USB Dongle

There are Logitech dongles (ex. Logitech MX5000) that can work in two modes: Embedded and HCI. In embedded mode dongle emulates a USB device so it seems to your PC that you are using a normal USB mouse/keyoard.

If you hold the little red Button on the USB BT mini-receiver it will enable the other mode. Hold the red button on the BT dongle and plug it into the computer, and after 3-5 seconds of holding the button, the Bluetooth icon will appear in the system tray. Discussion

Alternatively, you can install the bluez-hid2hci package. When you connect your Logitech dongle it will automatically switch.

hcitool scan: Device not found

  • On some laptops (e.g. Dell Studio 15, Lenovo Thinkpad X1) you have to switch the Bluetooth mode from HID to HCI. Install the bluez-hid2hci package, then udev should do this automatically. Alternatively, you can run this command to switch to HCI manually:
  • If the device will not show up and you have a Windows operating system on your machine, try booting it and enable the Bluetooth adapter from windows.
  • Sometimes also this simple command helps:

bluetoothctl: No default controller available

This error may happen if the device is blocked by rfkill.

It might also happen with some intel cards (such as the 8260) to not be picked up correctly by the Bluetooth service. In some cases, using the deprecated bluez-utils-compat AUR in lieu of bluez-utils have reportedly fixed the issue.

This might also be caused by power saving measures, in which case adding the kernel parameter btusb.enable_autosuspend=n is a potential solution. See also Red Hat Bugzilla – Bug 1573562.

systemd: Condition check resulted in Bluetooth service being skipped

bluetooth.service only requires the directory /sys/class/bluetooth to exist, which should be created by kernel module bluetooth , which is only autoloaded by systemd-udev if it actually finds a working Bluetooth hardware device.

If your /sys/class/bluetooth does not exist, check if your kernel Bluetooth module is loaded by lsmod . If not, and you believe you have a Bluetooth device, you can try manually starting them by loading the Bluetooth module and restarting bluetooth.service .

You should also load your corresponding kernel Bluetooth driver when loading the bluetooth module, most likely btusb , but can also be btrtl,btintel,btbcm,bnep,btusb etc.

Check bluetooth.service ‘s unit status to see whether it started.

If bluetooth.service started successfully, but there is chance that you still cannot use Bluetooth normally (e.g. bluetoothctl says something like org.Bluez.Error.NotReady when you scan on ). If this happens, try rebooting your computer, and double-check: whether directory /sys/class/bluetooth exists; whether lsmod includes correct Bluetooth modules; log messages in the journal; etc. systemd-udev should pickup your Bluetooth hardware automatically without manual changes again.

rfkill unblock: Do not unblock

If your device still soft blocked and you run ConnMan, try this:

Computer is not visible

Enable discoverable mode if your computer cannot be discovered from your phone:

Verify that discoverable mode is on:

If the computer still does not show up, try changing the device class in /etc/bluetooth/main.conf as follows:

A user reported that this was the only solution to make their computer visible for their phone. LG TVs (and some others) are discoverable from their audio devices, so using 000414 (the soundbar class) will make such devices appear.

Foxconn / Hon Hai / Lite-On Broadcom device

Some of these devices require the firmware to be flashed into the device at boot. The firmware is not provided but can converted from a Microsoft Windows .hex file into a .hcd using hex2hcd (which is installed with bluez-utils ).

In order to get the right .hex file, try searching the device vendor:product code obtained with lsusb, for example:

Alternatively, boot into Windows (a virtual machine installation will suffice) and get the firmware name from the Device Manager utility. If you want to know the model of your device but cannot see it in lsusb, you might see it in lsusb -v as iProduct .

The .hex file can be extracted from the downloaded Windows driver without having to run Windows for it. Download the right driver, for example Bluetooth Widcomm (listed among the drivers for Lifebook P771), which contains the drivers for many Broadcomm devices. In case of Bluetooth Widcomm, the driver is a self-extracting RAR archive, so it can be extracted using unrar x. To find out which of the many .hex files is the right one for you, look in the file Win32/bcbtums-win7x86-brcm.inf and search for [RAMUSBE031.CopyList] , where E031 should be replaced with the product code (the second hex number in lsusb) of your device in upper-case. Underneath you should see the file name of the right .hex file.

Once you have the .hcd file, copy it into /lib/firmware/brcm/BCM.hcd — this filename is suggested by dmesg and it may change in your case so check your dmesg output in order to verify. Then reload the btusb module:

The device should now be available. See BBS#162688 for information on making these changes persistent.

Intel combined WiFi and Bluetooth cards

Device connects, then disconnects after a few moments

If you see messages like the following in the journal, and your device fails to connect or disconnects shortly after connecting:

This may be because you have already paired the device with another operating system using the same Bluetooth adapter (e.g., dual-booting). Some devices cannot handle multiple pairings associated with the same MAC address (i.e., Bluetooth adapters). Follow instructions on #Dual boot pairing for solving this issue.

Device does not connect with an error in journal

If you see a message like the following in the journal while trying to connect to a device:

try installing pulseaudio-bluetooth and restarting PulseAudio. This error can manifest even while using only file transfer.

Device does not show up in scan

Some devices using Bluetooth low energy do not appear when scanning with bluetoothctl, for example the Logitech MX Master. The simplest way I have found to connect them is by installing bluez-utils-compat AUR , then start bluetooth.service and do:

In another terminal:

Wait until your device shows up, then Ctrl+c hcitool. bluetoothctl should now see your device and pair normally.

If incoming file transfers fail on an an otherwise functional Bluetooth connection, the problem may be due to symlinks in your file transfer path. Logs like this would appear in the journal:

If the path shown in the error message contains a symlink, then obexd by default will not accept it. The behavior can be overridden on initialization using a drop-in file for the obex.service user service:

Then reload the systemd manager configuration of the calling user and restart the obex.service user unit.

Interference between Headphones and Mouse

If you experience audio stuttering while using a Bluetooth mouse and keyboard simultaneously, you can try the following as referenced in #23 https://bugs.launchpad.net/ubuntu/+source/bluez/+bug/424215

Bluetooth mouse laggy movements

Try edit the file /var/lib/bluetooth/XX:XX:XX:XX:XX:XX/YY:YY:YY:YY:YY:YY/info ( XX:XX:XX:XX:XX:XX — your Bluetooth adapter MAC-address, YY:YY:YY:YY:YY:YY — your mouse MAC-address) and add those lines:

You can see your local adapter MAC address by running command hcitool dev , your can see MAC addresses of currently connected remote devices by running command hcitool con

Adapter disappears after suspend/resume

First, find vendor and product ID of the adapter. For example:

In this case, the vendor ID is 8087 and the product ID is 0025.

Then, use usb_modeswitch to reset the adapter:

Problems with all BLE devices on kernel 5.9+

Starting with v5.9, the kernel Bluetooth stack tries to use link-layer privacy on BLE connections. If the device works after pairing but does not survive a reboot or suspend, it is probably because of this.

To workaround [2] this issue, open /var/lib/bluetooth/adapter_mac/device_mac/info , remove the following lines, and restart bluetooth.service :

See the relevant discussion on the Arch forum.

Problems with some Bluetooth drivers in kernel 5.10

This section is being considered for removal.

Starting with v5.10, some Qualcomm Atheros Bluetooth chipset drivers have stopped working with the following error:

See the relevant bug report on the Linux.org Bugzilla.

You can either rebuild the modules with the applied patches (btusb-210681-fix), or use an old (5.9.x) kernel. This bug was fixed in linux 5.11.arch2-1.

Источник

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