summaryrefslogtreecommitdiffstats
path: root/stack/avdt
Commit message (Collapse)AuthorAgeFilesLines
* Allocate buffers of the right size when BT_HDR is includedPavlin Radoslavov2017-09-171-1/+1
| | | | | | | | | Bug: 63146105 Test: External script Change-Id: I1f2c871e3fcf57aabdad9d07905e6dae643bd496 Merged-In: I1f2c871e3fcf57aabdad9d07905e6dae643bd496 (cherry picked from commit 8810ffba990f8f53172c445ebde8707525bb7813) CVE-2017-0781
* Split A2dp implementationAyan Ghosh2015-12-011-0/+16
| | | | | | | | | | Implement Split A2dp to process AVDTP Signalling commands from host and media packet handling from Controller. Host uses vendor specific commands to let controller know the media channel configurations for controller to form the media packets accordingly. Change-Id: I7a98177a8125fd70b057bb514f0d870971a45bcf
* Fix for issues reported by Static analysis tool.Sudharma Damgatla2015-10-061-2/+8
| | | | | | Fixed issues in reported by static analysis tool. Change-Id: Ia08641ee774b3da07445ef17269862f38d83606d
* AV: Logging changes to properly set loglevelMallikarjuna GB2015-10-061-0/+22
| | | | | | | | | - Control block and log level initialization in BTA, AVDT and AVCT in proper place. - Init functions for AVCT and AVDT and call from stack init path. Change-Id: I6056d5e9132330b4116a6d4410c2259ccc181109
* Bluetooth: LE-L2CAP-COC on M.Balraj Selvaraj2015-10-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | LE L2CAP Connection Oriented Channel implementation for credit based flow control on LE L2CAP. - This feature is enabled only when BLE feature is enabled. - Handled signalling commands on channel id 5 to establish the connection of LE COC. - Implemented the SM for LE L2CAP channel to handle events from App layer and hci layer. - Introduced security levels for LE L2CAP channels. - Introduced tranport variable for major functions where BREDR and LE shares common data structures. - Implemented segmentation and reassembly of LE L2CAP SDU. - Introduced congestion mechanism for LE L2CAP channel - As the new LE L2CAP callbacks not required for existing BREDR services, made it as null for newly introduced LE L2CAP callbacks. - New APIs introduced for LE L2CAP connection establishment. - New APIs provided for LE L2CAP security procedure. - Relevent L2cap APIs from Test app interface exposed to the test tool. - New macros, definitions, structures introduced for LE L2CAP channel establishment/data tranfer. CRs-Fixed: 776657 Change-Id: I50a24374659f9802cbc92421db139f75f2790f2e
* - change control blocks for each device independently for each HS. - ↵Nitin Srivastava2015-10-063-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | change rc structures for multiple avrcp connections. - change scb structures for extending support for 2 a2dp. - add device address for all callbacks. Change-Id: Id99b8174479f8da9ec80afa8531755d160b32034 Bluetooth: Enable A2dp Multicast. This feature enables the multi streaming support on BT HOST. Change-Id: Ic3748c32b30036abd352c9322e30a704b2103fa7 Bluetooth: A2dp MultiCast/ Soft Hands-off. - Trigger suspend, when new ACL is up during active multicast - Initiate suspend on both links when it is initiated by either connected HS - Clear remote suspend flag when play is initiated by either connected HS - Allocate first free SCB when remote has initiated AVRCP connection and we are trying to connect to other HS - Update Encoder when HS2 is connected during active streaming on HS1 Change-Id: I7ccfb81637688c23c6a2b005f849ac76cc0dbd2a Bluetooth: Initialize RC handle with proper value. - Initialize rc_handle with 0xFF - On disconnect re-set rc_handle to invalid value. Change-Id: Id507114451701e998f9960aa5dc961ff16f2d1bf Bluetooth: Do not register for Volume change. - When absolute volume is not supported by any of connected HS do not register for volume change notification on connected HS. Change-Id: I3b29ac5929989bc7c45b1b0f8cbe75b3082e66d3 Bluetooth: Use SCB handle for Sniff. - Use scb handle for making entry for sniff instead of audio count.With Multi A2dp audio count denotes number of A2dp devices connected.Due to this stale entries were created for AV power entries, due to which links did not go to sniff after max entries in table is reached. Change-Id: I051017991c7d3d7d42c4822efdad2b2aa1b0e2b2 Bluetooth: Use free SCB for Incoming connections. - In connection race conditions, check for first free SCB to allocate for incoming connection. - Initiate disconnect for incoming connection when no free SCB is available. - Check for max. possible connections before initiating suspend for new link up-event. - Clear all flag on AVRCP disconnect. Change-Id: Ic605b0470ca88aac856cefe54bf6c9ec5320bd5a A2DP Multicast: Allow outgoing connections for scatternet - As there is fallback to soft handoff incase of scatternet scenarios, allow the outgoing connections in case of role switch failure for existing slave connection. - Reject the incoming connection from BTA while processing another incoming connection. Change-Id: Ib8a087eea5e9845a6e2ef758757f941c1bdf7b52 A2DP Multicast: Disable multicast if BR HS is connected - Disable multicast if BR headset is connected - Use scb index for AV Busy and Idle state updates Change-Id: If7310be4f47cbe0775eb35c0b81122d524be25f5 Dual A2DP: Avoid blocking Play key event - Send play key event for PLAY sent from non playing device to be compliant with default behavior for single connection. Change-Id: Ie07fc10d3a946ca4e3f9643b2ae5e556358fd0b8 A2DP Multicast: Update multicast state after AV state update - multicast state update checks the AV state for updating multicast condition. Need to make sure that AV state is updated in OPEN state before calling the API. Change-Id: Ifa0fd1a90ff5d8a05c37dba1590f76176d9899e0 Dual A2DP: Disconnect AVRCP only connection. - AVRCP only connection should be disconnected to avoid confusion to end user in the Dual A2DP/Multicast scenarios. - Proper check for RC connections before closing uinput. Change-Id: Id515c3f29499a3ada02b8e45cc2189276152a461 Conflicts: btif/src/btif_av.c Dual A2DP: Allocate free SCB for incoming connection - SCB allocated to incoming connection should be idle. If not, ongoing connection handling will be affected. Change-Id: Ideaab85b928f08b37c7a284644fd3a62926b15ec Dual A2DP: Initiate outgoing connection only if the state is Idle - A2DP connection also could be triggered from remote device before the AVRCP timer expires. Check the state before initiating connection for the device. Change-Id: Id538de6ce829a388a4c052769177319cd5c217fc Dual A2DP: Don't suspend if stream is started for other device - Avoid sending suspend for remote initiated START if stream is started for other device. IOT issues are seen with specific devices if gap between SUSPEND and START is less. Change-Id: I64d768aa8246101687bbc98b4ae0be97645bb5b1 A2DP Multicast: Update multicast state during role change - Role change can be triggered at any point of time during the connection. Update the multicast state upon getting role change event. Change-Id: I60a17e955b6fdc4379d571c59d8527ec023e9531 Revert "Bluetooth: Do not register for Volume change." This reverts commit c87e747f40b870b9a540902595524b34a5436b43. Change-Id: I4752486979366f67e9109bd61df54dc48786f564 Dual A2DP: Set the flush only when there is no play in progress - When connected to two devices update the flush state only if there is no play on any connected device. Change-Id: Ic13b7285625c49350334c35eed878407b6e78821 Dual A2DP: Handle connection inconstencies during stress scenarios - Avoid removal of connect nodes in profile connect queue - Dual Handoff flag cleanup during START failure - Reject the A2DP connection from remote device if it is initiated on the same endpoint where outgoing connection is being attempted. CRs-Fixed: 835641 Change-Id: I4cc0d680e5cabb003dd11c8ba232d1fc70f41780 Dual A2DP: Mark the AVDTP busy during outgoing connection - AVDTP incoming connection cannot be handled when there is outgoing connection in progress as per the base design. Reject the incoming AVDT connection so that other connection can happen and A2DP connection is always attempted from connectOtherProfile path. CRs-Fixed: 839392 Change-Id: Iff801a7e4f170aa85cd06278c7d62dfc81464b5a Dual A2DP: Acknowledge the SUSPEND after both streams stop - Avoid on_suspended call when other stream is not yet suspended as it unblocks the audio process to send further commands. - Handle RC close to cleanup the BTIF RC block even if the current AV connections are for different devices. This was seen because of not getting AVCT disconnection response and later this event is received after getting ACL disconnection complete. CRs-Fixed: 842690 Change-Id: I7eb95a9ddfc7be06af4521af1567e4e166630317 Dual A2DP: Disconnect the AVRCP only connection AVRCP only connection has to be disconnected when it is evaluated for A2DP connection and no free AV blocks are available in BTIF. Change-Id: I3f6b731ed6701c739defbfd8e011bbb6a1aeb3ba Conflicts: btif/src/btif_rc.c A2DP Multicast: Check for both streams for stream ready - Stream ready should succeed only after both streams are suspended during multicast, otherwise audio data coming will trigger inconsistent behavior for stream starting. Change-Id: Ia8794dbed7dbe5f55cf7139b200fcdf2eb5ee45f A2DP Multicast: Handle suspend for both streams In race conditions, it is seen that ACL is established while stream is being started for both devices for multicast. Since the multicast state is updated after stream start when suspend is initiated we need to check if both streams are started and suspend them accordingly. Change-Id: I23f64174914350b476022f7bfbfb553a55d12902 Dual A2DP: Clear the RC priority information while disconnect RC priority information has to be cleared during disconnection to avoid improper usage during start even after initiating disconnection. Change-Id: Ia52c04ea2bfecbf390aae12400073adb0f327718 Dual A2DP: Interface to query active device for handoff During Handoff case, check the playing device and device to start playback to provide state for given device. CRs-Fixed: 856063 Change-Id: I3a326d9f0c6221cfc4cdcc3fad037f22a29ff90e Dual A2DP: Connection failure handling for proper cleanup - Cleanup BTA AV block for the outgoing connection if it fails because of no resources - Reject the incoming connection if there is outgoing connection in progress Change-Id: I44d3dd6bbff93d38c1c22260056897e42d915ffa Conflicts: btif/src/btif_av.c Intimate app on AVRCP connection state change. - Intimate app on AVRCP connection state change. - Synchronize Connection state update and RC feature update, to make sure RC features update is sent after connection state update. Conflicts: btif/src/btif_av.c CRs-Fixed: 843335 Change-Id: I6e6298f42ddbddb5f29169cb4c15a3a1b3078bf7
* BT: Audio: Enhance default stack logging for AUDIOrakesh reddy2015-10-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make default logging for upstream events, statemachine state transitions, sco state transitions, call state transitions etc. Change-Id: Ia0dcb22e2efb99f186166ae4af2a8cb73f87616d Bluetooth: A2DP Sink Logging. - logs for state transition. - Latency logs with sequence Number. Change-Id: Iedabccd97d1118406f43b7ba494bdec5935b60b9 Print delay logs during A2dp streaming - Log systrace during A2dp streaming. This logging is not enabled by default.BT_AUDIO_SYSTRACE_LOG needs to be defined in applicable files to turn this logging on. - Properly name threads. - Log A2dp write delays. - Log pcm dump before writing to media socket to mediatask. This logging is not enabled by default. BT_AUDIO_SAMPLE_LOG needs to be dfined to enable this logging Change-Id: If081480b29f02126a1d48b9d0d9f855a3a605cc5 Enable required AVRCP Logging by default Enable required AVRCP Logging by default. Introduce additional logging whereever required. Change-Id: Ie2e88de06254257af3b77b4f8b06401273f29262 CRs-Fixed: 751733
* Proper Initialization of A2DP ProfilesAnubhav Gupta2015-10-064-18/+1
| | | | | | | | | | | | | | | | - Register SDP and SEP (Stream End Point) for the profile whose init is called. We achieve this by making registration api aware of profile id being called. - Register A2DP Src + Avrcp Target + Avrcp Controller. We need to support Absolute Volume as well, so Avrcp Controller is required here. - Register A2DP Sink + Avrcp Controller. In this case we do not support absolute volume - Adapter property is updated with profile ID for which init is called.This is required to make changes in btService for Profile initialization Change-Id: I3f12cda737b77e14cd67f99c96df8fcbf8529bb9
* Proper construction of AVDTP general reject message.AnubhavGupta2015-10-061-3/+2
| | | | | | | | | | | | This reverts commit 2ed10d442266eade44be121cd24fd473c85007d0. Original change needs to be reverted to align with Errata ESR04 where "Section 8.17, General Reject Page 71" of adopted AvDTP Spec is changed to have "Invalid Signal Identifier" in first 6 bits of Octet 1. This change helps passing PTS case TP/SIG/SMG/ESR04/BI-28-C Change-Id: I990fd96ae81cb594fce9f13620bc7223b1b7459b
* Proper construction of AVDTP general reject messageAnubhav Gupta2015-06-231-5/+3
| | | | | | | | Build AVDTP general reject message as per AVDTP Specification. Resolves issue with PTS AVDTP case TP/SIG/SMG/BI-28. Bug: 21896912 Change-Id: I10e729f099898096f666081f5e5cd8e4a9dc3ae7
* Property based change to qualify TC_INT_SRC_SIG_SMG_BV_23_CAnubhav Gupta2015-06-191-0/+13
| | | | | | | | | | | | As Bluedroid AVDTP solution does not use ABORT command in any of the usecases hence this property based change is made to pass AVDTP ABORT mandatory TC using PTS. Affected PTS TC: TC_INT_SRC_SIG_SMG_BV_23_C. System Property to enable sending ABORT to pass the TC is: bluetooth.pts.force_a2dp_abort Bug: 21896912 Change-Id: I71bd11de07b9d8fb15a933712db25f0a93e10dd5
* Reject AVDTP START and SUSPEND request in invalid stateAnubhav Gupta2015-06-161-9/+8
| | | | | | | | | Reject remote initiated AVDTP START and SUSPEND request in invalid state. This helps passing the below PTS cases. TC_ACP_SRC_SIG_SMG_BI_20 TC_ACP_SRC_SIG_SMG_BI_26 Change-Id: I177456389246df89e7d7560555ffffde0639e618
* Fix issues in A2dp, Avrcp, HF and AG reported by static analysis toolMallikarjuna GB2015-06-041-2/+2
| | | | | | | - Fixes to validate Array Index Value and Null Pointer Dereference reported by static analysis tool. Change-Id: Id1492315f68378fdcfa517bd0a5cacefc8ebfddb
* Static code analysis cleanups and minor bug fixesVenkatRaghavan VijayaRaghavan2015-04-061-2/+8
| | | | | | | | | | | - Fix for initializing all the un-initialized variables - Handling system call failure like socket,fcntl etc... - In btpan_tap_close validate tap_if_down and close the socket. - Invalid memset size, which could have potential memory issue - Change -1 to INVALID_FD where appropriate Bug: 19417758 Change-Id: Id31832f8678b2d72c80740c29b946a94e7ae0197
* Resolved trace level issue for AVDTPVenkatRaghavan VijayaRaghavan2015-03-161-5/+0
| | | | | | | | | Root Cause: Trace messages are getting logged When setting TRC_AVDT=5 the trace level doesn't take effect. Due to multiple initialization points the bt_stack.conf value was overwritten Bug: 19417758
* Eliminate unusable wcassert code in favor of plain old C asssert.Sharvil Nanavati2015-03-161-3/+4
| | | | | | | | The WC_* macros only expand to something meaningful when _DEBUG is also defined. However, on enabling _DEBUG, bluedroid fails to build because the wc_assert function is not defined anywhere. We can get what I imagine is the equivalent behavior by switching over to the standard C assert macro.
* Remove data_types.hChris Manton2015-03-168-8/+8
|
* A2DP sink: reply with success on Start command.Sharvil Nanavati2015-03-161-23/+17
| | | | | | | | | | | | | | We've observed a Nexus 5 sending back-to-back START requests. If we accept the first request and move to the STREAMING state, we'll reject subsequent requests. The phone, however, ignores the first response (since it has already issued another START) and will not route audio to Glass. This is a speculative fix. If we're in the STREAMING state and we get an incoming START request, accept the request instead of rejecting it to work around a buggy implementation on the peer. Bug: 18165461
* avdt: Make sure LCID field is filled out even on incoming connections.Sharvil Nanavati2015-03-161-0/+2
|
* Make build more strict by adding more warning flags.Sharvil Nanavati2015-03-162-4/+12
| | | | | | This change introduces -Wunused-but-set-variable to help catch programming errors. It also undefines NDEBUG so assertions are fatal and defines LOG_NDEBUG=1 to suppress LOGV.
* Removing unnecessary BTAPI #defines.June R. Tate-Gans2015-03-162-6/+5
|
* Remove BTTRC_INCLUDEDZach Johnson2015-03-164-69/+0
| | | | | | | It used functions that didn't exist, so there's no way it would compile if it was defined to true. Also removes some defines that would nop without it.
* Enforce GKI API buffer usageChris Manton2015-03-161-1/+1
| | | | Also add another API GKI_queue_length(BUFFER_Q *)
* am 98ad505f: Increment seq before adding to packet in ↵Matthew Xie2014-10-151-3/+1
|\ | | | | | | | | | | | | avdt_scb_hdl_write_req_no_frag * commit '98ad505f577599870cf0ae281a5d035e2e2453f9': Increment seq before adding to packet in avdt_scb_hdl_write_req_no_frag
| * Increment seq before adding to packet in avdt_scb_hdl_write_req_no_fragMatthew Xie2014-10-151-3/+1
| | | | | | | | | | | | | | | | | | | | Bluetooth Certification Test case TP/TRA/BTR/BV-01-C for Basic Transport Service Support fails. The failure is because the PTS is expecting the first RTP Media Frame to have a sequence number of 1. But metallica sends it as 0. bug 17893538 Change-Id: Idfe7ae382c3764616dab4733cdf83b1627b8b3c9
* | Logging cleanup: A2D, AVDT, and AVCT.Sharvil Nanavati2014-06-198-101/+101
| | | | | | | | Change-Id: I5a9d4bcdd65f6e965b434bf86949bba7155fd300
* | Add A2DP Sink SupportHemant Gupta2014-06-105-3/+83
| | | | | | | | Change-Id: I9affefdd2d00597545e49c593ef3bddb110d4c9c
* | Merge BT 4.1 featuresGanesh Ganapathi Batta2014-04-301-3/+5
|/ | | | | | | | | | | | | | | | The features include: - LE Peripheral Mode - Link Layer topology (LE Central & Peripheral Concurrency) - Dual Mode Topology (Ability to choose LE transport when connecting with other Dual Mode devices) - Fast advertising Interval - Limited Discovery Time Changes - GAP Authentication and Lost Bond - Dual Mode Addressing - Common Profile and Service Error Code - 32 bit UUIDs Change-Id: Ic6701da4cf6aaa390ff2c8816b43157f36b7fb42
* Major warnings cleanupMike J. Chen2014-02-117-0/+75
| | | | | | | | | | | | Mostly fixing unused parameter warnings. A few other warnings also fixed like possible use of unitialized variables (no real issue found, just compiler couldn't follow the path), signed vs unsigned warning. Also fixed some typos, indent issues, removal of dead code, etc. Change-Id: I95eb887aefc4d559d7921f71a0af5f3bfb01ac01 Signed-off-by: Mike J. Chen <mjchen@google.com>
* Fix warning "suggest braces around empty body in an 'if' statement"Mike J. Chen2014-01-312-5/+6
| | | | | | | | The body of an if statement could become empty if the macro body is NULL and cause the if to apply to the next line instead. Change-Id: I0bea6a46f29bc2c4dfc6e1fa13dd35b094310294 Signed-off-by: Mike J. Chen <mjchen@google.com>
* fixed problem with parsing GetAllCapabilitiesRspKim Schulz2013-12-161-2/+6
| | | | | | | | The check for GetAllCapabilitiesRsp was not correctly parsed and hence the qualification tests TP/SIG/SMG/BI-35-C and TP/SIG/SMG/BI-36-C could not be passed. This fixes that problem and makes it comply with the spec. Bug: 10906942 Change-Id: I8b46c1974b4cad13d5a6641e02bf8a5f2ebc8ebd
* Media profile drop on ending the outgoing video call and music is heard locallyZhihai Xu2013-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | receive AVDTP_Suspend response rejection which cause the A2DP disocnnected. There is collision of AVDTP_Suspend request: We send AVDTP_Suspend request and the headset send AVDTP_Suspend request also at the same time. then We send AVDTP_Suspend response, but the headset send AVDTP_Suspend response rejection with error code bad state after it receive the AVDTP_Suspend response from us. we call bta_av_suspend_cfm twice in this case: the first time we will call bta_av_suspend_cfm without error after receive AVDTP_Suspend request from headset. the second time we will call bta_av_suspend_cfm with error bad state after receive AVDTP_Suspend response rejection from headset. To fix this problem, we should ignore the AVDTP_Suspend response rejection from headset after receive AVDTP_Suspend request from headset. After we receive AVDTP_Suspend request from headset, the scb state will be changed to AVDT_SCB_OPEN_ST from AVDT_SCB_STREAM_ST. but when we receive AVDTP_Suspend response rejection from headset, we should ignore it when we are in AVDT_SCB_OPEN_ST. and also currently we already ignore AVDTP_Suspend response when we are in AVDT_SCB_OPEN_ST, I don't know why we didn't do it for AVDTP Suspend rejection. issue 8735903 Change-Id: I8db3ea6e7e4edfea41f255e7e29b8c7255cf3d96
* Initial version of BLE support for BluedroidGanesh Ganapathi Batta2013-02-274-18/+64
| | | | Change-Id: I9825a5cef9be2559c34c2a529b211b7d471147cf
* Snapshot cdeccf6fdd8c2d494ea2867cb37a025bf8879bafThe Android Open Source Project2012-12-1210-0/+9866
Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d