History log of /system/bt/stack/include/a2dp_api.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6173094348311f72ef17d091dd9172b776026ba4 01-Aug-2017 Satish Kodishala <skodisha@codeaurora.org> Merge "Use the correct AVDTP version-specific features" into oc-dr1-dev
am: 3568ed17b5

Change-Id: Ic3ab9e63708b984377a6d2af3e1b72303cf5de88
d45e7eacb539fe35a9189342a045b64feac2a7c1 24-Feb-2017 Satish Kodishala <skodisha@codeaurora.org> Use the correct AVDTP version-specific features

Failure:
A2DP is not reconnected after power cycling DUT BT.

Root cause:
AVDTP v1.3 feature request (AVDT_GetAllCapReq) sent by DUT
as remote supports the same, but this 1.3 feature is not
completely supported by DUT which leads to erroneous behavior.

Fix:
Use AVDT_GetAllCapReq request only when both host and remote
AVDTP version are 1.3 and above.

Test: 1.Pair to CarKit; 2.Connect to CarKit; 3.Do BT power cycle @ DUT
Bug: 35657623
Change-Id: I66c2d7d8fe8506b74282bcca93595e1cbf5c2565
(cherry picked from commit 9cd9ef4c3818d2c7949f52703b3c2ba0e0f43f2f)
/system/bt/stack/include/a2dp_api.h
9e030fde05352ec4385d7baf6cc2af89e95e039c 25-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Rename bt_bdaddr_t into RawAddress (3/3)

Test: compilation test
Change-Id: I4571721a0c6165a66450ee157a53d8d15bfc45d0
/system/bt/stack/include/a2dp_api.h
135b7f68e4404872b9c5541146702c079e987877 16-Jun-2017 Jakub Pawlowski <jpawlowski@google.com> Replace BD_ADDR with bt_bdaddr_t in SDP and A2DP related code

Test: compilation test
Change-Id: I59a69d56377d38f349def6b24aa5c7d5a3d4f859
/system/bt/stack/include/a2dp_api.h
d5f4960b425ac84cc7a9fd699f39c06869ce2666 04-Jan-2017 Pavlin Radoslavov <pavlin@google.com> Integration of the AAC codec for A2DP source

Also:
- Implemented data fragmentation inside bta_av_data_path()
that is RTP compatible.
- Do not use the codec_type when composing the RTP payload type
per RFC 3016, Section 4.2. That value doesn't have actual meaning
in the context of the Bluetooth supported codecs, and is ambiguous:
all vendor codecs map to the same value 0xFF.
- Updated support function A2DP_BitsSet() so it works for
up to 64-bit integers.
- Updated a log message inside l2c_data_write() to print
packet length and peer MTU on error.

Test: A2DP streaming to AAC headsets
Bug: 30958229
Change-Id: I1b530f1c5c495b8231fd68bed788d4567096683d
/system/bt/stack/include/a2dp_api.h
5ce0116fbf5b530d5b93f11312096eade1021c1e 05-Dec-2016 Pavlin Radoslavov <pavlin@google.com> Add a mechanism for configuring the A2DP Source codecs

* Codec config internal abstraction:
- Add new classes A2dpCodecConfig and A2dpCodecs that (will)
encapsulate all codec-related APIs
- Add unit tests for the above two classes
- Add method A2dpCodecConfig.buildCodecConfig(), and use it when
creating the codec configuration instead of A2DP_InitSource2SinkCodec().
The new method can build the codec config by taking into account
optional user codec-related configuration preferences.
- Use the A2DP codec config API from the hardware/libhardware bt_av.h API
- Replace enum tA2DP_CODEC_SEP_INDEX with btav_a2dp_codec_index_t
from the bt_av.h API
- Move codec-specific functions from stack/include/a2dp_api.h
and stack/a2dp/a2dp_api.cc to stack/include/a2dp_codec_api.h
and stack/a2dp/a2dp_codec_config.cc
- Create a new base class A2dpCodecConfig() to hold some of the
codec-related state, and implement the corresponding A2dpCodecConfigSbc
and A2dpCodecConfigSbcSink derived classes.
- Move A2DP spec-related constants from stack/include/a2dp_api.h
to stack/include/a2dp_constants.h
- Move A2DP-related error codes from stack/include/a2dp_api.h
to stack/include/a2dp_error_codes.h
- Move A2DP SBC spec-related constants from stack/include/a2dp_sbc.h to
stack/include/a2dp_sbc_constants.h

* Implement the backend mechanism for handling user (re)configuration of
A2DP Source codecs as requested via the JNI API calls.
Also, any codec changes are reported back via JNI API callbacks.
The current audio parameter selection (sample rate, bits per
sample, channel mode - mono/stereo) is as follows:
- If the user selected parameters are acceptable (based on
local codec capability and the remote Sink capability),
those parameters are used.
- Else if the Audio HAL's requested parameters are acceptable,
those are used.
- Else if the default settings are acceptable, those are used.
- Else use the best match among the local and the remote device's
capabilities.

* Update the mechanism for handling OTA configuration requests from the
remote Sink device.
- The OTA prefered codec configuration is ignored if the current
codec configuration contains explicit user configuration, or if the
codec configuration for the same codec contains explicit user
configuration.

* Refactor the Audio HAL <-> Bluetooth audio parameter negotiation
mechanism:
The new mechanism gives some flexibility to the Media Framework to
choose the appropriate audio format (sample rate, bits per sample,
and channel mode - mono/stereo), and at the same time allows
the Bluetooth stack to double-check / overwrite the choice.
- out_get_parameters() on the Audio HAL side asks the Bluetooth stack
for all currently supported formats (for the current codec),
and returns them to the Media Framework: sample rate, bits per sample,
and channel mode (mono/stereo).
- The first time adev_open_output_stream() is called on the Audio HAL,
it asks the Bluetooth stack about the audio format currently selected
by the Bluetooth stack (based on codec negotiation with the Sink device,
and User Configuration).
- The second time adev_open_output_stream() is called on the Audio HAL,
its "config" will eventually contain the audio format selected
internally by the Media Framework. That audio format is sent to the
Bluetooth stack.
If that format is acceptable to the Bluetooth stack, the Bluetooth
stack will reconfigure itself internally, and will respond back with
those values. Otherwise, it will respond back with the values that
should be used instead.

* Misc other fixes and refactoring:
- Fix the BTA handling of A2DP codec reconfiguration
- Fix a bug in the implementation of A2DP_BitsSet(), and add the
approriate unit test. Also, fix the code that was using this function
incorrectly.
- The SBC encoder is compiled as a separate library
- Replace leftover usage of "false" with "FALSE" for macros, and
vice-versa for variable values.

Test: A2DP streaming to headsets, TestPlans/71390
Bug: 30958229
Change-Id: I440b6126e2250e33b0075f9789dd93154c007c2b
/system/bt/stack/include/a2dp_api.h
4ebaa86a3ab1ea390d238e1f6dee62cd837c60ed 22-Nov-2016 Pavlin Radoslavov <pavlin@google.com> Add a mechanism for Audio Feeding Parameters negotiation

Previously, the Audio Feeding Parameters between the Media Framework
and A2DP were hard-coded: 44.1 KHz sample rate, 16-bits per sample, Stereo.
Now the Media Framework queries A2DP, and uses the returned values.

Bug: b/30958229
Test: Manual testing: A2DP streaming to headphones. TestTracker/68727
Change-Id: I70b90d2961ceb9efcd7021d2e12c240fe531ee1c
/system/bt/stack/include/a2dp_api.h
cd02ce9c60da962a7981320b26aada8744718941 05-Nov-2016 Pavlin Radoslavov <pavlin@google.com> A2DP Codec related cleanup

* Add new A2DP API and the corresponding unit tests:
- A2DP_InitSource2SinkCodec()
- A2DP_SourceCodecSepIndex()
- A2DP_GetTrackBitsPerSample()
* Use the new API to simplify the codec selection and setup
* Rename A2DP_BldSbcMplHdr() to A2DP_BuildMediaPayloadHeaderSbc()
* Remove the following APIs, because they are not needed anymore:
- A2DP_BuildSinkConfig()
- A2DP_CodecConfigMatchesCapabilities()
- A2DP_SetSourceCodec()
- A2DP_CodecRequiresReconfig()
- A2DP_IsSourceCodecSupported()
* Remove the following generic APIs, and keep only the SBC-specific APIs.
The information returned by those functions is SBC-specific, and doesn't
apply to other codecs:
- A2DP_GetNumberOfSubbands()
- A2DP_GetNumberOfBlocks()
- A2DP_GetAllocationMethodCode()
- A2DP_GetChannelModeCode()
- A2DP_GetSamplingFrequencyCode()
- A2DP_GetMinBitpool()
- A2DP_GetMaxBitpool()
* Rename:
A2DP_GetTrackFrequency() -> A2DP_GetTrackSampleRate()
tA2DP_FEEDING_PARAMS.sampling_freq -> sample_rate
tA2DP_FEEDING_PARAMS.num_channel -> channel_count
tA2DP_FEEDING_PARAMS.bit_per_sample -> bits_per_sample
* Remove btif_a2dp_source_encoder_update(), tA2DP_ENCODER_UPDATE_PARAMS
and associated events and processing mechanism, because they are not
needed anymore.
* Remove tA2DP_ENCODER_INTERFACE.encoder_update, because it is not
used anymore.
Now it is superceded by tA2DP_ENCODER_INTERFACE.encoder_init.
* Fix a bug inside bta_av_api_register() when initializing
the stream control block.
* Refactor bta_av_co_audio_getconfig() and bta_av_co_audio_setconfig()
* Remove tBTA_AV_CO_CB.codec_config_setconfig field, because it is not
needed anymore.
* Remove unused arguments when opening/closing audio stream
* Remove #ifdef BTA_AV_DEBUG guards: BTA_AV_DEBUG is always TRUE
* Remove SBC Mono -> Stereo hack

Test: Manual testing: A2DP streaming to headphones. TestTracker/68727
Change-Id: Ie0b209f7ad6c21c2c6d8d2e6277b86dfa63388c6
/system/bt/stack/include/a2dp_api.h
ee96a3c60fca590d38025925c072d264e06493c4 23-Nov-2016 Myles Watson <mylesgw@google.com> Fix asterisks in block quotes

Remove double asterisks from block quotes.

git grep -lP '^[*][*]' | xargs sed 's/^[*][*]/ \*/' -i

Fix asterisk line lengths

git grep -l '^[ /][*]\{79,\}[*/]' | \
xargs sed -i s,"^\([ /]\)[*]\([*]\{78\}\)[*]*\([*/]\)","\1\2\3",

Test: mma -j32
Change-Id: Ie3fd375ac2f804cb0f53bf1314a005e85973b3d7
/system/bt/stack/include/a2dp_api.h
feee26c3dae12b53773b31f57cf2533a3d993979 25-Oct-2016 Pavlin Radoslavov <pavlin@google.com> A2DP codec related fixes and cleanup

* Update bta_av_co_audio_getconfig() to select the preferred codec
* Fix a bug in selecting the A2DP codec inside
bta_av_co_audio_set_codec()
* No need for function A2DP_ParsSbcMplHdr() to be exposed in the API
* Generalize the following APIs, so they can be used to redirect
the call for vendor-specific codecs:
- A2DP_CodecSepIndexStr()
- A2DP_InitCodecConfig()
- A2DP_SetSourceCodec()
* Change tA2DP_ENCODER_INIT_PARAMS.SamplingFreq from uint16_t to
uint32_t so it can store larger sampling frequency.
* Rename content protection constants from BTA_AV_CP_*
to AVDT_CP_* and move them from bta_av_co.h to avdt_api.h
* Rename some of the internal functions in a2dp_sbc.cc
* Add extra debug logging and fix some comments

Test: A2DP streaming, unit tests passing
Change-Id: I1b67ff18dc568dd859429fcd89c644799fb1438d
/system/bt/stack/include/a2dp_api.h
82fcd30ee39420e8702e3d2499d638d9a946beab 24-Oct-2016 Pavlin Radoslavov <pavlin@google.com> Update the A2DP codec setup and selection mechanism

* Update bta_av_co_audio_set_codec() so it can select among
multiple available A2DP source codecs.
* Rename A2DP_SetCodec() to A2DP_SetSourceCodec() and update
it to use tA2DP_CODEC_SEP_INDEX as an argument to specify
the particular codec (instead of using SBC as default).

Also:
* Move the definition of AVDT_CODEC_SIZE from bt_target.h
to avdt_api.h and increased its value from 10 to 20
* Add missing bta_av_co_audio_sink_has_scmst() check inside
bta_av_co_find_peer_sink_supports_codec()
* Rename (inside bta_av_co.cc): cfg -> config

Bug: 30958229
Test: unit tests and A2DP streaming
Change-Id: I49fcf5063c3b6c4060abdfb60c2db171fa1ff747
/system/bt/stack/include/a2dp_api.h
b7bb9f066cb2c5268c9f8a24ed0988c0e03b49c8 19-Oct-2016 Pavlin Radoslavov <pavlin@google.com> Abstract the adjustment of A2DP codec parameters

Replaced hard-coded SBC-specific hack for updating some
of its parameters with an API abstraction: A2DP_AdjustCodec()
Also, added the corresponding unit tests.

Bug: 30958229
Test: manual A2DP testing, added new unit tests
Change-Id: I51a0a019d107362f9c24829408d426a5403b0a8e
/system/bt/stack/include/a2dp_api.h
397e5a5d6a6e14779af8431734ff605ccc49b2a7 15-Oct-2016 Pavlin Radoslavov <pavlin@google.com> Format A2DP-related code with clang-format

clang-format -style=file -i stack/a2dp/a2dp_* stack/include/a2dp_* \
btif/include/btif_a2dp* btif/src/btif_a2dp*

Test: top-level compilation and running A2DP
Change-Id: I66f0a047192b783ac0147def480754daf617dd8d
/system/bt/stack/include/a2dp_api.h
f66f4e95f2b4bc8d36033f2d65b387e32601fcd8 15-Oct-2016 Pavlin Radoslavov <pavlin@google.com> A2DP-related renaming: a2d_* to a2dp_*

Test: top-level compilation and running A2DP

Change-Id: Ibbd3176b86667885666bfe29025ec2c120fafce6
/system/bt/stack/include/a2dp_api.h