oz1sej
Posts: 24
Joined: Tue Feb 23, 2016 11:16 am

Support for vcgencmd display_power removed - what do I do now?

Sun Nov 13, 2022 1:54 pm

I'm controlling a large (4x4 screen) display with a Raspberry Pi 3. Until recently, I've been able to switch it off every night by putting a

Code: Select all

vcgencmd display_power 0
in crontab, and on again every morning with a 1. I just reinstalled, and now,

Code: Select all

$ vcgencmd display_power 0
just returns

Code: Select all

display_power=1
without turning the display off. I gather that I can use tvservice instead, but

Code: Select all

$ tvservice -l
tvservice is not supported when using the vc4-kms-v3d driver.
Similar features are available with standard linux tools
such as modetest from libdrm-tests.
This is a serious problem, and I need to solve it fast. I read somewhere that I need to "downgrade the kernel" - this sounds to me like a wrong solution. So please - what can I do?

Also, I'm shocked that support for something so basic, and so widespread, as turning an external display on and off if removed just like that, without introducing some other means of turning the external display on and off. This must be a very serious problem for thousands, if not millions around the world.

So any suggestions are welcome. This display draws 16 x 300 W = 4.8 kW. With the current electricity prices, this costs my company 60 € per day until this problem is solved - or until management demands that I stay at work until 21 hours to turn it off manually until I find a solution.

I could just shut it down at 21, but it has to turn on again early in the morning...

trejan
Posts: 5628
Joined: Tue Jul 02, 2019 2:28 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Sun Nov 13, 2022 2:46 pm

oz1sej wrote:
Sun Nov 13, 2022 1:54 pm
Also, I'm shocked that support for something so basic, and so widespread, as turning an external display on and off if removed just like that, without introducing some other means of turning the external display on and off. This must be a very serious problem for thousands, if not millions around the world.
Support for turning off the output wasn't removed. Linux KMS controls the display hardware now so you need to use the correct Linux utility to do it. The display_power option had race conditions when using KMS as it changed the hardware settings directly.

HDMI 1 off:

Code: Select all

DISPLAY=:0.0 xrandr --output HDMI-1 --off
HDMI 1 on:

Code: Select all

DISPLAY=:0.0 xrandr --output HDMI-1 --auto

User avatar
jojopi
Posts: 3737
Joined: Tue Oct 11, 2011 8:38 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Sun Nov 13, 2022 5:58 pm

xrandr reconfigures everything, so there is a risk of changing resolution, which did not exist with display_power. Unless you are concerned about the mouse being nudged, I would use:

Code: Select all

DISPLAY=:0 xset dpms force off

DISPLAY=:0 xset dpms force on
Outside Xorg I can not find any equivalent of disabling the output. There is an equivalent for powersave, but it is cumbersome and requires privilege:

Code: Select all

setterm -term linux -blank force -powersave powerdown 0>/dev/tty0

setterm -term linux -blank poke 0>/dev/tty0
This does not work on older kernels, nor if X is active. So we have multiple methods and it is difficult to pick the correct one automatically.

Any other suggestions?

aBUGSworstnightmare
Posts: 7343
Joined: Tue Jun 30, 2015 1:35 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Sun Nov 13, 2022 6:25 pm

jojopi wrote:
Sun Nov 13, 2022 5:58 pm
xrandr reconfigures everything, so there is a risk of changing resolution, which did not exist with display_power. Unless you are concerned about the mouse being nudged, I would use:

Code: Select all

DISPLAY=:0 xset dpms force off

DISPLAY=:0 xset dpms force on
Outside Xorg I can not find any equivalent of disabling the output. There is an equivalent for powersave, but it is cumbersome and requires privilege:

Code: Select all

setterm -term linux -blank force -powersave powerdown 0>/dev/tty0

setterm -term linux -blank poke 0>/dev/tty0
This does not work on older kernels, nor if X is active. So we have multiple methods and it is difficult to pick the correct one automatically.

Any other suggestions?
why should it change resolution? In case one is concerned add the 'resolution of your choice' to kernel command line

oz1sej
Posts: 24
Joined: Tue Feb 23, 2016 11:16 am

Re: Support for vcgencmd display_power removed - what do I do now?

Mon Nov 14, 2022 11:04 am

trejan wrote:
Sun Nov 13, 2022 2:46 pm

Code: Select all

DISPLAY=:0.0 xrandr --output HDMI-1 --off
Thank you SO much - this works exactly as expected!

oz1sej
Posts: 24
Joined: Tue Feb 23, 2016 11:16 am

Re: Support for vcgencmd display_power removed - what do I do now?

Mon Nov 14, 2022 11:06 am

jojopi wrote:
Sun Nov 13, 2022 5:58 pm
xrandr reconfigures everything, so there is a risk of changing resolution, which did not exist with display_power. Unless you are concerned about the mouse being nudged, I would use:

Code: Select all

DISPLAY=:0 xset dpms force off
This gives me

Code: Select all

$ DISPLAY=:0 xset dpms force off
server does not have extension for dpms option
xset:  unknown option force

usage:  xset [-display host:dpy] option ...
    To turn bell off:
	-b                b off               b 0
    To set bell volume, pitch and duration:
	 b [vol [pitch [dur]]]          b on
    To disable bug compatibility mode:
	-bc
    To enable bug compatibility mode:
	bc
    To turn keyclick off:
	-c                c off               c 0
    To set keyclick volume:
	 c [0-100]        c on
    To control Energy Star (DPMS) features:
	-dpms      Energy Star features off
	+dpms      Energy Star features on
	 dpms [standby [suspend [off]]]     
	      force standby 
	      force suspend 
	      force off 
	      force on 
	      (also implicitly enables DPMS features) 
	      a timeout value of zero disables the mode 
    To set the font path:
	 fp= path[,path...]
    To restore the default font path:
	 fp default
    To have the server reread font databases:
	 fp rehash
    To remove elements from font path:
	-fp path[,path...]  fp- path[,path...]
    To prepend or append elements to font path:
	+fp path[,path...]  fp+ path[,path...]
    To set LED states off or on:
	-led [1-32]         led off
	 led [1-32]         led on
	-led named 'name'   led off
	 led named 'name'   led on
    To set mouse acceleration and threshold:
	 m [acc_mult[/acc_div] [thr]]    m default
    To set pixel colors:
	 p pixel_value color_name
    To turn auto-repeat off or on:
	-r [keycode]        r off
	 r [keycode]        r on
	 r rate [delay [rate]]
    For screen-saver control:
	 s [timeout [cycle]]  s default    s on
	 s blank              s noblank    s off
	 s expose             s noexpose
	 s activate           s reset
    For status information:  q
    To print version: -version

User avatar
jojopi
Posts: 3737
Joined: Tue Oct 11, 2011 8:38 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Mon Nov 14, 2022 4:59 pm

oz1sej wrote:
Mon Nov 14, 2022 11:06 am
server does not have extension for dpms option
If you have disabled screen blanking using raspi-config (which seems likely in a signage application), apparently that also removes the power management extension.

This seems unnecessary and obnoxious, and I think you could reenable it in /etc/X11/xorg.conf.d/10-blanking.conf without any impact on (non)blanking.
aBUGSworstnightmare wrote:
Sun Nov 13, 2022 6:25 pm
why should it change resolution? In case one is concerned add the 'resolution of your choice' to kernel command line
Disabling an output with xrandr loses information about the output configuration. There is no option to reenable at the previous resolution, you must always choose a mode, or the preferred option for the display. I do not think the kernel command line is consulted. If you have even changed refresh rate from the default, that change will be lost on stopping and starting the output.

xrandr is not intended for temporarily suspending output, like display_power or dpms. I increasingly think there is not a very good alternative to display_power.

FreeZey
Posts: 7
Joined: Mon Feb 29, 2016 3:45 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Thu Mar 23, 2023 3:39 pm

Is there any timeline on the return of support for "vcgencmd" ?

It's so critical I bought a Pi3 as a work around but I'm finding it too slow to run a browser.

trejan
Posts: 5628
Joined: Tue Jul 02, 2019 2:28 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Thu Mar 23, 2023 3:51 pm

FreeZey wrote:
Thu Mar 23, 2023 3:39 pm
Is there any timeline on the return of support for "vcgencmd" ?
None. It’s not coming back. Using FKMS would make it work again but that is deprecated now so YMMV.

xrandr and xset don’t work for you? What are you trying to do?

aBUGSworstnightmare
Posts: 7343
Joined: Tue Jun 30, 2015 1:35 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Thu Mar 23, 2023 4:31 pm

jojopi wrote:
Mon Nov 14, 2022 4:59 pm
aBUGSworstnightmare wrote:
Sun Nov 13, 2022 6:25 pm
why should it change resolution? In case one is concerned add the 'resolution of your choice' to kernel command line
Disabling an output with xrandr loses information about the output configuration. There is no option to reenable at the previous resolution, you must always choose a mode, or the preferred option for the display. I do not think the kernel command line is consulted. If you have even changed refresh rate from the default, that change will be lost on stopping and starting the output.

xrandr is not intended for temporarily suspending output, like display_power or dpms. I increasingly think there is not a very good alternative to display_power.
hmm ... I'm still under the impression that these commands do exactly what they should
xrandr --output HDMI-1 --off turns the selected display off
xrandr --output HDMI-1 --auto turns the display on with the preferred resolution

At least that's what I read from the xrandr documentation ('man xrandr')
..
--auto For connected but disabled outputs, this will enable them using
their first preferred mode (or, something close to 96dpi if they
have no preferred mode). For disconnected but enabled outputs,
this will disable them.
--off Disables the output.
To my best knowledge 'tvservice' is not supported in KMS, use cec-ctl instead.

FreeZey
Posts: 7
Joined: Mon Feb 29, 2016 3:45 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Thu Mar 23, 2023 9:23 pm

trejan wrote:
Thu Mar 23, 2023 3:51 pm
xrandr and xset don’t work for you? What are you trying to do?
Xrandr loses all of the config (which I can live with) but it doesn't turn off the backlight (which I can't).

It's a screen on a magic mirror so it's on all the time and at night the backlight causes "moon glow".

I haven't been able to get xset to do anything, no error message, the commands just seem to be ignored. If I change the syntax I get things like

Code: Select all

xset:  unable to open display ":0"

aBUGSworstnightmare
Posts: 7343
Joined: Tue Jun 30, 2015 1:35 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Thu Mar 23, 2023 9:26 pm

FreeZey wrote:
Thu Mar 23, 2023 9:23 pm
trejan wrote:
Thu Mar 23, 2023 3:51 pm
xrandr and xset don’t work for you? What are you trying to do?
Xrandr loses all of the config (which I can live with) but it doesn't turn off the backlight (which I can't).

It's a screen on a magic mirror so it's on all the time and at night the backlight causes "moon glow".

I haven't been able to get xset to do anything, no error message, the commands just seem to be ignored. If I change the syntax I get things like

Code: Select all

xset:  unable to open display ":0"
start telling us which screen it is. Maybe it's lacking such capability.

FreeZey
Posts: 7
Joined: Mon Feb 29, 2016 3:45 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Fri Mar 24, 2023 9:21 am

aBUGSworstnightmare wrote:
Thu Mar 23, 2023 9:26 pm
start telling us which screen it is. Maybe it's lacking such capability.
Monitor details. Is there something specific I can run to check?

Code: Select all

$ ls /sys/class/drm/*/edid | xargs -i{} sh -c "echo {}; parse-edid < {}"
/sys/class/drm/card1-HDMI-A-1/edid
Checksum Correct

Section "Monitor"
        Identifier "DELL IN2020"
        ModelName "DELL IN2020"
        VendorName "DEL"
        # Monitor Manufactured week 31 of 2010
        # EDID version 1.3
        # Digital Display
        DisplaySize 440 250
        Gamma 2.20
        Option "DPMS" "true"
        Horizsync 30-83
        VertRefresh 50-76
        # Maximum pixel clock is 170MHz
        #Not giving standard mode: 1152x864, 75Hz
        #Not giving standard mode: 1280x1024, 60Hz
        #Not giving standard mode: 1600x900, 60Hz

$xrandr --verbose
Screen 0: minimum 320 x 200, current 900 x 1600, maximum 7680 x 7680
HDMI-1 connected primary 900x1600+0+0 (0x48) right (normal left inverted right x axis y axis) 443mm x 249mm
        Identifier: 0x45
        Timestamp:  12877
        Subpixel:   unknown
        Gamma:      1.0:1.0:1.0
        Brightness: 1.0
        Clones:
        CRTC:       0
        CRTCs:      0
        Transform:  1.000000 0.000000 0.000000
                    0.000000 1.000000 0.000000
                    0.000000 0.000000 1.000000
                   filter:
        EDID:
                00ffffffffffff0010ac28f04d325630
                1f140103802c1978ea9535a159579f27
                0e5054a54b00714f8180a9c001010101
                0101010101012f2640a060841a303020
                3500bbf91000001a000000ff00315439
                44593037523056324d0a000000fc0044
                454c4c20494e323032300a20000000fd
                00324c1e5311000a20202020202001a6
                02031b61230907078301000067030c00
                2000802d43908402e2000f8c0ad08a20
                e02d10103e9600a05a00000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000000
                00000000000000000000000000000029
        Broadcast RGB: Automatic
                supported: Automatic, Full, Limited 16:235
	...
        link-status: Good
                supported: Good, Bad
        CONNECTOR_ID: 41
                supported: 41
        non-desktop: 0
                range: (0, 1)

trejan
Posts: 5628
Joined: Tue Jul 02, 2019 2:28 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Fri Mar 24, 2023 10:00 am

FreeZey wrote:
Thu Mar 23, 2023 9:23 pm
Xrandr loses all of the config (which I can live with) but it doesn't turn off the backlight (which I can't).
xrandr works for me with Magicmirror. It turns off the HDMI output and then the monitor goes into standby. I have mine setup so that the output turns on again if a PIR module senses movement or if the touchscreen is touched.

FreeZey
Posts: 7
Joined: Mon Feb 29, 2016 3:45 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Fri Mar 24, 2023 10:16 am

trejan wrote:
Fri Mar 24, 2023 10:00 am
xrandr works for me with Magicmirror
I should clarify that I'm not running the MagicMirror software I just wrote something myself. It's a website running in a full screened browser. Then I was using a python program to turn the monitor off after 5 minutes and back on if someone pressed one of the 2 buttons on the sides of the mirror case.
trejan wrote:
Fri Mar 24, 2023 10:00 am
It turns off the HDMI output *and then the monitor goes into standby*.
Perhaps I just need to be more patient. I will do a test where I turn the monitor off with xrandr and then wait for a few minutes to see if the backlight turns itself off too.

trejan
Posts: 5628
Joined: Tue Jul 02, 2019 2:28 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Fri Mar 24, 2023 11:58 am

FreeZey wrote:
Fri Mar 24, 2023 10:16 am
Then I was using a python program to turn the monitor off after 5 minutes and back on if someone pressed one of the 2 buttons on the sides of the mirror case.
I’m using a Python script as well except mine turns back on via PIR or touch. MagicMirror is basically a website in the Electron browser anyway.
FreeZey wrote:
Fri Mar 24, 2023 10:16 am
I will do a test where I turn the monitor off with xrandr and then wait for a few minutes to see if the backlight turns itself off too.
If the monitor says no signal then xrandr worked. How the monitor deals with loss of signal is model specific. One monitor I have will turn off after a few seconds but one Dell monitor starts a 5 min timer with on screen display before it’ll go into standby.

You may be able to control the monitor via ddcutil.

FreeZey
Posts: 7
Joined: Mon Feb 29, 2016 3:45 pm

Re: Support for vcgencmd display_power removed - what do I do now?

Fri Mar 24, 2023 1:21 pm

What's the performance of the Electron browser like? I've tried Chromium and Firefox on a Pi3 as a work around (since it still supports vcgencmd) but they're both frustratingly slow.

I don't get a "no signal" message or anything indicating a disconnect (it's a Dell monitor), I've tried turning it off with xrandr this morning but the backlight is still on hours later so I don't think it has a secondary self timeout/shutoff.

I think I just need to keep looking for a vcgencmd work around. I'll add ddcutil to the list of things to try, I still have a few others suggested from Stack Overflow as well. It's just a shame the thing that worked is no longer available.

UPDATE:
No joy with ddcutil

Code: Select all

 $ sudo ddcutil detect
Invalid display
   I2C bus:             /dev/i2c-20
   EDID synopsis:
      Mfg id:           DEL
      Model:            DELL IN2020
      Serial number:    1T9DY07R0V2M
      Manufacture year: 2010
      EDID version:     1.3
   DDC communication failed

Return to “Raspberry Pi OS”