I am using a LSR WL1271-Ti-BLE Bluetooth device in an iMX53 based custom board. OS is Android (Gingerbread), kernel is 2.6.35. Bluetooth stack is Bluez. I'm having a problem when I attempt to start Bluetooth via the Android GUI. I also see an issue when I try to manually start Bluetooth via the command line. Possibly it's the same issue at work here but with different manifestations.
When I try to turn on Bluetooth via the Android UI I get the following error
D/BluetoothService( 2084): Bluetooth state 10 -> 11
V/BluetoothEventRedirector( 2206): Received android.bluetooth.adapter.action.STATE_CHANGED
I/bluedroid( 2084): Starting hciattach daemon
I/bluedroid( 2084): Starting bluetoothd deamon
E/BluetoothEventLoop.cpp( 2084): get_adapter_path: D-Bus error: org.bluez.Error.NoSuchAdapter (No such adapter)
E/BluetoothEventLoop.cpp( 2084): failure setting up Event Loop!
E/BluetoothEventLoop.cpp( 2084): get_adapter_path: D-Bus error: org.bluez.Error.NoSuchAdapter (No such adapter)
E/BluetoothEventLoop.cpp( 2084): failure setting up Event Loop!
D/BluetoothService( 2084): bt EnableThread giving up
I/bluedroid( 2084): Stopping bluetoothd deamon
I/bluedroid( 2084): Stopping hciattach deamon
D/BluetoothService( 2084): Bluetooth state 11 -> 10
V/BluetoothEventRedirector( 2206): Received android.bluetooth.adapter.action.STATE_CHANGED
When I try to manually run hciattach and hciconfig I get the following which indicates this bit is working OK.
# hciattach -s 115200 /dev/ttymxc4 texas 3000000 flow
[ATH_INFO] (external/bluetooth/bluez/
tools/hciattach.c) <init_uart>: Serial port is opened
[ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: Port settings is gotten
[ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: Port settings is set
[ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: Initial baud rate is set
[ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: Break is sent
Found a Texas Instruments' chip!
Firmware file : /system/lib/firmware/ti/TIInit_7.6.15.bts
Sending script to serial device
Loaded BTS script version 1
texas: changing baud rate to 3000000, flow control to 1
CCCCCCCCCCCCCCCCCCCCWRCSCCCCCWRCCWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRCCWRWRWRWRWRCCCCCWRWRWRWRWRWRWRWRWRCCCWRCCCCCCCCCCCCCCCWRCCWRCCCWRCCCCWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRWRCCCCCCWRCCWRCCWRCWRCCCCCCWRCCCC
[ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: u->init is loaded
[ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: Actual baud rate is set
[ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: Line discipline is set
[ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: Ioctl device is set
Added device hci0
Sending script to bluetooth socket
[ATH_INFO] (external/bluetooth/bluez/tools/hciattach.c) <init_uart>: u->post is loaded
Device setup complete
# hciconfig
hci0: Type: BR/EDR Bus: UART
BD Address: 34:B1:F7:97:8E:CE ACL MTU: 1021:4 SCO MTU: 180:4
UP RUNNING
RX bytes:352 acl:0 sco:0 events:10 errors:0
TX bytes:45 acl:0 sco:0 commands:10 erro
However when I run the bluetoothd daemon manually I get the following.
# bluetoothd -n -d
bluetoothd[2351]: Bluetooth deamon 4.69
bluetoothd[2351]: external/bluetooth/bluez/src/main.c:parse_config() parsing main.conf
bluetoothd[2351]: external/bluetooth/bluez/src/main.c:parse_config() discovto=120
bluetoothd[2351]: external/bluetooth/bluez/src/main.c:parse_config() pairto=0
bluetoothd[2351]: external/bluetooth/bluez/src/main.c:parse_config() pageto=8192
bluetoothd[2351]: external/bluetooth/bluez/src/main.c:parse_config() name=%m
bluetoothd[2351]: external/bluetooth/bluez/src/main.c:parse_config() class="0x40020C"
bluetoothd[2351]: external/bluetooth/bluez/src/main.c:parse_config() discov_interval=0
bluetoothd[2351]: external/bluetooth/bluez/src/main.c:parse_config() deviceid=android:generic:1.5
bluetoothd[2351]: external/bluetooth/bluez/src/main.c:parse_config() default_link_policy=7
bluetoothd[2351]: Starting SDP server
bluetoothd[2351]: opening L2CAP socket: Operation not permitted
bluetoothd[2351]: Server initialization failed
bluetoothd[2351]: external/bluetooth/bluez/src/plugin.c:plugin_init() Loading builtin plugins
bluetoothd[2351]: external/bluetooth/bluez/src/plugin.c:add_plugin() Loading hciops plugin
bluetoothd[2351]: external/bluetooth/bluez/src/plugin.c:plugin_init() Loading plugins /system/lib/bluez-plugin
bluetoothd[2351]: external/bluetooth/bluez/src/plugin.c:add_plugin() Loading audio plugin
bluetoothd[2351]: external/bluetooth/bluez/src/plugin.c:add_plugin() Loading input plugin
bluetoothd[2351]: Can't open HCI socket: Operation not permitted (1)
bluetoothd[2351]: adapter_ops_setup failed
#
I've searched around for these problem and I get quite a few hits but no resolution. Does anyone have an ideas as to the cause of this issue.
Thanks,
Bruno