Bluetooth/Bluez 4.xx unable to use some adapters

Bug #329828 reported by Dominique Meeùs
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
bluez (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: bluetooth

I suspect this is a bluetooth/bluez/bluetoothd bug, NOT a kernel bug because my Bluetooth adapter DOES work with kernel 2.6.28 and bluetooth/bluez 3.xx hcid (see https://bugs.launchpad.net/ubuntu/+bug/289836/comments/19 for Intrepid with kernel 2.6.27 and below for Jaunty).

I know most bluetooth bugs are marked as duplicate of a kernel bug. I file this as a separate bug on purpose.

I am working in Jaunty :~$ lsb_release -rd
Description: Ubuntu jaunty (development branch)
Release: 9.04
Kernel :~$ uname -r
2.6.28-7-generic
with bluetooth/bluez 4.29: ~$ dpkg -l blue*
||/ Nom Version Description
+++-==============-==============-============================================
ii bluefish 1.0.7-5 advanced Gtk+ HTML editor
ii bluetooth 4.29-0ubuntu1 Bluetooth support
ii bluez 4.29-0ubuntu1 Bluetooth tools and daemons
ii bluez-alsa 4.29-0ubuntu1 Bluetooth audio support
ii bluez-cups 4.29-0ubuntu1 Bluetooth printer driver for CUPS
ii bluez-gnome 1.8-0ubuntu2 Bluetooth utilities for GNOME
ii bluez-gstreame 4.29-0ubuntu1 Bluetooth gstreamer support
ii bluez-utils 4.29-0ubuntu1 Transitional package
also
ii gnome-bluetoot 0.11.0-0ubuntu GNOME Bluetooth tools.
ii libbluetooth3 4.29-0ubuntu1 Library to use the BlueZ Linux Bluetooth sta

This is my D-Link adapter: ~$ lsusb | grep Bluetooth
Bus 001 Device 003: ID 2001:f111 D-Link Corp. [hex] DBT-122 Bluetooth adapter

It is recognised: hcitool dev
Devices:
 hci0 00:13:46:00:55:A0

and active: ~$ hciconfig
hci0: Type: USB
 BD Address: 00:13:46:00:55:A0 ACL MTU: 377:10 SCO MTU: 16:0
 UP RUNNING
 RX bytes:667 acl:0 sco:0 events:19 errors:0
 TX bytes:373 acl:0 sco:0 commands:29 errors:0

though it doesn't see my phone (which is Bluetooth "visible"): ~$ hcitool scan
Scanning ...
Inquiry failed: Connection timed out
and: ~$ hcitool inq
Inquiring ...
Inquiry failed.: Connection timed out

even if given the BD address: ~$ sudo hcitool info 00:13:70:0E:8A:77
Requesting information ...
Can't create connection: Connection timed out

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

Replacing bluetooth/bluez 4.29 by bluetooth/bluez 4.30: ~$ dpkg -l *blue*
||/ Nom Version Description
+++-==============-==============-============================================
ii bluefish 1.0.7-5 advanced Gtk+ HTML editor
ii bluetooth 4.30-0ubuntu1~ Bluetooth support
ii bluez 4.30-0ubuntu1~ Bluetooth tools and daemons
ii bluez-gnome 1.8-0ubuntu2 Bluetooth utilities for GNOME
ii gnome-bluetoot 0.11.0-0ubuntu GNOME Bluetooth tools.
ii libbluetooth3 4.30-0ubuntu1~ Library to use the BlueZ Linux Bluetooth sta
ii python-bluez 0.15-1.1 Python wrappers around BlueZ for rapid bluet

it still doesn't work: hcitool scan
Scanning ...
Inquiry failed: Connection timed out

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

Replacing bluetooth/bluez 4.29 by bluetooth/bluez 3.36: ~$ dpkg -l *blue*
||/ Nom Version Description
+++-==============-==============-============================================
ii bluetooth3 3.26-0ubuntu14 Bluetooth stack utilities
ii bluez3-audio 3.26-0ubuntu14 Bluetooth audio support
ii bluez3-utils 3.26-0ubuntu14 Bluetooth tools and daemons
ii gnome-bluetoot 0.11.0-0ubuntu GNOME Bluetooth tools.
ii libbluetooth2 3.29-0ubuntu1 Library to use the BlueZ Linux Bluetooth sta
ii libbluetooth3 4.30-0ubuntu1~ Library to use the BlueZ Linux Bluetooth sta
ii python-bluez 0.15-1.1 Python wrappers around BlueZ for rapid bluet

Adapter is active: ~$ hciconfig
hci0: Type: USB
 BD Address: 00:13:46:00:55:A0 ACL MTU: 377:10 SCO MTU: 16:0
 UP RUNNING
 RX bytes:667 acl:0 sco:0 events:19 errors:0
 TX bytes:669 acl:0 sco:0 commands:38 errors:0

it still doesn't work: hcitool scan
Scanning ...
Inquiry failed: Connection timed out

OK. Let's try to restart

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

Upon restart, hci0 was down: ~$ hciconfig
hci0: Type: USB
 BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
 DOWN
 RX bytes:0 acl:0 sco:0 events:0 errors:0
 TX bytes:3 acl:0 sco:0 commands:1 errors:0

but i could activate it:: ~$ sudo hciconfig hci0 up
successfully: ~$ hciconfig
hci0: Type: USB
 BD Address: 00:13:46:00:55:A0 ACL MTU: 377:10 SCO MTU: 16:0
 UP RUNNING PSCAN ISCAN
 RX bytes:937 acl:0 sco:0 events:22 errors:0
 TX bytes:332 acl:0 sco:0 commands:22 errors:0

and not only my phone was found: :~$ sudo hcitool scan
Scanning ...
 00:13:70:0E:8A:77 Nokia 6021

but also Wammu did connect and I could successfully backup my phone as a Wammu backup file and in particular my calendar as an ics file that I did import successfully within the Lightning extension of Thunderbird.

In short: I DID use successfully a D-Link DBT-122 Bluetooth adapter, with kernel 2.6.28

I am sorry that I forgot to look at the daemon log at each try. I give some typical excerpts of the daemon log in attachment, with bluetoothd errors and the final success of hcid.

Revision history for this message
Dominique Meeùs (dominiquem) wrote :
Revision history for this message
Dominique Meeùs (dominiquem) wrote :

No more result with 4.30

Kernel : ~$ uname -r
2.6.28-8-generic

My device : ~$ lsusb |grep tooth
Bus 001 Device 003: ID 2001:f111 D-Link Corp. [hex] DBT-122 Bluetooth adapter

Bluez software : ~$ dpkg -l blue*
||/ Nom Version Description
+++-==============-==============-============================================
ii bluetooth 4.30-0ubuntu1 Bluetooth support
ii bluez 4.30-0ubuntu1 Bluetooth tools and daemons
ii bluez-alsa 4.30-0ubuntu1 Bluetooth audio support
ii bluez-cups 4.30-0ubuntu1 Bluetooth printer driver for CUPS
ii bluez-gnome 1.8-0ubuntu2 Bluetooth utilities for GNOME
ii bluez-gstreame 4.30-0ubuntu1 Bluetooth gstreamer support
ii bluez-utils 4.30-0ubuntu1 Transitional package
with
ii libbluetooth3 4.30-0ubuntu3 Library to use the BlueZ Linux Bluetooth sta

Device is up : ~$ hciconfig
hci0: Type: USB
 BD Address: 00:13:46:00:55:A0 ACL MTU: 377:10 SCO MTU: 16:0
 UP RUNNING
 RX bytes:667 acl:0 sco:0 events:19 errors:0
 TX bytes:578 acl:0 sco:0 commands:21 errors:0
(I had to disconnect the dongle and plug it back in to make this work)

Still no scanning the phone : ~$ hcitool scan
Scanning ...
Inquiry failed: Connection timed out

No pinging either : ~$ sudo l2ping 00:13:70:0E:8A:77
Can't connect: Connection timed out

Revision history for this message
Dominique Meeùs (dominiquem) wrote :
Download full text (4.4 KiB)

This seems definitely more a Bluez bug than a kernel bug. (But of course the kernel could be held responsible for the Bluez problems :-)
lsusb | grep tooth
Bus 001 Device 004: ID 2001:f111 D-Link Corp. [hex] DBT-122 Bluetooth adapter
uname -r
2.6.28-8-generic
dpkg -l blue*
ii bluetooth 4.30-0ubuntu1 Bluetooth support
ii bluez 4.30-0ubuntu1 Bluetooth tools and daemons
ii bluez-alsa 4.30-0ubuntu1 Bluetooth audio support
ii bluez-cups 4.30-0ubuntu1 Bluetooth printer driver for CUPS
ii bluez-gnome 1.8-0ubuntu2 Bluetooth utilities for GNOME
ii bluez-gstreame 4.30-0ubuntu1 Bluetooth gstreamer support
ii bluez-utils 4.30-0ubuntu1 Transitional package
dpkg -l libblue*
ii libbluetooth3 4.30-0ubuntu3 Library to use the BlueZ Linux Bluetooth sta

+++++++++++++++++++++++++++++++++++++++++++++++
Without Bluez, the dongle functions with btusb.
With bluetoothd started, things are broken.
+++++++++++++++++++++++++++++++++++++++++++++++

I stop everything:
sudo /etc/init.d/bluetooth stop
sudo hciconfig hci0 down
sudo rmmod btusb
sudo hciconfig hci0
Can't get device info: No such device

I start btusb and hci0:
sudo modprobe btusb
sudo hciconfig hci0
hci0: Type: USB
 BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
 DOWN
 RX bytes:0 acl:0 sco:0 events:0 errors:0
 TX bytes:0 acl:0 sco:0 commands:0 errors:0
sudo hciconfig hci0 up
sudo hciconfig
hci0: Type: USB
 BD Address: 00:13:46:00:55:A0 ACL MTU: 377:10 SCO MTU: 16:0
 UP RUNNING
 RX bytes:342 acl:0 sco:0 events:10 errors:0
 TX bytes:35 acl:0 sco:0 commands:10 errors:0
sudo hciconfig -a
hci0: Type: USB
 BD Address: 00:13:46:00:55:A0 ACL MTU: 377:10 SCO MTU: 16:0
 UP RUNNING
 RX bytes:342 acl:0 sco:0 events:10 errors:0
 TX bytes:35 acl:0 sco:0 commands:10 errors:0
 Features: 0xff 0xfe 0x0d 0x38 0x08 0x08 0x00 0x00
 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
 Link policy:
 Link mode: SLAVE ACCEPT
 Name: 'Broadcom BCM2035'
 Class: 0x000000
 Service Classes: Unspecified
 Device Class: Miscellaneous,
 HCI Ver: 1.2 (0x2) HCI Rev: 0x0 LMP Ver: 1.2 (0x2) LMP Subver: 0x309
 Manufacturer: Broadcom Corporation (15)
sudo hcitool scan
Scanning ...
 00:13:70:0E:8A:77 Nokia 6021
sudo hcitool info 00:13:70:0E:8A:77
Requesting information ...
 BD Address: 00:13:70:0E:8A:77
 Device Name: Nokia 6021
 LMP Version: 1.2 (0x2) LMP Subversion: 0x4db
 Manufacturer: Cambridge Silicon Radio (10)
 Features: 0xbf 0xee 0x0f 0x40 0x18 0x18 0x00 0x00
  <3-slot packets> <5-slot packets> <encryption> <slot offset>
  <timing accuracy> <role switch> <sniff mode> <RSSI>
  <channel quality> <SCO link> <HV3 packets> <u-law log>
  <A-law log> <CVSD> <paging scheme> <power control>
  <transparent SCO> <inquiry with RSSI> <AFH cap. slave>
  <AFH class. slave> <AFH cap. master> <AFH class. master>
sudo l2ping 00:13:70:0E:8A:77
Ping: 00:13:70:0E:8A:77 from 00:13:46:00:55:A0 (data size 44) ...
0 bytes from 00:13:70:0E:8A:77 id 0 time 11.87ms
0 bytes from 00:13:70:0E:8A:77 id 1 time 32.88ms
0 bytes from 00:13:70:0E:8A:77 id 2 time 12.89ms
0 bytes from 00:13:70:0E:8A:77 id 3 time 12.91ms
0 bytes from 00:13:70:0E:8A:77 id 4 time 11.90ms
0 bytes from 00:13:70:0E:8A:77 id 5 time 10.91ms
^...

Read more...

Revision history for this message
Dominique Meeùs (dominiquem) wrote :

No improvement with Bluez 4.32

hciconfig -a
hci0: Type: USB
 BD Address: 00:13:46:00:55:A0 ACL MTU: 377:10 SCO MTU: 16:0
 UP RUNNING
 RX bytes:667 acl:0 sco:0 events:19 errors:0
 TX bytes:621 acl:0 sco:0 commands:29 errors:0
 Features: 0xff 0xfe 0x0d 0x38 0x08 0x08 0x00 0x00
 Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
 Link policy:
 Link mode: SLAVE ACCEPT
Can't read local name on hci0: Connection timed out (110)

sudo hcitool scan
Scanning ...
Inquiry failed: Connection timed out

Revision history for this message
Tuan Quoc (tuanquoc20) wrote :

I think you have to set Bluetooth at PISCAN:
$ sudo hciconfig hci0 piscan

Revision history for this message
Tuan Quoc (tuanquoc20) wrote :

Now I have some trouble with Bluez-4.32:
hci0:PISCAN
hci1:PISCAN
and
ii bluemon 1.4-5ubuntu1 Activate or deactivate programs based on Blu
ii bluetooth 4.32-0ubuntu4. Bluetooth support
ii bluez 4.32-0ubuntu4. Bluetooth tools and daemons
ii bluez-alsa 4.32-0ubuntu4. Bluetooth audio support
un bluez-audio <none> (no description available)
ii bluez-btsco 1:0.50-0ubuntu Bluez Bluetooth SCO tool
ii bluez-compat 4.32-0ubuntu4. BlueZ 3.x compatibility binaries
ii bluez-cups 4.32-0ubuntu4. Bluetooth printer driver for CUPS
ii bluez-gnome 1.8-0ubuntu5 Bluetooth utilities for GNOME
ii bluez-gstreame 4.32-0ubuntu4. Bluetooth gstreamer support
ii bluez-hcidump 1.42-1build1 Analyses Bluetooth HCI packets
un bluez-input <none> (no description available)
un bluez-network <none> (no description available)
un bluez-pan <none> (no description available)
un bluez-passkey- <none> (no description available)
pn bluez-pcmcia-s <none> (no description available)
un bluez-serial <none> (no description available)
ii bluez-utils 4.32-0ubuntu4. Transitional package

Terminal:
$ hcitool dev
Devices:
 hci0 00:11:67:55:8F:69
$ sudo hcitool inq
 11:11:11:11:11:11
Now, I connect to DB 11:11:11:11:11:11
$ sudo hcitool -i hci0 cc 11:11:11:11:11:11

Then, test connect:
$ hcitool -i hci0 con
Connections:
(there is no connection)

Everybody can help me about that.

Revision history for this message
Tuan Quoc (tuanquoc20) wrote :
Download full text (3.5 KiB)

add:
~$ sudo strace -f hcitool -i hci0 cc --role=m 11:11:11:11:11:11

execve("/usr/local/bin/hcitool", ["hcitool", "-i", "hci0", "cc", "--role=m", "11:11:11:11:11:11"], [/* 16 vars */]) = 0
brk(0) = 0xb938c000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f5c000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=56691, ...}) = 0
mmap2(NULL, 56691, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f4e000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/local/lib/libbluetooth.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340H\0\0004\0\0\0p"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=97414, ...}) = 0
mmap2(NULL, 85712, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f39000
mmap2(0xb7f4c000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12) = 0xb7f4c000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\320h\1\0004\0\0\0\344"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1442180, ...}) = 0
mmap2(NULL, 1451632, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7dd6000
mprotect(0xb7f32000, 4096, PROT_NONE) = 0
mmap2(0xb7f33000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15c) = 0xb7f33000
mmap2(0xb7f36000, 9840, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f36000
close(3) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7dd5000
set_thread_area({entry_number:-1 -> 6, base_addr:0xb7dd5b00, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
open("/dev/urandom", O_RDONLY) = 3
read(3, "\347\306^\\"..., 4) = 4
close(3) = 0
mprotect(0xb7f33000, 8192, PROT_READ) = 0
mprotect(0xb7f4c000, 4096, PROT_READ) = 0
mprotect(0xb7f87000, 4096, PROT_READ) = 0
mprotect(0xb7f7b000, 4096, PROT_READ) = 0
munmap(0xb7f4e000, 56691) = 0
socket(PF_BLUETOOTH, SOCK_RAW, 1) = 3
ioctl(3, 0x800448d3, 0xbfe865ec) = 0
close(3) = 0
socket(PF_BLUETOOTH, SOCK_RAW, 1) = 3
ioctl(3, 0x800448d3, 0xbfe8661c) = 0
close(3) = 0
socket(PF_BLUETOOTH, SOCK_RAW, 1) = 3
bind(3, {sa_family=AF_BLUETOOTH, sa_data="\0\0\364\177\370\267\1\0\0\0nf\350\277"...}, 4) = 0
getsockopt(3, SOL_IP, IP_TTL, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0^\362"..., [16]) = 0
setsockopt(3, SOL_IP, IP_TTL, "\20\0\0\0\10\300\0\0\0\0\0\0\5\4\0\0"..., 16) = 0
writev(3, [{"\1"..., 1}, {"\5\4\r"..., 3}, {"\21\21\21\21\21\21\30\314\2\0\0\0\0"..., 13}], 3) = 17
poll([{fd=3, events=POLLIN}], 1,...

Read more...

Revision history for this message
Michael T (michaeltandy) wrote :

When I got this symptom from my USB dongle:

hcitool inq
Inquiring ...
Inquiry failed.: Connection timed out

I used the command 'sudo hciconfig hci0 reset' then repeated 'hcitool inq' and the problem went away.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bluez (Ubuntu):
status: New → Confirmed
Revision history for this message
Sergio Callegari (callegar) wrote :

Hi,

I have great isssues with ubuntu oneiric, bluez, a DELL E6500 and a nokia C2

hcitool scan works and can see the Nokia device.

however, any other attempt at initiating a bluetooth connection from the DELL fails

for instance hcitool info <my device address> invariably fails with

Requesting information ...
Can't create connection: Input/output error

Similarly, the sdptool browse command fails

Failed to connect to SDP server on ... Host is down

The only way to have the thing working seems to be

0) Remove any association to the computer on the phone
1) Initiate a device browse from the phone
2) when the phone finds the computer, ask the phone to associate
3) Complete the association

After this, for some time, all the bluetooth commands succeed.

Bluetooth adapter on the laptop is
Bus 003 Device 005: ID 413c:8156 Dell Computer Corp. Wireless 370 Bluetooth Mini-card

On the phone I get from hcitool info

Device Name: Nokia C2-01
        LMP Version: 2.1 (0x4) LMP Subversion: 0x1673
        Manufacturer: Cambridge Silicon Radio (10)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.