GNU/Linux, disable screen blanking on text console (tty1) - Page 1
Forum section: electronics / general

author: DiTBho
author_rank: Super Contributor
timestamp: March 27, 2025, 09:45:37 pm
content: Code:setterm -blank 0 -powerdown 0 -powersave off >/dev/tty0 </dev/tty0it this correct to disable the screen blanking on the { /dev/tty0 /dev/tty1 } text consoles?

author: DiTBho
author_rank: Super Contributor
timestamp: March 27, 2025, 09:50:40 pm
content: it doesn't work on my Apple MacMini, PowerMac-G4After 1 min of inactivity (no keypressed on the usb-kb), the screen goes blanking.

author: Whales
author_rank: Super Contributor
timestamp: March 27, 2025, 10:05:36 pm
content: Can you edit the kernel boot arguments? I believe consoleblank=0 is what you're after.

author: radiolistener
author_rank: Super Contributor
timestamp: March 27, 2025, 10:10:46 pm
content: yes, you can add kernel boot cmdline argument consoleblank=300, where 300 is the desired timeout for display blank on virtual terminals

author: DiTBho
author_rank: Super Contributor
timestamp: March 27, 2025, 10:50:00 pm
content: Isn't there any userspace option to set it?I cannot reboot the machine at the moment.

author: radiolistener
author_rank: Super Contributor
timestamp: March 28, 2025, 12:39:36 am
content: Quote from: DiTBho on March 27, 2025, 10:50:00 pmYou can see current setting withCode:cat /sys/module/kernel/parameters/consoleblankbut it looks that this parameter is read-only, so it seems the only way to change it is to reboot the systemJust triedCode:setterm -blank 0it seems that it works for me

author: DiTBho
author_rank: Super Contributor
timestamp: March 28, 2025, 05:15:56 am
content: Doesn't work hereProbably not supported (kernel side?), and it's not clear why it's not as it should be

author: DiTBho
author_rank: Super Contributor
timestamp: March 28, 2025, 06:58:18 am
content: Code:Documentation/kernel-parameters.txtconsoleblank=  The console blank (screen saver) timeout inseconds. Defaults to 10*60 = 10mins. A value of 0disables the blank timer.(kernel 2.6.39)

author: DiTBho
author_rank: Super Contributor
timestamp: March 28, 2025, 07:00:35 am
content: Meanwhile, I am migrating part of the running tasks to an other node, so I will be able to reboot.

author: thephil
author_rank: Regular Contributor
timestamp: March 28, 2025, 08:50:01 am
content: Quote from: DiTBho on March 27, 2025, 09:45:37 pmTo my knowledge,Code:setterm -blank 0Should do the trick. I wasn't sure if that was the same on the ancient 2.6 kernels, but I think it was. I am not so sure why you redirect STDIN and STDOUT. Maybe it has to do with that?I also found an old thread where someone didn't have setterm available and worked around it by sending a control string to the console:Code:printf "\033[9;%ld]" 0https://www.linuxquestions.org/questions/linux-server-73/how-to-disable-console-blanking-in-text-mode-780272/

author: DiTBho
author_rank: Super Contributor
timestamp: March 29, 2025, 12:49:53 pm
content: I ended up hacking the kernel.I removed all the calls the framebuffer blanking functions.Dunno why other user space methods didn't work.I will investigate in the future

author: radiolistener
author_rank: Super Contributor
timestamp: April 03, 2025, 06:38:04 am
content: what is the reason to change kernel code if you can completely disable it with a simple kernel option?

author: DiTBho
author_rank: Super Contributor
timestamp: April 03, 2025, 11:10:56 am
content: Quote from: radiolistener on April 03, 2025, 06:38:04 amBecause it didn't work either with a kernel option, and I had no time to investigate, as I have other issues to solve.

author: madires
author_rank: Super Contributor
timestamp: April 03, 2025, 11:46:09 am
content: It's quite simple (Debian/Ubuntu based):- edit /etc/default/grub- set GRUB_CMDLINE_LINUX="consoleblank=0"- run update-grub- reboot

author: DiTBho
author_rank: Super Contributor
timestamp: April 03, 2025, 12:39:34 pm
content: Quote from: madires on April 03, 2025, 11:46:09 amDo you think I don't know how to use a bootloader ?It didn't work even recompiling the kernel with that parameter passed via built-in kernel parameter!It sounds something broken with the kernel driver.

author: DiTBho
author_rank: Super Contributor
timestamp: April 03, 2025, 12:40:30 pm
content: So, as a temporary solution to enable/disable the blanking, this morning I implemented a kernel moduleProbably wrong philosophy, but it's a simple char-dev which registers a special dev-name "/dev/vt-blanking".Code:# echo "0" > /dev/vt-blankingradeonfb: blanking disabled# echo "1" > /dev/vt-blankingradeonfb: blanking enabledI removed (commented /**/ ) all the video blanking function calls from the vt.c module;the new module I wrote acts directly on the radeonfb kernel module functions,which in turn have created directly on the hw configuration bits of the video card.Code:~ drivers/tty/vt/vt.c~ drivers/video/aty/radeon_base.c~ drivers/video/aty/radeon_monitor.cCode:int radeon_screen_blank(struct radeonfb_info *rinfo,int blank,int mode_switch){...In practice, it invokes radeon_screen_blank() to enable/disable the circuits that generate the v_sync and h_sync synchronisms.It works well. It's fine like this, for now

author: DiTBho
author_rank: Super Contributor
timestamp: April 03, 2025, 12:43:53 pm
content: Now, there is no timer, blanking is instant.One thing I like even more, because of how I need it to work this way!The "timer" that triggers the blanking also seems to have problems.Another thing I need to investigate. Smells broken.

author: DiTBho
author_rank: Super Contributor
timestamp: April 03, 2025, 12:46:44 pm
content: Meanwhile, I am planning to mirate from kernel v2.6.39 to v6.15-rc1.blanking might also work, it might be a problem they've already fixed.A got a second mac-mini/PPC with 2Gbyte of ram. It will be tested there.Next weekend

author: madires
author_rank: Super Contributor
timestamp: April 03, 2025, 01:43:22 pm
content: Kernel 2.6.39 was released in 2011.

author: DiTBho
author_rank: Super Contributor
timestamp: April 03, 2025, 03:28:30 pm
content: Quote from: madires on April 03, 2025, 01:43:22 pmThere is no point in upgrading a 24h/7 server if it is not strictly necessary,Especially if there are hw peripherals (proprietary drivers, e.g. USB-2-Canbus) that are not supported starting from kernels 3.Also, it is not that the recent kernels are much better than those of 2011, since there is much less interest in PowerMacs.

author: DiTBho
author_rank: Super Contributor
timestamp: April 23, 2025, 11:36:30 pm
content: I recently got an IBM laptop model T23 (Pentium3), for 20 euro on eBay. It's old but it's very good to be used a vt100 serial terminal (with { gnu/screen, minicom, ... } ).Anyway, I discovered the savagefb kernel driver is buggy.It correctly detects a VGA display if connected, but does not handle a screen-blanking correctly: it's like a black hole, once the external CRT goes blanking, there is no way to get it back.Wrote a very rude patch ... for this

author: artag
author_rank: Super Contributor
timestamp: April 24, 2025, 07:37:02 pm
content: In trying to stop a machine blanking recently I came to the conclusion that there were 3-4 different methods to invoke screen blanking and at least two, perhaps 3 were active. So adding a new mechanism because they didn't understand the existing ones is likely why it keeps acquiring new methods, possibly with progressively shorter timeouts so they appeared to work.Frustrating though it is, I'd discourage you from adding yet another mechanism until you've determined how and when to disable the others. And writing that up would be a huge service to the community.