aboutsummaryrefslogtreecommitdiff
path: root/audio
AgeCommit message (Collapse)Author
2012-04-17fix gpl buildEric Laurent
Change-Id: Ia1dfb030383384813c6f5780f5e83967c7d21a23
2012-04-17audio: update to new audio HAL device API.Eric Laurent
Change-Id: Iba0802f8d03bc57ecf32736f5eb8beb59ac56f39
2012-03-08fix GPL buildEric Laurent
Change-Id: Iab79133bf1045a51e5f8fa97f0c60765ee02fbe9
2012-03-07audio: use common string for A2DP sink addressEric Laurent
Use definition from audio.h for A2DP sink address parameter. Change-Id: I18119acc6579b9fed6b2f8cf390bbbab1d5b5e46
2012-03-05audio: fix wrong latency reported by audio HALEric Laurent
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
2012-01-20Merge "Use audio_format_t consistently"Glenn Kasten
2012-01-13Use audio_mode_t consistentlyGlenn Kasten
Change-Id: Icc0048b165032366a035d35e79a5887dccab8c73
2012-01-13Use audio_format_t consistentlyGlenn Kasten
Change-Id: I6c64429f93c595df264138a668a91916e7bcec66
2012-01-06Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGESteve Block
See https://android-git.corp.google.com/g/#/c/157220 Bug: 5449033 Change-Id: I5d70c4def17fb904e39bbbca6b807dfa71b45bd9
2012-01-04am cbdef4bc: am 05675015: a2dp audio HAL: extend write timeout.Eric Laurent
* commit 'cbdef4bcda666239af9a2c77fd92e42d85160c65': a2dp audio HAL: extend write timeout.
2012-01-03Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) DO NOT MERGESteve Block
See https://android-git.corp.google.com/g/156016 Bug: 5449033 Change-Id: I2aa130ef94576887d8a88eaa42cc0f26ce7411b0
2011-12-21a2dp audio HAL: extend write timeout.android-cts-4.0.3_r2Eric Laurent
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
2011-12-05resolved conflicts for merge of 355afe9a to masterEric Laurent
Change-Id: I0657769de025844efb7a36e5ab868a9505c5faf7
2011-12-05a2dp HAL: add write thread to avoid audio skipsEric Laurent
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
2011-10-25Rename LOGV(_IF) to ALOGV(_IF) DO NOT MERGESteve Block
See https://android-git.corp.google.com/g/#/c/143865 Bug: 5449033 Change-Id: I68754993ff27a3048758905b8928f9791e9a7fbc
2011-08-23avdtp: fix race condition when starting a streamPeter Hurley
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.
2011-08-23Fix crash when disconnecting A2DPSyam Sidhardhan
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.
2011-07-13Merge "Add NOTICE and MODULE_LICENSE_GPL files."Jean-Baptiste Queru
2011-07-08Audio HAL: added interface for audio preprocessingEric Laurent
Change-Id: Ic15f9dc50ad4643e8272c62ed9134ab09f7d0966
2011-06-18Also allow legacy behaviorsJean-Baptiste Queru
Change-Id: I88ab8e0191e67fb09f9a271190993592fcab0484
2011-06-13audio hal: update audio hal header locationDima Zavin
Change-Id: Idb06aa33dc60eb4b1769335fc6c07ff007ccf090 Signed-off-by: Dima Zavin <dima@android.com>
2011-05-25Change version number to 4.93Jaikumar Ganesh
Change-Id: Idc8204629b859ef3873afc4d303a61308af14a07
2011-05-25Signal client thread in error cases.Mathias Jeppsson
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
2011-05-25update for new audio.h header locationDima Zavin
Change-Id: Ic3d8c530441a26074f6baabb7ea05182d5c03b1e Signed-off-by: Dima Zavin <dima@android.com>
2011-05-25Fix issue 4368520: crash in bluez audio at bootEric Laurent
Added missing initialization of output stream pointer in device struct and test on valid output stream in set_parameters() Change-Id: I162c410968dcbd6ed89f939c42bd48dbfe390a71
2011-05-25bluez/audio: add native android audio HAL wrapperDima Zavin
Change-Id: Ia01ea6f9caf51756d9d45a6068a8e2dc4bf7d49e Signed-off-by: Dima Zavin <dima@android.com>
2011-05-25Add missing NOTICE files.David Deephanphongs
Original commit: c3d03f1916d453eabbc5e3d58f6926dcaba2c4df update by Jaikumar Ganesh for Bluez upmerge.
2011-05-25A2dp SDP record: We only support player category.Jaikumar Ganesh
Change-Id: I6eaf6b2ad1eb99c0c163d4d1131d851ec6781cb6
2011-05-25Update SDP records for AVRCP TG role.Jaikumar Ganesh
Android only supports category 1 keys. Change-Id: I0760b7a8f49ff9e21dbd28cb3a5ce486209a30c3
2011-05-25Fix issue 2516842 Device runtime restarts while pairing and connecting A2DP HS.Eric Laurent
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
2011-05-25Use monotonically increasing clock for A2DP timing.Nick Pelly
This is to avoid skips when the system time changes.
2011-05-25Stop trying to send A2DP packets quickly to catch-up on missed write()'s afterNick Pelly
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.
2011-05-25Fix liba2dp.c compiler warnings.Nick Pelly
2011-05-25Set A2DP L2CAP socket to flushable while streaming A2DP, and set the automaticNick Pelly
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
2011-05-25Send SBC frames if output buffer is nearly full.Yu Kang Ku
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>
2011-05-25Add support for sending Broadcom coexistance setup commands for A2DP links.Nick Pelly
Enabled on platforms with BOARD_HAVE_BLUETOOTH_BCM. Change-Id: Ic223955ac3580e5a9430f96e069f686a7afdbef8
2011-05-25Bluetooth A2DP suspend-resume improvements.Eric Laurent
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().
2011-05-25Remove redundant call to bluetooth_init().Nick Pelly
This is a cleanup to Ian Kent's preceeding patchset. Change-Id: I8ff00530fdd337873ff898b7fd9009b0fc13f0b4
2011-05-25Add Bluetooth A2DP suspend/resume to DBUS API.Zhu Lan
Change-Id: Icef1729957ed55e491e63d74d14a2c0c93984c4d
2011-05-25bluez a2dp - use a sensible write timeoutIan Kent
The 500 msec write timeout is extremely optimistic, a 1000 msec timeout is closer to reality.
2011-05-25bluez a2dp - fix wait_for_start() spurious wakeupIan Kent
When waiting on a condition is is possble to receive spurious wake ups. Deal with this in wait_for_start(). Change-Id: I678e9d7831333d9b8baa31e9b0ec2597ca9263cd
2011-05-25bluez a2dp - fix wait_for_start() synchronizationIan Kent
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
2011-05-25bluez a2dp - destroy thread attr after thread createIan Kent
Pthread resources may be used by the thread attributes object. We should destroy this after thread creation.
2011-05-25bluez a2dp - destroy thread resources at exitIan Kent
The dynamically created pthread mutex and condition variables consume pthread resources. They should be destroyed prior to freeing the structure containing them.
2011-05-25bluez a2dp - fix a2dp_thread() spurious wakeupIan Kent
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
2011-05-25bluez a2dp - fix state machine synchronizationIan Kent
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!
2011-05-25bluez a2dp - syncronize worker thread startIan Kent
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().
2011-05-25Don't advertise AVRCP Controller support in SDP records.Nick Pelly
We are a AVRCP 1.0 target, not a controller. This is identical to the change we applied to Bluez 3.x
2011-05-25sbc: Enable neon optimizations.Mike Lockwood
Signed-off-by: Mike Lockwood <lockwood@android.com>
2011-05-25Add A2DP_INIT command and state.Jaikumar Ganesh
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.