Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2797

Built WSL do not include bluetooth controller of Mediatek

$
0
0

I have WSL and want to manage bluetooth from within it.

I've followed this instruction to build the custom WSL, including all the required checks into .config file.

Here's the latest .config file content that built the latest WSL firmware: https://pastebin.com/5CBrBf7c

And have used usbipd to share and attach the bluetooth device through:

  • usbipd bind --busid={BUSID}
  • usbipd attach --wsl --busid={BUSID}

Where both run successfully, and:

  • usbipd list gives:
Connected:BUSID  VID:PID    DEVICE                                                        STATE1-9    0e8d:0608  RZ608 Bluetooth(R) Adapter                                    Attached1-10   0b05:1939  AURA LED Controller, USB Input Device                         Not shared2-3    045e:07a5  USB Input Device                                              Not shared2-4    045e:0745  Microsoft Hardware USB Keyboard, USB Input Device             Not shared

However, running bluetoothctl scan on result in No default controller available.

My finding concludes that btmtk module is missing within the system. And I don't know how to find/have/run it.

From my research I've registered many useful commands, here's the outputs of them:

  • uname -a:
Linux HamzaHajeir 5.15.153.1-microsoft-standard-WSL2+ #3 SMP Sun Sep 15 23:57:54 +03 2024 x86_64 x86_64 x86_64 GNU/Linux
  • lsb_release -a
No LSB modules are available.Distributor ID: UbuntuDescription:    Ubuntu 24.04.1 LTSRelease:        24.04Codename:       noble
  • systemctl status bluetooth:
● bluetooth.service - Bluetooth service     Loaded: loaded (/usr/lib/systemd/system/bluetooth.service; enabled; preset: enabled)     Active: active (running) since Mon 2024-09-16 00:05:39 +03; 19h ago       Docs: man:bluetoothd(8)   Main PID: 485 (bluetoothd)     Status: "Running"      Tasks: 1 (limit: 9470)     Memory: 2.3M ()     CGroup: /system.slice/bluetooth.service└─485 /usr/libexec/bluetooth/bluetoothdSep 16 00:05:39 HamzaHajeir bluetoothd[485]: src/plugin.c:plugin_init() System does not support csip pluginSep 16 00:05:39 HamzaHajeir bluetoothd[485]: profiles/audio/micp.c:micp_init() D-Bus experimental not enabledSep 16 00:05:39 HamzaHajeir bluetoothd[485]: src/plugin.c:plugin_init() System does not support micp pluginSep 16 00:05:39 HamzaHajeir bluetoothd[485]: src/plugin.c:plugin_init() System does not support vcp pluginSep 16 00:05:39 HamzaHajeir bluetoothd[485]: src/plugin.c:plugin_init() System does not support mcp pluginSep 16 00:05:39 HamzaHajeir bluetoothd[485]: src/plugin.c:plugin_init() System does not support bass pluginSep 16 00:05:39 HamzaHajeir bluetoothd[485]: src/plugin.c:plugin_init() System does not support bap pluginSep 16 00:05:39 HamzaHajeir bluetoothd[485]: profiles/network/bnep.c:bnep_init() kernel lacks bnep-protocol supportSep 16 00:05:39 HamzaHajeir bluetoothd[485]: src/plugin.c:plugin_init() System does not support network pluginSep 16 00:05:39 HamzaHajeir bluetoothd[485]: Bluetooth management interface 1.21 initialized
  • sudo dmesg | grep firmware:
[    0.051585] Spectre V2 : Enabling Restricted Speculation for firmware calls[   25.755056] bluetooth hci0: Direct firmware load for mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin failed with error -2[   25.755059] Bluetooth: hci0: Failed to load firmware file (-2)[   25.755504] Bluetooth: hci0: Failed to set up firmware (-2)[26548.979065] bluetooth hci0: Direct firmware load for mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin failed with error -2[26548.979113] Bluetooth: hci0: Failed to load firmware file (-2)[26548.980582] Bluetooth: hci0: Failed to set up firmware (-2)

Note I've followed this procedure (#3) to include BT_RAM_CODE_MT7961_1_2_hdr.bin and other files, adding all files.

Therefore:

  • ls -a /lib/firmware/mediatek | grep MT7961:
BT_RAM_CODE_MT7961_1_2_hdr.binBT_RAM_CODE_MT7961_1_2_hdr.bin.zstBT_RAM_CODE_MT7961_1a_2_hdr.binBT_RAM_CODE_MT7961_1a_2_hdr.bin.zstWIFI_MT7961_patch_mcu_1_2_hdr.binWIFI_MT7961_patch_mcu_1_2_hdr.bin.zstWIFI_RAM_CODE_MT7961_1.binWIFI_RAM_CODE_MT7961_1.bin.zst
  • lsusb -v -s 001:003 (Note 003 is the corresponding device ID):
Bus 001 Device 003: ID 0e8d:0608 MediaTek Inc. Wireless_DeviceDevice Descriptor:  bLength                18  bDescriptorType         1  bcdUSB               2.10  bDeviceClass          239 Miscellaneous Device  bDeviceSubClass         2 [unknown]  bDeviceProtocol         1 Interface Association  bMaxPacketSize0        64  idVendor           0x0e8d MediaTek Inc.  idProduct          0x0608 Wireless_Device  bcdDevice            1.00  iManufacturer           5 MediaTek Inc.  iProduct                6 Wireless_Device  iSerial                 7 000000000  bNumConfigurations      1  Configuration Descriptor:    bLength                 9    bDescriptorType         2    wTotalLength       0x00fe    bNumInterfaces          3    bConfigurationValue     1    iConfiguration          8 Config_01    bmAttributes         0xc0      Self Powered    MaxPower              100mA    Interface Association:      bLength                 8      bDescriptorType        11      bFirstInterface         0      bInterfaceCount         3      bFunctionClass        224 Wireless      bFunctionSubClass       1 Radio Frequency      bFunctionProtocol       1 Bluetooth      iFunction               4 BT_FUNCTION    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        0      bAlternateSetting       0      bNumEndpoints           3      bInterfaceClass       224 Wireless      bInterfaceSubClass      1 Radio Frequency      bInterfaceProtocol      1 Bluetooth      iInterface              1 BT_ACL_If      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x81  EP 1 IN        bmAttributes            3          Transfer Type            Interrupt          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0010  1x 16 bytes        bInterval               1      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x82  EP 2 IN        bmAttributes            2          Transfer Type            Bulk          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0200  1x 512 bytes        bInterval               0      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x02  EP 2 OUT        bmAttributes            2          Transfer Type            Bulk          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0200  1x 512 bytes        bInterval               0    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        1      bAlternateSetting       0      bNumEndpoints           2      bInterfaceClass       224 Wireless      bInterfaceSubClass      1 Radio Frequency      bInterfaceProtocol      1 Bluetooth      iInterface              2 BT_SCO_If      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x83  EP 3 IN        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0000  1x 0 bytes        bInterval               4      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x03  EP 3 OUT        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0000  1x 0 bytes        bInterval               4    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        1      bAlternateSetting       1      bNumEndpoints           2      bInterfaceClass       224 Wireless      bInterfaceSubClass      1 Radio Frequency      bInterfaceProtocol      1 Bluetooth      iInterface              2 BT_SCO_If      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x83  EP 3 IN        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0009  1x 9 bytes        bInterval               4      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x03  EP 3 OUT        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0009  1x 9 bytes        bInterval               4    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        1      bAlternateSetting       2      bNumEndpoints           2      bInterfaceClass       224 Wireless      bInterfaceSubClass      1 Radio Frequency      bInterfaceProtocol      1 Bluetooth      iInterface              2 BT_SCO_If      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x83  EP 3 IN        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0011  1x 17 bytes        bInterval               4      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x03  EP 3 OUT        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0011  1x 17 bytes        bInterval               4    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        1      bAlternateSetting       3      bNumEndpoints           2      bInterfaceClass       224 Wireless      bInterfaceSubClass      1 Radio Frequency      bInterfaceProtocol      1 Bluetooth      iInterface              2 BT_SCO_If      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x83  EP 3 IN        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0019  1x 25 bytes        bInterval               4      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x03  EP 3 OUT        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0019  1x 25 bytes        bInterval               4    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        1      bAlternateSetting       4      bNumEndpoints           2      bInterfaceClass       224 Wireless      bInterfaceSubClass      1 Radio Frequency      bInterfaceProtocol      1 Bluetooth      iInterface              2 BT_SCO_If      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x83  EP 3 IN        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0021  1x 33 bytes        bInterval               4      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x03  EP 3 OUT        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0021  1x 33 bytes        bInterval               4    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        1      bAlternateSetting       5      bNumEndpoints           2      bInterfaceClass       224 Wireless      bInterfaceSubClass      1 Radio Frequency      bInterfaceProtocol      1 Bluetooth      iInterface              2 BT_SCO_If      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x83  EP 3 IN        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0031  1x 49 bytes        bInterval               4      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x03  EP 3 OUT        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0031  1x 49 bytes        bInterval               4    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        1      bAlternateSetting       6      bNumEndpoints           2      bInterfaceClass       224 Wireless      bInterfaceSubClass      1 Radio Frequency      bInterfaceProtocol      1 Bluetooth      iInterface              2 BT_SCO_If      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x83  EP 3 IN        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x003f  1x 63 bytes        bInterval               4      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x03  EP 3 OUT        bmAttributes            1          Transfer Type            Isochronous          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x003f  1x 63 bytes        bInterval               4    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        2      bAlternateSetting       0      bNumEndpoints           2      bInterfaceClass       224 Wireless      bInterfaceSubClass      1 Radio Frequency      bInterfaceProtocol      1 Bluetooth      iInterface              3 BT_ISO_If      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x8a  EP 10 IN        bmAttributes            3          Transfer Type            Interrupt          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0040  1x 64 bytes        bInterval               1      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x0a  EP 10 OUT        bmAttributes            3          Transfer Type            Interrupt          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0040  1x 64 bytes        bInterval               1    Interface Descriptor:      bLength                 9      bDescriptorType         4      bInterfaceNumber        2      bAlternateSetting       1      bNumEndpoints           2      bInterfaceClass       224 Wireless      bInterfaceSubClass      1 Radio Frequency      bInterfaceProtocol      1 Bluetooth      iInterface              3 BT_ISO_If      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x8a  EP 10 IN        bmAttributes            3          Transfer Type            Interrupt          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0200  1x 512 bytes        bInterval               1      Endpoint Descriptor:        bLength                 7        bDescriptorType         5        bEndpointAddress     0x0a  EP 10 OUT        bmAttributes            3          Transfer Type            Interrupt          Synch Type               None          Usage Type               Data        wMaxPacketSize     0x0200  1x 512 bytes        bInterval               1Binary Object Store Descriptor:  bLength                 5  bDescriptorType        15  wTotalLength       0x000c  bNumDeviceCaps          1  USB 2.0 Extension Device Capability:    bLength                 7    bDescriptorType        16    bDevCapabilityType      2    bmAttributes   0x00000000      (Missing must-be-set LPM bit!)Device Status:     0x0003  Self Powered  Remote Wakeup Enabled
  • hciconfig -a:
hci0:   Type: Primary  Bus: USB        BD Address: 00:00:00:00:00:00  ACL MTU: 0:0  SCO MTU: 0:0        DOWN        RX bytes:0 acl:0 sco:0 events:0 errors:0        TX bytes:0 acl:0 sco:0 commands:0 errors:0        Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00        Packet type: DM1 DH1 HV1        Link policy:        Link mode: PERIPHERAL ACCEPT
  • rfkill Shows unblocked hard and software:
ID TYPE      DEVICE      SOFT      HARD 1 bluetooth hci0   unblocked unblocked
  • lsmod | grep -i bt - This one which shows me that the module MTK module is missing:
btusb                  53248  0btrtl                  24576  1 btusbbtbcm                  24576  1 btusbbtintel                36864  1 btusbbluetooth             573440  11 btrtl,btintel,btbcm,btusb

And finally:

  • journalctl --dmesg --boot=-0 --grep blue
Sep 16 00:05:39 HamzaHajeir kernel: Bluetooth: Core ver 2.22Sep 16 00:05:39 HamzaHajeir kernel: Bluetooth: Starting self testingSep 16 00:05:39 HamzaHajeir kernel: Bluetooth: ECDH test passed in 2653 usecsSep 16 00:05:39 HamzaHajeir kernel: Bluetooth: SMP test passed in 1100 usecsSep 16 00:05:39 HamzaHajeir kernel: Bluetooth: Finished self testingSep 16 00:05:39 HamzaHajeir kernel: NET: Registered PF_BLUETOOTH protocol familySep 16 00:05:39 HamzaHajeir kernel: Bluetooth: HCI device and connection manager initializedSep 16 00:05:39 HamzaHajeir kernel: Bluetooth: HCI socket layer initializedSep 16 00:05:39 HamzaHajeir kernel: Bluetooth: L2CAP socket layer initializedSep 16 00:05:39 HamzaHajeir kernel: Bluetooth: SCO socket layer initializedSep 16 00:05:39 HamzaHajeir kernel: bluetooth hci0: Direct firmware load for mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin failed with error -2Sep 16 00:05:39 HamzaHajeir kernel: Bluetooth: hci0: Failed to load firmware file (-2)Sep 16 00:05:39 HamzaHajeir kernel: Bluetooth: hci0: Failed to set up firmware (-2)Sep 16 19:56:59 HamzaHajeir kernel: bluetooth hci0: Direct firmware load for mediatek/BT_RAM_CODE_MT7961_1_2_hdr.bin failed with error -2Sep 16 19:56:59 HamzaHajeir kernel: Bluetooth: hci0: Failed to load firmware file (-2)Sep 16 19:56:59 HamzaHajeir kernel: Bluetooth: hci0: Failed to set up firmware (-2)

What could be the issue? And how to solve it?

Note that I've tried running the bluetooth within Ubuntu from VMBox and it does work from within. Ofcourse when the bluetooth adapter not attached to WSL.


Viewing all articles
Browse latest Browse all 2797

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>