Bluetooth: Difference between revisions
imported>Pyrox0 Fix syntax highlighting |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
==Enabling Bluetooth support== | ==Enabling Bluetooth support== | ||
To enable support for Bluetooth devices, | To enable support for Bluetooth devices, amend your system configuration as follows: | ||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | |||
{ | |||
hardware.bluetooth. | ... | ||
}</ | hardware.bluetooth.enable = true; # enables support for Bluetooth | ||
hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot | |||
... | |||
} | |||
</nowiki>}} | |||
{{evaluate}} | {{evaluate}} | ||
==Pairing Bluetooth devices== | ==Pairing Bluetooth devices== | ||
In order to use Bluetooth devices, they must be paired with your NixOS machine. Heavier desktop environments will usually provide a Bluetooth management GUI which you can use to pair devices. | In order to use Bluetooth devices, they must be paired with your NixOS machine. Heavier desktop environments will usually provide a Bluetooth management GUI which you can use to pair devices. | ||
Line 86: | Line 87: | ||
===Enabling extra codecs=== | ===Enabling extra codecs=== | ||
While pulseaudio itself only has support for the SBC bluetooth codec there is out-of-tree support for AAC, APTX, APTX-HD and LDAC. | While pulseaudio itself only has support for the SBC bluetooth codec there is out-of-tree support for AAC, APTX, APTX-HD and LDAC. | ||
Line 139: | Line 137: | ||
Note that you may need to clear the pulseaudio config located at ~/.config/pulse to get this to work. Also you may have to unset and then set the default audio device to the bluetooth device, see https://github.com/NixOS/nixpkgs/issues/86441 for more info | Note that you may need to clear the pulseaudio config located at ~/.config/pulse to get this to work. Also you may have to unset and then set the default audio device to the bluetooth device, see https://github.com/NixOS/nixpkgs/issues/86441 for more info | ||
==Showing battery charge of bluetooth devices== | |||
If you want to see what charge your bluetooth devices have you have to enable experimental features, which might lead to bugs (according to [https://wiki.archlinux.org/title/Bluetooth_headset#Battery_level_reporting Arch Wiki). You can add the following to your config to enable experimental feature for bluetooth: | |||
<syntaxhighlight lang="nix">{ | |||
... | |||
hardware.bluetooth.settings = { | |||
General = { | |||
Experimental = true; | |||
}; | |||
}; | |||
... | |||
}</syntaxhighlight> | |||
Afterwards rebuild your system and then restart your bluetooth service by executing <syntaxhighlight lang="console">$ systemctl restart bluetooth</syntaxhighlight>. | |||
==Troubleshooting== | ==Troubleshooting== | ||
Line 191: | Line 202: | ||
==See also== | ==See also== | ||
* [http://anderspapitto.com/posts/2016-11-07-scripting_pulseaudio_bluetooth_jack.html Scripting PulseAudio, Bluetooth, JACK] | * [http://anderspapitto.com/posts/2016-11-07-scripting_pulseaudio_bluetooth_jack.html Scripting PulseAudio, Bluetooth, JACK] | ||
* [https://wiki.gentoo.org/wiki/Bluetooth Bluetooth (Gentoo Wiki)] | |||
* [https://wiki.archlinux.org/index.php/Bluetooth Bluetooth (Arch Linux Wiki)] | * [https://wiki.archlinux.org/index.php/Bluetooth Bluetooth (Arch Linux Wiki)] | ||
[[Category:Audio]][[Category:Configuration]][[Category:Hardware]] | [[Category:Audio]][[Category:Configuration]][[Category:Hardware]] |