Bug 505439

Summary: Cant pair HTC Magic Google Android Phone with bluetooth
Product: [Fedora] Fedora Reporter: Daniel Hedblom <daniel>
Component: gnome-bluetoothAssignee: Bastien Nocera <bnocera>
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: bnocera, daniel, gwendolen.lynch
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-18 15:48:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel Hedblom 2009-06-11 22:05:51 UTC
Description of problem:

When i try to pair my HTC Magic by bluetooth from Fedora 11 it always fails before i have the time to input the pin number. The time it takes before an error message is shown in fedora is about 6 seconds.

Version-Release number of selected component (if applicable): 
bluez 4.37-2
gnome-bluetooth-2.27.5-1

How reproducible:

This problem is reproducible always.

Steps to Reproduce:
1.
Try to pair the two units either from Fedora or the HTC magic. Same result regardless if using hcitool or gnome-bluetooth.
2.
Enter pin number. Most of the times the pairing fails before i have the time to put the pin in on the HTC Magic. Pairing also fails if i succeed putting all the digits in before the error message.

Actual results:
Error message telling the pairing has failed.

Expected results:
The computer should be paired with the HTC Magic Google Android phone.


Additional info:

On the same computer/software pairing with and using my Nokia BH-103 headset works like intended.

Debug info from bluetoothd:

bluetoothd[23908]: Discovery session 0x7fdeea4affe0 with :1.296 activated
bluetoothd[23908]: session_ref(0x7fdeea4affe0): ref=1
bluetoothd[23908]: session_unref(0x7fdeea4affe0): ref=0
bluetoothd[23908]: Discovery session 0x7fdeea4affe0 with :1.296 deactivated
bluetoothd[23908]: Stopping discovery
bluetoothd[23908]: adapter_get_device(00:22:A5:F9:59:B3)
bluetoothd[23908]: adapter_create_device(00:22:A5:F9:59:B3)
bluetoothd[23908]: Creating device /org/bluez/23908/hci0/dev_00_22_A5_F9_59_B3
bluetoothd[23908]: btd_device_ref(0x7fdeea4b0d70): ref=1
bluetoothd[23908]: /org/bluez/23908/hci0/dev_00_22_A5_F9_59_B3: requesting bonding
bluetoothd[23908]: Temporary agent registered for /org/bluez/23908/hci0/dev_00_22_A5_F9_59_B3 at :1.296:/org/bluez/agent/wizard
bluetoothd[23908]: adapter_get_device(00:22:A5:F9:59:B3)
bluetoothd[23908]: link_key_request (sba=00:15:83:19:24:60, dba=00:22:A5:F9:59:B3)
bluetoothd[23908]: kernel auth requirements = 0x03
bluetoothd[23908]: pin_code_request (sba=00:15:83:19:24:60, dba=00:22:A5:F9:59:B3)
bluetoothd[23908]: adapter_get_device(00:22:A5:F9:59:B3)
bluetoothd[23908]: /org/bluez/23908/hci0/dev_00_22_A5_F9_59_B3: requesting agent authentication
bluetoothd[23908]: hcid_dbus_bonding_process_complete: status=13
bluetoothd[23908]: adapter_get_device(00:22:A5:F9:59:B3)
bluetoothd[23908]: /org/bluez/23908/hci0/dev_00_22_A5_F9_59_B3: canceling bonding request
bluetoothd[23908]: /org/bluez/23908/hci0/dev_00_22_A5_F9_59_B3: canceling authentication request
bluetoothd[23908]: Releasing agent :1.296, /org/bluez/agent/wizard
bluetoothd[23908]: Removing temporary device /org/bluez/23908/hci0/dev_00_22_A5_F9_59_B3
bluetoothd[23908]: Removing device /org/bluez/23908/hci0/dev_00_22_A5_F9_59_B3
bluetoothd[23908]: btd_device_unref(0x7fdeea4b0d70): ref=0
bluetoothd[23908]: device_free(0x7fdeea4b0d70)

Comment 1 Bastien Nocera 2009-06-11 23:07:56 UTC
Please attach the output of "hcidump -X" when reproducing the problem.

Comment 2 Daniel Hedblom 2009-06-11 23:23:32 UTC
This is the dump i got from hcidump -X

< HCI Command: Exit Periodic Inquiry Mode (0x01|0x0004) plen 0
> HCI Event: Command Complete (0x0e) plen 4
  0000: 01 04 04 00                                       ....
< HCI Command: Create Connection (0x01|0x0005) plen 13
  0000: b3 59 f9 a5 22 00 18 cc  02 00 00 00 01           .Y.."........
> HCI Event: Command Status (0x0f) plen 4
  0000: 00 01 05 04                                       ....
> HCI Event: Role Change (0x12) plen 8
  0000: 00 b3 59 f9 a5 22 00 01                           ..Y.."..
> HCI Event: Connect Complete (0x03) plen 11
  0000: 00 2d 00 b3 59 f9 a5 22  00 01 00                 .-..Y.."...
< HCI Command: Read Remote Supported Features (0x01|0x001b) plen 2
  0000: 2d 00                                             -.
> HCI Event: Page Scan Repetition Mode Change (0x20) plen 7
  0000: b3 59 f9 a5 22 00 01                              .Y.."..
> HCI Event: Command Status (0x0f) plen 4
  0000: 00 00 1b 04                                       ....
> HCI Event: Max Slots Change (0x1b) plen 3
  0000: 2d 00 05                                          -..
> HCI Event: Command Status (0x0f) plen 4
  0000: 00 01 00 00                                       ....
< HCI Command: Remote Name Request (0x01|0x0019) plen 10
  0000: b3 59 f9 a5 22 00 02 00  00 00                    .Y..".....
> HCI Event: Command Status (0x0f) plen 4
  0000: 00 01 19 04                                       ....
> HCI Event: Read Remote Supported Features (0x0b) plen 11
  0000: 00 2d 00 ff ff 2d fe 9b  f9 00 80                 .-...-.....
< HCI Command: Authentication Requested (0x01|0x0011) plen 2
  0000: 2d 00                                             -.
> HCI Event: Remote Name Req Complete (0x07) plen 255
  0000: 00 b3 59 f9 a5 22 00 57  68 69 74 65 5f 74 75 78  ..Y..".White_tux
  0010: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  0020: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  0030: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  0040: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  0050: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  0060: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  0070: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  0080: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  0090: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  00a0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  00b0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  00c0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  00d0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  00e0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  00f0: 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00     ...............
> HCI Event: Command Status (0x0f) plen 4
  0000: 00 01 11 04                                       ....
> HCI Event: Link Key Request (0x17) plen 6
  0000: b3 59 f9 a5 22 00                                 .Y..".
< HCI Command: Link Key Request Negative Reply (0x01|0x000c) plen 6
  0000: b3 59 f9 a5 22 00                                 .Y..".
> HCI Event: Command Complete (0x0e) plen 10
  0000: 01 0c 04 00 b3 59 f9 a5  22 00                    .....Y..".
> HCI Event: PIN Code Request (0x16) plen 6
  0000: b3 59 f9 a5 22 00                                 .Y..".
< HCI Command: PIN Code Request Reply (0x01|0x000d) plen 23
  0000: b3 59 f9 a5 22 00 06 33  39 33 36 32 34 00 00 00  .Y.."..393624...
  0010: 00 00 00 00 00 00 00                              .......
> HCI Event: Command Complete (0x0e) plen 10
  0000: 01 0d 04 00 b3 59 f9 a5  22 00                    .....Y..".
> HCI Event: Auth Complete (0x06) plen 3
  0000: 13 2d 00                                          .-.
> HCI Event: Disconn Complete (0x05) plen 4
  0000: 00 2d 00 13                                       .-..

Comment 3 Bastien Nocera 2009-06-18 15:18:21 UTC
Please test with bluez 4.40 and gnome-bluetooth 2.27.6:
http://koji.fedoraproject.org/koji/buildinfo?buildID=102755
and
http://koji.fedoraproject.org/koji/buildinfo?buildID=106731

Comment 4 Gwendolen 2009-06-18 22:24:27 UTC
Problem is still present with these packages.

Side note, I had to rebuild gnome-phone-manager against the new gnome-bluetooth as well.

Comment 5 Gwendolen 2009-06-18 22:50:58 UTC
OK, I have had some limited success.

If I set gnome-bluetooth to use '0000' as the passkey, it gives me just enough time to enter it into the phone and the devices will pair.

However now the devices just sit in a "paired but not connected" state.  Attempting to force connection from either side does nothing.

Jun 19 08:48:04 legolas bluetoothd[3841]: Bluetooth daemon 4.40
Jun 19 08:48:04 legolas bluetoothd[3841]: Enabling debug information
Jun 19 08:48:04 legolas bluetoothd[3841]: Starting SDP server
Jun 19 08:48:04 legolas bluetoothd[3841]: Parsing /etc/bluetooth/audio.conf failed: No such file or directory
Jun 19 08:48:04 legolas bluetoothd[3841]: Parsing /etc/bluetooth/network.conf failed: No such file or directory
Jun 19 08:48:04 legolas bluetoothd[3841]: bridge pan0 created
Jun 19 08:48:04 legolas bluetoothd[3841]: Parsing /etc/bluetooth/input.conf failed: No such file or directory
Jun 19 08:48:04 legolas bluetoothd[3841]: HCI dev 0 registered
Jun 19 08:48:04 legolas bluetoothd[3841]: HCI dev 0 up
Jun 19 08:48:04 legolas bluetoothd[3841]: Starting security manager 0
Jun 19 08:48:04 legolas bluetoothd[3841]: Adapter /org/bluez/3841/hci0 has been enabled
Jun 19 08:48:30 legolas bluetoothd[3841]: Discovery session 0x7ff72a093c80 with :1.94 activated
Jun 19 08:49:13 legolas bluetoothd[3841]: link_key_request (sba=00:1F:3A:FC:CA:A3, dba=00:22:A5:EF:E1:A7)
Jun 19 08:49:13 legolas bluetoothd[3841]: pin_code_request (sba=00:1F:3A:FC:CA:A3, dba=00:22:A5:EF:E1:A7)
Jun 19 08:49:20 legolas bluetoothd[3841]: link_key_notify (sba=00:1F:3A:FC:CA:A3, dba=00:22:A5:EF:E1:A7, type=0)
Jun 19 08:49:20 legolas bluetoothd[3841]: probe failed with driver input-headset for device /org/bluez/3841/hci0/dev_00_22_A5_EF_E1_A7

Comment 6 Bastien Nocera 2009-09-16 11:20:42 UTC
Can you please test again with bluez-4.42 and gnome-bluetooth 2.27.8-2 (note the -2)?

Comment 7 Bastien Nocera 2009-09-18 15:15:38 UTC
This apparently doesn't work due to some stupidness on the phone's side.

See:
http://osdir.com/ml/android-platform/2009-05/msg00144.html
and:
http://www.spinics.net/lists/linux-bluetooth/msg02250.html

Comment 8 Bastien Nocera 2009-09-18 15:48:09 UTC
Apparently you just need to be really really fast, or pester Google to fix their Bluetooth code from ancient times.