Android-x86 bluez-hid2hci package or analog(s)

153 views
Skip to first unread message

Dmitriy

unread,
Jun 19, 2023, 4:42:37 PM6/19/23
to Android-x86
Hello

Does Android-x86 have bluez-hid2hci package or analog(s)?

Thank you
Dmitriy 

Povilas Staniulis

unread,
Jun 19, 2023, 6:33:43 PM6/19/23
to andro...@googlegroups.com
Android x86 used to support bluez as an alternative bluetooth stack to Android's native BlueDroid but this was dropped ages ago, mostly due to lack of maintenance of bluez Android port.
The answer to your question is very likely no. hid2hci is somewhat of a hack and I doubt BlueDroid has such functionality.

If someone knows better, do correct me.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/bc4632d5-a533-491f-b845-63ab55f34149n%40googlegroups.com.


Huy Minh Bùi (HMTheBoy154)

unread,
Jun 20, 2023, 3:17:30 AM6/20/23
to Android-x86
> Android x86 used to support bluez as an alternative bluetooth stack to Android's native BlueDroid but this was dropped ages ago, mostly due to lack of maintenance of bluez Android port.

It's Flouride now 



Vào lúc 05:33:43 UTC+7 ngày Thứ Ba, 20 tháng 6, 2023, wdmo...@gmail.com đã viết:

Huy Minh Bùi (HMTheBoy154)

unread,
Jun 20, 2023, 3:22:16 AM6/20/23
to Android-x86
Currently Android-x86 doesn't have this tool, however

One thing that I notice on hid2hci.c is that this thing rely on udev (#include "libudev.h") 
If you want to compile it on your own, you can try to build it with libudev-zero (https://github.com/illiliti/libudev-zero), replace #include "libudev.h" with #include "udev.h". 


Vào lúc 03:42:37 UTC+7 ngày Thứ Ba, 20 tháng 6, 2023, Dmitriy đã viết:

Dmitriy

unread,
Jun 20, 2023, 4:56:31 PM6/20/23
to Android-x86
Hello

The reason I'm looking into bluez-hid2hci package is because I was able to use it to make BCM2046 Bluetooth work in CentOS. Bluetooth is listed by lsusb as bus 3 device 2 with VID/PID 0a5c:4500. Do I have other potential options (beside  hid2hci) to make BCM2046 Bluetooth work in Android-x86?

Thank you
Dmitriy

Alexey Cherepanov (alxchr)

unread,
Jun 21, 2023, 11:56:28 PM6/21/23
to Android-x86
Hi Dmitriy,
android-x86 kernel support broadcom usb devices via btusb module and proper firmware placed in /system/lib/firmware/brcm directory.
What do you get on command
dmesg | grep -i bluetooth
with connected bt usb device?
среда, 21 июня 2023 г. в 01:56:31 UTC+5, Dmitriy:

Dmitriy

unread,
Jun 22, 2023, 10:32:40 AM6/22/23
to Android-x86
Hi Alexey

Output for "dmesg | grep -i bluetooth":
[ 62.202584] Bluetooth: Core ver 2.22
[ 62.202700] Bluetooth: HCI device and connection manager initialized
[ 62.202705] Bluetooth: HCI socket layer initialized
[ 62.202709] Bluetooth: L2CAP socket layer initialized
[ 62.202737] Bluetooth: SCO socket layer initialized

On CentOS (on which Bluetooth works on same laptop) , "dmesg | grep -i bluetooth" output contains additional line "usb 3-1.3: Product: Dell Wireless 370 Bluetooth Mini-card".
Output from lsmod does not list btusb, "modprobe btusb" followed by "pm enable com.android.bluetooth" is not enough to make Bluetooth work.

Thank you
Dmitriy

Huy Minh Bùi (HMTheBoy154)

unread,
Jun 22, 2023, 10:37:04 AM6/22/23
to Android-x86
This card seems to be Bluetooth 2.1

Check logcat to see if it's got any crash relate to Bluetooth HAL or anything relate to Bluetooth
Vào lúc 21:32:40 UTC+7 ngày Thứ Năm, 22 tháng 6, 2023, Dmitriy đã viết:

Huy Minh Bùi (HMTheBoy154)

unread,
Jun 22, 2023, 10:48:38 AM6/22/23
to Android-x86
A while ago I tested BlissOS 14.10 (based on Android 11) on a Thinkpad T420. While it's running 11, the Bluetooth HIDL is actually the same as Android-x86 9.0

I've found out that somehow the system can't be able to detect if Bluetooth LE is supported or not. T420 comes with a BCM2070, which use Bluetooth 3.0 and it lacks BLE.
https://www.thinkwiki.org/wiki/Bluetooth_Daughter_Card_(BDC-3)

so check if you got the same issue

https://i.ibb.co/JpTHJrT/photo-2023-06-03-00-09-36.jpg
Vào lúc 21:37:04 UTC+7 ngày Thứ Năm, 22 tháng 6, 2023, Huy Minh Bùi đã viết:

Alexey Cherepanov (alxchr)

unread,
Jun 22, 2023, 11:46:06 AM6/22/23
to Android-x86
Your device is not recognized by kernel. Try to load btusb and set VID and PID like this commands:
modprobe btusb; echo "04ca 2007" >> /sys/bus/usb/drivers/btusb/new_id;
In success case dmesg output should contain lines like this:
[ 5672.677177] Bluetooth: hci0: BCM: chip id 63
[ 5672.678377] Bluetooth: hci0: BCM: features 0x07
[ 5672.695453] Bluetooth: hci0: BCM20702A
[ 5672.697312] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
четверг, 22 июня 2023 г. в 19:32:40 UTC+5, Dmitriy:

Dmitriy

unread,
Jun 22, 2023, 2:26:05 PM6/22/23
to Android-x86
Hello

The following are perhaps relevant lines from logcat:
BluetoothManagerService: Bluetooth boot completed
BluetoothManagerService: MESSAGE_GET_NAME_AND_ADDRESS
BluetoothManagerService: Fail to bind to: Intent { act=android.bluetooth.IBluetooth }

BluetoothAdapter: isLeEnabled(): OFF
BluetoothAdapter: enableBLE(): Calling enable
BluetoothManagerService: enable(com.google.android.gms): mBluetooth = null mBinding = false mState = OFF 
BluetoothManagerService: MESSAGE_ENABLE(0): mBluetooth = null  

While trying to create btusb directory in /sys/bus/usb/drivers/ "operation not permitted" error is returned.

Thank you
Dmitriy

Alexey Cherepanov (alxchr)

unread,
Jun 22, 2023, 11:34:21 PM6/22/23
to Android-x86
Directory /sys/bus/usb/drivers/btusb is to be created by command
modprobe btusb
Don't try to create it manually.

четверг, 22 июня 2023 г. в 23:26:05 UTC+5, Dmitriy:

Dmitriy

unread,
Jun 23, 2023, 11:50:19 AM6/23/23
to Android-x86
Hi Alexey

Unfortunately modprobe btusb followed by echo "04ca 2007" >> /sys/bus/usb/drivers/btusb/new_id did not fix the problem. I've also tried putting "0a5c 4500" in new_id, also without success., hciconfig returns nothing. Is adding value to new_id automatically trigger btusb to try new device or additional command is needed?

Thank you
Dmitriy

Alexey Cherepanov (alxchr)

unread,
Jun 23, 2023, 12:07:10 PM6/23/23
to Android-x86
Did you try substitute real VID and PID of your bt device rather than ones from my example? If yes your device isn't supported by btusb, try to use other device.

пятница, 23 июня 2023 г. в 20:50:19 UTC+5, Dmitriy:

Dmitriy

unread,
Jun 23, 2023, 4:16:23 PM6/23/23
to Android-x86
Hi Alexey

Yes, I've tried "0a5c 4500" (BCM2046B1 USB 2.0 Hub, part of BCM2046 Bluetooth, listed by lsusb in android x86 and CentOS), also tried "413c 8156" (Dell 370 Bluetooth mini PCI Express card listed by lsusb in CentOS, but not in android x86). In CentOS I was not able to make Bluetooth work until I've installed bluez-hid2hci package.

Thank you
Dmitriy

Huy Minh Bùi (HMTheBoy154)

unread,
Jun 23, 2023, 4:17:29 PM6/23/23
to Android-x86
nvm I fixed that on BlissOS now

Vào lúc 21:48:38 UTC+7 ngày Thứ Năm, 22 tháng 6, 2023, Huy Minh Bùi đã viết:

Dmitriy

unread,
Jun 24, 2023, 10:36:05 AM6/24/23
to Android-x86
Hello

Is it possible to incorporate this fix into 32 bit Android-x86 4.19.110? (I have Intel Core 2 Duo CPU and as far as I understand it's not supported by 64 bit Android-x86/ BlissOS, because Intel Core 2 Duo CPU does not support SSE 4.2.)

Thank you
Dmitriy

Huy Minh Bùi (HMTheBoy154)

unread,
Jun 24, 2023, 11:10:41 AM6/24/23
to Android-x86
sorry, my issue is different than yours. I guess that for you to get Bluetooth, you gonna have to compile hid2hci on your own
Vào lúc 21:36:05 UTC+7 ngày Thứ Bảy, 24 tháng 6, 2023, Dmitriy đã viết:

Dmitriy

unread,
Jun 28, 2023, 3:42:16 PM6/28/23
to Android-x86
Hello

Does C compiler exist for Android-x86?

Thank you
Dmitriy

Povilas Staniulis

unread,
Jun 28, 2023, 4:56:56 PM6/28/23
to andro...@googlegroups.com
Of course it does :D
It's called Android NDK (based on gcc/clang, mostly clang nowadays). That's literally what is used to build all native code (non-Java) parts of Android.
--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.

Dmitriy

unread,
Jun 28, 2023, 6:35:54 PM6/28/23
to Android-x86
Hello

Let me rephrase a question. Does native C compiler exist which can be ran on Android-x86?

Thank you
Dmitriy

Povilas Staniulis

unread,
Jun 29, 2023, 6:49:22 AM6/29/23
to andro...@googlegroups.com
Android runs on Linux. In theory, anything that can run on Linux, can be built (in one way or another) to run on Android and that includes compilers.
Even without root access, you can get something like gcc or clang running inside of Termux.
If you have root access, you can run any distribution in a chroot environment and on x86 processors, you can easily run the official NDK this way (it will take more effort for ARM).

crw

unread,
Jun 29, 2023, 6:50:53 AM6/29/23
to Android-x86
Yes one exists, clang on termux. 

Dmitriy

unread,
Jul 5, 2023, 3:34:12 PM7/5/23
to Android-x86
Hello

I was able to successfully compile hid2hci.c after compiling and installing libudev-zero. I can submit following command:
./tools_hid2hci --method=dell --devpath=/devices/pci0000:00/0000:00:1a.0/usb3/3-1 –mode=hci

However, I'm getting following errors:
control transfer failed: Broken pipe (32)
error: switching device '/sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1' failed.

There are few "avc: denied" entries in dmesg triggered by tools_hid2hci execution. SELinux mode is permissive. I've tried to add androidboot.selinux=disable to grub entry to check if SELinux might be causing problems, however after boot sestatus still indicate SELinux is enabled.

Any ideas on how to fix errors during hid2hci execution?

Thank you
Dmitriy

Dmitriy

unread,
Jul 7, 2023, 4:57:44 PM7/7/23
to Android-x86
Hello

Problems with running hid2hci might by partially related to android x86 not detecting and listing by lsusb Dell 370 Bluetooth mini PCI Express card (413c 8156). This card is listed by lsusb on CentOS. What could be the reason(s) for android x86 not to detect this card?

Thank you
Dmitriy

Dmitriy

unread,
Jul 11, 2023, 3:26:47 PM7/11/23
to Android-x86
I've finally solved problems with Dell 370 Bluetooth mini PCI Express card (Broadcom BCM2046) on Android-x86, hid2hci has to be pointing to 413c:8158 device.

tools_hid2hci --method=dell --devpath=/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.2 -–mode=hci

It still generates error: switching device '/sys/devices/pci0000:00/0000:00:1a.0/usb3/3-1/3-1.2' failed, but nevertheless after running above command Dell 370 Bluetooth mini PCI Express card (413c 8156) is listed by lsusb and btusb is able to recognize it and Bluetooth is operational. Since it's might be useful to someone, attached is hid2hci code and executable file compiled on Android-x86 4.19.110 (32 bit) using clang in termux.  
tools_hid2hci
tools_hid2hci.c
Reply all
Reply to author
Forward
0 new messages