1# CEC CTS testing for Android TV devices
2
3NOTE: CTS has two meanings here. HDMI defines a set of tests in the
4**Compliance Test Specification** of HDMI 1.4b
5__HDMI Compliance Test Specification 1.4b__ and
6**Android Compatibility Test Suite**.
7
8The Android Compatibility Test Suite includes specific tests from the HDMI
9Compliance Test Specification as well as other Android specific tests.
10
11## Setup
12
13### Playback devices (aka Set Top Boxes)
14
15Running these CTS tests requires a specific HDMI layout with a CEC adapter.
16
17*   Android TV playback device
18*   CEC adapter, see [External CEC Adapter instructions](cec_adapter.md)
19*   Install `cec-client` binary, see [install instructions](cec_adapter.md#software)
20*   HDMI Display (aka a TV) with CEC disabled to avoid interference, or an HDMI fake plug
21
22It is recommended that the playback device has an HDMI physical address of `1.0.0.0` while running
23the tests. In case the DUT takes a physical address other than `1.0.0.0` and this is unavoidable,
24the tests can be configured to expect a different physical address by appending these arguments to
25the tradefed command:
26```
27--module-arg CtsHdmiCecHostTestCases:set-option:cec-phy-addr:<address_in_decimal>
28```
29Thus, for a device that is taking an address `3.0.0.0`, pass `12288` as the `cec-phy-addr` argument.
30
31The CEC adapter may also be installed in-between the TV and the playback device.
32
33![drawing](setup.png)
34
35### TV panel devices
36
37Running these CTS tests on TV panel devices requires an external CEC adapter.
38
39*   Android TV panel device
40*   CEC adapter, see [External CEC Adapter instructions](cec_adapter.md)
41*   Install `cec-client` binary, see [install instructions](cec_adapter.md#software)
42
43It is recommended to connect the CEC adapter to the HDMI ARC port of the TV device.
44
45### Automation
46
47Given the setup described above you can run this test module with the following commands:
48
49#### cts-tradefed
50
51```
52cts-tradefed > run cts -m CtsHdmiCecHostTestCases
53```
54
55#### atest
56```
57atest CtsHdmiCecHostTestCases
58```
59
60To shard the test (distribute and run the tests on multiple devices), use this
61command -
62```
63./cts-tradefed run commandAndExit cts --enable-token-sharding --shard-count 3 -m CtsHdmiCecHostTestCases
64```
65
66The shard count corresponds to the number of DUTs connected to the host.
67