Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Blanking the HDMI output

Featured Replies

I'm running OpenElec on a NanoPI-M1 and one thing missing is having the screen blanked when the screensaver kicks in, allowing the monitor to power down. In Kodi there's no option to do it, unlike when running in other OS.

Probably someone is going to direct me at CEC but that does not work for me as I have a PC monitor connected to the board through a HDMI->VGA adaptor.

I've read in the sunxi docs that the '/sys/class/graphics/fb0/blank' sysfs entry should control blanking for the framebuffer, therefore blanking the HDMI output, but it either does not work that way or at all, as nothing happens.

On the RP world there is a command line utility that can enable/disable the video output, is there any way of doing it on an H3-based board ?

  • Author

Cracked it. Anyone interested can use the code below to do it:

#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <string.h>

#define DISP_BLANK 0x0C

int main(int argc, char *argv[])
{
        int fd_disp, ret;
        unsigned long buffer[4] = {0};

        if (strcasecmp(argv[1], "off") == 0) buffer[1] = 1;
        else if (strcasecmp(argv[1], "on") == 0) buffer[1] = 0;
        else return 0;

        fd_disp = open("/dev/disp", O_RDWR);
        if (fd_disp == -1) {
                fprintf(stderr, "Error: Failed to open /dev/disp: %s\n", strerror(errno));
                return errno;
        }

        if (ioctl(fd_disp, DISP_BLANK, buffer)) ret = errno;
        else ret = 0;

        close(fd_disp);

        return ret;
}

Compile this for ARM and use as '<program name> off' to blank and '<program name> on' to un-blank.

Still, it is strange why just writing to the sysfs entry doesn't work...

 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.