nixos/hardware.facter.detected.bluetooth: bluetooth detection doesn't support USB hardware

Open Beginner friendly
#514,966 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet

Research direction

Search for the nixos/hardware.facter.detected.bluetooth definition and read how it currently checks the facter report. Use the supplied facter JSON to verify detection when a USB entry has driver or driver_module set to btusb, while preserving existing Bluetooth detection behavior.

Written by the indexing model from the issue text.

Description

0.kind: bug 6.topic: nixos
Nixpkgs version
  • Unstable (26.05)
Describe the bug

Facter detection looks for contents in config.hardware.facter.report.hardware.bluetooth.

For some laptops, bluetooth hardware is an internal USB module but doesn't appears in facter's JSON hardware.bluetooth.
In this case, the detection should also check for btusb driver in config.hardware.facter.report.hardware.usb:

      bluetooth_hardware = 0 < builtins.length (config.hardware.facter.report.hardware.bluetooth or [ ]);

      bluetooth_usb = lib.any (
        {
          driver ? null,
          driver_module ? null,
          ...
        }:
        driver == "btusb" || driver_module == "btusb"
      ) (config.hardware.facter.report.hardware.usb or [ ]);

      bluetooth_detected = bluetooth_hardware || bluetooth_usb;
Steps to reproduce

Use this facter json:

{
  "hardware": {
    "usb": [
      {
        "index": 29,
        "attached_to": 34,
        "class_list": [
          "usb",
          "unknown"
        ],
        "bus_type": {
          "hex": "0086",
          "name": "USB",
          "value": 134
        },
        "slot": {
          "bus": 0,
          "number": 0
        },
        "base_class": {
          "hex": "0000",
          "name": "Unclassified device",
          "value": 0
        },
        "sub_class": {
          "hex": "0000",
          "name": "Unclassified device",
          "value": 0
        },
        "vendor": {
          "hex": "0a5c",
          "name": "Broadcom Corp",
          "value": 2652
        },
        "device": {
          "hex": "216c",
          "name": "BCM43142A0",
          "value": 8556
        },
        "revision": {
          "hex": "0000",
          "name": "1.12",
          "value": 0
        },
        "serial": "7429AFFE2B38",
        "model": "Broadcom BCM43142A0",
        "sysfs_id": "/devices/pci0000:00/0000:00:1d.3/usb4/4-2/4-2:1.0",
        "sysfs_bus_id": "4-2:1.0",
        "resources": [
          {
            "type": "baud",
            "speed": 12000000,
            "bits": 0,
            "stop_bits": 0,
            "parity": 0,
            "handshake": 0
          }
        ],
        "detail": {
          "device_class": {
            "hex": "00ff",
            "name": "vendor_spec",
            "value": 255
          },
          "device_subclass": {
            "hex": "0001",
            "name": "audio",
            "value": 1
          },
          "device_protocol": 1,
          "interface_class": {
            "hex": "00ff",
            "name": "vendor_spec",
            "value": 255
          },
          "interface_subclass": {
            "hex": "0001",
            "name": "audio",
            "value": 1
          },
          "interface_protocol": 1,
          "interface_number": 0,
          "interface_alternate_setting": 0
        },
        "hotplug": "usb",
        "driver": "btusb",
        "driver_module": "btusb",
        "drivers": [
          "btusb"
        ],
        "driver_modules": [
          "btusb"
        ],
        "module_alias": "usb:v0A5Cp216Cd0112dcFFdsc01dp01icFFisc01ip01in00"
      }
    ]
  }
}
Expected behaviour

btusb module presence in usb hardware should enable bluetooth hardware support.

Screenshots

No response

Relevant log output

Additional context

My hardware is an old USB hardware (Broadcom BCM43142A0) requiring a proprietary driver. But the issue might be relevant for other Bluetooth USB controllers.

System metadata

Hardware not available at the time of writing

Notify maintainers

@Mic92


Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)

I assert that this issue is relevant for Nixpkgs
Is this issue important to you?

Add a 👍 reaction to issues you find important.

Dominant language
Nix
Stars
26.2k
Forks
20.1k
Avg merge
14h 6m
Merged PRs (30d)
584

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from NixOS/nixpkgs

All issues in NixOS/nixpkgs

Similar issues

More Operating Systems issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.