Nix channel 23.11: bluez and bluezFull

In channel NixOS 23.05, bluezFull worked, and all the bluez plugins worked great.

In channel NixOS 23.11, it’s indicated that 'bluezFull' has been renamed to/replaced by 'bluez' , however, bluez plugins are not working for me.

This is apparent when I try to connect a Playstation 4 controller via bluetooth. I am able to pair the bluetooth controller, but it does not work, and immediately the controller turns off.

Is it confirmed that bluez is the sole replacement of bluezFull, including all the bluezFull Plugins?
Is there a way to manually add all bluez plugins? I guess it’s one of the Nix pkgs.
Or, what would be the best solution? Switching back to NixOS channel 23.05?

The following error occurs when you try to build with pkgs.bluezFull:

error:
       … while calling the 'head' builtin

         at /nix/store/59idipklvxzlzf6p4jdz9j1gf0r404j1-nixos-23.11/nixos/lib/attrsets.nix:922:11:

          921|         || pred here (elemAt values 1) (head values) then
          922|           head values
             |           ^
          923|         else

       … while evaluating the attribute 'value'

         at /nix/store/59idipklvxzlzf6p4jdz9j1gf0r404j1-nixos-23.11/nixos/lib/modules.nix:807:9:

          806|     in warnDeprecation opt //
          807|       { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          808|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: 'bluezFull' has been renamed to/replaced by 'bluez'

1 Like

I am not really sure at this point if bluezFull was a separate derviation / package in 23.05. In fact it appears to have been an alias for bluez. I found this line in the aliases.nix of the 23.05 release:

bluezFull = bluez; # Added 2019-12-03

That would indicate the problem might be located elsewhere?

bluezFull doesn’t exist since bluez: 5.50 -> 5.52 by Moredread · Pull Request #74995 · NixOS/nixpkgs · GitHub and until 23.11 you where using an alias which was equivalent to bluez.

@Sandro

I see. I also searched the Nix pkgs and couldn’t find it, because like you said, it doesn’t exist.

I initially followed this guide to have bluezFull installed while I was using 23.05: functor.tokyo -- PlayStation 3/4 Controller Over Bluetooth on NixOS

Since the alias isn’t connecting to the “bluezFull” that I once used in 23.05, any idea how I can continue to use “bluezFull” while in 23.11? Should I switch channels from 23.11 to 23.05 (deprecated)?

Or is there a better way to force install this alias pkg?

well @nPrevail the problem might not have anything to do with bluez vs bluezFull. If you check the old article you linked, the author mentions the possibility of building bluez with the --enable-sixaxis flag. If you check the current derivation of bluez, you’ll see this flag is already applied by default currently. So whatever bluezFull was doing back in 2018, it should be done be default now,

Or is there a better way to force install this alias pkg?

You can of course create an overlay with an old version of nixpkgs to the get old version of bluez in the hope that this might resolve the issue.


However, in the meantime, I normally don’t ping people directly, in particular during Christmas, @cdepillabout, but this here appears to be based on an article you once wrote back in 2018. Maybe you have an idea why @nPrevail can no longer use his bluetooth PS4 controller since 23.11?

Got it.

I didn’t write the article in the aforementioned link. It’s something I found that worked while I was on 23.05.

Yes, I pinged the author of the article, as he is quite active here on this discourse forum :slight_smile:

But sadly the bluez package for NixOS doesn’t seem to have any active maintainers. So it isn’t clear whom to ask on this,

It might also be some regression bug in bluez. The package was upgraded from 5.66 to 5.70 between 23.05 and 23.11. You could try to downgrade that and see if that does anything.

I am able to pair the bluetooth controller, but it does not work, and immediately the controller turns off

Are you using Agent NoInputNoOutput I’m fairly sure I’ve connected a PS4 controller in the past and it sometimes helps to use that agent. I’m assuming you’re using bluetoothctl from the article linked. Might be worth checking the journal logs as well journalctl -u bluetooth.service

1 Like

Hi,

I have the exact same issue after upgrading to 23.11, my PS4 controller will pair, but on connection will disconnect 1 second later.
The controller would connect and be stable on 23.05. Once updated to 23.11 nixos will not stay connected.
I have tested the controller is working normally by connecting to my Chromecast with Google TV, on this the controller pairs and connects successfully

@nPrevail did you find a working solution to re-enable your PS4 controller?
Thanks

Kind of…

Quick update to everyone:
My PS4 controller works with bluez… AFTER I pair and then reboot the computer.

So here’s the steps:

  1. Pair PS4 controller via bluetooth
  2. Controller will blink a WHITE light few times until the white light stays solid.
  3. On my settings, it’ll show that the “wireless controller” is connected, but once the controller stops showing the solid WHITE light, wireless controller will be “disconnected.” (this is fine)
  4. THEN, reboot the computer.
  5. After reboot, the next time you turn on the PS4 controller, it will connect and pair normally, and will shine a BLUE light instead.

If you have multiple PS4 controllers, I’d recommend pairing ALL of them, one after the other, and then reboot.

This honestly is quite annoying. It used to be pair-able without needing to reboot. I can only hope that someone solves the issue.

I haven’t tested this with my PS5 controller yet.

1 Like

FWIW I’ve gotten my PS5 to connect without rebooting and it reconnects without issue as well. Sadly, Steam can’t detect it though :thinking:

Edit: Ah, I got steam to pick up the PS5 controller (sorry, this might be off topic a bit and these extra udev rules might be needless…) but anyway:

  services.udev.extraRules = ''
    # PS5 DualSense controller over USB hidraw
    KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ce6", MODE="0660", TAG+="uaccess"

    # PS5 DualSense controller over bluetooth hidraw
    KERNEL=="hidraw*", KERNELS=="*054C:0CE6*", MODE="0660", TAG+="uaccess"
  '';

in my configuration.nix and (one) reboot for the rules to take and the PS5 controller connects over Bluetooth and reconnects without issue and appears in steam now.

I’m on 24.05 (I’m doubtful anything major has changed since 23.11 but can’t be sure).

It might be worth checking dmesg for anything useful about the controller. I messed with an Xbox One controller that was connecting and disconnecting after initial pairing (Bluetooth is finicky). Here’s some example output:

[  661.975591] input: DualSense Wireless Controller Touchpad as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-8/1-8.2/1-8.2:1.0/bluetooth/hci0/hci0:256/0005:054C:0CE6.0009/input/input30
[  661.975931] playstation 0005:054C:0CE6.0009: Registered DualSense controller hw_version=0x00000313 fw_version=0x01090002
[  940.375983] hid-generic 0005:045E:02FD.000A: unknown main item tag 0x0
[  940.375988] hid-generic 0005:045E:02FD.000A: unknown main item tag 0x0
[  940.376121] input: Xbox Wireless Controller as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-8/1-8.2/1-8.2:1.0/bluetooth/hci0/hci0:512/0005:045E:02FD.000A/input/input31
[  940.376238] input: Xbox Wireless Controller Consumer Control as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-8/1-8.2/1-8.2:1.0/bluetooth/hci0/hci0:512/0005:045E:02FD.000A/input/input32
[  940.376320] hid-generic 0005:045E:02FD.000A: input,hidraw7: BLUETOOTH HID v9.03 Gamepad [Xbox Wireless Controller] on 10:3d:1c:ae:e3:ad
[  940.423607] microsoft 0005:045E:02FD.000A: unknown main item tag 0x0
[  940.423610] microsoft 0005:045E:02FD.000A: unknown main item tag 0x0
[  940.423716] input: Xbox Wireless Controller as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-8/1-8.2/1-8.2:1.0/bluetooth/hci0/hci0:512/0005:045E:02FD.000A/input/input33
[  940.423804] microsoft 0005:045E:02FD.000A: input,hidraw7: BLUETOOTH HID v9.03 Gamepad [Xbox Wireless Controller] on 10:3d:1c:ae:e3:ad

also try journalctl -ru bluetooth.service I had failed to mention the -r flag earlier. There might be some useful error in there.

I can’t seem to find my PS4 controller so I can’t test that one :face_with_diagonal_mouth:

Hi - Thank you the reboot tip. I did exactly the same and it worked

  • Pair - try to connect, connects/disconnects.
  • reboot with controller powered on
  • host starts connected and stays connected to controller

by way of update - the reboot trick stopped working for me, which led to a few hours of frustration.
I went down a rabbit hole of both upgrading and downgrading bluez to versions:

  • 5.66 (from nixos 23.05)
  • 5.68 ( noted in arch forums as working as a downgrade for user with same issue on 5.7)
  • 5.71 (latest and said to help ps4 issue in an arch forums thread)

None of the above worked for me, the controller will pair but will connect/disconnect same second when try to connect.

I ended up booting in grub back to a 23.05 release (thank you nixos for this built in time-machine) - added the controller, it pairs and connects and is stable.

No further forward, but ill stick on 23.05 as works perfectly for me.

That said - i can anytime boot into 23.11 and i can run commands/help debug, or even give a shell if another wants to take a look help debug for others.

No further forward, but ill stick on 23.05 as works perfectly for me.

Did you consider making an overlay just for certain packages from 23.05 (i.e. bluez)? Because 23.05 is going to be end-of-life at some point.

Are you sure this is entirely related to the version of bluez?

I’ve stuck to using this:

hardware.bluetooth = {
enable = true;
package = pkgs.bluez;
};

After I pair PS4 controllers, they do instantly turn off. But when I reboot the system, they connect and work with no issues. This is my basic work around for now.

As @APCodes mentioned, I figured that 23.05 will reach its end-of-life, so I figured to stick to 23.11 and with this “faux” work-around.

1 Like

I was able to fix the same issue with my PS3 controller by disabling the ClassicBondedOnly option.

    hardware.bluetooth = {
      enable = true;
      input.General.ClassicBondedOnly = false;
    };

Credits to https://askubuntu.com/questions/1497783/why-does-official-ps3-bluetooth-controller-no-longer-work-and-pin-code-suddenly

1 Like

Whilst absolutely not a fix i found the 8bit-do usb wireless adapter 2 works a treat - $20, you pair to the dongle not the laptop, the ds4 is then presented as a wired controller.
For bonus points - can unplug the controller and put in a switch, laptop, pc etc no need to repair.

As an aside, or rather more on point - I had success in arch with blues 5.73. But the adapter works too flawlessly for me to spend more time digging into the issue - but hopeful next release the problem goes away naturally