日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

ubuntu18.04 rtl8761a bluetooth driver

發(fā)布時間:2024/1/18 Ubuntu 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 ubuntu18.04 rtl8761a bluetooth driver 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

?最近想給我的臺式機上加個藍牙適配器,藍牙5.0那種,支持BLE設(shè)備,這樣我就可以基于我的手環(huán)以及手機之類的BLE設(shè)備做一些東西玩玩。不幸的是,藍牙適配器買回來后沒法驅(qū)動,dmesg | tail -f 可以看到加載/lib/firmware/rtl_bt/下面的firmware失敗了,我進目錄看了下,并沒有現(xiàn)成的firmware。Google了一下,在linux git repo中找到了需要的文件,然后就是下載解壓復(fù)制,重新插拔usb藍牙適配器,提示加載firmware成功了,hciconfig -a也可以看到hci0設(shè)備了,但是執(zhí)行部分指令的時候失敗,blueman也無法操作藍牙適配器。

藍牙適配器型號是:

uGreen Bluetooth 5.0 USB Adapter CM390

(base) ? ~ dmesg | tail -f [ 406.634801] usb 1-12.4.2: Product: Bluetooth Radio [ 406.634802] usb 1-12.4.2: Manufacturer: Realtek [ 406.634803] usb 1-12.4.2: SerialNumber: 00E04C239987 [ 406.646215] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761 [ 406.647209] Bluetooth: hci0: RTL: rom_version status=0 version=1 [ 406.647212] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761a_fw.bin [ 406.647312] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761a_config.bin [ 406.647339] Bluetooth: hci0: RTL: cfg_sz 44, total sz 14808 [ 408.725601] Bluetooth: hci0: command 0xfc20 tx timeout [ 416.789322] Bluetooth: hci0: RTL: download fw command failed (-110) (base) ? ~ hciconfig -a hci0: Type: Primary Bus: USBBD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0DOWN RX bytes:427 acl:0 sco:0 events:60 errors:0TX bytes:15050 acl:0 sco:0 commands:61 errors:0Features: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00Packet type: DM1 DH1 HV1 Link policy: Link mode: SLAVE ACCEPT

雖然log中顯示的型號是rtl8761a,但是不知道識別得是否正確,這個型號信息有可能不是它的真實型號。網(wǎng)上查不到關(guān)于這個cm390的更多的芯片信息。

百般查找,發(fā)現(xiàn)這個藍牙適配器芯片的型號為:rtl8761buv!!!

嘗試了一種取巧的辦法,就是將找到的rtl8761bu的firmware改名,改成rtl8761a,但是加載的時候報錯“unknow project id 14”,使用hcitool操作的時候也報錯,顯然這種辦法也是不行的。

[ 1185.809177] Bluetooth: hci0: RTL: rom_version status=0 version=1 [ 1185.809197] Bluetooth: hci0: RTL: rtl: loading rtl_bt/rtl8761a_fw.bin [ 1185.809911] Bluetooth: hci0: RTL: rtl: loading rtl_bt/rtl8761a_config.bin [ 1185.810051] Bluetooth: hci0: RTL: unknown project id 14 [ 1186.430001] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 1186.430016] Bluetooth: BNEP filters: protocol multicast [ 1186.430046] Bluetooth: BNEP socket layer initialized

“hci0: RTL: unknown project id 14”所以,log中顯示出來加載rtl8761a的firmware明顯是不對的。之所以識別不正確,從網(wǎng)上可以查到的信息來看,是因為kernel的驅(qū)動btusb.c中有bug,需要修改后重新編譯安裝。

接下來下載我的kernel版本對應(yīng)的源碼。

uname -a 5.4.0-80-generic #90~18.04.1-Ubuntu git clone git://kernel.ubuntu.com/ubuntu/ubuntu-bionic.git

checkout與我的內(nèi)核版本一致的tag,然后主要參照下面兩篇文章,問題搞定。

https://github.com/torvalds/linux/blob/master/drivers/bluetooth/btrtl.c

https://gist.github.com/rometsch/dfd24fb09c85c1ad2f25223dc1481aaa

在第二個地址中,它解決的是rtl8761b芯片的驅(qū)動,直接照著改還是不行的,因為我的芯片是rtl8761bu,所以將firmware改正確就好了,然后編譯,替換,重啟,藍牙適配器插上

(base) ? ~ dmesg|grep "Bluetooth"[ 43.647082] usb 1-12.4.2: Product: Bluetooth Radio [ 43.677827] Bluetooth: Core ver 2.22 [ 43.677845] Bluetooth: HCI device and connection manager initialized [ 43.677847] Bluetooth: HCI socket layer initialized [ 43.677848] Bluetooth: L2CAP socket layer initialized [ 43.677849] Bluetooth: SCO socket layer initialized [ 43.685124] Bluetooth: hci0: RTL: examining hci_ver=0a hci_rev=000b lmp_ver=0a lmp_subver=8761 [ 43.686127] Bluetooth: hci0: RTL: rom_version status=0 version=1 [ 43.686128] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_fw.bin [ 43.686487] Bluetooth: hci0: RTL: loading rtl_bt/rtl8761bu_config.bin [ 43.686560] Bluetooth: hci0: RTL: cfg_sz 6, total sz 20522 [ 43.721049] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 43.721050] Bluetooth: BNEP filters: protocol multicast [ 43.721052] Bluetooth: BNEP socket layer initialized [ 43.797228] Bluetooth: hci0: RTL: fw version 0x0999646b [ 43.869262] Bluetooth: RFCOMM TTY layer initialized [ 43.869267] Bluetooth: RFCOMM socket layer initialized [ 43.869269] Bluetooth: RFCOMM ver 1.11 [ 1202.463538] Bluetooth: hci0: hardware error 0x33

可以看到藍牙適配器正常驅(qū)動起來了,使用Bluetooth Manager程序搜索一下,成功發(fā)現(xiàn)N多藍牙設(shè)備,試了一下與我的手環(huán)鏈接,都是正常的。到此結(jié)束。

總結(jié)

以上是生活随笔為你收集整理的ubuntu18.04 rtl8761a bluetooth driver的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。