OSDN Git Service

android-x86/external-bluetooth-bluez.git
12 years agoMerge remote-tracking branch 'korg/froyo' into froyo-x86 froyo-x86 android-x86-2.2-r2
Chih-Wei Huang [Sun, 26 Jun 2011 06:59:42 +0000 (14:59 +0800)]
Merge remote-tracking branch 'korg/froyo' into froyo-x86

13 years agoadd sbc_primitives_mmx.c for x86 android-x86-2.2
Chih-Wei Huang [Fri, 9 Oct 2009 11:21:45 +0000 (19:21 +0800)]
add sbc_primitives_mmx.c for x86

13 years agoAdd voice dailing feature to the SDP record.
Jaikumar Ganesh [Thu, 27 May 2010 16:41:46 +0000 (09:41 -0700)]
Add voice dailing feature to the SDP record.

Bug: 2719204
Dr No: Eastham / Jsh

Change-Id: I03d8d6761d8b114e2cdf95ed0fab86c7cb61e469

14 years agoFix issue 2516842 Device runtime restarts while pairing and connecting A2DP HS.
Eric Laurent [Wed, 7 Apr 2010 12:33:08 +0000 (05:33 -0700)]
Fix issue 2516842  Device runtime restarts while pairing and connecting A2DP HS.

There are several problems in liba2dp.c:

1 There is a bug in bluetooth_parse_capabilities(): the capabilities field pointer increment
in the while loop is wrong and in case the first capabilities field is not the one we need
we end up reading undefined data.
2 In the same while loop there is no protection for infinite looping if the length of the
capabilities field is 0.
3 When start or configure fail, we just reset state to A2DP_STATE_INITIALIZED to force a new
configuration attempt. This is bad as we don't close the connection and configure expects a
closed connection. Subsequent configure attempts will fail reading sbc capabilites.
4 When there is a problem executing a command in a2dp_thread() loop, we do not reset current command
which prevents from executing the same command again.

Here is what happens in this issue:
There is an error in the A2DP start request because the headset has been disconnected and we go back to configure.
Because of problem 3, the connection is still opened when we run configure again and the 1st capabilitites
field lock indicator is set. We try to read next field and because of problems 1 & 2 we end up looping here for ever.
As data->mutex is locked, it cannot be acquired by pthread_cond_timedwait() trying to exit in
wait_for_start() and the timeout mechanism fails. We stay locked here with A2dpAudioInterface::A2dpAudioStreamOut::mLock also
locked as we are in A2dpAudioInterface::A2dpAudioStreamOut:write().
When system_server tries to disable bluetooth A2DP, A2dpAudioInterface::A2dpAudioStreamOut::setBluetoothEnabled()
tries to acquire mLock and system_server is also deadlocked.

Change-Id: I785250fe65651ec6fc2ae01a4250a61f2fd43908

14 years agoAllow configure default link policy in main.conf
Bao Liang [Thu, 4 Mar 2010 02:26:47 +0000 (10:26 +0800)]
Allow configure default link policy in main.conf

Currently BlueZ is hard-coding the default link policy to include
role switch, hold mode, sniff mode and park state. However, some
device will have problem to maintain the connection or setup SCO
if they are in park state. Making these operation modes configurable
in main.conf improves flexibility so any of these four modes can be
disabled if necessary.

Signed-off-by: Bao Liang <tim.bao@motorola.com>
14 years agoIncrease A2DP flush timeout from 120ms to 200ms.
Nick Pelly [Thu, 11 Mar 2010 23:35:41 +0000 (15:35 -0800)]
Increase A2DP flush timeout from 120ms to 200ms.

This is to reduce the chance of skipping on A2DP sinks that have buffers
larger than 120ms. Changed on advice from BCM.

Change-Id: I3d6574b30b362b43e311991eb3cc41776c5f9b52

14 years agoMerge "Add an API to set the link timeout."
Jaikumar Ganesh [Wed, 10 Mar 2010 00:56:29 +0000 (16:56 -0800)]
Merge "Add an API to set the link timeout."

14 years agoAdd an API to set the link timeout.
Jaikumar Ganesh [Tue, 9 Mar 2010 23:35:00 +0000 (15:35 -0800)]
Add an API to set the link timeout.

Change-Id: I5abd8fc37e20a7916e84e624f883c7a1987b0587

14 years agoAdd an empty CleanSpec.mk
Jean-Baptiste Queru [Tue, 9 Mar 2010 02:04:17 +0000 (18:04 -0800)]
Add an empty CleanSpec.mk

Change-Id: I352eaaa2ba844b7c14bce1589156161c050afe34

14 years agoMerge "Update Bluetooth configuration path."
Jaikumar Ganesh [Fri, 26 Feb 2010 03:41:07 +0000 (19:41 -0800)]
Merge "Update Bluetooth configuration path."

14 years agoUpdate Bluetooth configuration path.
Jaikumar Ganesh [Fri, 26 Feb 2010 02:19:58 +0000 (18:19 -0800)]
Update Bluetooth configuration path.

14 years agoAdd option to change sco packet type in scotest.
Nick Pelly [Fri, 19 Feb 2010 00:04:42 +0000 (16:04 -0800)]
Add option to change sco packet type in scotest.

Change-Id: I5afca60a75a318e69c543d231c69e3264e0dff12

14 years agoUpdate userspace headers for SCO/eSCO packet selection in struct sockaddr_sco.
Nick Pelly [Thu, 18 Feb 2010 23:59:16 +0000 (15:59 -0800)]
Update userspace headers for SCO/eSCO packet selection in struct sockaddr_sco.

uint16_t sco_pkt_type is introduced to struct sockaddr_sco. It allows bitwise
selection of SCO/eSCO packet types. Currently those bits are:

0x0001 HV1 may be used.
0x0002 HV2 may be used.
0x0004 HV3 may be used.
0x0008 EV3 may be used.
0x0010 EV4 may be used.
0x0020 EV5 may be used.
0x0040 2-EV3 may be used.
0x0080 3-EV3 may be used.
0x0100 2-EV5 may be used.
0x0200 3-EV5 may be used.

This is similar to the Packet Type parameter in the HCI Setup Synchronous
Connection Command, except that we are not reversing the logic on the EDR bits.
This makes the use of sco_pkt_tpye forward portable for the use case of
white-listing packet types, which we expect will be the primary use case.

If sco_pkt_type is zero, or userspace uses the old struct sockaddr_sco,
then the default behavior is to allow all packet types.

Packet type selection is just a request made to the Bluetooth chipset, and
it is up to the link manager on the chipset to negiotiate and decide on the
actual packet types used. Furthermore, when a SCO/eSCO connection is eventually
made there is no way for the host stack to determine which packet type was used
(however it is possible to get the link type of SCO or eSCO).

sco_pkt_type is ignored for incoming SCO connections. It is possible
to add this in the future as a parameter to the Accept Synchronous Connection
Command, however its a little trickier because the kernel does not
currently preserve sockaddr_sco data between userspace calls to accept().

The most common use for sco_pkt_type will be to white-list only SCO packets,
which can be done with the hci.h constant SCO_ESCO_MASK.

This patch is motivated by broken Bluetooth carkits such as the Motorola
HF850 (it claims to support eSCO, but will actually reject eSCO connections
after 5 seconds) and the 2007/2008 Infiniti G35/37 (fails to route audio
if a 2-EV5 packet type is negiotiated). With this patch userspace can maintain
a list of compatible packet types to workaround remote devices such as these.

Change-Id: Ie6dc57a6a2d4ec4b42f919070d98d39f225eaf95

14 years agoam 1a4ab293: am e7532b6a: reconcile main tree with open-source eclair
The Android Open Source Project [Fri, 5 Feb 2010 22:14:29 +0000 (14:14 -0800)]
am 1a4ab293: am e7532b6a: reconcile main tree with open-source eclair

Merge commit '1a4ab293f0652242ab818613f4301ffd761efb59'

* commit '1a4ab293f0652242ab818613f4301ffd761efb59':
  android-2.1_r1 snapshot

14 years agoam e7532b6a: reconcile main tree with open-source eclair
The Android Open Source Project [Fri, 5 Feb 2010 16:43:46 +0000 (08:43 -0800)]
am e7532b6a: reconcile main tree with open-source eclair

Merge commit 'e7532b6aced6424a38e5b67db8602513bdbc9883' into eclair-plus-aosp

* commit 'e7532b6aced6424a38e5b67db8602513bdbc9883':
  android-2.1_r1 snapshot

14 years agoreconcile main tree with open-source eclair
The Android Open Source Project [Fri, 5 Feb 2010 16:09:33 +0000 (08:09 -0800)]
reconcile main tree with open-source eclair

14 years agoAdd 0xff (any object type) to sdptool OPUSH supported formats list.
Nick Pelly [Tue, 2 Feb 2010 21:08:51 +0000 (13:08 -0800)]
Add 0xff (any object type) to sdptool OPUSH supported formats list.

This fixed an issue with sending an image from OSX. OSX would show a warning
that the bluez stack does not support this file type, but offer to send it
anyway (which works). This change to advertise support for all object types
will remove this warning.

The list of file types that can be advertised in the SDP record is very limited
anyway. It is best to list that we support all file types here, and then filter
at the OPP/OBEX connection instead.

For reference:
0x01 = vCard 2.1
0x02 = vCard 3.0
0x03 = vCal 1.0
0x04 = iCal 2.0
0x05 = vNote
0x06 = vMessage
0xFF = any type of object.

14 years agoRevert "Set OPUSH SDP record supported format list to 0xff (any object type)."
Nick Pelly [Thu, 4 Feb 2010 16:52:08 +0000 (08:52 -0800)]
Revert "Set OPUSH SDP record supported format list to 0xff (any object type)."

This reverts commit ee7f17f2e9bc434c04fdfe5bfab84a6c48687b7a.

14 years agoSet OPUSH SDP record supported format list to 0xff (any object type).
Nick Pelly [Tue, 2 Feb 2010 21:08:51 +0000 (13:08 -0800)]
Set OPUSH SDP record supported format list to 0xff (any object type).

This fixed an issue with sending an image from OSX. OSX would show a warning
that the bluez stack does not support this file type, but offer to send it
anyway (which works). This change to advertise support for all object types
will remove this warning.

The list of file types that can be advertised in the SDP record is very limited
anyway. It is best to list that we support all file types here, and then filter
at the OPP/OBEX connection instead.

For reference:
0x01 = vCard 2.1
0x02 = vCard 3.0
0x03 = vCal 1.0
0x04 = iCal 2.0
0x05 = vNote
0x06 = vMessage
0xFF = any type of object.

Change-Id: I6ca5b8f3ec463ec30b77c7a83d23e1e3cd3c39cb

14 years agoreconcile android-2.1_r1 snapshot
The Android Open Source Project [Fri, 29 Jan 2010 22:07:48 +0000 (14:07 -0800)]
reconcile android-2.1_r1 snapshot

14 years agobluez: Enable pand in build
San Mehat [Thu, 28 Jan 2010 01:38:15 +0000 (17:38 -0800)]
bluez: Enable pand in build

Signed-off-by: San Mehat <san@google.com>
14 years agobluez: pand: Enable android logging
San Mehat [Thu, 21 Jan 2010 18:35:35 +0000 (10:35 -0800)]
bluez: pand: Enable android logging

Signed-off-by: San Mehat <san@google.com>
14 years agobluez: Add Android.mk for pand (off by default)
San Mehat [Thu, 21 Jan 2010 18:19:39 +0000 (10:19 -0800)]
bluez: Add Android.mk for pand (off by default)

Signed-off-by: San Mehat <san@google.com>
14 years agoandroid-2.1_r1 snapshot
The Android Open Source Project [Tue, 12 Jan 2010 23:18:17 +0000 (15:18 -0800)]
android-2.1_r1 snapshot

14 years agoam 928e6acc: am 60e8a333: Use monotonically increasing clock for A2DP timing.
Nick Pelly [Thu, 17 Dec 2009 18:46:40 +0000 (10:46 -0800)]
am 928e6acc: am 60e8a333: Use monotonically increasing clock for A2DP timing.

Merge commit '928e6acc10ad4966bc7f0f9ca896f04af2340a16'

* commit '928e6acc10ad4966bc7f0f9ca896f04af2340a16':
  Use monotonically increasing clock for A2DP timing.

14 years agoam 60e8a333: Use monotonically increasing clock for A2DP timing.
Nick Pelly [Thu, 17 Dec 2009 18:44:15 +0000 (10:44 -0800)]
am 60e8a333: Use monotonically increasing clock for A2DP timing.

Merge commit '60e8a3334a826bdfacb74231a343227981f2e380' into eclair-plus-aosp

* commit '60e8a3334a826bdfacb74231a343227981f2e380':
  Use monotonically increasing clock for A2DP timing.

14 years agoUse monotonically increasing clock for A2DP timing.
Nick Pelly [Thu, 17 Dec 2009 11:12:26 +0000 (03:12 -0800)]
Use monotonically increasing clock for A2DP timing.

This is to avoid skips when the system time changes.

14 years agoam 464dbc9c: am f3002f06: Stop trying to send A2DP packets quickly to catch-up on...
Nick Pelly [Tue, 15 Dec 2009 23:04:43 +0000 (15:04 -0800)]
am 464dbc9c: am f3002f06: Stop trying to send A2DP packets quickly to catch-up on missed write()\'s after falling behind by 200ms, or on poll() timeout.

Merge commit '464dbc9c5d6e4346ba0af20008849826ca30380c'

* commit '464dbc9c5d6e4346ba0af20008849826ca30380c':
  Stop trying to send A2DP packets quickly to catch-up on missed write()'s after

14 years agoam f3002f06: Stop trying to send A2DP packets quickly to catch-up on missed write...
Nick Pelly [Tue, 15 Dec 2009 15:41:22 +0000 (07:41 -0800)]
am f3002f06: Stop trying to send A2DP packets quickly to catch-up on missed write()\'s after falling behind by 200ms, or on poll() timeout.

Merge commit 'f3002f064c3f20af793e83f1de02647ebc6f2037' into eclair-plus-aosp

* commit 'f3002f064c3f20af793e83f1de02647ebc6f2037':
  Stop trying to send A2DP packets quickly to catch-up on missed write()'s after

14 years agoMerge commit 'goog/eclair-plus-aosp'
Android Git Automerger [Tue, 15 Dec 2009 08:44:41 +0000 (00:44 -0800)]
Merge commit 'goog/eclair-plus-aosp'

14 years agoStop trying to send A2DP packets quickly to catch-up on missed write()'s after
Nick Pelly [Tue, 15 Dec 2009 00:55:17 +0000 (16:55 -0800)]
Stop trying to send A2DP packets quickly to catch-up on missed write()'s after
falling behind by 200ms, or on poll() timeout.

This allows us to recover more quickly from a situation where an A2DP headset
rejects A2DP packets for a short time. We now reset to regular packet metering
faster.

14 years agoam db97f3f2: am bd1fc7d2: am 30b313b3: Changes flush timeout from 60 ms to 120 ms.
Nick Pelly [Fri, 11 Dec 2009 07:41:33 +0000 (23:41 -0800)]
am db97f3f2: am bd1fc7d2: am 30b313b3: Changes flush timeout from 60 ms to 120 ms.

Merge commit 'db97f3f200502522853040617a943627a2a1c125'

* commit 'db97f3f200502522853040617a943627a2a1c125':
  Changes flush timeout from 60 ms to 120 ms.

14 years agoam bd1fc7d2: am 30b313b3: Changes flush timeout from 60 ms to 120 ms.
Nick Pelly [Fri, 11 Dec 2009 01:52:23 +0000 (17:52 -0800)]
am bd1fc7d2: am 30b313b3: Changes flush timeout from 60 ms to 120 ms.

Merge commit 'bd1fc7d2f3115a984cac80967ad474990414177c' into eclair-mr2-plus-aosp

* commit 'bd1fc7d2f3115a984cac80967ad474990414177c':
  Changes flush timeout from 60 ms to 120 ms.

14 years agoam 30b313b3: Changes flush timeout from 60 ms to 120 ms.
Nick Pelly [Fri, 11 Dec 2009 01:41:06 +0000 (17:41 -0800)]
am 30b313b3: Changes flush timeout from 60 ms to 120 ms.

Merge commit '30b313b39a7985329f4f3df1a7a41ae80ca5f1f1' into eclair-mr2

* commit '30b313b39a7985329f4f3df1a7a41ae80ca5f1f1':
  Changes flush timeout from 60 ms to 120 ms.

14 years agoam d449cf9e: am c151ea98: am 4b9b3f4e: Fix liba2dp.c compiler warnings.
Nick Pelly [Fri, 11 Dec 2009 01:14:33 +0000 (17:14 -0800)]
am d449cf9e: am c151ea98: am 4b9b3f4e: Fix liba2dp.c compiler warnings.

Merge commit 'd449cf9e80a1571ee5c0ecf3aa0e7620855c4194'

* commit 'd449cf9e80a1571ee5c0ecf3aa0e7620855c4194':
  Fix liba2dp.c compiler warnings.

14 years agoam 240e3db1: am 805c107e: am 085910ff: Set A2DP L2CAP socket to flushable while strea...
Nick Pelly [Fri, 11 Dec 2009 01:14:30 +0000 (17:14 -0800)]
am 240e3db1: am 805c107e: am 085910ff: Set A2DP L2CAP socket to flushable while streaming A2DP, and set the automatic flush timeout.

Merge commit '240e3db13918bce001e76fcdbe6c0ce87a3549f8'

* commit '240e3db13918bce001e76fcdbe6c0ce87a3549f8':
  Set A2DP L2CAP socket to flushable while streaming A2DP, and set the automatic

14 years agoam 4e0b1f47: am 2c42523a: am ed11b556: Add L2CAP_LM_FLUSHABLE to Bluez header.
Nick Pelly [Fri, 11 Dec 2009 01:14:27 +0000 (17:14 -0800)]
am 4e0b1f47: am 2c42523a: am ed11b556: Add L2CAP_LM_FLUSHABLE to Bluez header.

Merge commit '4e0b1f47d9135f4015b63ad2402216d456379df0'

* commit '4e0b1f47d9135f4015b63ad2402216d456379df0':
  Add L2CAP_LM_FLUSHABLE to Bluez header.

14 years agoam 8a4d6387: am 2938a9c1: am d1ccb469: Add ACL flow control state (MTU, packets avail...
Nick Pelly [Fri, 11 Dec 2009 01:14:23 +0000 (17:14 -0800)]
am 8a4d6387: am 2938a9c1: am d1ccb469: Add ACL flow control state (MTU, packets available, packets total) for debug.

Merge commit '8a4d638741a2bb6b8e69f01ffb92c534740a14ae'

* commit '8a4d638741a2bb6b8e69f01ffb92c534740a14ae':
  Add ACL flow control state (MTU, packets available, packets total) for debug.

14 years agoam c151ea98: am 4b9b3f4e: Fix liba2dp.c compiler warnings.
Nick Pelly [Fri, 11 Dec 2009 00:57:14 +0000 (16:57 -0800)]
am c151ea98: am 4b9b3f4e: Fix liba2dp.c compiler warnings.

Merge commit 'c151ea982ee7894589f44b6b43fe89aafcf38015' into eclair-mr2-plus-aosp

* commit 'c151ea982ee7894589f44b6b43fe89aafcf38015':
  Fix liba2dp.c compiler warnings.

14 years agoam 805c107e: am 085910ff: Set A2DP L2CAP socket to flushable while streaming A2DP...
Nick Pelly [Fri, 11 Dec 2009 00:57:11 +0000 (16:57 -0800)]
am 805c107e: am 085910ff: Set A2DP L2CAP socket to flushable while streaming A2DP, and set the automatic flush timeout.

Merge commit '805c107ed0d5b5b240fc9991ff6be77dad650994' into eclair-mr2-plus-aosp

* commit '805c107ed0d5b5b240fc9991ff6be77dad650994':
  Set A2DP L2CAP socket to flushable while streaming A2DP, and set the automatic

14 years agoam 2c42523a: am ed11b556: Add L2CAP_LM_FLUSHABLE to Bluez header.
Nick Pelly [Fri, 11 Dec 2009 00:57:07 +0000 (16:57 -0800)]
am 2c42523a: am ed11b556: Add L2CAP_LM_FLUSHABLE to Bluez header.

Merge commit '2c42523a333d545e0dbf08c9e4a6e748d27ca46a' into eclair-mr2-plus-aosp

* commit '2c42523a333d545e0dbf08c9e4a6e748d27ca46a':
  Add L2CAP_LM_FLUSHABLE to Bluez header.

14 years agoam 2938a9c1: am d1ccb469: Add ACL flow control state (MTU, packets available, packets...
Nick Pelly [Fri, 11 Dec 2009 00:57:03 +0000 (16:57 -0800)]
am 2938a9c1: am d1ccb469: Add ACL flow control state (MTU, packets available, packets total) for debug.

Merge commit '2938a9c1fe14089e2f2e942958b8aa6264a60aa3' into eclair-mr2-plus-aosp

* commit '2938a9c1fe14089e2f2e942958b8aa6264a60aa3':
  Add ACL flow control state (MTU, packets available, packets total) for debug.

14 years agoam 4b9b3f4e: Fix liba2dp.c compiler warnings.
Nick Pelly [Fri, 11 Dec 2009 00:43:41 +0000 (16:43 -0800)]
am 4b9b3f4e: Fix liba2dp.c compiler warnings.

Merge commit '4b9b3f4e3b212d8f362af1f24c2802e361294d28' into eclair-mr2

* commit '4b9b3f4e3b212d8f362af1f24c2802e361294d28':
  Fix liba2dp.c compiler warnings.

14 years agoam 085910ff: Set A2DP L2CAP socket to flushable while streaming A2DP, and set the...
Nick Pelly [Fri, 11 Dec 2009 00:43:37 +0000 (16:43 -0800)]
am 085910ff: Set A2DP L2CAP socket to flushable while streaming A2DP, and set the automatic flush timeout.

Merge commit '085910ff264f1b41751672d99469467d8d14806c' into eclair-mr2

* commit '085910ff264f1b41751672d99469467d8d14806c':
  Set A2DP L2CAP socket to flushable while streaming A2DP, and set the automatic

14 years agoam ed11b556: Add L2CAP_LM_FLUSHABLE to Bluez header.
Nick Pelly [Fri, 11 Dec 2009 00:43:33 +0000 (16:43 -0800)]
am ed11b556: Add L2CAP_LM_FLUSHABLE to Bluez header.

Merge commit 'ed11b556f0e0eb71ab07bbf782c3c86d50dc1456' into eclair-mr2

* commit 'ed11b556f0e0eb71ab07bbf782c3c86d50dc1456':
  Add L2CAP_LM_FLUSHABLE to Bluez header.

14 years agoam d1ccb469: Add ACL flow control state (MTU, packets available, packets total) for...
Nick Pelly [Fri, 11 Dec 2009 00:43:29 +0000 (16:43 -0800)]
am d1ccb469: Add ACL flow control state (MTU, packets available, packets total) for debug.

Merge commit 'd1ccb4691dd87a4b0c0c16bab5eca19194321f3d' into eclair-mr2

* commit 'd1ccb4691dd87a4b0c0c16bab5eca19194321f3d':
  Add ACL flow control state (MTU, packets available, packets total) for debug.

14 years agoam 30b313b3: Changes flush timeout from 60 ms to 120 ms.
Nick Pelly [Thu, 10 Dec 2009 01:08:11 +0000 (17:08 -0800)]
am 30b313b3: Changes flush timeout from 60 ms to 120 ms.

Merge commit '30b313b39a7985329f4f3df1a7a41ae80ca5f1f1' into eclair-plus-aosp

* commit '30b313b39a7985329f4f3df1a7a41ae80ca5f1f1':
  Changes flush timeout from 60 ms to 120 ms.

14 years agoChanges flush timeout from 60 ms to 120 ms.
Nick Pelly [Thu, 10 Dec 2009 00:20:28 +0000 (16:20 -0800)]
Changes flush timeout from 60 ms to 120 ms.

Less A2DP drop-outs due to unnecessary flushing.

BCM recommend 120-150ms for lazy flushing.

14 years agoam 4b9b3f4e: Fix liba2dp.c compiler warnings.
Nick Pelly [Wed, 9 Dec 2009 13:38:08 +0000 (05:38 -0800)]
am 4b9b3f4e: Fix liba2dp.c compiler warnings.

Merge commit '4b9b3f4e3b212d8f362af1f24c2802e361294d28' into eclair-plus-aosp

* commit '4b9b3f4e3b212d8f362af1f24c2802e361294d28':
  Fix liba2dp.c compiler warnings.

14 years agoam 085910ff: Set A2DP L2CAP socket to flushable while streaming A2DP, and set the...
Nick Pelly [Wed, 9 Dec 2009 13:38:05 +0000 (05:38 -0800)]
am 085910ff: Set A2DP L2CAP socket to flushable while streaming A2DP, and set the automatic flush timeout.

Merge commit '085910ff264f1b41751672d99469467d8d14806c' into eclair-plus-aosp

* commit '085910ff264f1b41751672d99469467d8d14806c':
  Set A2DP L2CAP socket to flushable while streaming A2DP, and set the automatic

14 years agoam ed11b556: Add L2CAP_LM_FLUSHABLE to Bluez header.
Nick Pelly [Wed, 9 Dec 2009 13:38:02 +0000 (05:38 -0800)]
am ed11b556: Add L2CAP_LM_FLUSHABLE to Bluez header.

Merge commit 'ed11b556f0e0eb71ab07bbf782c3c86d50dc1456' into eclair-plus-aosp

* commit 'ed11b556f0e0eb71ab07bbf782c3c86d50dc1456':
  Add L2CAP_LM_FLUSHABLE to Bluez header.

14 years agoam d1ccb469: Add ACL flow control state (MTU, packets available, packets total) for...
Nick Pelly [Wed, 9 Dec 2009 13:37:58 +0000 (05:37 -0800)]
am d1ccb469: Add ACL flow control state (MTU, packets available, packets total) for debug.

Merge commit 'd1ccb4691dd87a4b0c0c16bab5eca19194321f3d' into eclair-plus-aosp

* commit 'd1ccb4691dd87a4b0c0c16bab5eca19194321f3d':
  Add ACL flow control state (MTU, packets available, packets total) for debug.

14 years agoFix liba2dp.c compiler warnings.
Nick Pelly [Wed, 9 Dec 2009 09:25:41 +0000 (01:25 -0800)]
Fix liba2dp.c compiler warnings.

14 years agoSet A2DP L2CAP socket to flushable while streaming A2DP, and set the automatic
Nick Pelly [Wed, 9 Dec 2009 09:23:43 +0000 (01:23 -0800)]
Set A2DP L2CAP socket to flushable while streaming A2DP, and set the automatic
flush timeout.

Remove the (ahead < 0) logic that was designed to skip forwards when streaming
was lagging. This logic was not working properly, and ACL flushing does its
job.

14 years agoAdd L2CAP_LM_FLUSHABLE to Bluez header.
Nick Pelly [Wed, 9 Dec 2009 09:18:22 +0000 (01:18 -0800)]
Add L2CAP_LM_FLUSHABLE to Bluez header.

14 years agoAdd ACL flow control state (MTU, packets available, packets total) for debug.
Nick Pelly [Wed, 9 Dec 2009 09:09:36 +0000 (01:09 -0800)]
Add ACL flow control state (MTU, packets available, packets total) for debug.

Accessed with the debug tool 'hcitool con'

14 years agoam 4a9b3c31: merge from open-source master
Jean-Baptiste Queru [Sun, 15 Nov 2009 23:03:26 +0000 (15:03 -0800)]
am 4a9b3c31: merge from open-source master

Merge commit '4a9b3c31ab26781b4748bf38a49c4509388e75a8'

* commit '4a9b3c31ab26781b4748bf38a49c4509388e75a8':

14 years agomerge from open-source master
Jean-Baptiste Queru [Sun, 15 Nov 2009 22:55:07 +0000 (14:55 -0800)]
merge from open-source master

14 years agomerge from open-source master
Jean-Baptiste Queru [Sun, 15 Nov 2009 22:05:59 +0000 (14:05 -0800)]
merge from open-source master

Merge commit 'goog/stage-korg-master' into HEAD

14 years agoam 5f022293: merge from open-source master
Jean-Baptiste Queru [Sun, 15 Nov 2009 19:30:45 +0000 (11:30 -0800)]
am 5f022293: merge from open-source master

Merge commit '5f022293cad83d84b8a02a0477d3a0632caeaef3'

* commit '5f022293cad83d84b8a02a0477d3a0632caeaef3':
  eclair snapshot

14 years agomerge from open-source master
Jean-Baptiste Queru [Sun, 15 Nov 2009 18:59:01 +0000 (10:59 -0800)]
merge from open-source master

14 years agoeclair snapshot
Jean-Baptiste Queru [Fri, 13 Nov 2009 02:45:21 +0000 (18:45 -0800)]
eclair snapshot

14 years agoam 6f39ea2e: am a74a11ed: Send SBC frames if output buffer is nearly full.
Yu Kang Ku [Thu, 5 Nov 2009 23:57:21 +0000 (15:57 -0800)]
am 6f39ea2e: am a74a11ed: Send SBC frames if output buffer is nearly full.

Merge commit '6f39ea2e26c6fb99e21d469c9bdccd1d3a43a49f'

* commit '6f39ea2e26c6fb99e21d469c9bdccd1d3a43a49f':
  Send SBC frames if output buffer is nearly full.

14 years agoam a74a11ed: Send SBC frames if output buffer is nearly full.
Yu Kang Ku [Thu, 5 Nov 2009 23:39:57 +0000 (15:39 -0800)]
am a74a11ed: Send SBC frames if output buffer is nearly full.

Merge commit 'a74a11ed158d466e89c27961fe67934979104c38' into eclair-mr2

* commit 'a74a11ed158d466e89c27961fe67934979104c38':
  Send SBC frames if output buffer is nearly full.

14 years agoSend SBC frames if output buffer is nearly full.
Yu Kang Ku [Thu, 5 Nov 2009 18:49:48 +0000 (10:49 -0800)]
Send SBC frames if output buffer is nearly full.

This is to address an A2DP issue seen with the Mazda carkit, where A2DP audio
cannot be played. The MTU size (8200) requested by this carkit is much greater
than the output buffer size (2048) allocated by the Bluez A2DP profile. The
output buffer being full is giving an SBC encode error. This patch checks for
the buffer full condition.

Change-Id: Idded504d085c760baef15cd3cef84fcf57165e4f
Signed-off-by: Yu Kang Ku <kang.ku@motorola.com>
Signed-off-by: Nick Pelly <npelly@google.com>
14 years agoam 03e2d30e: am 60a51ae8: Add support for sending Broadcom coexistance setup commands...
Nick Pelly [Mon, 2 Nov 2009 05:57:03 +0000 (21:57 -0800)]
am 03e2d30e: am 60a51ae8: Add support for sending Broadcom coexistance setup commands for A2DP links.

Merge commit '03e2d30ed17f4e87507b4c38b779d4b9fa13dc79'

* commit '03e2d30ed17f4e87507b4c38b779d4b9fa13dc79':
  Add support for sending Broadcom coexistance setup commands for A2DP links.

14 years agoam 7e8d6f1e: am 9c2b1e35: Fix handling of SDP records.
Jaikumar Ganesh [Mon, 2 Nov 2009 05:50:31 +0000 (21:50 -0800)]
am 7e8d6f1e: am 9c2b1e35: Fix handling of SDP records.

Merge commit '7e8d6f1e227ed86aa97873dda522c9a694c0d441'

* commit '7e8d6f1e227ed86aa97873dda522c9a694c0d441':
  Fix handling of SDP records.

14 years agoam 60a51ae8: Add support for sending Broadcom coexistance setup commands for A2DP...
Nick Pelly [Sat, 31 Oct 2009 01:56:07 +0000 (18:56 -0700)]
am 60a51ae8: Add support for sending Broadcom coexistance setup commands for A2DP links.

Merge commit '60a51ae85f9e049d3522e118de1d4518b543e1ff' into eclair-mr2

* commit '60a51ae85f9e049d3522e118de1d4518b543e1ff':
  Add support for sending Broadcom coexistance setup commands for A2DP links.

14 years agoAdd support for sending Broadcom coexistance setup commands for A2DP links.
Nick Pelly [Sat, 31 Oct 2009 01:18:33 +0000 (18:18 -0700)]
Add support for sending Broadcom coexistance setup commands for A2DP links.

Enabled on platforms with BOARD_HAVE_BLUETOOTH_BCM.

Change-Id: Ic223955ac3580e5a9430f96e069f686a7afdbef8

14 years agoam 9c2b1e35: Fix handling of SDP records.
Jaikumar Ganesh [Fri, 30 Oct 2009 17:31:13 +0000 (10:31 -0700)]
am 9c2b1e35: Fix handling of SDP records.

Merge commit '9c2b1e35d6a6f06870d2ad309e406b5ad532a0c9' into eclair-mr2

* commit '9c2b1e35d6a6f06870d2ad309e406b5ad532a0c9':
  Fix handling of SDP records.

14 years agoFix handling of SDP records.
Jaikumar Ganesh [Fri, 30 Oct 2009 16:29:02 +0000 (09:29 -0700)]
Fix handling of SDP records.

Delete SDP records when device is deleted.
Update cache whenever SDP is performed.
Remove SDP records even when there is no driver associated with the UUID.

Bug: 2173752
Dr No: Eastham

14 years agoam efc34e0e: (-s ours) am 2cb28731: (-s ours) do not merge - Fix for issue 2184627...
Eric Laurent [Thu, 29 Oct 2009 06:48:26 +0000 (23:48 -0700)]
am efc34e0e: (-s ours) am 2cb28731: (-s ours) do not merge - Fix for issue 2184627 cherry picked from eclair-mr2

Merge commit 'efc34e0ef5bbf21c2c53e5ad3de771673a311e25'

* commit 'efc34e0ef5bbf21c2c53e5ad3de771673a311e25':
  do not merge - Fix for issue 2184627 cherry picked from eclair-mr2

14 years agoam 2cb28731: (-s ours) do not merge - Fix for issue 2184627 cherry picked from eclair-mr2
Eric Laurent [Wed, 28 Oct 2009 17:26:44 +0000 (10:26 -0700)]
am 2cb28731: (-s ours) do not merge - Fix for issue 2184627 cherry picked from eclair-mr2

Merge commit '2cb28731fbb3be20e2bca2a053aec5a61a5f8ce0' into eclair-mr2

* commit '2cb28731fbb3be20e2bca2a053aec5a61a5f8ce0':
  do not merge - Fix for issue 2184627 cherry picked from eclair-mr2

14 years agodo not merge - Fix for issue 2184627 cherry picked from eclair-mr2
Eric Laurent [Fri, 16 Oct 2009 16:22:50 +0000 (09:22 -0700)]
do not merge - Fix for issue 2184627 cherry picked from eclair-mr2

Bluetooth A2DP suspend-resume improvements.

This change will reduce the occurence rate of A2DP sink suspend resume failures observed in issues 21846272181005 and possibly 2189628.

Avoid lockups in case of BT device disconnection during the A2DP start process by using a timeout when reading from bluetooth command socket.
Correct a typo causing potential deadlock in wait_for_start().

14 years agoBluetooth A2DP suspend-resume improvements.
Eric Laurent [Fri, 16 Oct 2009 16:22:50 +0000 (09:22 -0700)]
Bluetooth A2DP suspend-resume improvements.

This change will reduce the occurence rate of A2DP sink suspend resume failures observed in issues 21846272181005 and possibly 2189628.

Avoid lockups in case of BT device disconnection during the A2DP start process by using a timeout when reading from bluetooth command socket.
Correct a typo causing potential deadlock in wait_for_start().

14 years agoAdd DBUS interfaces AddRfcommServiceRecord() and RemoveServiceRecord().
Nick Pelly [Thu, 1 Oct 2009 02:09:58 +0000 (19:09 -0700)]
Add DBUS interfaces AddRfcommServiceRecord() and RemoveServiceRecord().

org.bluez.Adapter.AddRfcommServiceRecord takes a name, uuid and channel
and creates a record like:

Service Name: MyApplication
Service RecHandle: 0x10009
Service Class ID List:
  UUID 128: 42999bc0-ac5e-11de-8a39-0800200c9a66
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 26

It returns the integer Record Handle, that can be used with
org.bluez.Adapter.RemoveServiceRecord to remove that record.

Bug: 2158900
DrNo: eastham

Change-Id: Ie375d5ccd24b5faf067a26b8a04a1449b3f56ce2

14 years agoRemove redundant call to bluetooth_init().
Nick Pelly [Wed, 30 Sep 2009 18:35:21 +0000 (11:35 -0700)]
Remove redundant call to bluetooth_init().

This is a cleanup to Ian Kent's preceeding patchset.

Change-Id: I8ff00530fdd337873ff898b7fd9009b0fc13f0b4

14 years agoAdd Bluetooth A2DP suspend/resume to DBUS API.
Zhu Lan [Tue, 23 Jun 2009 08:04:09 +0000 (16:04 +0800)]
Add Bluetooth A2DP suspend/resume to DBUS API.

Change-Id: Icef1729957ed55e491e63d74d14a2c0c93984c4d

14 years agobluez a2dp - use a sensible write timeout
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - use a sensible write timeout

The 500 msec write timeout is extremely optimistic, a 1000 msec
timeout is closer to reality.

14 years agobluez a2dp - fix wait_for_start() spurious wakeup
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - fix wait_for_start() spurious wakeup

When waiting on a condition is is possble to receive spurious
wake ups. Deal with this in wait_for_start().

Change-Id: I678e9d7831333d9b8baa31e9b0ec2597ca9263cd

14 years agobluez a2dp - fix wait_for_start() synchronization
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - fix wait_for_start() synchronization

On entry to wait_for_start() it's possible we are in state
A2DP_STATE_NONE if a2dp_thread() has not completed bluetooth_init().
Also, we call the pthread_mutex_*() functions more frequently than
we really need to.

Move the mutex locking outside the loop and let condition wait
take care of the locking. Also move the A2DP_STATE_NONE check
below the condition wait so we can be sure the state machine
has been poked before we test it.

Change-Id: I020bea365a623e88cb1a5f7e5fccd8f8aa948518

14 years agobluez a2dp - destroy thread attr after thread create
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - destroy thread attr after thread create

Pthread resources may be used by the thread attributes object.
We should destroy this after thread creation.

14 years agobluez a2dp - destroy thread resources at exit
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - destroy thread resources at exit

The dynamically created pthread mutex and condition variables
consume pthread resources. They should be destroyed prior to
freeing the structure containing them.

14 years agobluez a2dp - fix a2dp_thread() spurious wakeup
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - fix a2dp_thread() spurious wakeup

When waiting on a condition is is possble to receive spurious
wake ups. Use the fact that when we poke the state machine the
command must have changed to deal with this.

Change-Id: I0ed2f2a15c15dea30cb1d5cf3b67c8549d6802d4

14 years agobluez a2dp - fix state machine synchronization
Ian Kent [Mon, 28 Sep 2009 15:47:44 +0000 (23:47 +0800)]
bluez a2dp - fix state machine synchronization

Using a worker thread implementation for A2DP means that if we don't
have some way to syncroniize state transitions we can get overlap of
requested command functions or lost signals. In order for the A2DP
state machine to function each command operation must complete before
the next is initiated or we will get errors caused by these out of
sequence commands. And if we signal the thread when it is not waiting
on the condition the signal will be missed.

This could be partly resolved by implementing a queue but then there
is an overhead with also implementing a wait mechamism for state
transitions. It's much easier and simpler to just hold the mutex
during command processing which also deals with the lost signals issue.
This may well not achieve the original goal of the worker thread
implementation but neither would a queue implementation. It looks
like this is just the way things are!

14 years agobluez a2dp - syncronize worker thread start
Ian Kent [Mon, 28 Sep 2009 15:47:43 +0000 (23:47 +0800)]
bluez a2dp - syncronize worker thread start

There is an order of execution assumption made when starting the
a2dp worker thread. Add an additional condition variable to allow
us to make sure we have reached the thread_wait condition wait
before returning from a2dp_init().

14 years agoRename audio_device_is_connected more appropriately
Johan Hedberg [Thu, 3 Sep 2009 16:08:07 +0000 (19:08 +0300)]
Rename audio_device_is_connected more appropriately

14 years agoFix AVDTP Abort when transport closes before response
Johan Hedberg [Thu, 3 Sep 2009 15:22:14 +0000 (18:22 +0300)]
Fix AVDTP Abort when transport closes before response

Change-Id: I5d2bced52514eb14fd8236a9262ae5c71e68f524

14 years agoFix agent_free call due to the picking up of upmerge fixes.
Jaikumar Ganesh [Tue, 29 Sep 2009 01:05:23 +0000 (18:05 -0700)]
Fix agent_free call due to the picking up of upmerge fixes.

Change-Id: Ia0a12ec45dd498572e4a4f2354d383ba5ea436ce

14 years agoFix AVDTP suspend while closing
Johan Hedberg [Wed, 16 Sep 2009 11:15:22 +0000 (14:15 +0300)]
Fix AVDTP suspend while closing

We should reject any suspend request if we've already started the close
procedure for a stream.

14 years agoFix command timeout handling when there's no stream
Johan Hedberg [Tue, 15 Sep 2009 18:12:04 +0000 (21:12 +0300)]
Fix command timeout handling when there's no stream

The media stream could be gone by the time that the AVDTP command timeout
expires (e.g. if the media transport channel gets closed prematurely). In
such a case there's no need to send a separate ABORT command but we can
directly proceed with closing the signalling channel.

14 years agoFix AVDTP ABORTING state transition
Johan Hedberg [Tue, 15 Sep 2009 14:17:07 +0000 (17:17 +0300)]
Fix AVDTP ABORTING state transition

The transition to ABORTING state when acting as initiator should happen
when we receive the ABORT reply and not when we send the initial ABORT
command. The reply handling is already correct but since there's a state
change also in the sending part the later state change request would fail.
This patch fixes the issue by removing the state change when sending the
ABORT command.

Change-Id: I9cf9f27924b7d348523125ddccff7c8ecebacf93

14 years agoFix stream handling when the media transport disconnects prematurely
Johan Hedberg [Tue, 15 Sep 2009 08:05:49 +0000 (11:05 +0300)]
Fix stream handling when the media transport disconnects prematurely

We might not have a stream anymore when receiving the reply to a AVDTP
command that assumes that there is an existing stream. So ignore the
replies to these commands if we don't have a stream anymore.

14 years agoFixed duplicate attempt from device to connect 'signalling' channel
Peter Hurley [Wed, 9 Sep 2009 17:25:35 +0000 (13:25 -0400)]
Fixed duplicate attempt from device to connect 'signalling' channel

A device may attempt to initiate a duplicate avdtp channel while
a host-initiated channel connection is still pending. This
situation is referred to as 'XCASE connect:connect' in sink.c and
source.c. This fix rejects the device-initiated connection in this
circumstance.

14 years agoFix agent destroy callback handling for errors
Johan Hedberg [Sun, 6 Sep 2009 00:18:19 +0000 (03:18 +0300)]
Fix agent destroy callback handling for errors

The destroy callback should not be called if calling the agent fails and
an error is returned to the caller of the agent.c public function.

14 years agoFix agent_authorize error return
Johan Hedberg [Sun, 6 Sep 2009 00:15:42 +0000 (03:15 +0300)]
Fix agent_authorize error return

14 years agoFix audio authorization cancelation on the same mainloop iteration
Johan Hedberg [Sat, 5 Sep 2009 20:06:23 +0000 (23:06 +0300)]
Fix audio authorization cancelation on the same mainloop iteration

If the device is trusted and the authorization is canceled before the idle
callback takes place the idle callback should be removed. This patch adds
tracking of the idle id and removes it in the case of cancelation.

Change-Id: I7a22176bb9c881349cde0730e196378c94665ecb

14 years agoMake dev->authorized private to audio/device.c
Johan Hedberg [Sat, 5 Sep 2009 19:09:34 +0000 (22:09 +0300)]
Make dev->authorized private to audio/device.c

There's no need to expose the authorized setting outside of device.c.

14 years agoFix AVDTP stream leak for invalid media transport config
Johan Hedberg [Sat, 5 Sep 2009 14:50:13 +0000 (17:50 +0300)]
Fix AVDTP stream leak for invalid media transport config

14 years agoFix race condition in authorizing audio connections
Johan Hedberg [Fri, 4 Sep 2009 16:40:19 +0000 (19:40 +0300)]
Fix race condition in authorizing audio connections

The current check for implicit authorization is if any other audio profile
is already connected. However, a the second profile might try to connect
right after we've gotten a positive authorization reply for the first one
but before the first profile has reached "connected" state. So just by
checking the connected state of other profiles we might get a false
negative for the decision of doing implicit authorization.

This patch adds a variable to the audio_device struct for keeping track of
if we've gotten a positive authorization reply that can be used in
addition to the "any other profiles" connected check. This variable gets
cleared when the (global audio) device state goes back to disconnected.