BBBAndroid with USB Bluetooth Adapter Support

734 views
Skip to first unread message

Keith Conger

unread,
Feb 5, 2015, 1:39:48 PM2/5/15
to beagl...@googlegroups.com
Has anyone managed to enable USB Bluetooth Adapter Support in BBBAndroid.  I've read the Android > 4.2 can support USB bluetooth if built correctly.

This is what I've tried so far:

I set the following in "device/ti/beagleboneblack/BoardConfig.mk"
BOARD_HAVE_BLUETOOTH := true

And the following in "kernel/.config"
CONFIG_BT=y
CONFIG_BT_RFCOMM=y
CONFIG_BT_RFCOMM_TTY=y
CONFIG_BT_BNEP=y
CONFIG_BT_BNEP_MC_FILTER=y
CONFIG_BT_BNEP_PROTO_FILTER=y
CONFIG_BT_HIDP=y

#
# Bluetooth device drivers
#
CONFIG_BT_HCIBTUSB=y
CONFIG_BT_HCIBTSDIO=y
CONFIG_BT_HCIUART=y
CONFIG_BT_HCIUART_H4=y
CONFIG_BT_HCIUART_BCSP=y
CONFIG_BT_HCIUART_ATH3K=y
CONFIG_BT_HCIUART_LL=y
CONFIG_BT_HCIUART_3WIRE=y
CONFIG_BT_HCIBCM203X=y
CONFIG_BT_HCIBPA10X=y
CONFIG_BT_HCIBFUSB=y
CONFIG_BT_HCIVHCI=y
CONFIG_BT_MRVL=y
CONFIG_BT_MRVL_SDIO=y
CONFIG_BT_ATH3K=y
CONFIG_BT_WILINK=y

However after I build a new image, most of the above are reverted to ‘m’ from ’y’.

Created a file called “/system/etc/permissions/beagleboardblack.xml” that contains:

<permissions>
<feature name="android.hardware.bluetooth" />
</permissions>

I'm new to the Android OS build environment, so I'm not sure if I missing something.  I need Bluetooth for the project I'm working on.  So I'm open to any options even if it means different hardware all together.

Thanks in advance


Andrew Henderson

unread,
Feb 10, 2015, 12:26:07 PM2/10/15
to beagl...@googlegroups.com
Well, Bluetooth being recognized by the kernel and Bluetooth being accessible via the API are two very different animals.  Enabling the Bluetooth stack in the kernel, as well as the device drivers, is the first step.  Once that portion is done, your Bluetooth device must be registered within the Android HAL to access it from the API.  If you take a look in the BBBAndroid source tree in hardware/libhardware/include/hardware/bluetooth.h, you can see the interface functions used to bridge the API to a Bluetooth device.  I have not checked into whether you can bypass all of this by using a USB Bluetooth device, though.  For example, if you are using a Bluetooth keyboard with a USB/Bluetooth dongle plugged into the BBB, will the BBB see it as a Bluetooth device or a USB keyboard?  If you can leverage the USB drivers and have the Bluetooth functionality of your device be "invisible" to Android, then you're in luck.  But, if you want to use the full Bluetooth API to manage your device, BBBAndroid is missing the portion of the HAL needed to make that happen.

What is the nature of the Bluetooth device that you are using? 

Keith Conger

unread,
Feb 10, 2015, 12:45:49 PM2/10/15
to beagl...@googlegroups.com
Hi Andrew,

Thanks for replying.

I have read that.  I'm currently compiling BBBAndroid with Android-x86's bluedroid which appears to have USB BT support.


I'd like to use rfcomm and audio, rfcomm is more important though.  I'm open to other hardware suggestions too.  

My requirements for my little pet project are:

Android 
Resistive touch screen
Bluetooth
USB Host
RTC
Audio out

BTW I see your attending SU.  Great school, I attended a few courses there and just moved away from the area.

Thanks again,
Keith


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/X4HYHv9cC-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Keith Conger
keith DOT conger AT gmail DOT com
http://thecongers.org

Keith Conger

unread,
Feb 10, 2015, 12:47:54 PM2/10/15
to beagl...@googlegroups.com
Forgot to ask.  How do I get my kernel options to stick in the BBBAndroid build process?  My manual settings keep getting reverted when I build it.

Keith

On Tue, Feb 10, 2015 at 10:26 AM, Andrew Henderson <hend...@icculus.org> wrote:

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/X4HYHv9cC-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Henderson

unread,
Feb 10, 2015, 1:20:44 PM2/10/15
to beagl...@googlegroups.com
If you get bluedroid working and it is a viable approach, let me know and I'll add it into the manifest as an external repo for BBBAndroid.  Right now, I don't have the cgroups set up properly for audio, so I'm not sure how well audio support is working via HDMI or audio cape.  Bluetooth is a question mark right now, but the other pieces work OK.  I've used the Adafruit DS1307 RTC breakout board via I2C to set the system clock during the kernel boot process, so that will be transparent to Android.

If you take a look at the top-level makefile, you'll see these lines:

kernel_not_configured := $(wildcard kernel/.config)

ifeq ($(TARGET_PRODUCT), beagleboneblack)
CLEAN_RULE = kernel_clean clean
rowboat: kernel_build
endif

kernel_build: droid
ifeq ($(strip $(kernel_not_configured)),)
        $(MAKE) -C kernel ARCH=arm am335x_evm_android_defconfig
endif

That "am335x_evm_android_defconfig" is getting selected because the script isn't finding your kernel/.config file.  I guess this isn't working properly for you for some reason?  Anyway, you can remove that defconfig from that line or backup/modify that defconfig in kernel/arch/arm/configs.

I have been at SU for so long now that I have a mailbox in the EECS department and potential PhD students are brought by my office to ask questions during their campus visits.  My usual advice to them is to dress warm and invest in a high-quality snow shovel.


On Tuesday, February 10, 2015 at 5:45:49 PM UTC, Keith Conger wrote:
Hi Andrew,

Thanks for replying.

I have read that.  I'm currently compiling BBBAndroid with Android-x86's bluedroid which appears to have USB BT support.


I'd like to use rfcomm and audio, rfcomm is more important though.  I'm open to other hardware suggestions too.  

My requirements for my little pet project are:

Android 
Resistive touch screen
Bluetooth
USB Host
RTC
Audio out

BTW I see your attending SU.  Great school, I attended a few courses there and just moved away from the area.

Thanks again,
Keith

Keith Conger

unread,
Feb 10, 2015, 1:26:04 PM2/10/15
to beagl...@googlegroups.com
I'll let you know how it goes with bluedroid.  And thanks for the help and information.  I may have some questions when I get to adding the RTC.

I spent the first 35 years of my life in the Syracuse area, don't miss the snow.  This fall I moved to Colorado Springs :)


--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/X4HYHv9cC-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Keith Conger

unread,
Feb 10, 2015, 3:41:52 PM2/10/15
to beagl...@googlegroups.com
It built without errors.  I'm having trouble with the kernel though.  I made sure kernel/.config and am335x_evm_android_defconfig both had CONFIG_BT=y.  I re-ran make in the root of BBBAndroid. As soon as I answered the questions about the USB gadget driver it reverted to CONFIG_BT=m along with the other options I modified.  Any ideas Andrew?

Keith

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/X4HYHv9cC-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Henderson

unread,
Feb 10, 2015, 4:06:34 PM2/10/15
to beagl...@googlegroups.com
Try configuring the kernel using the "menuconfig" target (like "make menuconfig" in the makefile).  I suspect that you are manually setting something in the .config and there are other settings that conflict with it.  Normally, these conflicts are managed via the Kconfig or menuconfig interface (i.e. it just takes options away from you or forces some items to be modules).  Make sure that the options that you are setting are actually all compatible with each other.  If all else fails, you can manually insmod modules in the init.{ro.hardware}.rc file inside of Android during boot.

Keith Conger

unread,
Feb 10, 2015, 5:29:53 PM2/10/15
to beagl...@googlegroups.com
That was it RFKILL needed to be built in also.  Rebuilding.

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/X4HYHv9cC-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Keith Conger

unread,
Feb 11, 2015, 10:26:23 AM2/11/15
to beagl...@googlegroups.com
Getting closer.  I have everything built and running bdt, produces a logcat message that there is no supported device.  This is with two different adapters.  I've posted some questions to the android-x86 list including which adapters are supported.  I think I'm getting close.

Also I found that there is a android-bluez project that is a drop in replacement for bluedroid.  I may try that next.

To unsubscribe from this group and all its topics, send an email to beagleboard+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

LW

unread,
Feb 16, 2015, 3:17:03 PM2/16/15
to beagl...@googlegroups.com
Hi Keith,

I am working on similar project and very interested your progress.

I have a Knivao BTD-400 Bluetooth USB adapter (it uses Broadcom BCM20702A0 chip). My work is based on the TI stock Beaglebone Black android code base (JB 4.2 Kernel 3.2.0). I noticed that the BCM20702A0 is supported by default.

By adding the VID and PID of the USB adapter to the btusb_table in btusb.c and perform an echo in android shell like: echo "0x05ac, 0x21e8" > /sys/bus/usb/driver/btusb/new_id, the hci0 interface will shown up under /sys/class/bluetooth/hci/hci0

Then I can the hciconfig to bring hci0 up / down and use hcitool to do scan and detect other bluetooth devices (hciconfig and hcitool are ported from ICS). It seems that the USB bluetooth device at kernel level is alive. As you know in JB4.2 it seems that the UART interface is the by-default interface between the android and kernel. Basically I am not able to enable the bluetooth from android. The interface is missing. I am trying to figure out how to bridge the gap here.

It seems that you made progress on the android side but couldn't detect supported device. I wonder if you could share the information on porting and building the bluedroid ( assuming using android-x86).

Thanks,

Lei
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Keith Conger

unread,
Feb 16, 2015, 6:23:24 PM2/16/15
to beagl...@googlegroups.com
Hi,

I'm currently trying two approaches:

1) Integrating android-x86's bluedroid

2) Using android-bluez as a replacement to bluedroid

Neither is functional yet :(  I'll report back when I have something working.

Keith

Keith Conger

unread,
Feb 17, 2015, 4:20:42 PM2/17/15
to beagl...@googlegroups.com
I think I'm getting close with integrating android-bluez.  I have bluetoothd 'seeing' my adapter however dies at connecting to IPC.  I've posed the question to the bluez list.

Here is a logcat with debugging enabled.  I've googled the errors and have had no luck. 

I/bluetoothd( 1072): Bluetooth daemon 5.28

D/bluetoothd( 1072): external/bluetooth/bluez/android/main.c:set_capabilities() Caps: eff: 0x3400, perm: 0x3400, inh: 0x0

D/bluetoothd( 1072): external/bluetooth/bluez/android/bluetooth.c:bt_bluetooth_start() index -1

I/bluetoothd( 1072): Starting SDP server

D/bluetoothd( 1072): external/bluetooth/bluez/android/main.c:main() Entering main loop

I/bluetoothd( 1072): mgmt_if: [0xffff] command 0x0001

I/bluetoothd( 1072): mgmt_if: < 01 00 ff ff 00 00                                ..??..          

I/bluetoothd( 1072): mgmt_if: > 01 00 ff ff 06 00 01 00 00 01 07 00              ..??........    

I/bluetoothd( 1072): mgmt_if: [0xffff] command 0x0001 complete: 0x00

D/bluetoothd( 1072): external/bluetooth/bluez/android/bluetooth.c:read_version_complete() 

I/bluetoothd( 1072): Bluetooth management interface 1.7 initialized

I/bluetoothd( 1072): Kernel connection control will be used

I/bluetoothd( 1072): mgmt_if: [0xffff] command 0x0003

I/bluetoothd( 1072): mgmt_if: < 03 00 ff ff 00 00                                ..??..          

I/bluetoothd( 1072): mgmt_if: > 01 00 ff ff 07 00 03 00 00 01 00 00 00           ..??.........   

I/bluetoothd( 1072): mgmt_if: [0xffff] command 0x0003 complete: 0x00

D/bluetoothd( 1072): external/bluetooth/bluez/android/bluetooth.c:read_index_list_complete() 

D/bluetoothd( 1072): external/bluetooth/bluez/android/bluetooth.c:read_index_list_complete() Number of controllers: 1

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0004

I/bluetoothd( 1072): mgmt_if: < 04 00 00 00 00 00                                ......          

I/bluetoothd( 1072): mgmt_if: > 01 00 00 00 1b 01 04 00 00 e9 36 36 e7 18 00 03  .........?66?...

I/bluetoothd( 1072): mgmt_if:   0f 00 bf 10 00 00 90 00 00 00 00 00 00 42 43 4d  ..?..........BCM

I/bluetoothd( 1072): mgmt_if:   32 30 34 35 42 33 00 00 00 00 00 00 00 00 00 00  2045B3..........

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00                                               .               

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0004 complete: 0x00

D/bluetoothd( 1072): external/bluetooth/bluez/android/bluetooth.c:read_info_complete() 

D/bluetoothd( 1072): external/bluetooth/bluez/src/sdpd-service.c:register_device_id() Adding device id record for 0002:1d6b:0247:051c

D/bluetoothd( 1072): external/bluetooth/bluez/src/sdpd-service.c:add_record_to_server() Adding record with handle 0x10001

D/bluetoothd( 1072): external/bluetooth/bluez/src/sdpd-service.c:add_record_to_server() Record pattern UUID 00001002-0000-1000-8000-00805f9

D/bluetoothd( 1072): external/bluetooth/bluez/src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000113a-0000-1000-8000-00805f9

D/bluetoothd( 1072): external/bluetooth/bluez/src/sdpd-service.c:add_record_to_server() Record pattern UUID 0000113b-0000-1000-8000-00805f9

D/bluetoothd( 1072): external/bluetooth/bluez/android/bluetooth.c:load_ltks() ltks 0

D/bluetoothd( 1072): external/bluetooth/bluez/android/bluetooth.c:load_irks() irks 0

D/bluetoothd( 1072): external/bluetooth/bluez/android/bluetooth.c:load_link_keys() keys 0 

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x000e

I/bluetoothd( 1072): mgmt_if: < 0e 00 00 00 02 00 02 0c                          ........        

I/bluetoothd( 1072): mgmt_if: > 01 00 00 00 06 00 0e 00 00 00 00 00              ............    

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x000e complete: 0x00

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0011

I/bluetoothd( 1072): mgmt_if: < 11 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00  ................

I/bluetoothd( 1072): mgmt_if:   00 00 00 00 00 00                                ......          

I/bluetoothd( 1072): mgmt_if: > 01 00 00 00 06 00 11 00 00 00 00 00              ............    

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0011 complete: 0x00

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0034

I/bluetoothd( 1072): mgmt_if: < 34 00 00 00 07 00 00 00 00 00 00 00 00           4............   

I/bluetoothd( 1072): mgmt_if: > 01 00 00 00 0a 00 34 00 00 00 00 00 00 00 00 00  ......4.........

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0034 complete: 0x00

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0018

I/bluetoothd( 1072): mgmt_if: < 18 00 00 00 01 00 01                             .......         

I/bluetoothd( 1072): mgmt_if: > 01 00 00 00 03 00 18 00 00                       .........       

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0018 complete: 0x00

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0028

I/bluetoothd( 1072): mgmt_if: < 28 00 00 00 08 00 02 00 6b 1d 47 02 1c 05        (.......k.G...  

I/bluetoothd( 1072): mgmt_if: > 01 00 00 00 03 00 28 00 00                       ......(..       

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0028 complete: 0x00

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0010

I/bluetoothd( 1072): mgmt_if: < 10 00 00 00 11 00 fb 34 9b 5f 80 00 00 80 00 10  ......?4._......

I/bluetoothd( 1072): mgmt_if:   00 00 00 12 00 00 00                             .......         

I/bluetoothd( 1072): mgmt_if: > 01 00 00 00 06 00 10 00 00 00 00 00              ............    

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0010 complete: 0x00

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0010

I/bluetoothd( 1072): mgmt_if: < 10 00 00 00 11 00 fb 34 9b 5f 80 00 00 80 00 10  ......?4._......

I/bluetoothd( 1072): mgmt_if:   00 00 3b 11 00 00 00                             ..;....         

I/bluetoothd( 1072): mgmt_if: > 01 00 00 00 06 00 10 00 00 00 00 00              ............    

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0010 complete: 0x00

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0013

I/bluetoothd( 1072): mgmt_if: < 13 00 00 00 02 00 00 00                          ........        

I/bluetoothd( 1072): mgmt_if: > 02 00 00 00 03 00 13 00 0c                       .........       

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x13 status: 0x0c

I/bluetoothd( 1072): Failed to load LTKs: Not Supported (0x0c)

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0030

I/bluetoothd( 1072): mgmt_if: < 30 00 00 00 02 00 00 00                          0.......        

I/bluetoothd( 1072): mgmt_if: > 02 00 00 00 03 00 30 00 0c                       ......0..       

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x30 status: 0x0c

I/bluetoothd( 1072): Failed to load IRKs: Not Supported (0x0c)

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0012

I/bluetoothd( 1072): mgmt_if: < 12 00 00 00 03 00 00 00 00                       .........       

I/bluetoothd( 1072): mgmt_if: > 01 00 00 00 03 00 12 00 00                       .........       

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0012 complete: 0x00

D/bluetoothd( 1072): external/bluetooth/bluez/android/bluetooth.c:load_link_keys_complete() status 0

I/bluetoothd( 1072): Adapter initialized

D/bluetoothd( 1072): external/bluetooth/bluez/android/ipc.c:cmd_connect_cb() 

E/bluetoothd( 1072): IPC: command socket connect failed

I/bluetoothd( 1072): Switching controller off

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0005

I/bluetoothd( 1072): mgmt_if: < 05 00 00 00 01 00 00                             .......         

I/bluetoothd( 1072): mgmt_if: > 01 00 00 00 07 00 05 00 00 90 00 00 00           .............   

I/bluetoothd( 1072): mgmt_if: [0x0000] command 0x0005 complete: 0x00

D/bluetoothd( 1072): external/bluetooth/bluez/android/main.c:cleanup_services() 

I/bluetoothd( 1072): Stopping SDP server

I/bluetoothd( 1072): Exit

Andrew Henderson

unread,
Feb 17, 2015, 4:48:08 PM2/17/15
to beagl...@googlegroups.com
On Tuesday, February 17, 2015 at 4:20:42 PM UTC-5, Keith Conger wrote:
 

D/bluetoothd( 1072): external/bluetooth/bluez/android/ipc.c:cmd_connect_cb() 

E/bluetoothd( 1072): IPC: command socket connect failed

OK, this is the place to start.  A socket isn't being created properly.  That means that either the permissions aren't correct or the call used to create/interact with the socket is not supported.  The Bionic libc replacement does not implement a number of Linux kernel system calls because those system calls are not used under Android.  For example, shared memory or message queue syscalls aren't implemented because all IPC should be routed through Binder.  My guess is that you are running into something like this (section 1.2):


The epoll_create1 syscall is not implemented by default in Bionic, so making an epoll_create1() call in Bionic results in an immediate failure.  Try dumping out logcat info at that error point with the errno value after the failed function call in cmd_connect_cb().  I bet that it is calling a Bionic function that doesn't generate the appropriate syscall to the kernel.

Keith Conger

unread,
Feb 17, 2015, 5:05:20 PM2/17/15
to beagl...@googlegroups.com
Hi Andrew,

I did hand patch epoll_create1() into bionic. The above was a logcat,
how do I get the errno value?

Thanks,
Keith

Andrew Henderson

unread,
Feb 17, 2015, 5:18:21 PM2/17/15
to beagl...@googlegroups.com
On Tue, 17 Feb 2015, Keith Conger wrote:

> I did hand patch epoll_create1() into bionic. The above was a logcat,
> how do I get the errno value?

Immediately after any failed POSIX call, the errno global variable (an
integer) is set. Just include the errno.h header in the file making the
failed call to get access to the errno variable. You can see how the
logcat message is being generated in that same file (usually via a
system() call to "logcat" or a C++ stream to LOG(INFO) or whatever.

Andrew

Keith Conger

unread,
Feb 17, 2015, 5:52:32 PM2/17/15
to beagl...@googlegroups.com
Oh ok I see. I'll give it a try.

Thanks,
Keith

Keith Conger

unread,
Feb 17, 2015, 7:24:07 PM2/17/15
to beagl...@googlegroups.com
Ok, apparently my problem may be because I'm running bluetoothd by hand and the socket isn't created.  

However I did get 111, connection refused.

Here is a complete logcat and my init files.
init-current.zip

Keith Conger

unread,
Feb 19, 2015, 12:09:54 PM2/19/15
to beagl...@googlegroups.com
I've made a lot of progress with the help of the bluez team.  It looks like my problem is that Android thinks its running in an emulator.

Using haltest from bluez everything works. haltest actually goes through Android bluetooth HAL.

Andrew any idea on why it would think your kernel is for an emulator?

Thanks,
Keith

Andrew Henderson

unread,
Feb 19, 2015, 12:23:50 PM2/19/15
to beagl...@googlegroups.com
Yes, there is a kernel command line option that is passed to the kernel in
the uEnv.txt file that says so (qemu=1, I think?). It has been a while,
but I believe this is necessary to emulate the OpenGL ES calls.
Otherwise, it all crashes constantly because there isn't OpenGL ES
support. You can try removing that option, though, and see how it works
for you. I originally added that in for the 4.2.2 JellyBean build from
Rowboat, though we might get lucky and have it work without it from the
4.4.4 KitKat build from AOSP.

Andrew

Keith Conger

unread,
Feb 19, 2015, 12:25:15 PM2/19/15
to beagl...@googlegroups.com
Sorry, I see the problem. ro.kernel.qemu is set to 1.

I'm commenting out the check. And rebuilding.

Keith Conger

unread,
Feb 19, 2015, 12:31:17 PM2/19/15
to beagl...@googlegroups.com
I'll give it a try.

Keith Conger

unread,
Feb 19, 2015, 12:36:45 PM2/19/15
to beagl...@googlegroups.com
Still crashes :)  

Keith Conger

unread,
Feb 19, 2015, 1:50:43 PM2/19/15
to beagl...@googlegroups.com
I've got bluetooth finally working.  Andrew, what would be the best way to pass you the changes needed?

Thanks again for all your help.

Keith

Andrew Henderson

unread,
Feb 19, 2015, 2:27:37 PM2/19/15
to beagl...@googlegroups.com
On Thursday, February 19, 2015 at 1:50:43 PM UTC-5, Keith Conger wrote:
I've got bluetooth finally working.  Andrew, what would be the best way to pass you the changes needed?

Patches generated by git are fine.  If you know the major parts that you patched, you can also cd into the appropriate directory and do a "git status" to show you which files have changed and just mail me those files (hendersa (at) icculus.org).  For subdirectories that are completely new (like the Bluez added into external/), you can just tar up the directory and send it to me.  My understanding is that you added in Bluez, modified the build scripts to pull that external project in, patched bionic, and changed the kernel config to build in Bluetooth.  Does that sound about right? 

Thanks again for all your help.

No problem at all.  Thanks for sticking this out and working through all this.  I'm sure others will appreciate the effort. 

Andrew

Keith Conger

unread,
Feb 19, 2015, 6:13:13 PM2/19/15
to beagl...@googlegroups.com


On Thursday, February 19, 2015 at 12:27:37 PM UTC-7, Andrew Henderson wrote:
On Thursday, February 19, 2015 at 1:50:43 PM UTC-5, Keith Conger wrote:
I've got bluetooth finally working.  Andrew, what would be the best way to pass you the changes needed?

Patches generated by git are fine.  If you know the major parts that you patched, you can also cd into the appropriate directory and do a "git status" to show you which files have changed and just mail me those files (hendersa (at) icculus.org).  For subdirectories that are completely new (like the Bluez added into external/), you can just tar up the directory and send it to me.  My understanding is that you added in Bluez, modified the build scripts to pull that external project in, patched bionic, and changed the kernel config to build in Bluetooth.  Does that sound about right? 


Ok I'll start work on getting it over to you. Basically you are correct. Here are the steps at a high level:

* Add bluez repo to the manifest and told it to not pull bluedroid.
* Patched bionic, although I see bluez has a patched bionic in a repo for 4.4, maybe I can just change the manifest.
* Built bluetooth kernel modules from backports, 3.8 is too old
* Added insmod commands to init.{ro.hardware}.rc "on boot" and added "import init.bluetooth.rc"
* Commented out qemu=1 check for bluetooth.
* Had to manually move some libraries to /system/lib/hw/ from /system/lib/

Keith

mgob...@orcasolutions.be

unread,
Mar 4, 2015, 10:26:23 AM3/4/15
to beagl...@googlegroups.com
Hi All,

Hi All I'm trying to do the exact same thing here with bbbandroid. I have an asus 4.0 dongle with the BCM20702A0 chipset. I'm not really experienced when it comes to making my own kernels.
I do understand what you are doing with these high level steps you laid out here. However, I could use some help to actually execute them... I see you are going to include them as patches? Is the patch already available? Where can I find it? Thanks!

Michael

Op vrijdag 20 februari 2015 00:13:13 UTC+1 schreef Keith Conger:

Keith Conger

unread,
Mar 4, 2015, 10:42:25 AM3/4/15
to beagl...@googlegroups.com, mgob...@orcasolutions.be
Hi Michael,

I've sent them to Andrew to review and hopefully include in bbbandroid.  If you're in a hurry I could email them to you.

Keith

Michael Gobbers

unread,
Mar 4, 2015, 10:45:05 AM3/4/15
to Keith Conger, beagl...@googlegroups.com

That would be great! I'm in kind of a hurry. At the moment I completer step 2 of the steps you mentioned.

Cheers,
Michael

Andrew Henderson

unread,
Mar 5, 2015, 4:22:11 PM3/5/15
to beagl...@googlegroups.com, keith....@gmail.com, mgob...@orcasolutions.be
I have the integration of Bluetooth into BBBAndroid in my work queue, and I'm getting to it, but it will still be a few days (at least).

mgob...@orcasolutions.be

unread,
Mar 6, 2015, 3:41:43 AM3/6/15
to beagl...@googlegroups.com, keith....@gmail.com, mgob...@orcasolutions.be
Hey Andrew,

I received the patch files and the backports from Keith by mail. So I can progress. However, I seem to have a problem when building the backports tree. I included them in the root of the bbbandroid repo and when the kernel is being built in the make process I'm getting the following output/error:

  Building modules, stage 2.
  MODPOST 1257 modules
make[1]: Leaving directory `/home/michael/kernel'
make -C backports-3.18.1-1 ARCH=arm CROSS_COMPILE=/home/michael/prebuilts/gcc/linux-x86/arm/arm-gnueabihf-4.7/bin/arm-linux-gnueabihf- KLIB_BUILD=../kernel
make[1]: Entering directory `/home/michael/backports-3.18.1-1'
/--------------
| You shouldn't run make in the backports tree, but only in
| the generated output. This here is only the skeleton code
| copied into the output directory. To use the backport system
| from scratch, go into the top-level directory and run
| ./gentree.py /path/to/linux-next/ /tmp/output
| and then make menuconfig/... in the output directory. See
| ./gentree.py --help
| for more options.
\--
make[2]: *** [modules] Error 1
make[1]: *** [default] Error 2
make[1]: Leaving directory `/home/michael/backports-3.18.1-1'
make: *** [kernel_build] Error 2

Maybe you could shed some light on this?

Thanks,
Michael



Op donderdag 5 maart 2015 22:22:11 UTC+1 schreef Andrew Henderson:

Keith Conger

unread,
Mar 6, 2015, 1:18:22 PM3/6/15
to mgob...@orcasolutions.be, beagl...@googlegroups.com
Hi Micheal,

In the backports folder can you do a "ls -al" and send me the output.
Also Andrew has yet to review or try my patches.

Keith

pichelin...@gmail.com

unread,
Jun 6, 2016, 9:06:01 AM6/6/16
to BeagleBoard
hi all !

I'm running a xenomai patched kernel under android for a project purpose. However i need to get the bluetooth working and i can find a true answer if wether or not it is possible to run bluetooth in BBBAndroid 4.2.2 kernel 3.8 !
So i figured maybe you guys have an answer to that question I just want to be sure before buying my BBB.
And if so is it hard to implement ? i've seen multiple topics on that subject but yours is the closest !

Hope you can read me !

Thanks in advance

Minh-son PICHELIN
Reply all
Reply to author
Forward
0 new messages