hal: Add support for BT encoder configuration

Add structures for SBC, AAC, APTX encoder configurations which are
used between audio HAL and BT IPC library for proper DSP configuration.

Also enable the feature flag for split a2dp on supported targets.

Change-Id: If126c6764cfd7a2e46cb7784ad899681de581b56
This commit is contained in:
Satya Krishna Pindiproli 2017-04-26 14:24:53 +05:30
parent 9c0a178446
commit f7d6571d0a
5 changed files with 44 additions and 4 deletions

View File

@ -29,7 +29,7 @@ MM_AUDIO_ENABLED_SAFX := true
AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS := false
AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true
AUDIO_FEATURE_ENABLED_USB_TUNNEL_AUDIO := true
AUDIO_FEATURE_ENABLED_SPLIT_A2DP := false
AUDIO_FEATURE_ENABLED_SPLIT_A2DP := true
AUDIO_FEATURE_ENABLED_3D_AUDIO := false
AUDIO_FEATURE_ENABLED_VOICE_PRINT := false
USE_LEGACY_AUDIO_DAEMON := false

View File

@ -29,7 +29,7 @@ MM_AUDIO_ENABLED_SAFX := true
AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS := false
AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true
AUDIO_FEATURE_ENABLED_USB_TUNNEL_AUDIO := true
AUDIO_FEATURE_ENABLED_SPLIT_A2DP := false
AUDIO_FEATURE_ENABLED_SPLIT_A2DP := true
AUDIO_FEATURE_ENABLED_3D_AUDIO := false
AUDIO_FEATURE_ENABLED_VOICE_PRINT := false
USE_LEGACY_AUDIO_DAEMON := false

View File

@ -29,7 +29,7 @@ MM_AUDIO_ENABLED_SAFX := true
AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS := false
AUDIO_FEATURE_ENABLED_AUDIOSPHERE := true
AUDIO_FEATURE_ENABLED_USB_TUNNEL_AUDIO := true
AUDIO_FEATURE_ENABLED_SPLIT_A2DP := false
AUDIO_FEATURE_ENABLED_SPLIT_A2DP := true
AUDIO_FEATURE_ENABLED_3D_AUDIO := false
DOLBY_ENABLE := false
endif

View File

@ -172,6 +172,46 @@ struct custom_enc_cfg_aptx_t
uint32_t custom_size;
};
/* TODO: Define the following structures only for O using PLATFORM_VERSION */
/* Information about BT SBC encoder configuration
* This data is used between audio HAL module and
* BT IPC library to configure DSP encoder
*/
typedef struct {
uint32_t subband; /* 4, 8 */
uint32_t blk_len; /* 4, 8, 12, 16 */
uint16_t sampling_rate; /*44.1khz,48khz*/
uint8_t channels; /*0(Mono),1(Dual_mono),2(Stereo),3(JS)*/
uint8_t alloc; /*0(Loudness),1(SNR)*/
uint8_t min_bitpool; /* 2 */
uint8_t max_bitpool; /*53(44.1khz),51 (48khz) */
uint32_t bitrate; /* 320kbps to 512kbps */
} audio_sbc_encoder_config;
/* Information about BT APTX encoder configuration
* This data is used between audio HAL module and
* BT IPC library to configure DSP encoder
*/
typedef struct {
uint16_t sampling_rate;
uint8_t channels;
uint32_t bitrate;
} audio_aptx_encoder_config;
/* Information about BT AAC encoder configuration
* This data is used between audio HAL module and
* BT IPC library to configure DSP encoder
*/
typedef struct {
uint32_t enc_mode; /* LC, SBR, PS */
uint16_t format_flag; /* RAW, ADTS */
uint16_t channels; /* 1-Mono, 2-Stereo */
uint32_t sampling_rate;
uint32_t bitrate;
} audio_aac_encoder_config;
/*********** END of DSP configurable structures ********************/
/* API to identify DSP encoder captabilities */

View File

@ -224,7 +224,7 @@ bool audio_extn_usb_is_capture_supported();
#else
void audio_extn_a2dp_init(void *adev);
int audio_extn_a2dp_start_playback();
void audio_extn_a2dp_stop_playback();
int audio_extn_a2dp_stop_playback();
void audio_extn_a2dp_set_parameters(struct str_parms *parms);
bool audio_extn_a2dp_is_force_device_switch();
void audio_extn_a2dp_set_handoff_mode(bool is_on);