Understanding audio codec

Hello,
I am trying to configure and understand the use of the audio codecs for transmission. I have a device that takes I2S data and then transmits that to a wireless speaker. I know that the speaker supports AAC, but no matter what I do, the A2DP will only connect as SBC. Is there any way to force the connection to use a specific codec? Or am I misunderstanding the function of the codec? My understanding was I could pass in I2S data and then the codec would compress that and save bandwith and latency on the stream.

Hi @cefali9154,
The SBC codec is mandatory and always enabled, regardless of any optional codecs. You can use below command to enable AAC codec.

set codec=2
OK
write
OK
reset
Sierra Wireless Copyright 2018
Melody Audio V7.3
Build: 1544637564
Ready
CHARGER_DISABLED
Thanks

@Vianney , per the Melody 7.x user guide, would it not be CODEC = 1 to enable AAC? Since bit 0 is the AAC bit? Regardless I have tried both with CODEC = 1 and CODEC = 3 so that bit would be enabled, but on 3 different bluetooth devices (with at least one that supports AAC) they all connect via SBC.

e.g Connecting to Pixel Buds 2 (which support AAC)

LINK 10 CONNECTED A2DP F80FF9F8C973 SUSPENDED SBC SRC 48000
LINK 11 CONNECTED AVRCP F80FF9F8C973 STOPPED

Now initially I thought this may be because I have AUDIO_DIGITAL set to 48kHz, but even when AUDIO_DIGITAL=0 44100 64 100300 OFF, I still get the above message where a 48kHz SBC link is opened and not the desired AAC link.

My complete config is:
AUDIO=1 1
AUDIO_ANALOG=15 15 1 OFF
AUDIO_DIGITAL=0 48000 46 100300 OFF
AUTOCONN=1
AUTO_DATA=OFF OFF
BALANCE=100 100
BATT_CONFIG=ON 170 4250 1500 150
BC_SMART_CONFIG=68E3 28F0 89F7 D93C
BEACON_DATA=0 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 04 D2 16 2E EE
BLE_CONFIG=0 OFF 80 ON
BLE_CONN_PARAMS=128 12 24 40 0 400 100 400 400 64 400 400
BT_STATE_CONFIG=1 1
BT_VOL_CONFIG=A 60 10 1
CLASS_1=OFF
CMD_TO=20
COD=240404
CODEC=1 OFF
DEEP_SLEEP=OFF
DEVICE_ID=0001 0002 0003 0004 0005 0006 0007 0008
ENABLE_BATT_IND=ON
ENABLE_LED=OFF
ENABLE_SPP_SNIFF=OFF 0 0 0 0 0
GPIO_CONFIG=OFF 0
HFP_CONFIG=OFF ON OFF OFF OFF OFF
HIGH_SPEED=OFF OFF
LOCAL_ADDR=20FABB0A5C4B 000000000000
MAX_REC=2
MM=OFF OFF 0 OFF OFF OFF OFF OFF
MUSIC_META_DATA=OFF
MUSIC_OLD_AVRCP=OFF
NAME=BC-0A5C4B
NAME_SHORT=BC0A5C4B
PIN=0000
PROFILES=0 0 0 1 1 0 0 0 0 0 0 0
REMOTE_ADDR=000000000000
SPP_UUID=00 00 11 01 00 00 10 00 80 00 00 80 5F 9B 34 FB
SSP_CAPS=3
TWS_CONFIG=OFF 1 2
UART_CONFIG=9600 OFF 0
USB_HOST=OFF
VREG_ROLE=1

yes @cefali9154, codec=1 for AAC, my typo during comment this. I can change AAC codec on my module. Need to compare 2 configurations to see where is problem

@Vianney are you able to post your CONFIG that you used?

Hi @cefali9154
That’s all our config

  • Set codec= AAC

set codec=1 on
OK
write
OK
reset
Sierra Wireless Copyright 2018
Melody Audio V7.3
Build: 1544637564
Ready

  • Connect to a smartphone

open 482CA00A55AD a2dp
PENDING
PAIR_PENDING
PAIR_OK 482CA00A55AD
OPEN_OK 10 A2DP 482CA00A55AD
ROLE_OK 482CA00A55AD M
OPEN_OK 11 AVRCP 482CA00A55AD
AVRCP_PAUSE 11

status
STATE CONNECTED[1] CONNECTABLE[OFF] DISCOVERABLE[OFF] BLE[OFF]
LINK 10 CONNECTED A2DP 482CA00A55AD SUSPENDED AAC SNK 48000
LINK 11 CONNECTED AVRCP 482CA00A55AD PAUSED
OK

config
AUDIO=0 0
AUDIO_ANALOG=15 15 1 OFF
AUDIO_DIGITAL=0 44100 64 100A00 OFF
AUTOCONN=0
AUTO_DATA=OFF OFF
BALANCE=100 100
BATT_CONFIG=OFF 145 4250 1500 150
BC_SMART_CONFIG=68E3 28F0 89F7 D93C
BEACON_DATA=0 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 04 D2 16 2E EE
BLE_CONFIG=0 OFF 80 ON
BLE_CONN_PARAMS=128 12 24 40 0 400 100 400 400 64 400 400
BT_STATE_CONFIG=0 0
BT_VOL_CONFIG=A 60 10 1
CLASS_1=OFF
CMD_TO=20
COD=240404
CODEC=1 ON
DEEP_SLEEP=OFF
DEVICE_ID=0001 0002 0003 0004 0005 0006 0007 0008
ENABLE_BATT_IND=ON
ENABLE_LED=ON
ENABLE_SPP_SNIFF=OFF 0 0 0 0 0
GPIO_CONFIG=ON 0
HFP_CONFIG=OFF ON OFF OFF OFF OFF
HIGH_SPEED=OFF OFF
LOCAL_ADDR=20FABB019004 000000000000
MAX_REC=2
MM=OFF OFF 0 OFF OFF OFF OFF OFF
MUSIC_META_DATA=OFF
MUSIC_OLD_AVRCP=OFF
NAME=BC-019004
NAME_SHORT=BC019004
PIN=0000
PROFILES=0 0 1 0 1 0 0 0 0 0 0 0
REMOTE_ADDR=000000000000
SPP_UUID=00 00 11 01 00 00 10 00 80 00 00 80 5F 9B 34 FB
SSP_CAPS=3
TWS_CONFIG=OFF 1 2
UART_CONFIG=9600 OFF 0
USB_HOST=OFF
VREG_ROLE=1
OK

@Vianney thanks for posting that. I went through everything and didnt have any luck with the BC127 acting as a source. I was able to reproduce your results when I configured the BC127 as a sink though. So clearly the capability is there, but why would it not work as a source? Do you have something you can test with? e.g. a Bluetooth speaker or something?

Hi @er1c,
Which BC 127 type you are using? BC127/BC127 HD/BC127 EXT ? I am using BC 127 and got the same your behavior. I also downgraded to Melody 7.2 and it is the same. It looks like that is a legacy behavior and AAC codec only is supported for HD firmware which is compatible with BC127 HD/EXT hardware. Please contact the seller or contributor for more support
Thanks

@Vianney I am using just a normal BC127. I had this issue with firmware 6.1.5 as well so it appears this issue has been around for a while.