Are BLE/LC3 supported?

I’m super new to NixOS, and this is something that I had issues setting up on other distros too, what I want to do is to enable Bluetooth LE audio connections and LC3 (or LC3+) codec support on Pipewire and Bluez:

Is it something that can be enabled through the NixOS config? Has someone managed to do so either through it or through workarounds? I’m running NixOS 24.05 with latest kernel (6.11) and unstable channel

1 Like

*NixOS, not nix. (I’m not being pedantic for its own sake, if you search “nix manual” you will literally get unhelpful results if you’re trying to configure the distro.)

Anyway, to answer your question: can you? yes, if you can do it on any other distro, it’s doable here. How easy is it? Well… if you look at the plethora of prerequisites, first off, do you have an adapter and device that even support it? And if so, then you’ll need to set the BT config as mentioned.

Luckily for you, LC3 support is enabled by default in the nixpkgs build of PW, so you don’t have to suffer through waiting for thousands of packages to rebuild:

Anyway please share what you tried first, or where you are stuck, and you will get better answers.

2 Likes

Thanks for the correction and the suggestions, I’ve edited the post to reflect the correct operating system.

do you have an adapter and device that even support it?

I have two pci cards supporting BLE, one from Intel (AX210) and the other from Mediatek (MT922), both are able to see the LE devices (a keyboard and a a pair of Creative earbuds) but can’t connect to the BLE interfaces, which works fine on an Android Phone. In both adapters, the output from btmgmt info shows the correct flags.

Luckily for you, LC3 support is enabled by default in the nixpkgs build of PW

That’s great to know!

Anyway please share what you tried first, or where you are stuck, and you will get better answers.

Honestly, I don’t know how to approach this on NixOS, I could probably just edit /etc/bluetooth/main.conf to include the settings on the guide and look for a kernel that already has the required patches, unless they’re on 6.11. I don’t have technical knowledge on the topic and there might be a “NixOS way” to approach this through the config file.

Use hardware.bluetooth.settings instead

https://search.nixos.org/options?channel=24.05&show=hardware.bluetooth.settings&from=0&size=50&sort=relevance&type=packages&query=bluetooth

For example here you’d need at least

 hardware.bluetooth = {
    enable = true;
    settings = {
       General = {
         ControllerMode = "le";
         Experimental = true;
       };
    };
  };
2 Likes

Thenk you,

  hardware.bluetooth = {
    enable = true;
    powerOnBoot = true;
    settings = {
       General = {
         ControllerMode = "le";
         Experimental = true;
       };
    };
  };

has made the devices pair as BLE but when trying to connect after pairing it just instantly disconnects with no messages on bluetoothctl, I suppose it can be due to the feature being experimental, I’ll rollback for now as with this enabled, normal mode doesn’t seem to work with the earbuds, the keyboard connects and works fine both ways. I really appreciate the help given

Hi everyone

I’m trying to connect to my Sony inzone buds via bluetooth on my Tuxedo Pulse 14 Gen 4 laptop.

I get this in dmesg:

[ 1918.086826] Bluetooth: hci0: Opcode 0x2013 failed: -22
[ 1923.442711] Bluetooth: hci0: Opcode 0x2013 failed: -22

There is a message for each earphone, they show up separately in bluetooth settings and I can connect to them separately.

When I click connect there is a sound in the earpiece to signal the connection, however they don’t show up in the list of audio devices.

I added this to my NixOS config but it didn’t make a difference:

{
  hardware.bluetooth = {
    enable = true;
    settings = {
      General = {
        ControllerMode = "le";
        Experimental = true;
      };
    };
  };
}

On the Tuxedo website this laptop is listed as supporting Bluetooth 5.3

Audio - of course - doesn’t come through the earbuds, which makes sense since they cannot even be selected.

I’m on the same boat - I got a PCI AX210 so I know that it supports the protocol and the Sony WH-1000XM6 support the protocol as well.

The headset shows the UUID: Published Audio Capabil.. (00001850-0000-1000-8000-00805f9b34fb) through bluetoothctl info but the controller doesn’t

The pipewire docs say that this is probably due to pipewire or bluez not being compiled with LC3 support.

It’s noteworthy that in order to even reach the state for the headset to advertised the LE Audio interface I had to scan le (instead of scan on since I wanted to keep hardware.bluetooth.settings.General.ControllerMode = "dual") from bluetoothctl and pair + connect to that “new”, LE-only device. it has a different MAC than the regular APT/LDAC device.

The end result is: I connect to the headphones over LE but pipewire does nothing about it, no audio profile selection menu in the bluetooth gui and no source/sink

here’s some interesting bluetooth.service logs:

Sep 17 19:58:07 desktop bluetoothd[29051]: profiles/audio/bap.c:bap_adapter_probe() BAP requires ISO Socket which is not enabled
Sep 17 19:58:07 desktop bluetoothd[29051]: bap: Operation not supported (95)
Sep 17 19:58:07 desktop bluetoothd[29051]: profiles/audio/avrcp.c:avrcp_controller_server_probe() Unable to register AVRCP service record
Sep 17 19:58:07 desktop bluetoothd[29051]: avrcp-controller: Operation not permitted (1)
Sep 17 19:58:07 desktop bluetoothd[29051]: profiles/audio/avrcp.c:avrcp_target_server_probe() Unable to register AVRCP target service record
Sep 17 19:58:07 desktop bluetoothd[29051]: audio-avrcp-target: Operation not permitted (1)
Sep 17 19:58:07 desktop bluetoothd[29051]: src/profile.c:ext_register_record() Failed to register service record
Sep 17 19:58:07 desktop bluetoothd[29051]: src/profile.c:ext_register_record() Failed to register service record
Sep 17 19:58:07 desktop bluetoothd[29051]: src/profile.c:ext_register_record() Failed to register service record
Sep 17 19:58:07 desktop bluetoothd[29051]: src/profile.c:ext_register_record() Failed to register service record
Sep 17 19:58:07 desktop bluetoothd[29051]: src/profile.c:ext_register_record() Failed to register service record
Sep 17 19:58:07 desktop bluetoothd[29051]: src/profile.c:ext_register_record() Failed to register service record
Sep 17 19:58:07 desktop bluetoothd[29051]: src/profile.c:ext_register_record() Failed to register service record
Sep 17 19:58:07 desktop bluetoothd[29051]: profiles/audio/bap.c:bap_probe() BAP requires ISO Socket which is not enabled
Sep 17 19:58:07 desktop bluetoothd[29051]: src/service.c:service_probe() bap profile probe failed for 80:99:E7:F0:C1:99
Sep 17 19:58:07 desktop bluetoothd[29051]: Failed to set mode: Not Supported (0x0c)
...
Sep 17 19:58:07 desktop bluetoothd[29051]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110a-0000-1000-8000-00805f9b34fb
Sep 17 19:58:07 desktop bluetoothd[29051]: profiles/audio/media.c:app_register_endpoint() Unable to register endpoint :1.184:/MediaEndpoint/A2DPSource/opus_05_duplex: Success
Sep 17 19:58:07 desktop bluetoothd[29051]: profiles/audio/media.c:client_ready_cb() No valid external Media objects found
Sep 17 19:58:07 desktop bluetoothd[29051]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110a-0000-1000-8000-00805f9b34fb
Sep 17 19:58:07 desktop bluetoothd[29051]: profiles/audio/media.c:media_endpoint_create() Unable initialize endpoint for UUID 0000110b-0000-1000-8000-00805f9b34fb
Sep 17 19:58:09 desktop bluetoothd[29051]: profiles/battery/battery.c:parse_battery_level() Trying to update an unregistered battery
Sep 17 19:58:09 desktop bluetoothd[29051]: profiles/audio/bap.c:bap_probe() BAP requires ISO Socket which is not enabled
Sep 17 19:58:09 desktop bluetoothd[29051]: src/service.c:service_probe() bap profile probe failed for 80:99:...