Age | Commit message (Collapse) | Author |
|
Change-Id: Ia1dfb030383384813c6f5780f5e83967c7d21a23
|
|
Change-Id: Iba0802f8d03bc57ecf32736f5eb8beb59ac56f39
|
|
Change-Id: Iab79133bf1045a51e5f8fa97f0c60765ee02fbe9
|
|
Use definition from audio.h for A2DP sink address parameter.
Change-Id: I18119acc6579b9fed6b2f8cf390bbbab1d5b5e46
|
|
Commit 355afe9a broke the calculation of the latency returned by A2DP,
leading to incorrect A/V sync.
The latency must take into account the intermediate buffering added in audio HAL.
Change-Id: I1f3d7494fe58517151c5dba0a4883f583d7a6ef2
|
|
|
|
Change-Id: Icc0048b165032366a035d35e79a5887dccab8c73
|
|
Change-Id: I6c64429f93c595df264138a668a91916e7bcec66
|
|
See https://android-git.corp.google.com/g/#/c/157220
Bug: 5449033
Change-Id: I5d70c4def17fb904e39bbbca6b807dfa71b45bd9
|
|
* commit 'cbdef4bcda666239af9a2c77fd92e42d85160c65':
a2dp audio HAL: extend write timeout.
|
|
See https://android-git.corp.google.com/g/156016
Bug: 5449033
Change-Id: I2aa130ef94576887d8a88eaa42cc0f26ce7411b0
|
|
Extend the timeout delay in out_write() when waiting for
available space in output buffer to accomodate A2DP sink with a long
startup time.
Issue 5781477.
Change-Id: I4e31b5116ddbea8774a15b2016d088ea7039ec93
|
|
Change-Id: I0657769de025844efb7a36e5ab868a9505c5faf7
|
|
The a2dp stack is throttling the audio throughtput
to accommodate headsets that can accept audio too fast.
This makes that very limited audio buffering exists in the
A2DP output path. We are therefore vulnerable to irregular scheduling of
audioflinger mixer thread when CPU clock speed or system activity changes.
The fix consists in adding an intermediate audio buffer between audioflinger
mixer thread and the A2DP socket.
Issue 5682206.
Change-Id: I6f2387fb694a75e62c0805b7f134f7cb88eaedd6
|
|
See https://android-git.corp.google.com/g/#/c/143865
Bug: 5449033
Change-Id: I68754993ff27a3048758905b8928f9791e9a7fbc
|
|
The AVDTP spec allows for a race condition between remote and local
device when issuing an AVDTP_START cmd on a stream in the OPEN state.
However, the internal state must continue to be consistent. For example,
suppose that avdtp_start() has been called while in the OPEN state and
a AVDTP_START cmd is sent. Now before we have received a response (and
thus entered the STREAMING state), we *receive* a START cmd. Prior to
this fix, since the sep is still in the OPEN state, we would accept
the new START cmd. This will leads us to send both a Start_Ind and
Start_Cfm - not good.
Now, we track this transitional state (starting == TRUE).
NB - 'starting' is only in a valid state while the sep is in the
OPEN state. 'starting' is reset when we return to the OPEN state.
|
|
When we disconnect an A2DP device by immediate power off and quickly
also initiate a disconnection from our side, a crash is occurring. This
is happening because of the disconnect_timeout coming after freeing the
session.
|
|
|
|
Change-Id: Ic15f9dc50ad4643e8272c62ed9134ab09f7d0966
|
|
Change-Id: I88ab8e0191e67fb09f9a271190993592fcab0484
|
|
Change-Id: Idb06aa33dc60eb4b1769335fc6c07ff007ccf090
Signed-off-by: Dima Zavin <dima@android.com>
|
|
Change-Id: Idc8204629b859ef3873afc4d303a61308af14a07
|
|
When the a2dp_thread has finished executing one command, it signals
the client thread. Some error cases do not signal and due to this
calls to liba2dp will hang until the client thread times out.
Add signaling in error cases to avoid calls to liba2dp to hang.
Change-Id: Ic6eae5af3ed4f40c0eb022aba35ed4e0d3f81904
|
|
Change-Id: Ic3d8c530441a26074f6baabb7ea05182d5c03b1e
Signed-off-by: Dima Zavin <dima@android.com>
|
|
Added missing initialization of output stream pointer in
device struct and test on valid output stream in set_parameters()
Change-Id: I162c410968dcbd6ed89f939c42bd48dbfe390a71
|
|
Change-Id: Ia01ea6f9caf51756d9d45a6068a8e2dc4bf7d49e
Signed-off-by: Dima Zavin <dima@android.com>
|
|
Original commit: c3d03f1916d453eabbc5e3d58f6926dcaba2c4df
update by Jaikumar Ganesh for Bluez upmerge.
|
|
Change-Id: I6eaf6b2ad1eb99c0c163d4d1131d851ec6781cb6
|
|
Android only supports category 1 keys.
Change-Id: I0760b7a8f49ff9e21dbd28cb3a5ce486209a30c3
|
|
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
|
|
This is to avoid skips when the system time changes.
|
|
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.
|
|
|
|
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.
Changes made by: Jaikumar Ganesh for Bluez upgrade to 4.89
Change-Id: Ic9025be657cbea1362b0a7f1d5a30ecf55e6cad2
|
|
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>
|
|
Enabled on platforms with BOARD_HAVE_BLUETOOTH_BCM.
Change-Id: Ic223955ac3580e5a9430f96e069f686a7afdbef8
|
|
This change will reduce the occurence rate of A2DP sink suspend resume failures observed in issues 2184627, 2181005 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().
|
|
This is a cleanup to Ian Kent's preceeding patchset.
Change-Id: I8ff00530fdd337873ff898b7fd9009b0fc13f0b4
|
|
Change-Id: Icef1729957ed55e491e63d74d14a2c0c93984c4d
|
|
The 500 msec write timeout is extremely optimistic, a 1000 msec
timeout is closer to reality.
|
|
When waiting on a condition is is possble to receive spurious
wake ups. Deal with this in wait_for_start().
Change-Id: I678e9d7831333d9b8baa31e9b0ec2597ca9263cd
|
|
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
|
|
Pthread resources may be used by the thread attributes object.
We should destroy this after thread creation.
|
|
The dynamically created pthread mutex and condition variables
consume pthread resources. They should be destroyed prior to
freeing the structure containing them.
|
|
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
|
|
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!
|
|
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().
|
|
We are a AVRCP 1.0 target, not a controller.
This is identical to the change we applied to Bluez 3.x
|
|
Signed-off-by: Mike Lockwood <lockwood@android.com>
|
|
In bluez4, when a device is unpaired the socket end is freed and
so we will get a EPIPE when we write to it, this causes us to call
bluetooth_close. On the next write, we don't call bluetooth_init.
The logic here is thati, if the state is A2DP_STATE_NONE and we
are waiting for BLUETOOTH_START state, we need to call bluetooth_init.
The ENODEV case is where the other end, doesn't exist, and we are
trying to write repeatedly, which means the problem is elsewhere.
When we start initially (i.e the first time) when a2dp_set_sink is called,
we used to directly set the command to configure and the a2dp_thread used to
call bluetooth_init. This fix makes this a separate state and step.
Tested:
1. A2DP music playing, turn BT off. Turn BT open, A2DP should work.
2. A2DP music playing, disconnect. On reconnection, it should work.
3. A2DP music playing, cause a crash in bluetoothd. On restart, it should
work.
4. A2DP music playing, remote end powers down. On power up, it should work.
5. A2DP music playing, disconnect and unpair. On repair and reconnect,
it should work.
Tested with 2 headsets and with the troublesome HBH-DS790.
|