I am running LXQt under NixOS and having problems getting Bluetooth to work. My computer is a old ThinkPad T61. The configuration.nix file currently uses pipewire instead of PulseAudio. Suggestions?
Getting Bluetooth to work on an older ThinkPad T61 running LXQt under NixOS with PipeWire instead of PulseAudio can be a bit tricky, but it’s definitely possible. Here’s a step-by-step guide to help you troubleshoot and configure Bluetooth properly:
1. Ensure Bluetooth Hardware is Recognized
First, verify that your Bluetooth hardware is detected by the system. Run the following command:
lsusb
Look for a Bluetooth adapter in the output. If it’s not listed, your hardware might not be supported or could be disabled in the BIOS.
2. Enable Bluetooth Services in configuration.nix
Ensure that the necessary Bluetooth services are enabled in your configuration.nix file. Add or update the following lines:
{
hardware.bluetooth.enable = true; # Enable Bluetooth support
services.blueman.enable = true; # Optional: Blueman GUI for managing Bluetooth
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true; # Enable PipeWire PulseAudio compatibility layer
};
}
After making changes, rebuild your system:
sudo nixos-rebuild switch
3. Install Bluetooth Tools
Ensure you have the necessary Bluetooth utilities installed. Add the following to your environment.systemPackages in configuration.nix:
{
environment.systemPackages = with pkgs; [
bluez # Bluetooth protocol stack
bluez-tools # Additional Bluetooth tools
blueman # Optional: GUI for managing Bluetooth
];
}
Rebuild your system again.
4. Start and Enable Bluetooth Service
Ensure the Bluetooth service is running:
sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service
Check the status of the service:
sudo systemctl status bluetooth.service
If the service fails to start, check the logs for errors:
journalctl -u bluetooth.service
5. Configure PipeWire for Bluetooth Audio
PipeWire should handle Bluetooth audio out of the box, but ensure the following:
- The
pipewire-pulseservice is running:
systemctl --user status pipewire-pulse.service
- If not, start it:
systemctl --user start pipewire-pulse.service
6. Pair and Connect Devices
Use bluetoothctl or Blueman to pair and connect your Bluetooth devices.
Using bluetoothctl:
- Open a terminal and run:
bluetoothctl
- Turn on Bluetooth:
power on
- Enable agent:
agent on
- Scan for devices:
scan on
- Pair and connect to your device:
pair <DEVICE_MAC>
trust <DEVICE_MAC>
connect <DEVICE_MAC>
Using Blueman:
- Launch Blueman from your LXQt menu and follow the GUI to pair and connect your device.
7. Troubleshooting
- No Sound Through Bluetooth: Ensure the correct audio profile is selected. Use
pavucontrol(PulseAudio Volume Control) to check and switch the profile toA2DPfor high-quality audio orHSP/HFPfor headset functionality. - Bluetooth Device Not Found: Ensure your Bluetooth adapter is not blocked. Run:
rfkill list
If it’s blocked, unblock it:
rfkill unblock bluetooth
- Permissions Issues: Ensure your user is in the
lpgroup (required for Bluetooth):
sudo usermod -aG lp $USER