With Android 14 framework support, OEMs can configure set-top boxes (STBs) and over-the-top (OTT) devices with built-in or connected speakers to be soundbars for connected devices. The dynamic soundbar mode (DSM) in Android 14 supports the HDMI consumer electronics control (CEC) attributes for soundbars, such as audio return channel (ARC) and system audio control.
This feature targets only Android TV CEC playback devices.
Requirements
To adopt the soundbar feature, OEMs must meet the device and System UI requirements listed in this section.
Device requirements
To support DSM, the STB or OTT device must meet the following requirements:
- The device must run Android 14.
- When DSM is enabled, the device must behave like a soundbar following the HDMI CEC specifications, such as ARC.
- The device must be capable of playing sound on built-in or connected speakers.
- When the device isn't an active source, all media must be paused on the device, limiting its power consumption.
System UI requirements
To support DSM, OEMs must meet the following requirements while designing the System UI:
- The UI label must include a reference to ARC or Audio Return Channel (ARC).
- The UI must inform the user to connect the device to the TV's ARC port to establish the ARC connection.
- The UI must inform the user that the feature might not work as expected if another soundbar or audio-video receiver (AVR) is connected in the HDMI network.
- The UI must inform the user that the screen might flicker when toggling the setting.
- If the device has no built-in speakers, DSM must be disabled by default.
As a best practice, we recommend using the Display & Sound menu as the location for the user setting to enable or disable ARC, as shown in SysUI implementation.
Framework implementation
The implementation of the CEC soundbar functionality and the dynamic allocation of logical address 5 exists in the Android framework. The framework allocates the logical address when the soundbar setting is enabled, for the device to become a soundbar dynamically. When the soundbar setting is disabled, the framework deallocates the logical address.
Based on the user input on the System UI, HdmiControlManager
sets CEC_SETTING_NAME_SOUNDBAR_MODE
to SOUNDBAR_MODE_ENABLED
or
SOUNDBAR_MODE_DISABLED
. The default value of CEC_SETTING_NAME_SOUNDBAR_MODE
is set to SOUNDBAR_MODE_DISABLED
.
HdmiControlService
listens to the change in the CEC_SETTING_NAME_SOUNDBAR_MODE
setting to do the following:
- Validate if a local playback device exists and the ARC property is supported.
- Trigger logical address allocation to add or remove the local audio device.
- Ensure that the setting’s state is preserved, if the device is hotplugged.
See the following sample of declarations to set and get the status of the soundbar mode:
/**
* Name of a setting deciding whether the Soundbar mode feature is enabled.
* Before exposing this setting make sure the hardware supports it, otherwise, you may
* experience multiple issues.
*
* @see HdmiControlManager#setSoundbarMode(int)
*/
public static final String CEC_SETTING_NAME_SOUNDBAR_MODE = "soundbar_mode";
/**
* Soundbar mode feature enabled.
*/
public static final int SOUNDBAR_MODE_ENABLED = 1;
/**
* Soundbar mode feature disabled.
*/
public static final int SOUNDBAR_MODE_DISABLED = 0;
/**
* Set the status of Soundbar mode feature.
*
* This allows to enable/disable Soundbar mode on the playback device.
* The setting's effect will be available on devices where the hardware supports this feature.
* If enabled, an audio system local device will be allocated and try to establish an ARC
* connection with the TV. If disabled, the ARC connection will be terminated and the audio
* system local device will be removed from the network.
*/
public void setSoundbarMode(@SoundbarMode int value) {
}
/**
* Get the current status of Soundbar mode feature.
*
* Reflects whether Soundbar mode is currently enabled on the playback device.
* If enabled, an audio system local device will be allocated and try to establish an ARC
* connection with the TV. If disabled, the ARC connection will be terminated and the audio
* system local device will be removed from the network.
*/
public int getSoundbarMode() {}
OEM implementation
To support the dynamic soundbar feature, OEMs must ensure that the hardware supports it. OEMs must configure the device and implement the System UI to provide the required interface for user inputs.
Device implementation
To support the soundbar feature on a device:
- Bring up the playback device on Android 14.
- Implement the HDMI ARC port in the driver.
Leave the RRO values of
config_cecSoundbarModeEnabled_default
andconfig_cecSoundbarModeDisabled_default
unchanged inconfig.xml
so that the feature remains disabled by default.Ensure that the device has either built in or connected speakers to play the audio on, and edit the audio policy configuration.
Set the system property
persist.sys.hdmi.property_arc_support
totrue
, to indicate that ARC is supported.Expose the setting to toggle the soundbar mode in the System UI.
For debugging, use the following
adb
command to turn the soundbar feature on or off (1
for on and0
for off):
adb shell cmd hdmi_control cec_setting set soundbar_mode <1/0>
SysUI implementation
This section describes a recommended, mock UI flow for turning DSM on and off. The Audio output setting is under the Display & Sound menu, as shown in figure 1:
Figure 1. Audio output setting under the Display & Sound menu.
For DSM to work, the Enable HDMI-CEC setting must be toggled on. The ARC setting can be enabled only if HDMI-CEC is enabled. The ARC setting is unavailable and disabled if HDMI-CEC is disabled as shown in figure 2. In the following UI flow, when the user turns off the Enable HDMI-CEC setting in the Display & Sound menu and selects Home Speaker, the ARC setting is disabled. The user can enable the Play television audio setting by enabling Enable HDMI-CEC.
Figure 2. UI for disabled ARC option.
When the HDMI-CEC setting is enabled, the user can use the ARC setting under Audio output to turn DSM on and off. To turn on DSM, the user follows the UI flow in figure 3. In the following UI flow, to enable soundbar mode, the user selects Home Speaker, and selects and confirms the ARC setting. To turn off DSM, the user turns the ARC setting off.
Figure 3. UI to enable DSM.
Validation
OEMs can perform an audio test to ensure that the playback device's speakers play sound originating from the TV, or from other devices connected to the TV panel.
Manual validation
Use the following scenarios to manually validate the expected behavior:
- The ARC setting is enabled:
- The TV mutes itself.
- The TV sound is routed to the device's speakers.
- The ARC setting is disabled:
- The TV stops routing the audio to the device.
- The TV starts playing audio.
- The ARC setting is enabled and the device is connected to a non-ARC
port to the TV:
- The device doesn’t play the TV’s sound.
- The ARC setting is enabled and logical address 5 is in use by another
device before the device is connected:
- The device behaves like a pure playback device, not a soundbar.
- The ARC setting is enabled, logical address 5 is in use by the device, and
another audio system is connected in the network:
- There's no change in the device’s soundbar behavior.
- The ARC setting is enabled, logical address 5 is in use by the device
connected to a non-ARC port, and another audio system is connected to the
ARC port:
- The ARC connection isn't established with the TV for the second audio system because it uses an unregistered logical address.
- The ARC setting is enabled, and the device is hotplugged:
- The device follows normal behavior as when the setting is enabled.
CTS validation
CtsHdmiCecHostTestCases
is required to pass when the soundbar setting is disabled. The HdmiCecSoundbarModeTest.java
test in the CtsHdmiCecHostTestCases
test suite, tests the DSM functionalities.
Although not a certification requirement, run CtsHdmiCecHostTestCases
with the
soundbar setting enabled to validate your implementation.
See CEC CTS testing for Android TV devices to run the Android CTS tests for HDMI CEC.