Android CEC Screen power On/Off with DSDevices

Android CEC Screen power On/Off with DSDevices

If you are using a CMS later than v3.0 please use this link

This guide will take you through how to use the DSDevices DSCS9X and DSCS9 to control the attached TV/screen via HDMI-CEC.

Modern TVs and signage panels offer the HDMI-CEC standard to accept power on/off Events via the HDMI cable.

The DSDevices DSCS9X and DSCS9 offers a method to send those CEC control signals so that you can turn the screen on and off via Commands Scheduled in Xibo or built into Layouts.

Player Setup

If you are using a DSCS9X, please go straight to the Xibo Setup section below.

Plesae note: DSCS9 devices shipped from 1st January 2019 onwards have the DSDCEC app pre-installed and the CEC options correctly configured for you automatically, so you can skip straight to the Xibo Setup section below.

On your DSCS9, first install the DSDCEC app which you can download from the DSDevices Utilities section of the Download Centre.

Once installed, if you open the DSDCEC app, it should look like this:

Next, go into the Settings app from the device home screen:

Select Preference:

Select HDMI CEC:

Ensure that the following options are selected:

  • CEC Control - Open
  • One key play - Close
  • One key power off - Close
  • Auto change language - Close

Exit the settings using the back arrow at the bottom of the screen.

Next, ensure that your TV or panel has HDMI-CEC control enabled. How you achieve this varies from manufacturer to manufacturer. Please see the user guide for your particular TV for guidance.

Once CEC is enabled, ensure that your DSCS9 is connected to the TV via HDMI cable. CEC control signals cannot pass through HDMI to VGA adapters for example.

Click the POWEROFF button, or press f on the keyboard in the DSDCEC app. Your TV should turn off. Assuming it does so, turn the screen back on manually, or if you have a keyboard connected use the n button to trigger a power-on event.

Assuming that the screen powers off and on as expected, the Player setup is complete.

Xibo Setup

Once the Players are configured and power off/on is working from the DSDCEC app, triggering that from Xibo is straight forward.

From the CMS, we first need to define a Command to turn screen power off and on. Go to the CMS Menu, and select the Commands page located under the Displays section.

If you don’t already have a suitable Command defined, create one now by clicking Add Command.

Repeat for a Screen On Command.

The two new Commands should now appear in your list. If you already have screen on/off commands defined (for example if you use webOS Players), then there’s no need to define specific ones for Android. You can use the same Commands across both types of Player.

If you don’t already have a Display Settings Profile that you’ll use for DSDevices DSCS9X and DSCS9 based Players, then now is a great time to create one.

To create a new profile, in the CMS main Menu, go to Display Settings and click Add Profile. Ensure the Client Type is set to Android, and give the Profile a meaningful name.

Enter your Licence Pool information, along with any other settings you would routinely change for your environment.

Finally, move to the Commands tab, and define the two Commands you created earlier for these devices as follows:

Those commands are:

Screen Off: echo 0x40 0x36 > /sys/class/cec/cmd Screen On: echo 0x40 0x04 > /sys/class/cec/cmd

Save your Display Settings Profile.

Please note: From v2 R216 and later and v3 R301 and later the following command string shortcuts can be used: Screen Off: dsd_cec_off Screen On: dsd_cec_on
Screenshot/Image

You now need to assign that Display Settings Profile to your DSCS9 Players. If you’re using only one Display Settings Profile, and have put those Commands into the Default Profile, then you can skip this step. Otherwise, go to the Displays page of the CMS.

Edit each Display served by a DSCS9 and click on the Advanced tab. Choose the new Profile you created in the Settings Profile? field and Save your changes.

Allow time for the Player to download the new Settings Profile. You can see when it last connected on the Displays page. Once that date changes, it should have the new Commands defined.

If you have XMR up and running, you can now send an instant screen on/off command from the Displays page:

Click the row menu next to your selected Display, and select Send Command. Pick Screen Off and then Save. The screen should receive an XMR message and turn off.

The same Commands can then be Scheduled from the Schedule screen (these don’t require XMR to work):

As in the example image above, the selected Start Time would cause the screen to turn off at 18:30 on the selected Display. You could then use a Repeat to cause that to happen every day for example. A similar Schedule could be defined to turn the screen back on again.

It is also possible to embed the Commands required into a Layout. Simply add the Shell Command Widget and choose the Commands you defined earlier. When that particular Layout is shown, the screen power state will change accordingly.