Audio Agent Configuration

The user can configure general parameters for the module. These parameters are stored in the RAM memory. If required, the parameters can be stored to Flash memory. When the module reboots, it will boot with the parameters that are saved to Flash memory.

There are 4 main commands to configure parameters. The commands to modify configuration parameters are described below. Mandatory parameters are listed in “( )” optional parameters are listed in “[ ]”.

General Configuration Commands

Command

Description

CONFIG

Shows all parameters.

GET (config_name)

Reads the value of a configuration parameter.

RESTORE

Resets and restores the configuration parameters to default factory settings.

SET (config_name)=param_1 param_2 …param_n

Sets a new value to a configuration parameter.

WRITE

Write configuration changes to Flash memory. This command writes all the current configuration parameters to non-volatile memory. These are then read at boot-up time.

Note: If the module boots up with PIO_0 high, the factory default configurations are reset. This allows reverting to a known and working configuration state if severe problems are encountered.

The different configuration parameters are described in alphabetical order in the table below. Once modified, many configuration parameters will not take effect before a reboot. Therefore they need to be stored to Flash before rebooting.

Command

Description

Default

Requires reboot

AUDIO=(input)[output]

Select the audio interface. The first parameter is for the input, second for the output. If only one parameter is provided, it will be applied to both. Values can be:

  • 0 - Analog

  • 1 - Digital

  • 2 - USB

0 0

No

AUDIO_ANALOG=(input_gain)(output_gain)(micbias) (preamp)

Configuration of the audio analog interface(AUDIO=0):

  • input_gain: Codec input gain (0 – 22)

  • output_gain: Codec output gain (0 – 15)

  • micbias: Enable mic bias (2.6V)

  1. Disable the microphone bias

  2. Turn the microphone bias on only when there is audio

  3. Enable the microphone bias all the time

  • preamp: Enable microphone pre-amplifier

15 15 1 OFF

No

AUDIO_DIGITAL=(format) (rate)(param1)(param2)

Configuration of the digital audio interface(AUDIO=1):

format: digital output format

  1. I2S

  2. PCM

  3. SPDIF

Check the digital interface section in the Audio Configuration chapter for more information about the rest of the parameters.

0 44100 64 100A00

Yes

AUTOCONN=(value)

  1. Disabled

  2. Paired Device List. Audio Agent attempts to connect to previously paired devices at power on (see LIST command).

  3. Remote address. Audio Agent attempts to connect to the device with the Bluetooth address specified by the REMOTE_ADDR parameter at power on.

When autoconn is enabled and Audio Agent is establishing a connection, it automatically connects all the other profiles that have been connected before. This also applies when using the OPEN command.

Note: Audio Agent can store up to 8 paired devices in its persistent memory. When the pairing memory is full, Audio Agent erase the oldest paired device and keep the 8 most recently paired devices in memory.

0

Yes

AUTO_DATA=(ble)(spp) | Enter Data Mode immediately on BLE or SPP connection if not already
in Data mode.

OFF OFF OFF

No

BALANCE=(left_channel)(right_channel)

Adjust the left/right volume. Values between 0 to 100.

100 100

No

BATT_CONFIG=(status)(critLvl)(chrgLvl) (vthm_max)(current)

Configures the battery charger and other settings related to the battery:

  • status: ON to enable charging. Should be OFF when not using a battery.

  • critLvl: Critical battery level. Device will shut off until charged above this level (in units of 20mV).

  • chrgLvl: Charge voltage limit threshold. Charging will stop once the battery reaches this voltage (in mV).

  • vthm_max: Thermistor voltage limit threshold. Charging will stop once the thermistor reaches this voltage (in mV).

  • current: Set the current for charging the battery in mA. Values should be in range 0-200 mA. If set to zero, charging is disabled.

OFF 145 4250 1500 150

Yes

BC_SMART_CONFIG=(srv_uuid)(char_uuid) (enable_cmd)

Change the default value for Audio Agent Smart primary service UUID and Audio Agent Smart Data Characteristic UUID. The last parameter can be used to disable commands over BLE (BC_SMART_COMMANDS). It is recommended to disable if high BLE data rate is needed.

68E3 28F0 89F7 D93C ON

Yes

BEACON_DATA=(data)

Configure Beacon. Note that this parameter is used only when the BLE role is Beacon.

The first byte define the type of Beacon:

  1. iBeacon

  2. Eddystone UID

  3. Eddystone URL

The following 21 bytes defines the Beacon parameters. Refer to the BLE Beacon section for more info.

0 00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 04 D2 16 2E EE

Yes

BLE_CONFIG=(role)[auto_adv][indication][mtu] [random_addr]

role: Set the BLE role of the device

  1. Peripheral

  2. Central

  3. Beacon

auto_adv: Enable/Disable BLE constant advertisements when the device is not connected (only when BLE role is Peripheral)

mtu: Maximum transmission unit (ATT_MTU). This value is used when negotiating the MTU with the remote device. The actual MTU value can be retrieved from the STATUS command’s result. It is important to notice that the maximum packet length that can be sent is MTU-3. Value between 23 and 150.

random_addr: Generate a random address for BLE connections

0 OFF 40 ON

No

BLE_CONN_PARAMS

Sets the BLE advertising, scanning and connection parameters. Refer to BLE Connection Parameters for more info.

128 12 6 40 0 400 50 400 400 64 400 400

Yes

BT_VOL_CONFIG=(def_hfp)(def_a2dp)(a2dp_steps)

Bluetooth volume configuration:

def_hfp: Default HFP volume level in the range 0 to F

def_a2dp: Default A2DP volume level in the range 0 to a2dp_steps-1

a2dp_steps: Number of steps in hex between minimum and maximum volume (for A2DP only)

A A 10

Yes

CLASS_1=(value)

Class 1 operation. If set to ON, PIO_0 and PIO_1 functionalities are disabled and can be used to control an external power amplifier (PA).

OFF

Yes

CMD_TO=(value)

Guard time for detecting a $$$$ command to switch from data mode to command mode. There should be 20ms x CMD_TO between the last character and the $$$$. And there should be 20ms x CMD_TO after the $$$$ for the command to be recognised.

20

No

COD=(value)

Class of Device.

Some common examples of COD values are the following:

  • 240404: Wearable Headset Device

  • 200404: Audio headphones

240404

No

CODEC=(value) [enable_talkback]

The value specifies which A2DP optional codecs are enabled.

  • bit[0]. AAC

  • bit[1]. aptX

  • bit[2]. aptX Low Latency (not available on Audio Agent HD releases)

  • bit[3]. aptX HD (available on Audio Agent HD releases only)

Example: CODEC=3 (0b011) means aptX and AAC are enabled, aptX LL is disabled.

Note: SBC is always enabled. When optional codecs are enabled, the order of selection when establishing a stream is: aptX HD > aptX LL > aptX > AAC > SBC

Note: aptX is required for aptX Low Latency and aptX HD.

enable_talkback(optional): Enables or disables A2DP TalkBack feature. The TalkBack feature works only with aptX Low Latency and requires a cVc and aptX license key.

0 OFF

Yes

CONN_TO=(value)

Time Audio Agent stays connectable (in seconds) after a connection has been established in Multipoint. Values accepted: 0 – 65534. 0 – never stop being connectable;

0

No

DEEP_SLEEP=(value)

Enable and Disable Deep Sleep

OFF

No

DEVICE_ID=(word_1) … (word_8)

The Device ID sets the configuration parameters for the Device ID Profile. This profile sets the following as an SDP record so that remote devices can get extra information about the product:

  • Vendor Id source (2 bytes)

  • Vendor Id(2 bytes)

  • Product Id(2 bytes)

  • BCD version (2 bytes)

  • Software version (8 bytes)

For more information about these settings, refer to Device ID profile specification on the Bluetooth.org adopted specification page

0000 0000 0000 0000 0000 0000 0000 0000

Yes

DISCOVERABLE=(value)(timeout)

Configure when Audio Agent becomes discoverable.

Note that you can also use the DISCOVERABLE command.

value:

  1. Not discoverable after power on

  2. Always discoverable.

2. Discoverable at power on. Not discoverable after a successful connection.

Timeout: Discoverable timeout in seconds. Zero to disable. Does not apply if always discoverable.

2 0

Yes

ENABLE_BATT_IND=(value)

Enables and disables the iOS battery indication 1

ON

No

ENABLE_CAPSENSE=(value)

Enables and disables cap senses. When it is enabled, CAPSENSE notification are received when the state of a pad changes.

OFF

Yes

ENABLE_LED=(value)

Enables and disables LED support in Audio Agent

ON

No

ENABLE_SPP_SNIFF=(state)(min_interval) (max_interval)(attempt)(timeout)[duration]

Enables SPP only connections to go into sniff mode which allows Audio Agent to use low power modes. These values take effect if SPP is the only connected profile

  • state:

    OFF active

    ON
    • passive (if all parameters are 0)

    • sniff with passive (with all parameters supplied)

Parameters:

  • min_interval: the minimum interval of the sniff period

  • max_interval: the maximum interval of the sniff period

  • attempt: Determines for how many slots the slave shall listen when the slave isnot treating this as a scatternet link.

  • Timeout: Determines for how many additional slots the slave shall listen whenthe slave is not treating this as a scatternet link.

  • Duration: the time to stay in this sniff state.

OFF 0 0 0 0 0

No 2

GPIO_CONFIG=(ctrl) [pio4_cfg] [analog]

GPIO configuration.

ctrl: Enables/disables GPIO control.

pio4_cfg: Bitmask to select PIO_4 functionality (only if GPIO control disabled):

If an event is selected, PIO4 is raised when the event occurs. You can clear it with the PIO command (“PIO 4 OFF”).

  • Bit0: A2DP_STREAM_START (event)

  • Bit1: A2DP_STREAM_SUSPEND (event)

  • Bit2: AVRCP_PLAY (event)

  • Bit3: AVRCP_PAUSE or AVRCP_STOP (event)

  • Bit4: CALL_INCOMING (event)

  • Bit5: CALL_OUTGOING (event)

  • Bit6: LINK_LOSS (event)

  • Bit7: When data mode is exited (event)

  • Bit8: PIO4 high if connected, low if not connected(state)

  • Bit9: AVRCP_MEDIA (event)

  • Bit10: CALL_IDLE or CALL_ACTIVE (event)

Value expected in hexadecimal. (ex: ‘003’ to raise PIO_4 on all the A2DP events).

analog: Configures the analog input detection pin. Value can be any of the following:

  • 0 to 31: Pin 0 to 31.

  • 254: Disabled.

  • 255: Assume always connected.

The analog input detection pin is active low.

ON 0 254

Yes

HFP_CONFIG=(cvc)(wbs) (inband)(nrec)(at_cmd)

Configuration of the HFP and AGHFP profiles:

cvc: Enables or disables CVC (Clear Voice Capture).

wbs: Enables or disables Wide-Band Speech support.

inband: Enables or disables in-band ringing for incoming calls.

nrec: Sets the HFP NREC flag, which tells the AG not to use its internal Noise Reduction/Echo Canceller algorithm. We suggest you set this to ON if using CVC or an external noise reduction platform.

at_cmd: Enables or disables AT commands.

Note: Whether Wide Band Speech is used or not depends on the result of the codec negotiation between the hands free device and the audio gateway device.

OFF ON OFF OFF OFF

Yes

HIGH_SPEED=(spp)

Enable/Disable High Speed for SPP.

This feature allows faster data transfer in Data mode. When active, the DSP is used to speed up the transfer and therefore the audio is disabled.

Note that when using this mode, the escape sequence to exit Data mode is disabled. You can however use GPIO 5 to exit from Data mode (if GPIO control is disabled) or close the connection.

OFF

No

LOCAL_ADDR=(value 3 )

Contains the local Bluetooth address of the device.

-

-

MAX_REC=(value)

Maximum times to try to reconnect to a device in PDL

2

Yes

MM (enable) [(user_eq_en) (bank) (bass_boost_en) (3d_enhance_en) (compander_en) (dither_en) (speaker_eq_en)]

Configure the Music Manager audio enhancements for A2DP music streams. All configuration parameters following MUSIC_MANAGER are ON or OFF except bank which is between 0 and 6.

enable – mandatory, enable or disable MM

All subsequent parameters are optional but must be provided in order. i.e. if you want to modify (bass boost) you have to supply (user_eq_en) and (bank).

user_eq_en – enable/disable the user equaliser block

bank – set the equaliser bank to use when user equaliser is enabled. Available banks are 0 to 6:

  • 0: None (flat frequency repsponse)

  • 1: None

  • 2: Bass boost

  • 3: Treble boost

  • 4: Rock

  • 5: Jazz

  • 6: None

bass_boost_en – enable/disable the bass boost block

3d_enhance_en – enable/disable the 3D enhancement block

compander_en – enable/disable the compander block

dither_en – enable/disable the post processing/dither block

speaker_eq_en – enable/disable the speaker equaliser block

Please note that these configurations only enable/disable music manager blocks. Those need to be configured use UFE, as specified by CSR.

OFF OFF 0 OFF OFF OFF OFF OFF

No

MUSIC_META_DATA=(value)

Enables and disables AVRCP Meta Data

OFF

No

MUSIC_OLD_AVRCP=(value)

Switch AVRCP version to 1.0. This will disable Meta Data and Absolute volume support.

OFF

Yes

NAME=(value)

Name of the device (32 characters max). The last 5 symbols (“XXXXX”) are the last 6 symbols of the Bluetooth address.

IOT-XXXXXX

Yes

NAME_SHORT=(value)

Short name (7 characters max) used for Audio Agent Smart Advertisements. The last 5 symbols (“XXXXX”) are the last 5 symbols of the Bluetooth address.

IOTXXXXX

Yes

PROFILES=(hfp)(aghfp)(a2dp_snk)(a2dp_src) (avrcp)(ble)(spp)(pbap)(hid_device)(hid_host) (map)

Configuration of the Bluetooth profiles. The value for each profile indicates the maximum number of connections (up to 3).

Notes:

  • It is not possible to have A2DP Sink and A2DP Source at the same time. It means that one of the values must be 0.

  • BLE is limited to a single connection in Peripheral mode and up to 3 in Central mode.

  • It is not possible to have HID host and HID device in the same device.

  • SPP is limited to 2 connections.

2 0 2 0 2 1 2 1 0 0 1 0

Yes

PIN=(value)

Pin Code

0000

No

REMOTE_ADDR=(value)

Address of device to auto-connect to on reset. Works only if devices are paired. Will attempt MAX_REC times and then go discoverable

0

Yes

SPP_UUID=(value)

Change the UUID for the SPP profile

00 00 11 01 00 00 10 00 80 00 00 80 5F 9B 34 FB

Yes

SSP_CAPS=(value)

Set the Secure Simple Pairing capabilities for this device. Accepted values are:

  • 0 - display only

  • 1 - display yes/no

  • 2 - keyboard only

  • 3 - no display, no keyboard (i.e.JustWorks)

  • 4 - display and keyboard // not supported by standard

  • 5 - reject SSP request

If SSP_CAPS is not equal to 3, the PASSKEY command might have to be used to pair with a device.

3

No

TWS_CONFIG=(autoconn) (master) (slave)

True Wireless Stereo configuration:

autoconn: if ON, connect automatically TWS after an A2DP connection provided that there is there is a TWS present in the paired list and no other TWS device is already connected.

master/slave: Audio routing for a Master/Slave TWS device relaying/receiving audio in a TWS session.

  • 0 - stereo

  • 1 - left channel

  • 2 - right channel

  • 3 - downmix

Note that the audio routing applied on both devices is the one configured on the master device. By default, the master device is left and the slave is right.

OFF 1 2

No

UART_CONFIG=(baud) (flow_ctrl)(parity)

UART configuration:

baud: UART Baud rate (9600, 19200, 38400, 57600, 115200, 230400, 460800, 921600).

flow_ctrl: Enable or disable flow control.

parity: UART Parity (0=none, 1=odd, 2=even).

9600 OFF 0

No Yes No

USB_HOST=(value)

Determine the host interface: value is ON for USB and OFF for UART.

OFF

Yes

VREG_ROLE=(value)

Changes behaviour of VREG button when held (3s press)

  • Nothing

  • Power On/Off

1

No

1

Due to iOS behaviour, this needs to be changed before initial Pairing to iOS device. Changing after that will not remove indicator on iOS.

2

Changing the sniff parameters require the connection to restart.

3

Please note that value is a read only.