Android-x86 Bluez integration

1,498 views
Skip to first unread message

Chih-Wei Huang

unread,
Jul 17, 2015, 6:46:34 AM7/17/15
to Android-x86, linux-b...@vger.kernel.org
Hi all,
As you have probably noticed, the Bluez 5.32 was
integrated to kitkat-x86 to replace bluedroid stack
as a part of the Android-x86 4.4-r3 release.
Many thanks to the Bluez team to make this possible
and Povilas Staniulis / cheatman pointed me
the direction.

I've tested all the devices with Bluetooth chip I have.
Almost all of them work nice.
It's much more stable and usable than before.
I'm very satisfied with the status.

If you have HCI USB based chip with
correct linux driver and firmware,
the 4.4-r3 release should just work for you.
If not, show me the output of
dmesg, lsmod, logcat and hciconfig.

If you have HCI UART bluetooth device,
you may need to configure the UART port
by hciattach or similar tool.
Read the init_hal_bluetooth function of
device/generic/x86/init.sh and see the
T10*TA section as an example.
Send me a patch if you have configured it
successfully.

Known issues:
* Bluetooth in ASUS T100 is still unstable:
Sometimes can't scan any device.
Can pair a Bluetooth speaker but can't play audio.
Probably a driver or firmware issue?

I'll update the lollipop-x86 for the
Bluez integration later.

--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Saipudin Haris

unread,
Jul 18, 2015, 12:21:38 AM7/18/15
to andro...@googlegroups.com, linux-b...@vger.kernel.org
Hi Chih-Wei,

I've tested android-x86-4.4-r3.iso, just to report that my built in macbook 8,1 bluetooth is not detected...
lsmod.txt
tombstone_00.txt
apple broadcom bluetooth hci.png
dmesg.txt
logcat.txt

Chih-Wei Huang

unread,
Jul 18, 2015, 9:54:41 AM7/18/15
to Android-x86
2015-07-18 12:21 GMT+08:00 Saipudin Haris <dns2...@gmail.com>:
> Hi Chih-Wei,
>
> I've tested android-x86-4.4-r3.iso, just to report that my built in macbook
> 8,1 bluetooth is not detected...

Could you just try

busybox modprobe btusb
hciconfig

If hciconfig show something (hci0 exists), try
to restart gui

stop; start

and see if bluetooth works.

Saipudin Haris

unread,
Jul 18, 2015, 12:24:12 PM7/18/15
to andro...@googlegroups.com
Hi Chih-Wei,


Here are transcript from Terminal Emulator
==============================

uid=0(root) gid=0(root)@x86:/ # busybox modprobe btusb
uid=0(root) gid=0(root)@x86:/ # hciconfig -a
hci0:   Type: BR/EDR  Bus: USB
        BD Address: B8:8D:12:1C:ED:BB  ACL MTU: 1021:8  SCO MTU: 64:1
        DOWN
        RX bytes:511 acl:0 sco:0 events:23 errors:0
        TX bytes:339 acl:0 sco:0 commands:23 errors:0
        Features: 0xff 0xff 0xcf 0xfe 0x9b 0xff 0x79 0x83
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH HOLD SNIFF PARK
        Link mode: SLAVE ACCEPT

uid=0(root) gid=0(root)@x86:/ # stop; start




After turning on the bluetooth in settings

=============================

uid=0(root) gid=0(root)@x86:/ # hciconfig -a
hci0:    Type: BR/EDR  Bus: USB
    BD Address: B8:8D:12:1C:ED:BB  ACL MTU: 1021:8  SCO MTU: 64:1
    UP RUNNING PSCAN ISCAN
    RX bytes:2909 acl:0 sco:0 events:184 errors:0
    TX bytes:4119 acl:0 sco:0 commands:150 errors:0
    Features: 0xff 0xff 0xcf 0xfe 0x9b 0xff 0x79 0x83
    Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
    Link policy: RSWITCH HOLD SNIFF PARK
    Link mode: SLAVE ACCEPT
    Name: 'MacBookPro8,1'
    Class: 0x1a020c
    Service Classes: Networking, Capturing, Object Transfer
    Device Class: Phone, Smart phone
    HCI Version: 2.1 (0x4)  Revision: 0x34f
    LMP Version: 2.1 (0x4)  Subversion: 0x422a
    Manufacturer: Broadcom Corporation (15)



NB: 1. the internal bluetooth adapter detected succesfully, but it can't scan / find bluetooth device (it can't see my phone)...
       2. i tried to scan/find from my phone, it is detected, but when i tried to pair from my phone it pop up error about "incorrect pin or passkey"
bluetooth detected.jpg
incorrect pin or passkey.png

pstglia

unread,
Jul 18, 2015, 8:17:53 PM7/18/15
to andro...@googlegroups.com
Tested with a small dongle I have (0a12:0001 - Cambridge Silicon Radio Ltda) and it worked fine.

I could pair it with my Mobile Phone and exchange pics from/to it.

* * *

uid=0(root) gid=0(root)@x86:/ # hciconfig
hci0: Type: BR/EDR Bus: USB
BD Address: 00:18:E4:0B:C8:41 ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN
RX bytes:710143 acl:2409 sco:0 events:984 errors:0
TX bytes:247380 acl:1562 sco:0 commands:55 errors:0

uid=0(root) gid=0(root)@x86:/ # lsusb
...
Bus 005 Device 002: ID 0a12:0001

Saipudin Haris

unread,
Jul 19, 2015, 1:55:19 AM7/19/15
to andro...@googlegroups.com
Hi Chih-Wei,

I've run tested by macbook builtin bluetooth adapter with Ubuntu 10.04.02 and my other phone, Samsung GT-N7000.
i've attached screenshot of test. 


1. ubuntu 14.04.02 bt can see my phone.jpg
10. ubuntu 10.04.02 dmesg.txt
11. ubuntu 10.04.02 lsmod.txt
2. my phone can see ubuntu 14.04.02 bt.jpg
3. pair request from ubuntu 10.04.02 to my phone.jpg
4. pair request from ubuntu 10.04.02.jpg
5. pair from ubuntu 10.04.02 to my phone succesfully.jpg
6. bt send file test from ubuntu 10.04.02 to my phone.jpg
7. received bt send file test from ubuntu 10.04.02 to my phone.png
8. failed to send file test from my phone to ubuntu 10.04.02.png
9. ubuntu 10.04.02 hciconfig.jpg

Saipudin Haris

unread,
Jul 19, 2015, 2:03:16 AM7/19/15
to andro...@googlegroups.com
edit from previous post: not Ubuntu 10.04.02 but Ubuntu 14.04.02 (my bad)

I've also re-run test my macbook builtin bluetooth adapter with Android x86 v4.4-r3 and my other phone, Samsung GT-N7000.
1. android x86 bt can't see my phone, but my phone bt suddenly appear if i try to pair from my phone. note, i can't pair from android x86. if i click pair it from android x86 it just say pairing then stop.jpg
10. failed bluetooth sent file from android x86 to phone status.jpg
11. failed bluetooth sent file from android x86 to phone retry confirmation.jpg
2. phone pair request to android x86.png
3. phone pair request confirmation on android x86.jpg
4. phone pair suceesfully.jpg
5. bluetooth incoming file from phone confirmation.jpg
5. bluetooth incoming file from phone notification.jpg
7. bluetooth received incoming file from phone notification.jpg
8. bluetooth incoming file from phone notification.jpg
9. failed bluetooth sent file from android x86 to phone notification.jpg

rbg

unread,
Jul 19, 2015, 3:12:36 AM7/19/15
to andro...@googlegroups.com
how about etc/modules.blacklist????

aren't they blacklisted by default....???!!!

Chih-Wei Huang

unread,
Jul 20, 2015, 4:13:04 AM7/20/15
to Android-x86
2015-07-19 15:12 GMT+08:00 rbg <rbg.hp...@gmail.com>:
> how about etc/modules.blacklist????
>
> aren't they blacklisted by default....???!!!

Oh, they should be removed from the blacklist.
I forgot. Thank you for pointing it out.

Saipudin Haris

unread,
Jul 20, 2015, 1:43:01 PM7/20/15
to andro...@googlegroups.com
Hi Chih-Wei,

I've re-download your android x86 4.4 r3 re-built image and i re-tested it on my macbook internal bluetooth adapter against my GT-N7000 phone. I''ve attached the first test result.

problem:  android x86 4.4 r3 bt can't see my phone or other bluetooth device.
dmesg.txt
hciconfig.txt
logcat.txt
logcat_grep_bluetooth.txt
lsmod.txt
tombstone_00.txt
android x86 bt can't see my phone GT-N7000 re-test (sorry for the video quality).mp4

Saipudin Haris

unread,
Jul 20, 2015, 1:54:48 PM7/20/15
to andro...@googlegroups.com
Hi Chih-Wei,

this is the the second test result from previous post.

problem:  1. android x86 bluetooth can not send pair request to my GT-N7000,
                   but my GT-N7000 can send pair request to android x86 which then "forced" android x86 to see my GT-N7000.

               2. Pairing can only be established from my GT-N7000 only.

               3. android x86 4.4 r3 bluetooth can not send files to my GT-N7000 or other bluetooth device.
android x86 bluetooth file receive ok.jpg
android x86 bluetooth say 'pairing' to GT-N7000 then just stop.mp4
dmesg.txt
gallery thumbnail generation failed but can view properly. i can't send this test image via bluetooth to my phone GT-N7000 status.jpg
gallery thumbnail generation failed but can view properly. i can't send this test image via bluetooth to my phone GT-N7000.jpg
gallery thumbnail generation failed, known issues maybe.....jpg
logcat.txt
lsmod.txt
this android x86 bluetooth 'search for device' button does nothing, just say 'pairing' and then stop.jpg

rbg

unread,
Jul 20, 2015, 6:14:41 PM7/20/15
to andro...@googlegroups.com
could you look into this known issue on the MacBookPro....cause your using the b43 driver for you WiFi it appears...


hopefully it has been solved but who knows...

Saipudin Haris

unread,
Jul 20, 2015, 7:27:10 PM7/20/15
to andro...@googlegroups.com
Hi rbg,

Thanks for the info, All Problem SOLVED! It works like a charm.
================================================================

uid=0(root) gid=0(root)@x86:/ # hciconfig -a
hci0:   Type: BR/EDR  Bus: USB
        BD Address: B8:8D:12:1C:ED:BB  ACL MTU: 1021:8  SCO MTU: 64:1
        UP RUNNING PSCAN ISCAN
        RX bytes:3049 acl:22 sco:0 events:107 errors:0
        TX bytes:7108 acl:22 sco:0 commands:69 errors:0
        Features: 0xff 0xff 0xcf 0xfe 0x9b 0xff 0x79 0x83
        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
        Link policy: RSWITCH HOLD SNIFF PARK
        Link mode: SLAVE ACCEPT
        Name: 'MacBookPro8,1'
        Class: 0x1a020c
        Service Classes: Networking, Capturing, Object Transfer
        Device Class: Phone, Smart phone
        HCI Version: 2.1 (0x4)  Revision: 0x34f
        LMP Version: 2.1 (0x4)  Subversion: 0x422a
        Manufacturer: Broadcom Corporation (15)

uid=0(root) gid=0(root)@x86:/ # hcitool scan
Scanning ...
uid=0(root) gid=0(root)@x86:/ # rmmod b43
uid=0(root) gid=0(root)@x86:/ # busybox modprobe b43 btcoex=0
uid=0(root) gid=0(root)@x86:/ # hcitool scan
Scanning ...
        B0:EC:71:8C:65:40       GT-N7000
uid=0(root) gid=0(root)@x86:/ #

Chih-Wei Huang

unread,
Jul 20, 2015, 10:42:49 PM7/20/15
to Android-x86
That's great.

Please show the result of
cat /sys/class/dmi/id/product_name

I can add the quirk later.

rbg

unread,
Jul 20, 2015, 10:54:30 PM7/20/15
to andro...@googlegroups.com

Hey...even a blind squirrel finds an acorn every once in a while!!!!!!!!


the articles I went through trying to locate the issue...

most relevant info seemed to be:
--------------------------------
There seems to be a conflict between the bluetooth module and the b43 wifi. 

The solution is creating /etc/modprobe.d/b43.conf with
the following content:

options b43 btcoex=0

(so I assume this could be rolled into the KitKat / Lollipop code base somehow...
  question is what will it disrupt / cause other issues with???)


Because of the work I had done with the b43 / wl intergration (I emailed Chih-Wei that info)
I knew there was / could be many conflicts with those drivers and other drivers...as I had expressed 
in the android-x86 forums....this is simply one I hadn't seen...BUT I'd bet there are others......

REFS:
-----




Saipudin Haris

unread,
Jul 20, 2015, 11:11:58 PM7/20/15
to andro...@googlegroups.com
Hi Chih-Wei Huang

this is the result output you asked:
=========================
 
uid=0(root) gid=0(root)@x86:/ # cat /sys/class/dmi/id/product_name
MacBookPro8,1
uid=0(root) gid=0(root)@x86:/ #

Chih-Wei Huang

unread,
Jul 21, 2015, 2:31:53 AM7/21/15
to Android-x86
2015-07-21 11:11 GMT+08:00 Saipudin Haris <dns2...@gmail.com>:
> Hi Chih-Wei Huang
>
> this is the result output you asked:
> =========================
>
> uid=0(root) gid=0(root)@x86:/ # cat /sys/class/dmi/id/product_name
> MacBookPro8,1

Please apply the attached patch to device/generic/x86
and rebuild the image, or just apply it
to /system/etc/init.sh
(if you've installed it as read-write system)
macbook.diff

Saipudin Haris

unread,
Jul 21, 2015, 6:46:42 AM7/21/15
to andro...@googlegroups.com
Hi Chih-Wei,

The Patch Works, All Bluetooth Problem SOLVED!
I've also attached the modified init.sh, dmesg & logcat output.
init.sh
dmesg.txt
logcat.txt

Mario Holzinger

unread,
Jul 29, 2015, 2:41:41 AM7/29/15
to Android-x86, linux-b...@vger.kernel.org, cwh...@android-x86.org
Hi All!

I have successfully compiled a current version of kitkat with working bluetooth on my Microsoft Surface Pro 2.
many thanks for that.

did someone work also on the lollipop branch?
did you expect that it is difficult to port or should it be only the change of the repository to BlueZ and maybe minor adjustments

I will begin porting and look how far I come.
However any hint would help me to avoid problems

regards
Mario

Chih-Wei Huang

unread,
Jul 29, 2015, 2:52:37 AM7/29/15
to Mario Holzinger, Android-x86, linux-b...@vger.kernel.org
2015-07-29 14:41 GMT+08:00 Mario Holzinger <sandma...@gmail.com>:
>> Hi All!
>
>
> I have successfully compiled a current version of kitkat with working
> bluetooth on my Microsoft Surface Pro 2.
> many thanks for that.
>
> did someone work also on the lollipop branch?
> did you expect that it is difficult to port or should it be only the change
> of the repository to BlueZ and maybe minor adjustments

No, there should no particular issue to
integrate bluez into the lollipop branch.
I just have no time to do it yet.

> I will begin porting and look how far I come.
> However any hint would help me to avoid problems

Read http://git.kernel.org/cgit/bluetooth/bluez.git/tree/android/README

Rafael Segura

unread,
Aug 1, 2015, 6:46:58 PM8/1/15
to Android-x86, linux-b...@vger.kernel.org

Bluetooth not working on HP Stream 7, bluetooth provided by Realtek RTL8723bs SDIO adapter

Rafael Segura

unread,
Aug 1, 2015, 6:48:10 PM8/1/15
to Android-x86, linux-b...@vger.kernel.org


On Friday, July 17, 2015 at 7:46:34 AM UTC-3, Chih-Wei Huang wrote:

rbg

unread,
Sep 7, 2015, 9:11:14 AM9/7/15
to Android-x86, sandma...@gmail.com, linux-b...@vger.kernel.org
UNOFFICIAL lollipop-x86 5.1.1_r13 BlueZ (Bluetooth) TEST BUILD
-----------------------------------------------------------------------------------------

      ---- FOR TESTING PURPOSES ONLY----

********************************************************************
WARNING: be advised that:
 - These changes may contain bugs that could DAMAGE your hardware and/or cause DATA LOSS.

 - The iso was simply tested for boot and a couple things checked...
 - img file untested...
 - No Bluetooth testing was able to be done...NO Bluetooth DEVICES

Use it AT YOUR OWN RISK. YOU WERE ADVISED
********************************************************************

please supply: logcat / dmesg / lsmod / lspci -k to help development

check these forums if unsure how to get the above...plenty
of help and HOWTO's..


TEST BUILD available here:

Reply all
Reply to author
Forward
0 new messages