oicfar
Posts: 33
Joined: Tue Sep 17, 2019 7:39 am

Disable HDMI in Bullseye

Tue Nov 09, 2021 1:38 am

Hi,

I switched to Bullseye release and I want disable HDMI. The command which worked in Buster isn't working now:

Code: Select all

$ tvservice --off
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.
I didn't find any solution.


Thx
Rafal

User avatar
jahboater
Posts: 8126
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: Disable HDMI in Bullseye

Tue Nov 09, 2021 1:53 am

There is:

Code: Select all

vcgencmd display_power 0
but I don't think its the same thing.

"tvservice" has been a Raspbery Pi tool for a very long time, it would be nice to know what has replaced it.

oicfar
Posts: 33
Joined: Tue Sep 17, 2019 7:39 am

Re: Disable HDMI in Bullseye

Tue Nov 09, 2021 8:08 am

jahboater wrote:
Tue Nov 09, 2021 1:53 am
There is:

Code: Select all

vcgencmd display_power 0
but I don't think its the same thing.

"tvservice" has been a Raspbery Pi tool for a very long time, it would be nice to know what has replaced it.
With tvservice --off you could save power if you run the Raspi headless.

User avatar
jahboater
Posts: 8126
Joined: Wed Feb 04, 2015 6:38 pm
Location: Wonderful West Dorset

Re: Disable HDMI in Bullseye

Tue Nov 09, 2021 9:16 am

oicfar wrote:
Tue Nov 09, 2021 8:08 am
With tvservice --off you could save power if you run the Raspi headless.
Yes, but the "tvservice" command appears to be missing from bullseye.

tontonfred
Posts: 2
Joined: Fri Dec 17, 2021 2:03 am

Re: Disable HDMI in Bullseye

Sat Dec 18, 2021 6:11 am

Here is a one way to disable HDMI in Bullseye (there may be others). If you are running the Pi headless (or are otherwise not interested in using the newer G2 driver), you can switch back to the legacy G1 driver in raspi-config (Advanced / GL driver). tvservice will then become available again, allowing HDMI to be powered off.

oicfar
Posts: 33
Joined: Tue Sep 17, 2019 7:39 am

Re: Disable HDMI in Bullseye

Sat Dec 18, 2021 10:22 am

tontonfred wrote:
Sat Dec 18, 2021 6:11 am
Here is a one way to disable HDMI in Bullseye (there may be others). If you are running the Pi headless (or are otherwise not interested in using the newer G2 driver), you can switch back to the legacy G1 driver in raspi-config (Advanced / GL driver). tvservice will then become available again, allowing HDMI to be powered off.
Hm ... I don't see this option

My raspi-config version is 20211203 and I don't have Advanced / GL driver option. An I have tvservice, but

Code: Select all

$ tvservice off
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.

klricks
Posts: 8346
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA

Re: Disable HDMI in Bullseye

Sat Dec 18, 2021 1:21 pm

ontonfred wrote:
Sat Dec 18, 2021 6:11 am
Here is a one way to disable HDMI in Bullseye (there may be others). If you are running the Pi headless (or are otherwise not interested in using the newer G2 driver), you can switch back to the legacy G1 driver in raspi-config (Advanced / GL driver). tvservice will then become available again, allowing HDMI to be powered off.
That option was removed from raspi-config. Now to get legacy mode you can edit /boot/config.txt and disable the kms driver.
Unless specified otherwise my response is based on the latest and fully updated RPi OS Bullseye w/ Desktop OS.

DirtyAngelica
Posts: 52
Joined: Wed Jun 10, 2020 12:52 pm

Re: Disable HDMI in Bullseye

Sun Jan 30, 2022 1:33 am

Has anyone figured out an easier way to disable HDMI in Bullseye without disabling KMS driver?
- Raspberry Pi 4:
8GB RAM - 32 units (for every residence in my apartment complex because every tenant requested one) with Pi-Hole on each one!

- Server:
Intel Core i3-530
Gigabyte GA-H55M-S2H
Windows Home Server OEM
Crucial DDR3 4GB kit
Antec 500W

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

Re: Disable HDMI in Bullseye

Sun Jan 30, 2022 7:01 am

Assuming your display is connected to HDMI0 connector (linux naming is HDMI-1) have you tried

Code: Select all

xrandr --output HDMI-1 --off
or add below to the kernel command line (cmdline.txt)

Code: Select all

video=HDMI-1:d

RDPUser
Posts: 215
Joined: Tue Jan 30, 2018 12:18 pm

Re: Disable HDMI in Bullseye

Sun Mar 06, 2022 9:49 pm

Code: Select all

xrandr --output HDMI-1 --off
This doesn't work for me. Message

Code: Select all

warning: output HDMI-1 not found; ignoring
I've switched to old driver and executed

Code: Select all

tvservice --off
Then energy consumption goes down from 0.11A to 0.07A, so saving about 40 mA. That is about 1/3 power saving.

This command works when you go to raspi-config --> Advanced options --> GL driver. Then it dowloads about 30.5 MB and installs about 131 MB, but then Legacy driver can be selected used and power can be saved.

I didn't try

Code: Select all

video=HDMI-1:d
because then video would be always off (if working at all). But the advantage of tvservice --off is that you can execute it about 5 minutes after boot. So if there is a problem some time you can easily connect display cable, disable tvservice --off and do debugging why something isn't working.

Would be great if there would be an equal option for the new drivers.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 30998
Joined: Sat Jul 30, 2011 7:41 pm

Re: Disable HDMI in Bullseye

Mon Mar 07, 2022 10:20 am

tvservice will not work, ever AFAIK, on the KMS driver.

You'll need to use the appropriate commands for DRM/KMS.

When you used HDMI-1 in the above examples, what happens when you replace with HDMI-2? Get a list of attached displays and their names by just using xrandr by itself. I just tried this and it worked on a Pi4 with HDMI-1

// To turn off
xrandr --output HDMI-1 --off
//to turn on.
xrandr --output HDMI-1 --auto
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

RDPUser
Posts: 215
Joined: Tue Jan 30, 2018 12:18 pm

Re: Disable HDMI in Bullseye

Mon Mar 07, 2022 2:39 pm

Code: Select all

xrandr
Screen 0: minimum 0 x 0, current 5760 x 1080, maximum 32768 x 32768
default connected primary 5760x1080+0+0 1523mm x 285mm
   5760x1080      0.00*
Trying xrandr --output "Screen 0" --off or xrandr --output Screen-0 --off doesn't work.

Power consumption is still about 30 mA higher than with Buster and tvservice -o

I have to mention that I had to install xrandr via sudo apt install x11-xserver-utils whereas tvservice was shipped out of the box. I'm using Raspberry PI OS lite.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 30998
Joined: Sat Jul 30, 2011 7:41 pm

Re: Disable HDMI in Bullseye

Mon Mar 07, 2022 4:57 pm

RDPUser wrote:
Mon Mar 07, 2022 2:39 pm

Code: Select all

xrandr
Screen 0: minimum 0 x 0, current 5760 x 1080, maximum 32768 x 32768
default connected primary 5760x1080+0+0 1523mm x 285mm
   5760x1080      0.00*
Trying xrandr --output "Screen 0" --off or xrandr --output Screen-0 --off doesn't work.

Power consumption is still about 30 mA higher than with Buster and tvservice -o

I have to mention that I had to install xrandr via sudo apt install x11-xserver-utils whereas tvservice was shipped out of the box. I'm using Raspberry PI OS lite.
Odd, its says "default" where mine says "HDMI-1", so you could try "default" as the screen name.

Are you sure you are using Bullseye and are using the KMS driver?
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

RDPUser
Posts: 215
Joined: Tue Jan 30, 2018 12:18 pm

Re: Disable HDMI in Bullseye

Mon Mar 07, 2022 5:56 pm

Its a completly new installed image "2022-01-28-raspios-bullseye-armhf-lite.zip" without any updates.

Code: Select all

lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

Using default does also not work:

Code: Select all

xrandr --output default --off
xrandr: Configure crtc 0 failed
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  139 (RANDR)
  Minor opcode of failed request:  7 (RRSetScreenSize)
  Serial number of failed request:  21
  Current serial number in output stream:  22
tvservice which is available without explicitly installing it indicates that the KMS driver is used.

Code: Select all

 tvservice -o
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.
I did sudo apt update && sudo apt upgrade && sudo reboot but behaviour stays the same.

cleverca22
Posts: 5869
Joined: Sat Aug 18, 2012 2:33 pm

Re: Disable HDMI in Bullseye

Mon Mar 07, 2022 6:23 pm

RDPUser wrote:
Mon Mar 07, 2022 2:39 pm
Trying xrandr --output "Screen 0" --off or xrandr --output Screen-0 --off doesn't work.

Power consumption is still about 30 mA higher than with Buster and tvservice -o
i suspect that may be a limitation of the new kms drivers, not turning off as much peripherals as the old dispmanx stack

there is a master enable flag in the HVS that seems to turn a large chunk of it off, but can only be used if all displays are shutdown

RDPUser
Posts: 215
Joined: Tue Jan 30, 2018 12:18 pm

Re: Disable HDMI in Bullseye

Mon Mar 07, 2022 6:27 pm

cleverca22 wrote:
Mon Mar 07, 2022 6:23 pm
RDPUser wrote:
Mon Mar 07, 2022 2:39 pm
Trying xrandr --output "Screen 0" --off or xrandr --output Screen-0 --off doesn't work.

Power consumption is still about 30 mA higher than with Buster and tvservice -o
i suspect that may be a limitation of the new kms drivers, not turning off as much peripherals as the old dispmanx stack

there is a master enable flag in the HVS that seems to turn a large chunk of it off, but can only be used if all displays are shutdown
How can this master enable flag be used? I have no displays connected so this would be ideal to save power.

cleverca22
Posts: 5869
Joined: Sat Aug 18, 2012 2:33 pm

Re: Disable HDMI in Bullseye

Mon Mar 07, 2022 9:46 pm

https://github.com/librerpi/lk-overlay/ ... #L317-L320

Code: Select all

  *REG32(SCALER_DISPCTRL) &= ~SCALER_DISPCTRL_ENABLE; // disable HVS
  *REG32(SCALER_DISPCTRL) = SCALER_DISPCTRL_ENABLE // re-enable HVS
    | DSP3_MUX(3)
    | 0x7f; // irq en
i believe clearing that bit in the main control register will turn a large chunk of the HVS off, which may reduce power usage
the problem then, is finding the right place in https://github.com/raspberrypi/linux/tr ... pu/drm/vc4 to modify
to turn things off when not in use, and to turn it back on and fully re-initialize the hvs, when it i needed again

Return to “Raspberry Pi OS”