動態單件式環繞劇院模式

支援 Android 14 架構,機上盒 (STB) 以及內建或連網喇叭的 over-the-top (OTT) 裝置 設定為連線裝置的單件式環繞劇院。動態單件式環繞劇院模式 Android 14 (DSM) 支援 HDMI 消費端 單件式環繞劇院的電子控制 (CEC) 屬性,例如音訊回傳通道 (ARC) 和系統音訊控制。

這項功能僅適用於 Android TV CEC 播放裝置。

需求條件

如要採用單件式環繞劇院功能,原始設備製造商 (OEM) 必須符合裝置和系統 UI 滿足本節所列需求

裝置需求

如要支援 DSM,STB/OTT 裝置必須符合下列需求:

  • 裝置必須搭載 Android 14。
  • 啟用 DSM 後,裝置運作時必須類似單件式環繞劇院, HDMI CEC 規格,例如 ARC。
  • 裝置必須能播放內建或連線音效 音箱。
  • 如果裝置不是使用中的來源,你必須在 同時限制其耗電量。
,瞭解如何調查及移除這項存取權。

系統 UI 需求

如要支援 DSM,原始設備製造商 (OEM) 在設計 系統 UI:

  • UI 標籤必須包含 ARC音訊回傳通道 (ARC)
  • 使用者介面必須通知使用者將裝置連接到電視的 ARC 通訊埠,以便 建立 ARC 連線
  • 如果遇到下列情況,UI 必須告知使用者,功能可能無法正常運作 已連接其他單件式環繞劇院或音訊/視訊接收器 (AVR) 更是如此
  • UI 必須告知使用者,切換 以及環境敘述
  • 如果裝置沒有內建喇叭,您必須預設為停用 DSM。

最佳做法:建議您使用多媒體和播放音效選單 讓使用者設定啟用或停用 ARC,如 SysUI 實作

架構實作

導入 CEC 單件式環繞劇院功能和動態分配 Android 架構中的邏輯位址 5架構會 啟用單件式環繞劇院設定時的邏輯地址,讓裝置 自動成為單件式環繞劇院停用單件式環繞劇院設定時, 這個架構就會解除分配邏輯位址

根據使用者在系統 UI 上輸入的內容,HdmiControlManager 將「CEC_SETTING_NAME_SOUNDBAR_MODE」設為 SOUNDBAR_MODE_ENABLEDSOUNDBAR_MODE_DISABLED。預設值為 CEC_SETTING_NAME_SOUNDBAR_MODE 已設為 SOUNDBAR_MODE_DISABLED

HdmiControlService 會監聽 CEC_SETTING_NAME_SOUNDBAR_MODE 中的變更 設定執行以下動作:

  • 確認本機播放裝置是否存在,以及 ARC 屬性 支援。
  • 觸發邏輯位址分配作業,新增或移除本機音訊裝置。
  • 確保在裝置熱插電時,設定狀態會保留。

請參閱下列宣告範例,瞭解如何設定及取得 單件式環繞劇院模式:

    /**
     * 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.
     *
     * <p>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.
     *
     * <p>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) 實作

為了支援動態單件式環繞劇院功能,原始設備製造商 (OEM) 必須確保 但 AI 會支援該執行緒。原始設備製造商 (OEM) 必須設定裝置,並 實作系統 UI 來提供必要的介面 使用者輸入內容

裝置實作

如要支援裝置的單件式環繞劇院功能:

  1. 啟動搭載 Android 14 的播放裝置。
  2. 在驅動程式中插入 HDMI ARC 連接埠。
  3. RRO 值請保留 「config_cecSoundbarModeEnabled_default」和「config_cecSoundbarModeDisabled_default」 「config.xml」中維持不變 讓該功能預設為停用

  4. 確認裝置已內建 連線的揚聲器,以便播放音訊,並編輯 音訊政策設定

  5. 將系統屬性 persist.sys.hdmi.property_arc_support 設為 true,表示支援 ARC。

  6. 系統 UI 中公開切換單件式環繞劇院模式的設定。

如要偵錯,請使用以下 adb 指令開啟單件式環繞劇院功能 (1 為開啟,0 為關閉):

adb shell cmd hdmi_control cec_setting set soundbar_mode <1/0>

SysUI 實作

本節說明開啟及關閉 DSM 的建議模擬 UI 流程。 音訊輸出設定位於螢幕和音效選單,如圖所示 圖 1:

dsm_audio_output

圖 1. 音訊輸出設定,位於 [顯示與]音效選單。

為了讓 DSM 正常運作,您必須開啟「啟用 HDMI-CEC」設定。 只有在 HDMI-CEC 功能啟用時,才能啟用 ARC 設定。「ARC」設定 如果 HDMI-CEC 功能已停用,就會顯示為灰色,如圖 2 所示。在 在使用者關閉啟用 HDMI-CEC 設定後 多媒體和[音效] 選單,然後選取「家用喇叭」和「ARC」設定 已停用。使用者可以透過下列方式啟用「Play 電視音訊」設定: 啟用「啟用 HDMI-CEC」

dsm_ui_disable_arc

圖 2. 已停用 ARC 選項的使用者介面。

HDMI-CEC 設定啟用後,使用者就能在以下位置使用 ARC 設定: 音訊輸出:可開啟或關閉 DSM。使用者按照使用者介面啟用 DSM 功能 流程在下方的使用者介面流程中,如要啟用單件式環繞劇院模式,使用者 依序選取「家用喇叭」,然後選取並確認「ARC」設定。關閉 關閉 DSM,使用者關閉「ARC」設定。

dsm_ui_enable_arc

圖 3. 使用者介面啟用 DSM。

驗證

原始設備製造商 (OEM) 可執行音訊測試,確保播放裝置的喇叭 播放來自電視或其他連接電視裝置的音效 面板。

手動驗證

請參考下列情境,手動驗證預期的行為:

  • ARC 設定已啟用:
    • 電視會自動設為靜音。
    • 電視音訊會傳送到裝置的揚聲器。
  • ARC 設定已停用:
    • 電視會停止將音訊轉送至裝置。
    • 電視開始播放音訊。
  • ARC 設定已啟用,且裝置已連上非 ARC 轉移至電視:
    • 裝置不會播放電視音效。
  • ARC 設定已啟用,且另一個邏輯地址 5 正在使用 :
    • 裝置的運作方式與純播放裝置類似,而非單件式環繞劇院。
  • 已啟用 ARC 設定,裝置正在使用邏輯位址 5 其他音訊系統連上網路中:
    • 裝置的單件式環繞劇院行為則沒有改變。
  • ARC 設定已啟用,裝置正在使用邏輯位址 5 另一個音訊系統則連接到非 ARC 連接埠 ARC 通訊埠:
    • 第二次音訊時,尚未與電視建立 ARC 連線 系統是因為使用未註冊的邏輯地址。
  • ARC 設定已啟用,且裝置已接上電源:
    • 裝置會像啟用這項設定一樣正常運作。

CTS 驗證

CtsHdmiCecHostTestCases 當單件式環繞劇院設定停用時,就必須傳遞音號。HdmiCecSoundbarModeTest.javaCtsHdmiCecHostTestCases 測試套件中測試 DSM 功能。

雖然非認證需求條件,但只要執行CtsHdmiCecHostTestCases, 已啟用單件式環繞劇院設定,以便驗證實作結果。

請參閱「Android TV 裝置適用的 CEC CTS 測試」 執行適用於 HDMI CEC 的 Android CTS 測試。