BTHOST_IPC: Pass Aptx mode info to MM-Audio
-> These changes are for passing Aptx Mode info
to MM-Audio as received from BTHOST during
stream start.
-> Handle TWS-Mono channel mode
CRs-Fixed: 2310018
Change-Id: Icca7ff58cc001c081a2cd0fd59049d33186ff47e
diff --git a/bthost_ipc/bthost_ipc.c b/bthost_ipc/bthost_ipc.c
index 623501a..8cc34a6 100644
--- a/bthost_ipc/bthost_ipc.c
+++ b/bthost_ipc/bthost_ipc.c
@@ -458,9 +458,9 @@
case A2DP_APTX_ADAPTIVE_CHANNELS_MONO:
aptx_adaptive_codec.channel_mode = 1;
break;
- /*case A2DP_APTX_ADAPTIVE_CHANNELS_STEREO:
+ case A2DP_APTX_ADAPTIVE_CHANNELS_TWS_MONO:
aptx_adaptive_codec.channel_mode = 2;
- break;*/
+ break;
case A2DP_APTX_ADAPTIVE_CHANNELS_JOINT_STEREO:
aptx_adaptive_codec.channel_mode = 0;
break;
@@ -468,7 +468,7 @@
aptx_adaptive_codec.channel_mode = 4;
break;
default:
- ALOGE("Unknown sampling rate");
+ ALOGE("Unknown channel id");
}
len--;
@@ -506,9 +506,12 @@
aptx_adaptive_codec.mtu = *(uint16_t *)p_cfg;
p_cfg += 6;
aptx_adaptive_codec.bits_per_sample = *(uint32_t *)p_cfg;
+ p_cfg += 4;
+ aptx_adaptive_codec.aptx_mode= *(uint16_t *)p_cfg;
ALOGW("%s: ## aptXAdaptive ## MTU = %d", __func__, aptx_adaptive_codec.mtu);
ALOGW("%s: ## aptXAdaptive ## Bits Per Sample = %d", __func__, aptx_adaptive_codec.bits_per_sample);
+ ALOGW("%s: ## aptXAdaptive ## Mode = %d", __func__, aptx_adaptive_codec.aptx_mode);
return ((void *)&aptx_adaptive_codec);
}
diff --git a/bthost_ipc/bthost_ipc.h b/bthost_ipc/bthost_ipc.h
index 81dcef8..225995d 100644
--- a/bthost_ipc/bthost_ipc.h
+++ b/bthost_ipc/bthost_ipc.h
@@ -99,7 +99,7 @@
A2DP_CTRL_GET_CONNECTION_STATUS,
} tA2DP_CTRL_EXT_CMD;
-#define MAX_CODEC_CFG_SIZE 32
+#define MAX_CODEC_CFG_SIZE 34
struct a2dp_config {
uint32_t rate;
uint32_t channel_flags;
@@ -201,7 +201,7 @@
/* APTX Adaptive bitmask helper */
#define A2D_APTX_ADAPTIVE_SAMP_FREQ_MASK (0xF8)
-#define A2D_APTX_ADAPTIVE_CHAN_MASK (0x0F)
+#define A2D_APTX_ADAPTIVE_CHAN_MASK (0x1F)
#define A2DP_APTX_ADAPTIVE_SAMPLERATE_44100 (0x08)
#define A2DP_APTX_ADAPTIVE_SAMPLERATE_48000 (0x10)
#define A2DP_APTX_ADAPTIVE_SAMPLERATE_88000 (0x20)
@@ -315,6 +315,7 @@
uint8_t TTP_TWS_low;
uint8_t TTP_TWS_high;
uint32_t bits_per_sample;
+ uint16_t aptx_mode;
} audio_aptx_adaptive_encoder_config_t;
struct bit_rate_level_map_t {