I just made up a Debian trixie setup that has no need for a GUI. In fact, I rarely use the text console either. However, because the machine is dual boot and also serves another purpose, it’s connected to my main monitor and KVM switch.
The monitor has three inputs, and when whatever display it’s set to goes into powersave mode, it will seek out another one that’s active and automatically switch to it.
You can probably see where this is heading: it’s really inconvenient if one of the inputs never goes into powersave mode. And, of course, it wastes energy.
I have concluded that the Linux text console has lost the ability to enter powersave mode after an inactivity timeout. It can still do screen blanking — setting every pixel to black — but that is a distinct and much less useful thing.
You can do a lot of searching online that will tell you what to do. Almost all of it is wrong these days. For instance, none of these work:
- Anything involving vbetool. This is really, really old advice.
- Anything involving xset, unless you’re actually running a GUI, which is not the point of this post.
- Anything involving setterm or the kernel parameters video=DPMS or consoleblank.
- Anything involving writing to paths under /sys, such as ones ending in dpms.
Why is this?
Well, we are on at least the third generation of Linux text console display subsystems. (Maybe more than 3, depending on how you count.) The three major ones were:
- The VGA text console
- fbdev
- DRI/KMS
As I mentioned recently in my post about running an accurate 80×25 DOS-style console on modern Linux, the VGA text console mode is pretty much gone these days. It relied on hardware rendering of the text fonts, and that capability simply isn’t present on systems that aren’t PCs — or even on PCs that are UEFI, which is most of them now.
fbdev, or a framebuffer console under earlier names, has been in Linux since the late 1990s. It was the default for most distros until more recently. It supported DPMS powersave modes, and most of the instructions you will find online reference it.
Nowadays, the DRI/KMS system is used for graphics. Unfortunately, it is targeted mainly at X11 and Wayland. It is also used for the text console, but things like DPMS-enabled timeouts were never implemented there.
You can find some manual workarounds — for instance, using ddcutil or similar for an external monitor, or adjusting the backlight files under /sys on a laptop. But these have a number of flaws — making unwanted brightness adjustments, and not automatically waking up on keypress among them.
My workaround
I finally gave up and ran apt-get install xdm. Then in /etc/X11/xdm/Xsetup, I added one line:
xset dpms 0 0 120
Now the system boots into an xdm login screen, and shuts down the screen after 2 minutes of inactivity. On the rare occasion where I want a text console from it, I can switch to it and it won’t have a timeout, but I can live with that.
Thus, quite hopefully, concludes my series of way too much information about the Linux text console!
@jgoerzen You mean now e.g. setting consoleblank=X will really just produce a black screen after X seconds?
(I don't think this is related to dri and kms, at least not only that. I'd have to check but I think some of the setups of mine where the linux virtual console could trigger screen sleep with older versions were using dri and kms?
I had to do a hardware change and getting this set up was one of the things I've been postponing. Maybe I should look into this soon…)
Remote Reply
Original Comment URL
Your Profile
@jgoerzen BTW, I just noticed that in my notes from when I had to start setting consoleblank in some system (possibly from c. 2019–2020?), I have this:
ยซDespite what the commit message regarding this change [1] says, consoleblank *does* trigger DPMS.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=a4199f5eb8096d63828f7333fa45650a7b0a99ed ยป
But it's likely I was missing something else that happened to make this also trigger DPMS. Notes also say "setterm –blank" seem to change the same value for all VTs, or at least triggers the same behaviour I was looking for.
Remote Reply
Original Comment URL
Your Profile
@njsg @jgoerzen@changelog.complete.org Yes, exactly. If you have more insights, I'd welcome them!
Remote Reply
Original Comment URL
Your Profile
@jgoerzen@floss.social @jgoerzen@changelog.complete.org on a more recent (but still not recent enough for me to be confident this hasn't changed recently) kernel than my previous attempts, setterm –blank=Y still triggers DPMS after Y minutes in the virtual console.
I'm not sure I'll be able to check it soon, but I'll see if I can test newer kernels for this. GPU is nVidia with nouveau.
Remote Reply
Original Comment URL
Your Profile
Screen Power Saving in the Linux Console – John Goerzen:
https://changelog.complete.org/archives/42061-screen-power-saving-in-the-linux-console
Remote Reply
Original Comment URL
Your Profile
`setterm –blank=force` should work for you as it is emulated well for KMS
If you use a timer (`setterm –blank=5`) you may have to
`echo N >/sys/module/drm_kms_helper/parameters/fbdev_emulation` to stop the frambuffer device emulation interfering