You are not logged in.

#1 2024-07-31 14:48:22

VictorTesla
Member
Registered: 2024-07-25
Posts: 2

[SOLVED] Bluetooth Not Working in Arch Despite Ubuntu Success

I recently set up a dual-boot configuration with Ubuntu and Arch Linux.
I'm having trouble getting Bluetooth to work in Arch Linux (Kernel 6.10.0-arch1-2) , despite it working perfectly in my Ubuntu (kernel version 6.8.0-38-generic).

I have RT3920 wifi bluetooth chipset which in known to now work well with linux because of lack of support from the manufacturer
But i managed to get it to work using rtbth-dkms by loimu

Here's how I managed to successfully install it in Ubuntu. here and here

git clone https://github.com/loimu/rtbth-dkms.git
cd rtbth-dkms
make
sudo make install
sudo cp -r ~/rtbth /usr/src/rtbth-3.9.3
sudo dkms install rtbth/3.9.3

then added this line "modprobe rtbth &> /dev/null" to /etc/rc.local

It start working after a reboot and i can use it with blueman as well as from default bluetooth manager

but in Arch i am not able to build it form source i know there are some aur pkg rtbth-dkms and rtbth-dkms-git but they are old and even they are not getting installed

when i try building by exec make it says stdarg.h no such file or dir so i reinstalled base-devel , linux headers still stdarg.h no  such file or dir

so i copied stdarg.h from bin and the cloned dir then i got another error

/home/victor/tmp/rtbth-dkms/rtbth_core_bluez.c: In function ‘rtbt_hps_iface_init’:
/home/victor/tmp/rtbth-dkms/rtbth_core_bluez.c:318:21: error: ‘struct hci_dev’ has no member named ‘dev_type’
  318 |                 hdev->dev_type = HCI_PRIMARY;
      |                     ^~
/home/victor/tmp/rtbth-dkms/rtbth_core_bluez.c:318:34: error: ‘HCI_PRIMARY’ undeclared (first use in this function); did you mean ‘HCI_PRIVACY’?
  318 |                 hdev->dev_type = HCI_PRIMARY;
      |                                  ^~~~~~~~~~~
      |                                  HCI_PRIVACY
/home/victor/tmp/rtbth-dkms/rtbth_core_bluez.c:318:34: note: each undeclared identifier is reported only once for each function it appears in

now i dont know how to fix this

please can someone help me install rtbht-dkms by loimu on arch linux I think it should work because the difference between the kernels is not a lot
Arch Linux (Kernel 6.10.0-arch1-2) Ubuntu (kernel version 6.8.0-38-generic)
using latest ubuntu lts 24.04

which one in true

  1. Is it just not possible because its compatible

  2. Do I need an older kernel

  3. Do I need to configure some basic thing that already comes in ubuntu but not in arch

  4. Do I need fix each error one by one

  5. Do I need to read The Arch Wiki

Last edited by VictorTesla (2024-08-16 07:01:43)

Offline

#2 2024-08-01 17:44:09

zbygv
Member
Registered: 2024-08-01
Posts: 4

Re: [SOLVED] Bluetooth Not Working in Arch Despite Ubuntu Success

I tried building the module, and had similar results, except I wasn't missing stdarg.h.

The stdarg.h issue is a bit hard to pinpoint, but I only have two headers called stdarg.h; one is owned by gcc, and the other by wine, but I don't see why windows headers would be involved, so maybe it is something to do with gcc?

For the other error, it looks like that member might have been removed from hci_dev sometime between those versions of the kernel, and the definition of HCI_PRIMARY along with it, but removing that line will allow it to build; whether it works is a different question, but maybe you could try that?

I'll try to look through the kernel changelogs to see what changed there.

Last edited by zbygv (2024-08-01 17:56:47)

Offline

#3 2024-08-01 18:26:42

zbygv
Member
Registered: 2024-08-01
Posts: 4

Re: [SOLVED] Bluetooth Not Working in Arch Despite Ubuntu Success

Yeah, I think it's safe to remove the line, here's a snippet from the commit history where it explains why it's removed:

commit f25b7fd36cc3a850e006aed686f5bbecd200de1b
Author: Ying Hsu <yinghsu@chromium.org>
Date:   Wed May 29 08:00:00 2024 +0000

    Bluetooth: Add vendor-specific packet classification for ISO data
    
    When HCI raw sockets are opened, the Bluetooth kernel module doesn't
    track CIS/BIS connections. User-space applications have to identify
    ISO data by maintaining connection information and look up the mapping
    for each ACL data packet received. Besides, btsnoop log captured in
    kernel couldn't tell ISO data from ACL data in this case.
    
    To avoid additional lookups, this patch introduces vendor-specific
    packet classification for Intel BT controllers to distinguish
...skipping...

    Bluetooth: HCI: Remove HCI_AMP support
    
    Since BT_HS has been remove HCI_AMP controllers no longer has any use so
    remove it along with the capability of creating AMP controllers.
    
    Since we no longer need to differentiate between AMP and Primary
    controllers, as only HCI_PRIMARY is left, this also remove
    hdev->dev_type altogether.
    
    Fixes: e7b02296fb40 ("Bluetooth: Remove BT_HS")
    Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Offline

#4 2024-08-16 06:59:49

VictorTesla
Member
Registered: 2024-07-25
Posts: 2

Re: [SOLVED] Bluetooth Not Working in Arch Despite Ubuntu Success

Thanks, I finally managed to make it work. I commented out the 318th line in rtbth_core_bluez.c. It compiled, but it didn't work.

312 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,34)
313                 hdev->bus = HCI_PCI;
314 #else
315                 hdev->type = HCI_PCI;
316 #endif
317 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,8,0)
318 //                hdev->dev_type = HCI_PRIMARY;
319 #else
320                 hdev->dev_type = HCI_BREDR;
321 #endif
322                 pci_set_drvdata(pcidev, hdev);
323                 SET_HCIDEV_DEV(hdev, &pcidev->dev);

So, I cloned the AUR package rtbth-dkms-git and tried to edit its source by forking this repository. I then updated rtbth_core_bluez.c in my fork.

Next, I modified the PKGBUILD file, changed the source from git+https://github.com/loimu/rtbth-dkms to git+https://github.com/Vict0rTesla/rtbth-dkms,
and also updated the pkgver() function:

pkgver() {
  echo "4.0.0"
}

Finally, I compiled it. with makepkg -si
Again, thank you so much for helping!

Offline

#5 2024-08-16 10:34:05

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 23,897

Re: [SOLVED] Bluetooth Not Working in Arch Despite Ubuntu Success

That pkgver function doesn't reflect updated git changes, making -git based packages should have a dynamic pkgver function reflecting the commit being used for a given package: https://wiki.archlinux.org/title/VCS_pa … elines#Git

Offline

Board footer

Powered by FluxBB