ats2851 / cm591 ugreen bluetooth 5.3 for Linux

在某宝买了个绿联USB蓝牙5.3设备,但是发现Ubuntu22.04上不可用=_=由于Linux兼容性问题和用户群较少,所以对于新的蓝牙技术的支持永远都落后与Windows,气抖冷,决定开启我的上网找驱动之旅。

这个方法有普遍适用性,不仅限于ats2851和绿联的蓝牙设备

step1 找出设配器的型号(可选)

这个简单,购买的产品的说明书首页就写着 Model:CM591

step2 找出蓝牙型号

方法1

windows设备管理器查看硬件ID,再用硬件ID上网找

https://oemdrivers.com/devid/

扫描二维码关注公众号,回复: 15433629 查看本文章

方法2

使用型号信息上蓝牙官网搜,一般有BQB认证是可以搜索出来的

Launch Studio - Listing Search

不过很可惜,我这只能找到蓝牙版本信息,找不到芯片信息

方法3

大胆点,客气点,直接找某宝客服问(我就是用这种方法找到芯片型号,省时间省脑力,哈哈哈)

step3 根据芯片型号找驱动

芯片型号一致的话,驱动是通用的。用关键词"ats2851 Linux " 去搜索。

一般年代越久远,驱动支持越完善。如果没找到的话,可能是芯片太新或者用户群比较小,建议如下

1、换外网搜索英文结果

2、等一段时间再搜

3、自己写一个驱动

4、换一个直接支持Linux的蓝牙设备

5、放弃使用Linux,回归Windows怀抱

然后

下面是我暂时发现看起来比较靠谱的方法,不过还没尝试(因为装Ubuntu的电脑在家里),可以参考一下

======================================================
XanMod Linux Kernel 6.1.8 released
00f4b7c Bluetooth: Fix issue with Actions Semi ATS2851 based devices
https://www.linuxcompatible.org/story/xanmod-linux-kernel-618-released/

======================================================
/* Actions Semiconductor ATS2851 based devices */
https://github.com/torvalds/linux/blob/master/drivers/bluetooth/btusb.c

To try without adding the repository
1.Download from Sourceforge and install:
https://sourceforge.net/projects/xanmod/files/
2.In terminal:
sudo dpkg -i linux-image-*xanmod*.deb linux-headers-*xanmod*.deb
3.Reboot.
4.Check it:
cat /proc/version

======================================================
How to get ATS2851 Bluetooth 5.3 USB adapter working/supported?
https://discussion.fedoraproject.org/t/how-to-get-ats2851-bluetooth-5-3-usb-adapter-working-supported/70616

T: Bus=02 Lev=02 Prnt=02 Port=01 Cnt=01 Dev#= 3 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1
P: Vendor=10d7 ProdID=b012 Rev=88.91
S: Manufacturer=Actions
S: Product=general adapter
S: SerialNumber=ACTIONS1234
C:* #Ifs= 2 Cfg#= 1 Atr=c0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=81(I) Atr=03(Int.) MxPS= 64 Ivl=1ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=01(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms
I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=01(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms
I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=01(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms
I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=01(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms
I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=01(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms
I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E: Ad=01(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms
E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms

I’m hoping the following gets added to the usb.ids:
10d7 Actions Semiconductor Co., Ltd
b012 ATS2851 Bluetooth 5.3 Transceiver [Ugreen CM591]

找到usb.ids并追加以上代码
find / -iname usb.ids

======================================================
[PATCH] Bluetooth: Fix issue with Actions Semi ATS2851 based devices
https://www.spinics.net/lists/linux-bluetooth/msg102121.html

======================================================
usb.ids source code
http://www.linux-usb.org/usb.ids
最全USB ID‘s 收录
https://blog.csdn.net/wwwyue1985/article/details/113745944

step3-1 0422更新,对网上搜集的资源进行筛选

目前基本确认XanMod Linux Kernel 6.1.8 released和https://github.com/torvalds/linux/blob/master/drivers/bluetooth/btusb.c是对应的

1.先安装开发版的内核

sudo apt install linux-xanmod*

根据响应的deb包选择适合自己电脑的内核,比如linux-headers-6.2.12-x64v1-xanmod1和linux-headers-6.2.12-x64v1-xanmod1就是本文修改时间时适配64位V1版本CPU的最新内核版本,一般下载最新的内核就可以了,不过内核对应的CPU版本必须选对,否则更新内核后会导致无法正常开机,此时需要在引导界面选择旧内核进系统删除开发版内核。

然后sudo apt install linux-headers-6.2.12-x64v1-xanmod1 linux-headers-6.2.12-x64v1-xanmod1把内核安装好,重启

2.用gcc编译btusb.c

本人对gcc编译和驱动编译不是很了解,还在学习中,等成功了再写到文章里面。欢迎留言补充。下面补充跟编译驱动有关的链接作为备忘

找不到module.h - Linux环境编程-Chinaunix
【译】一个简单的 make & makefile 教程 - 知乎

step3-2 0423更新,xanmod取消对ATS2851的支持

看到xanmod/linux的github公告,大概意思就是ATS2851芯片的声明信息中存在一些问题,按照炬力的文档加入驱动,也会报错,现在已被Linux拉黑,言下之意,通过安装 6.2.12-xanmod1已经不能解决该芯片的问题。

Bluetooth: Fix issue with Actions Semi ATS2851 based devices

[ Upstream commit 5d44f76fab0839799b19cbc88d13575da968dc08 ]

Their devices claim to support the erroneous data reporting, but don't
actually support the required commands. So blacklist them and add a
quirk.

  < HCI Command: Read Default Erroneous Data Reporting (0x03|0x005a) plen 0
  > HCI Event: Command Status (0x0f) plen 4
        Read Default Erroneous Data Reporting (0x03|0x005a) ncmd 1
          Status: Unknown HCI Command (0x01)

相关原文出处

Bluetooth: Fix issue with Actions Semi ATS2851 based devices · xanmod/linux@e261de0 · GitHub

Bluetooth 5.3 adapter Ugreen CM591 (chip ATS2851) · Issue #337 · xanmod/linux · GitHub

至此,因为炬力的宣传文档错误,导致Linux官方无法为其制作相关驱动,所以通过寻找官方驱动支持的绿联这款蓝牙适配器的尝试宣告失败。那就没办法了,想在Linux用蓝牙5.3只能更换设备了,赶紧联系客服7天无理由(⁎⁍̴̛ᴗ⁍̴̛⁎)

猜你喜欢

转载自blog.csdn.net/qq_33562122/article/details/130126385
5.3