History log of /system/bt/embdrv/sbc/encoder/srce/sbc_encoder.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/embdrv/sbc/encoder/srce/sbc_encoder.c
911d1ae03efec2d54c3b1b605589d790d1745488 29-Nov-2016 Myles Watson <mylesgw@google.com> Apply clang-format to the rest of the tree

find * | grep "\.[ch]" | xargs clang-format --style=file -i

Test: mma -j32
Change-Id: I6fcc9862bb7bc07c2a367ca58fef2b3cd27a6f05
/system/bt/embdrv/sbc/encoder/srce/sbc_encoder.c
26f21028e2c8538d166a9005dd6d30831059ea05 25-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Simplify SBC encoder API

Currently it is unclear what the input, output, and configuration of
the SBC codec are. This patch refactors the use of the SBC_Encoder
function. Parameters for input and output are added, instead of passing
them in alongside the configuration.

Test: Tested A2DP playback
Change-Id: I755a022983f823475c14815cc0610f90a5fbc813
/system/bt/embdrv/sbc/encoder/srce/sbc_encoder.c
86828cbfe9e1d8bb7fc30fe5b65505306355a106 15-Oct-2016 Jakub Pawlowski <jpawlowski@google.com> Use proper types in SBC related code

Use int32_t and int16_t instead of SINT32 and SINT16

Test: organoleptic assessment of audio quality from Android and Linux
Change-Id: Ia4d8a5f08163a90240382fd102082f5aab9611c5
/system/bt/embdrv/sbc/encoder/srce/sbc_encoder.c
7fcea70080153d4fef470ba97574cacfe55ae012 24-Jun-2016 Andre Eisenbach <eisenbach@google.com> Remove SBC frame scrambling

Bug: 29601962
Change-Id: I30ce09f1c7550a1be9fd1c8ed70745f9aa0cdb44
(cherry picked from commit 470aee234664fd75094c16dd2c70313ee28354c1)
/system/bt/embdrv/sbc/encoder/srce/sbc_encoder.c
d19e0785e662e640191a075eda07acce61c2aeda 15-Jul-2016 Marie Janssen <jamuraa@google.com> Use standard types, consistent ifdef style everywhere

Remove the typedefs in stack/include/bt_types.h

Use standard types everywhere.
Use standard style for #if statements:
- #if (VAR_NAME == TRUE)
- #if (VAR_NAME1 == TRUE && VAR_NAME2 == TRUE)
Use __func__ instead of __FUNCTION__
Fix some debug statements to use __func__

Update script to be less disruptive to aligned assignment blocks.

Change-Id: I8f8f068e6c26ce74fd3b3707e1e31fd0b919cdd0
/system/bt/embdrv/sbc/encoder/srce/sbc_encoder.c
7b7b0578285281c762bd52255072cb34800ec7ea 20-May-2016 Chih-Hung Hsieh <chh@google.com> Fix misc-macro-parentheses warnings in embdrv/sbc.

When compiled with WITH_TIDY=1, clang-tidy warns about
missing parameters around macro parameters.

Bug: 28705665
Change-Id: I79d234b88e090137412936b80303d21f0c59b0ae
/system/bt/embdrv/sbc/encoder/srce/sbc_encoder.c
5ce1230b187e9b47aa674ba3787a222b98dfe421 03-Apr-2015 Scott James Remnant <keybuk@google.com> Add missing header for APPL_TRACE_EVENT

Change-Id: Iebe9d899dc73867549c40a569094ff9b5c340808
/system/bt/embdrv/sbc/encoder/srce/sbc_encoder.c
e8c3d75b75493911ebf0f99c83676359657178f7 04-May-2014 Sharvil Nanavati <sharvil@google.com> Logging cleanup: BTIF and APPL.

Change-Id: I5b1214642bbb4b9aecc0fd2c899a6ec2c9793286
/system/bt/embdrv/sbc/encoder/srce/sbc_encoder.c
5738f83aeb59361a0a2eda2460113f6dc9194271 13-Dec-2012 The Android Open Source Project <initial-contribution@android.com> Snapshot cdeccf6fdd8c2d494ea2867cb37a025bf8879baf

Change-Id: Ia2de32ccb97a9641462c72363b0a8c4288f4f36d
/system/bt/embdrv/sbc/encoder/srce/sbc_encoder.c