[Software] [Solved] How to install Realtek 8761b Bluetooth driver with dkms

New to Debian (Or Linux in general)? Ask your questions here!
Message
Author
User avatar
lospala
Posts: 116
Joined: 2023-05-31 08:32
Location: Buenoa Aires, Argentina
Has thanked: 13 times
Been thanked: 4 times

[Software] [Solved] How to install Realtek 8761b Bluetooth driver with dkms

#1 Post by lospala »

Hi
I have bought a Bluetooth Dongle 5.0 (chipset Realtek 8761B). . I installed the firmware as per below code and everything went fine.
After that I upgraded kernel two times and after every upgrade Bluetooth stopped working as if there were no firmware. The only solution was installing firmware again and
removing the previous Bluetooth connections and creating new ones.
I believed that installing the firmware as per below code, they will be maintained upon every kernel upgrade like the case is with the USB dongle that was installed once and maintained.
Is there a solution other that reinstalling?
Regards

Code: Select all

administrador@debian:~/Escritorio/LINUX_DRIVER$ LC_ALL=C sudo make install INTERFACE=usb
[sudo] password for administrador: 
mkdir -p /lib/modules/6.1.0-11-amd64/kernel/drivers/bluetooth
Start Realtek Bluetooth USB driver installation
mkdir -p /lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_fw to /lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_fw /lib/firmware
Copy rtkbt-firmware/lib/firmware/rtl*_config /lib/firmware
cp -a rtkbt-firmware/lib/firmware/rtl*_config /lib/firmware
make -C usb install
make[1]: Entering directory '/home/administrador/Escritorio/LINUX_DRIVER/usb'
rmmod btusb
rmmod: ERROR: Module btusb is not currently loaded
make[1]: [Makefile:7: install] Error 1 (ignored)
mv /lib/modules/6.1.0-11-amd64/kernel/drivers/bluetooth/btusb.ko /lib/modules/6.1.0-11-amd64/kernel/drivers/bluetooth/btusb_bak
mv: cannot stat '/lib/modules/6.1.0-11-amd64/kernel/drivers/bluetooth/btusb.ko': No such file or directory
make[1]: [Makefile:8: install] Error 1 (ignored)
rmmod rtk_btusb
rmmod: ERROR: Module rtk_btusb is not currently loaded
make[1]: [Makefile:9: install] Error 1 (ignored)
make -C ./bluetooth_usb_driver
make[2]: Entering directory '/home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver'
make -C /lib/modules/6.1.0-11-amd64/build M=/home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver modules
make[3]: Entering directory '/usr/src/linux-headers-6.1.0-11-amd64'
  CC [M]  /home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver/rtk_coex.o
  CC [M]  /home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver/rtk_misc.o
  CC [M]  /home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver/rtk_bt.o
  LD [M]  /home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver/rtk_btusb.o
  MODPOST /home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver/Module.symvers
  CC [M]  /home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver/rtk_btusb.mod.o
  LD [M]  /home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver/rtk_btusb.ko
  BTF [M] /home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver/rtk_btusb.ko
Skipping BTF generation for /home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver/rtk_btusb.ko due to unavailability of vmlinux
make[3]: Leaving directory '/usr/src/linux-headers-6.1.0-11-amd64'
make[2]: Leaving directory '/home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver'
cp -f ./bluetooth_usb_driver/rtk_btusb.ko /lib/modules/6.1.0-11-amd64/kernel/drivers/bluetooth/rtk_btusb.ko
depmod -a 6.1.0-11-amd64
make -C ./bluetooth_usb_driver clean
make[2]: Entering directory '/home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver'
rm -rf *.o *.mod.c *.mod.o *.ko *.symvers *.order *.a
make[2]: Leaving directory '/home/administrador/Escritorio/LINUX_DRIVER/usb/bluetooth_usb_driver'
echo "install rtk_btusb success!"
install rtk_btusb success!
make[1]: Leaving directory '/home/administrador/Escritorio/LINUX_DRIVER/usb'
administrador@debian:~/Escritorio/LINUX_DRIVER$ 
Last edited by lospala on 2023-08-19 15:20, edited 10 times in total.
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

User avatar
stevepusser
Posts: 13098
Joined: 2009-10-06 05:53
Has thanked: 54 times
Been thanked: 99 times

Re: [Software] Every kernel upgrade bluetooth drivers dissapear

#2 Post by stevepusser »

The solution is for that outside driver to be converted to a DKMS source package, so that it automatically will rebuild with every kernel upgrade.

I leave it to you to web search to see if someone has already done that.
MX Linux packager and developer

User avatar
lospala
Posts: 116
Joined: 2023-05-31 08:32
Location: Buenoa Aires, Argentina
Has thanked: 13 times
Been thanked: 4 times

Re: [Software] Every kernel upgrade bluetooth drivers dissapear

#3 Post by lospala »

Thank you
I spent a lot of time searching how to and where and I found a firmware (the only one located)

Code: Select all

git clone https://aur.archlinux.org/rtl8761usb.git
But when I try to install it with sudo dkms install dkms.conf it shows a log that says not rules at all
I cannot find inside the folder any instruction of what to do to install it.
Anyway I will keep on trying and searching
Regards
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

User avatar
lospala
Posts: 116
Joined: 2023-05-31 08:32
Location: Buenoa Aires, Argentina
Has thanked: 13 times
Been thanked: 4 times

Re: [Software] [Closed] Every kernel upgrade bluetooth drivers dissapear

#4 Post by lospala »

I close this post as after one week of searching I see that there is no Realtek 8761 or 8771 package working with dkms so far and . I'm not that expert to build my own one.
Rgds
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

Aki
Global Moderator
Global Moderator
Posts: 4093
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 117 times
Been thanked: 544 times

Re: [Software] [Closed] Every kernel upgrade bluetooth drivers dissapear

#5 Post by Aki »

Hello,
lospala wrote: 2023-08-11 16:09 I have bought a Bluetooth Dongle 5.0 (chipset Realtek 8761B). . I installed the firmware as per below code and everything went fine. After that I upgraded kernel two times and after every upgrade Bluetooth stopped working as if there were no firmware. The only solution was installing firmware again and removing the previous Bluetooth connections and creating new ones.
I believed that installing the firmware as per below code, they will be maintained upon every kernel upgrade like the case is with the USB dongle that was installed once and maintained.
...
It seems you are compiling an "out of the tree" kernel module. Therefore, you need to rebuild it every time you update the kernel, unless you automate it with a dkms configuration.

What's the file name of the involved firmware ?

What is the output of lsusb when the dongle is connected ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
lospala
Posts: 116
Joined: 2023-05-31 08:32
Location: Buenoa Aires, Argentina
Has thanked: 13 times
Been thanked: 4 times

Re: [Software] [Closed] Every kernel upgrade bluetooth drivers dissapear

#6 Post by lospala »

Thank you AKI

You are right. Every install is out of the kernel
The bluetooth dongle is marked as MTS-BT5PRO
As per the vendor website the firmware is Realtek 8761b
The driver I have downloaded from Internet is LINUX_DRIVER-20230803T190513Z-001.zip
Below the output of lsusb (I see there 8771)

Code: Select all

administrador@debian:~$ LC_ALL=C lsusb
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 003: ID 2357:011e TP-Link AC600 wireless Realtek RTL8811AU [Archer T2U Nano]
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 0bda:8771 Realtek Semiconductor Corp. Bluetooth Radio
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 005: ID 0458:6007 KYE Systems Corp. (Mouse Systems) Genius Webcam
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 004: ID 320f:5000 Evision RGB Keyboard
Bus 003 Device 003: ID 046d:c077 Logitech, Inc. Mouse
Bus 003 Device 002: ID 1b3f:2019 Generalplus Technology Inc. USB Microphone
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
administrador@debian:~$ 
Thanks for involving and for any guide you can give me.
Rgds
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

Aki
Global Moderator
Global Moderator
Posts: 4093
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 117 times
Been thanked: 544 times

Re: [Software] [Closed] Every kernel upgrade bluetooth drivers dissapear

#7 Post by Aki »

lospala wrote: 2023-08-13 14:34 The driver I have downloaded from Internet is LINUX_DRIVER-20230803T190513Z-001.zip
What's the URL where it can be downloaded ?
lospala wrote: 2023-08-13 14:34 Below the output of lsusb (I see there 8771)

Code: Select all

administrador@debian:~$ LC_ALL=C lsusb
...
Bus 005 Device 002: ID 0bda:8771 Realtek Semiconductor Corp. Bluetooth Radio
...
The "8771" (in the lsusb) is the "ProductID" while "0bda" is the "VendorID" according to USB identification standards. They are not the name of the chipset ("Realtek 8761b") used for the product.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
lospala
Posts: 116
Joined: 2023-05-31 08:32
Location: Buenoa Aires, Argentina
Has thanked: 13 times
Been thanked: 4 times

Re: [Software] [Closed] Every kernel upgrade bluetooth drivers dissapear

#8 Post by lospala »

#7 Post by Aki » 2023-08-13 12:35

What's the URL where it can be downloaded ?
Hello
I spent all afternoon looking for the link but I don't remember where I downloaded it from or found it. Luckily I saved a copy on Dropbox. I give you the link

https://www.dropbox.com/scl/fi/mo3n6pbd ... 1c4ce&dl=0

Thanks
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

User avatar
lospala
Posts: 116
Joined: 2023-05-31 08:32
Location: Buenoa Aires, Argentina
Has thanked: 13 times
Been thanked: 4 times

Re: [Software] [Closed] Every kernel upgrade bluetooth drivers dissapear

#9 Post by lospala »

As usually happens when you take your car to the mechanic, the failure disappears. I just found the driver download link :D


https://archive.org/download/mpow_mpbh4 ... BLinux.tgz
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

Aki
Global Moderator
Global Moderator
Posts: 4093
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 117 times
Been thanked: 544 times

Re: [Software] [Closed] Every kernel upgrade bluetooth drivers dissapear

#10 Post by Aki »

Hello,

Your device (with chipset Realtek 8761b):

Code: Select all

...
Bus 005 Device 002: ID 0bda:8771 Realtek Semiconductor Corp. Bluetooth Radio
...
seems to be supported in the kernel shipped with Debian Bookworm [1]:

Code: Select all

..
	{ USB_DEVICE(0x0bda, 0x8771), .driver_info = BTUSB_REALTEK |
						     BTUSB_WIDEBAND_SPEECH },
..
The kernel module is btusb:

Code: Select all

$ sudo modinfo btusb
filename:       /lib/modules/6.1.0-11-amd64/kernel/drivers/bluetooth/btusb.ko
license:        GPL
version:        0.8
description:    Generic Bluetooth USB driver ver 0.8
author:         Marcel Holtmann <marcel@holtmann.org>
...
A firmware is required, that is in the package firmware-realtek [2] (from non-free-firmware repository).

Pardon the trivial question, but are you sure you need an out of the tree kernel module ?

---
[1] https://sources.debian.org/src/linux/6.1.38-4/drivers/bluetooth/btusb.c/#L637
[2] https://packages.debian.org/bookworm/firmware-realtek
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
lospala
Posts: 116
Joined: 2023-05-31 08:32
Location: Buenoa Aires, Argentina
Has thanked: 13 times
Been thanked: 4 times

Re: [Software] [Closed] Every kernel upgrade bluetooth drivers dissapear

#11 Post by lospala »

Aki wrote: 2023-08-14 19:40 Hello,

Your device (with chipset Realtek 8761b):
[/code] seems to be supported in the kernel shipped with Debian Bookworm [1]:
I must tell you that Debian was installed upon release date and I bought Realtek Bluetooth dongle on August. I keep a backup of the latest upgrade (just when relevant changes are made) and a copy of the previous Debian install (previous to those changes). In none of them firmware-realtek was installed. To test if Kernel supported this dongle i did this afternoon a fresh install of Debian formatting both partitions (home and / ) and upon booting in the folder "lib/firmware" there was a folder "rtlbt" containing various rtxxxx files among them there were rt8761b_config and rt8761b_fw

Apart from this, I have checked Synaptic and the package firmware-realtek had been installed (like the firmware files) by Debian installer.

After that I installed bluez and blueman to test if Bluetooth worked. I got one connection of the headphones but the connection was not automatic, I had to connect it manually through the b Bluetooth windows of the panel

I rebooted the system and it did not connect again. I started, stopped and restarted Bluetooth service and the behavior is somehow erratic because headphones disappear and if not the connection is not possible again as it hangs while headphones are pairing

Now... I also reproduced the command you posted and I have got this output

Code: Select all

administrador@debian:~$ sudo modinfo btusb
modinfo: ERROR: Module btusb not found.
administrador@debian:~$ 
The only way so far except the btusb iussue cam be relevant ( being sincere I don't know what is it) is installing the drivers I passed to you but they must be reinstalled every kernel upgrade

thanks for your support
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

Aki
Global Moderator
Global Moderator
Posts: 4093
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 117 times
Been thanked: 544 times

Re: [Software] [Closed] Every kernel upgrade bluetooth drivers dissapear

#12 Post by Aki »

lospala wrote: 2023-08-14 22:35 ...
Now... I also reproduced the command you posted and I have got this output

Code: Select all

administrador@debian:~$ sudo modinfo btusb
modinfo: ERROR: Module btusb not found.
administrador@debian:~$ 
The only way so far except the btusb iussue cam be relevant ( being sincere I don't know what is it) is installing the drivers I passed to you but they must be reinstalled every kernel upgrade
Just one last check. What is the output of the following command ?

Code: Select all

$ ls -la /lib/modules/$(uname -r)/kernel/drivers/bluetooth/btusb.ko
$ ls -la /lib/modules/$(uname -r)/kernel/drivers/bluetooth/btusb_bak
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
lospala
Posts: 116
Joined: 2023-05-31 08:32
Location: Buenoa Aires, Argentina
Has thanked: 13 times
Been thanked: 4 times

Re: [Software] [Closed] Every kernel upgrade bluetooth drivers dissapear

#13 Post by lospala »

Aki wrote: 2023-08-15 07:12
Just one last check. What is the output of the following command ?
Firstly I say thanks for your support

I made a mistake when I pasted the code saying that no btusb was found because after checking in the Debianfresh install that Debian installer detected the dongle and installed
firmware-realtek I returned to the actual Debian backup by cloning the entire hdd.

This Debian backup has kernel 6.1.38-3 and it has installed the bluetooth driver . My mistake was to put in a terminal the sentence that gave the output that no btusb was found doing this in the debian with driver installed instead of the fresh install. I have today uninstalled the driver , rebooted and finally I got this shorted output

Code: Select all

administrador@debian:~$ LC_ALL=C sudo modinfo btusb
filename:       /lib/modules/6.1.0-11-amd64/kernel/drivers/bluetooth/btusb.ko
license:        GPL
version:        0.8
description:    Generic Bluetooth USB driver ver 0.8
author:         Marcel Holtmann <marcel@holtmann.org>
srcversion:     C7B6A0C47D47F3AA9071297
alias:          usb:v8087p0A5Ad*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0930p*d*dc*dsc*dp*icFFisc01ip01in* etc etc 
Regarding your last post;

Code: Select all

administrador@debian:~$ LC_ALL=C ls -la /lib/modules/$(uname -r)/kernel/drivers/bluetooth/btusb.ko
-rw-r--r-- 1 root root 151115 Aug  7 18:01 /lib/modules/6.1.0-11-amd64/kernel/drivers/bluetooth/btusb.ko
administrador@debian:~$ 

Code: Select all

administrador@debian:~$ LC_ALL=C ls ls -la /lib/modules/$(uname -r)/kernel/drivers/bluetooth/btusb_bak
ls: cannot access 'ls': No such file or directory
ls: cannot access '/lib/modules/6.1.0-11-amd64/kernel/drivers/bluetooth/btusb_bak': No such file or directory
administrador@debian:~$ 
Well now without the driver and the kernel supporting the dongle I see that I cannot detect headphones or my cell phone like I did before with the driver.
Basically I had installed only bluez and blueman. Now I tried installing one by one: bluedevil and after Bluetooth but no connection can be made. The erratic behavior persists without the driver. Sometimes I am allowed to pair and connect. If I reboot either the headphones dissapeared form the panel Bluetooth window of it they are there I cannot connect anymore. If I delete them and pair them again most of the times are not detected. PC Bluetooth is alkwas active. I guess It might be a problem of a missing package but I don’t know.
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

Aki
Global Moderator
Global Moderator
Posts: 4093
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 117 times
Been thanked: 544 times

Re: [Software] Every kernel upgrade bluetooth drivers dissapear

#14 Post by Aki »

Hello,

The original installation script of the custom ("out-of-the-tree") kernel module deactivates the "in-tree" btusb kernel module (renaming it). This way your Realtek 8761 bluetooth USB dongle will work, but bluetooth dongles from other manufacturers will no longer work. That's why you cannot find the module

Code: Select all

/lib/modules/6.1.0-11-amd64/kernel/drivers/bluetooth/btusb.ko
after installing the custom module.

I'm not a kernel expert, but it seems to me it is written not to be integrated in the mainline kernel, even if it works. In the "readme" file it is documented that "The supported kernel version is 2.6.32 - 5.3.". It compiles with 6.1 anyway, too.

Below I report the instructions to build the USB module of your Realtek 8761 BT-USB dongle using the dkms (Dynamic Kernel Module Support) starting from source code.

Code: Select all

# Documentation:
#       https://wiki.debian.org/BuildADebianKernelPackage
#       https://wiki.debian.org/KernelDKMS
#       https://manpages.debian.org/bookworm/dkms/dkms.8.en.html

# The following commands should be given as root user
apt install install build-essential linux-source bc kmod 
apt install cpio flex libncurses5-dev libelf-dev libssl-dev dwarves bison 

# Source code from: 
#       git clone https://aur.archlinux.org/rtl8761usb.git
#
# note: 
#       1) the license of this code is unknown and it is not included in source code
#       2) the source code is hosted outside AUR repositories
#       3) here is covered only the building witk dkms of "rtk_btusb" custom kernel module 
#          (another kernel modules named "uart" is included in source code, but I don't
#          know if it is always required)
#       4) custom firmware installation seems to be required (from downloaded file)

# Download the source code
wget https://archive.org/download/mpow_mpbh456ab_driverforlinux/mpow_MPBH456AB_driver%2Bfor%2BLinux.tgz

# Uncompress and untar source code
tar xvf mpow_MPBH456AB_driver+for+Linux.tgz

# Change current directory to the custom "rtk_btusb" kernel module
cd 20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver

# Create the dkms.conf file in the custom module's source code directory
# named 20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver
cat << EOF > dkms.conf
PACKAGE_NAME=rtk_btusb
PACKAGE_VERSION=20200610
BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build"
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
DEST_MODULE_LOCATION[0]=/extra
AUTOINSTALL=yes
EOF

# Add custom module to dkms (from current directory) with dkms.conf file
dkms add $PWD

# Build custom module with dkms
dkms build -m rtk_btusb -v 20200610

# Install custom module with dkms 
dkms install -m rtk_btusb -v 20200610

# Install custom firmware file from 20200610_LINUX_BT_DRIVER/ directory
cd ../../
cp -vi rtkbt-firmware/lib/firmware/rtl* /lib/firmware/

# Blacklist btusb kernel module (conflicts with this custom kernel module named "rtk_btusb")
# note: it will be impossible to use other kernel bluetooth dongles devices based on btusb kernel module.
echo "blacklist btusb" > /etc/modprobe.d/btusb_blacklist.conf

# Update the initramfs
update-initramfs -u

# After building the module:
modinfo rtk_btusb
filename:       /lib/modules/6.1.0-11-amd64/updates/dkms/rtk_btusb.ko
license:        GPL
version:        3.1.9321f79.20200610-155144
description:    Realtek Bluetooth USB driver ver 3.1.9321f79.20200610-155144
author:         
srcversion:     9D390BD101025C4B42E4801
alias:          usb:v1358p*d*dc*dsc*dp*icE0isc01ip01in*
alias:          usb:v0489p*d*dc*dsc*dp*icE0isc01ip01in*
alias:          usb:v13D3p*d*dc*dsc*dp*icE0isc01ip01in*
alias:          usb:v0BDAp*d*dc*dsc*dp*icE0isc01ip01in*
depends:        usbcore,bluetooth
retpoline:      Y
name:           rtk_btusb
vermagic:       6.1.0-11-amd64 SMP preempt mod_unload modversions 
sig_id:         PKCS#7
signer:         DKMS module signing key
sig_key:        BC:9F:18:0A:24:22:D8:B0:2A:DC:77:5D:0A:3B:A1:AF:E4:B4:6A
sig_hashalgo:   sha256
signature:      55:F6:B6:3C:91:A5:24:E2:7F:8A:37:07:FA:73:8B:73:34:04:2D:C2:
                E0:9F:B4:E7:DD:BA:41:64:D3:B0:B4:35:2A:43:F3:01:08:BC:BA:0C:
                42:A1:1F:1B:28:72:7A:95:7B:CC:E6:F9:F0:7B:23:CC:F6:7D:A8:60:
                9B:DA:D2:03:83:32:6A:3E:4D:B1:A6:2E:31:5D:8F:7E:F8:F7:73:B2:
                27:F9:97:66:F5:CA:94:34:1E:AD:9B:C2:BD:3C:F8:7C:C9:6E:46:6F:
                E2:CB:D7:F0:20:73:5F:97:30:2E:49:CB:4C:3E:EF:F3:1D:42:0C:44:
                E4:7B:54:09:49:55:D1:B2:91:2F:B1:65:09:F2:BE:30:6C:2C:48:26:
                28:C5:21:AA:83:A4:AA:FD:53:B8:05:46:D0:3B:ED:A0:B8:EE:88:0F:
                E2:98:A3:12:10:1F:23:39:CF:16:74:40:0D:DF:BF:CF:AE:F0:B5:B3:
                00:A5:52:75:B0:FE:14:62:8A:36:A8:D0:3D:FE:8F:0C:9A:D6:F3:94:
                24:D4:8A:F5:66:F5:FB:9D:C9:60:71:3F:A3:02:08:AD:3F:22:9A:4B:
                23:5A:FB:87:E5:66:A6:4F:0C:78:5D:C2:FA:F8:FB:CE:B6:03:D1:38:
                4D:0C:DA:71:D1:88:83:E0:3F:B5:82:44:90:4C:3B:64
You probably need to remove the compiled custom kernel module currently installed (to avoid conflicts between dkms-built and manual-built kernel modules)

After installing the "out-of-the-tree" as dkms kernel module, it should be automatically recompiled every time you update the kernel (if it is still compatible at source code level).

Hope this help. Let me know.

- -- -- -- - -- -- -- - -- -- -- - -- -- -- - -- -- --

EDIT (Sat Aug 19 16:59:31 CEST 2023): the above script requires that the $ character in the bash "Here Document" to be "escaped"; see next post for the correction.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
lospala
Posts: 116
Joined: 2023-05-31 08:32
Location: Buenoa Aires, Argentina
Has thanked: 13 times
Been thanked: 4 times

Re: [Software] Every kernel upgrade bluetooth drivers dissapear

#15 Post by lospala »

Thanks a lot. I will try to do it carefully Ana I let you know.
Kind regards
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

User avatar
lospala
Posts: 116
Joined: 2023-05-31 08:32
Location: Buenoa Aires, Argentina
Has thanked: 13 times
Been thanked: 4 times

Re: [Software] Every kernel upgrade bluetooth drivers dissapear

#16 Post by lospala »

#14 Post by Aki » 2023-08-16 06:56

Hope this help. Let me know.
Hi Aki

I followrd all steps but I come to this point and I cannot follow
Firstly I moved the rtl8761usb.conf as well as the other two files within the folder downloaded with git (rtl8761usb) to the folder 20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver
When I try to to build module from this last folder but _I get this output;

Code: Select all

root@debian:/home/administrador/Escritorio/20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver# LC_ALL=C dkms build -m rtk_btusb -v 20200610
Sign command: /usr/lib/linux-kbuild-6.1/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub

Building module:
Cleaning build area...(bad exit status: 2)
make -j4 KERNELRELEASE=6.1.0-10-amd64 -C M=///build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 6.1.0-10-amd64 (x86_64)
Consult /var/lib/dkms/rtk_btusb/20200610/build/make.log for more information.
root@debian:/home/administrador/Escritorio/20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver# 
Is it something I made a mistake? (all packages required have been previously installed successfully)

Thanks and regards
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

Aki
Global Moderator
Global Moderator
Posts: 4093
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 117 times
Been thanked: 544 times

Re: [Software] Every kernel upgrade bluetooth drivers dissapear

#17 Post by Aki »

What is the content of the file named /var/lib/dkms/rtk_btusb/20200610/build/make.log ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
lospala
Posts: 116
Joined: 2023-05-31 08:32
Location: Buenoa Aires, Argentina
Has thanked: 13 times
Been thanked: 4 times

Re: [Software] Every kernel upgrade bluetooth drivers dissapear

#18 Post by lospala »

Aki wrote: 2023-08-17 17:39 What is the content of the file named /var/lib/dkms/rtk_btusb/20200610/build/make.log ?

Code: Select all

administrador@debian:~$ LC_ALL==C cat /var/lib/dkms/rtk_btusb/20200610/build/make.log
DKMS make.log for rtk_btusb-20200610 for kernel 6.1.0-10-amd64 (x86_64)
jue 17 ago 2023 18:16:37 -03
make: *** make: *** M=///build:No such file or directory.  Stop
administrador@debian:~$ 



Thanks
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

Aki
Global Moderator
Global Moderator
Posts: 4093
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 117 times
Been thanked: 544 times

Re: [Software] Every kernel upgrade bluetooth drivers dissapear

#19 Post by Aki »

@lospala:
Sorry, my bad. To sort it out, replace the content of the file named dkms.conf in 20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver with:

Code: Select all

PACKAGE_NAME=rtk_btusb
PACKAGE_VERSION=20200610
BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
MAKE[0]="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build"
CLEAN="make -C ${kernel_source_dir} M=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build clean"
DEST_MODULE_LOCATION[0]=/extra
AUTOINSTALL=yes
Then, give the following commands with 20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver as current directory:

Code: Select all

script log.txt
pwd
dkms remove -m rtk_btusb -v 20200610
rm -rf /usr/src/rtk_btusb-20200610/
dkms add $PWD
dkms build -m rtk_btusb -v 20200610
dkms install -m rtk_btusb -v 20200610
exit
The output of previous commands will be recorded in the file named log.txt
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
lospala
Posts: 116
Joined: 2023-05-31 08:32
Location: Buenoa Aires, Argentina
Has thanked: 13 times
Been thanked: 4 times

Re: [Software] Every kernel upgrade bluetooth drivers dissapear

#20 Post by lospala »

Aki wrote: 2023-08-18 09:19 @lospala:
To sort it out, replace the content of the file named dkms.conf in 20200610_LINUX_BT_DRIVER/usb/bluetooth_usb_driver with:

Cheers it works !!!

I edited dkms.conf with root privilege and pasted into it the syntax you gave me.
I could build the package and followed all steps.
I did this on a backup of a just installed Debian with almost no packages. I rebooted and paired easily the headphones
After that I upgraded to kernel 6.1.38-4 and upon reboot I could connect headphones automatically !!!

Definitively Aki...you're my hero
Thank you very much for your time and for your attitude.

I am changing the status to solved
Rgds
Disorder consists of arranging certain elements so that they do not suggest known geometric shapes to the observer.

Post Reply