<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rqpt</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rqpt"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/Rqpt"/>
	<updated>2026-04-25T22:40:42Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Bluetooth&amp;diff=27464</id>
		<title>Bluetooth</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Bluetooth&amp;diff=27464"/>
		<updated>2024-10-05T19:20:33Z</updated>

		<summary type="html">&lt;p&gt;Rqpt: Suggest installing pipewire-spa-bluez to solve pairing failure issue - worked for me&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft|work in progress}}&lt;br /&gt;
&lt;br /&gt;
[https://en.wikipedia.org/wiki/Bluetooth Bluetooth] is a standard for the short-range wireless interconnection of cellular phones, computers, and other electronic devices. [https://www.bluez.org/ BlueZ] is an implementation of the Bluetooth protocol stack for Linux, and it is provided by the {{Pkg|bluez}} package.&lt;br /&gt;
&lt;br /&gt;
This article describes the basic installation of Bluetooth controllers and devices.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites and Basic Installation ==&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
{{todo|test bluetooth with [[mdev]]}}&lt;br /&gt;
&lt;br /&gt;
{{Pkg|eudev}} should be installed and setup:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# setup-devd udev}}&lt;br /&gt;
&lt;br /&gt;
=== Basic Installation ===&lt;br /&gt;
&lt;br /&gt;
Basic installation is as follows:&lt;br /&gt;
&lt;br /&gt;
# Install {{Pkg|bluez}}&lt;br /&gt;
#* Optionally install {{Pkg|bluez-deprecated}} if you need deprecated tools like &amp;lt;code&amp;gt;hcitool&amp;lt;/code&amp;gt;&lt;br /&gt;
# Load the &amp;lt;code&amp;gt;btusb&amp;lt;/code&amp;gt; kernel module&lt;br /&gt;
# Add user to the &amp;lt;code&amp;gt;lp&amp;lt;/code&amp;gt; group&lt;br /&gt;
# Start and enable the Bluetooth service&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add bluez&lt;br /&gt;
&amp;amp;#35; apk add bluez-deprecated&lt;br /&gt;
&amp;amp;#35; modprobe btusb&lt;br /&gt;
&amp;amp;#35; adduser $USER lp&lt;br /&gt;
&amp;amp;#35; rc-service bluetooth start&lt;br /&gt;
&amp;amp;#35; rc-update add bluetooth default}}&lt;br /&gt;
&lt;br /&gt;
Now, check the state of the Bluetooth radio transmitter using &amp;lt;code&amp;gt;rfkill&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|$ rfkill list bluetooth}}&lt;br /&gt;
&lt;br /&gt;
It should return something similar to:&lt;br /&gt;
&lt;br /&gt;
 0: hci0: Bluetooth&lt;br /&gt;
         Soft blocked: no&lt;br /&gt;
         Hard blocked: no&lt;br /&gt;
&lt;br /&gt;
If the device is listed as blocked, it can be unblocked using the same tool:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# rfkill unblock bluetooth}}&lt;br /&gt;
&lt;br /&gt;
{{Note|It may be necessary to restart the Bluetooth service before continuing.}}&lt;br /&gt;
&lt;br /&gt;
=== Front-ends ===&lt;br /&gt;
&lt;br /&gt;
There are several front-ends available:&lt;br /&gt;
&lt;br /&gt;
* The {{Pkg|bluez}} comes with the &amp;lt;code&amp;gt;bluetoothctl&amp;lt;/code&amp;gt; front-end&lt;br /&gt;
* {{Pkg|blueman}}: a full-featured Bluetooth manager&lt;br /&gt;
* {{Pkg|bluedevil}}: the [[KDE]] Bluetooth manager&lt;br /&gt;
* {{Pkg|bluetuith}}: simple text-based bluetooth management user interface&lt;br /&gt;
* {{Pkg|gnome-bluetooth}}: the [[GNOME]] Bluetooth manager&lt;br /&gt;
&lt;br /&gt;
== Pairing ==&lt;br /&gt;
&lt;br /&gt;
=== Using &amp;lt;code&amp;gt;bluetoothctl&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Begin by starting &amp;lt;code&amp;gt;bluetoothctl&amp;lt;/code&amp;gt; and follow these basic steps:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|$ bluetoothctl}}&lt;br /&gt;
&lt;br /&gt;
The prompt should display:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;#&lt;br /&gt;
&lt;br /&gt;
List the available controllers:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# list&lt;br /&gt;
&lt;br /&gt;
Display information about a controller:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# show &#039;&#039;controller_mac_address&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Set the default controller:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# select &#039;&#039;controller_mac_address&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Power on the controller:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# power on&lt;br /&gt;
&lt;br /&gt;
Enable the agent and set it as default:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# agent on&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# default-agent&lt;br /&gt;
&lt;br /&gt;
Set the controller as discoverable (temporarily for 3 minutes) and pairable:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# discoverable on&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# pairable on&lt;br /&gt;
&lt;br /&gt;
Scan for devices:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# scan on&lt;br /&gt;
&lt;br /&gt;
Put the device into pairing mode. This generally involves pressing a button or a combinations of buttons, usually for several seconds.&lt;br /&gt;
&lt;br /&gt;
Discover the device MAC address:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# devices&lt;br /&gt;
&lt;br /&gt;
Pair with the device:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# pair &#039;&#039;device_mac_address&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Enter the PIN if prompted:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:red;&amp;quot;&amp;gt;[agent]&amp;lt;/span&amp;gt; PIN code: ####&lt;br /&gt;
&lt;br /&gt;
Trust the device:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# #trust &#039;&#039;device_mac_address&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Connect to the device:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# connect &#039;&#039;device_mac_address&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Display information about the device:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# info &#039;&#039;device_mac_address&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The device is now paired:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# quit&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Set adapter power state ===&lt;br /&gt;
&lt;br /&gt;
If you would like the adapter to not be automatically enabled (e.g. on a portable device where you wish to save battery), set &amp;lt;code&amp;gt;AutoEnable=false&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;/etc/bluetooth/main.conf&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;[Policy]&amp;lt;/code&amp;gt; section:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/bluetooth/main.conf|[Policy]&lt;br /&gt;
...&lt;br /&gt;
AutoEnable&amp;amp;#61;false&lt;br /&gt;
...}}&lt;br /&gt;
&lt;br /&gt;
=== Battery Reporting ===&lt;br /&gt;
&lt;br /&gt;
An experimental feature can be enabled in order to report device battery level:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/bluetooth/main.conf|[General]&lt;br /&gt;
...&lt;br /&gt;
Experimental&amp;amp;#61;true&lt;br /&gt;
...}}&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
Due to the variety of available Bluetooth hardware it is possible that you receive errors while attempting to install, activate, or find your Bluetooth device.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;No default controller available&amp;quot; error ===&lt;br /&gt;
&lt;br /&gt;
After having followed these instructions, or others, you run &amp;lt;code&amp;gt;bluetoothctl&amp;lt;/code&amp;gt; and encounter the following scenario:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# list&lt;br /&gt;
 &amp;lt;span style=&amp;quot;color:blue;&amp;quot;&amp;gt;[bluetooth]&amp;lt;/span&amp;gt;# show&lt;br /&gt;
 No default controller available&lt;br /&gt;
&lt;br /&gt;
One possible solution is that you are missing firmware drivers.&lt;br /&gt;
&lt;br /&gt;
Try running the following command to discover the source of the issue:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# dmesg &amp;amp;#124; grep -i bluetooth &amp;amp;#124; grep -i firmware}}&lt;br /&gt;
&lt;br /&gt;
There are many firmware packages available that could likely solve the this problem (see {{Pkg|linux-firmware-*}}).&lt;br /&gt;
&lt;br /&gt;
Another possible solution is to install {{Pkg|hidapi}} and add load the module:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# apk add hidapi&lt;br /&gt;
&amp;amp;#35; modprobe uhid}}&lt;br /&gt;
&lt;br /&gt;
It may also be necessary to create configuration to load the uhid and btusb kernel modules on boot:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cat &amp;lt;&amp;lt;EOF &amp;gt; /etc/modules-load.d/uhid.conf&lt;br /&gt;
&amp;amp;#35;Load uhid kernel module:&lt;br /&gt;
uhid&lt;br /&gt;
EOF}}&lt;br /&gt;
&lt;br /&gt;
{{Cmd|cat &amp;lt;&amp;lt;EOF &amp;gt; /etc/modules-load.d/btusb.conf&lt;br /&gt;
&amp;amp;#35;Load btusb kernel module:&lt;br /&gt;
btusb&lt;br /&gt;
EOF}}&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;org.bluez.Error.NotAvailable br-connection-profile-unavailable&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
The error &amp;lt;code&amp;gt;br-connection-profile-unavailable&amp;lt;/code&amp;gt; is sometimes produced when trying to connect a Bluetooth HID device but the &amp;lt;code&amp;gt;uhid&amp;lt;/code&amp;gt; kernel module is not loaded. HID devices include keyboards and the volume buttons on headphones (which are sometimes presented to the OS as a keyboard), mice, game controllers, alphanumeric displays, etc.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;uhid&amp;lt;/code&amp;gt; kernel module is required for USB HID devices with drivers that are implemented in userspace, when userspace HID support is enabled.&lt;br /&gt;
&lt;br /&gt;
Loading &amp;lt;code&amp;gt;uhid&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;modprobe&amp;lt;/code&amp;gt; after encountering this error does not always fix the problem.&lt;br /&gt;
&lt;br /&gt;
Try setting up &amp;lt;code&amp;gt;uhid&amp;lt;/code&amp;gt; to load at boot, and then rebooting:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|# cat &amp;lt;&amp;lt;EOF &amp;gt; /etc/modules-load.d/uhid.conf&lt;br /&gt;
&amp;amp;#35;Load uhid kernel module:&lt;br /&gt;
uhid&lt;br /&gt;
EOF&lt;br /&gt;
&amp;amp;#35; reboot}}&lt;br /&gt;
&lt;br /&gt;
Alternatively, the userspace HID feature can be disabled entirely in favour of kernel HIDP drivers in &amp;lt;code&amp;gt;/etc/bluetooth/input.conf&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{{Cmd|1=UserspaceHID=false}}&lt;br /&gt;
&lt;br /&gt;
If running pipewire, you may also try installing {{Pkg|pipewire-spa-bluez}} to see if that solves the issue.&lt;br /&gt;
&lt;br /&gt;
=== Unable to control Bluetooth speaker volume / Bluetooth output is muted (Pulseaudio) ===&lt;br /&gt;
&lt;br /&gt;
It is possible to automatically switch audio output and volume control to last connected device.&lt;br /&gt;
&lt;br /&gt;
This can solve the problem of controlling the speaker volume when switching between Bluetooth devices.&lt;br /&gt;
&lt;br /&gt;
Append the following lines at the end of the {{Path|/etc/pulse/default.pa}}:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Cat|/etc/pulse/default.pa|...&lt;br /&gt;
&amp;amp;#35;##Automatically switch audio to the most recently connected device (Bluetooth, HDMI, USB)&lt;br /&gt;
load-module module-switch-on-connect}}&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[PulseAudio#Bluetooth|PulseAudio with Bluetooth]]&lt;br /&gt;
* [[PipeWire#Bluetooth_audio|PipeWire with Bluetooth]]&lt;br /&gt;
* [https://wiki.postmarketos.org/wiki/Bluetooth Bluetooth entry on PostmarketOS Wiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Bluetooth Bluetooth entry on Gentoo Wiki]&lt;br /&gt;
* [https://wiki.archlinux.org/title/Bluetooth Bluetooth entry on ArchWiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Multimedia]]&lt;br /&gt;
[[Category:Hardware]]&lt;br /&gt;
[[Category:Sound]]&lt;br /&gt;
[[Category:Drivers]]&lt;/div&gt;</summary>
		<author><name>Rqpt</name></author>
	</entry>
</feed>