karlstav / cava

Cross-platform Audio Visualizer
MIT License
3.92k stars 225 forks source link

console blanking behavior after stopping cava #535

Closed bdmillan closed 7 months ago

bdmillan commented 7 months ago

I run RaspiOS Lite Bookworm on a venerable Model 1B. Cava works nicely on my 7" 1024x600 hdmi screen. No graphical desktop, so framebuffer I guess. However I use the unit for other tasks. I have 'consoleblank = 0' set in /boot/cmdline.txt. So the screen never blanks. But, after running Cava, the screen will blank 10 minutes after Cava is stopped with CTRL-C. I've been unable to revert to the non-blanking behavior without a reboot. Tried setterm -d and setupcon, but it still blanks after 10 minutes. I'd like to reverse what it is that Cava does to the console setup in a script that I can tack on to one of my other tasks. So I guess what I'm asking is How can I revert the tty terminal state to where it was after booting, without rebooting? What is it that Cava does that would allow screen blanking after it halts? Thank you for any insights you might have.

karlstav commented 7 months ago

Looks like cava disables blanking itself at startup and then sets it to 10 at exit. This was something I stuck in there for my own part not thinking it would affect other people. I think having the option for cava to disable the blanking is still nice to have. I will change it to an option (default don't disable blanking) and also just remove the re-enabling.

As a temporary workaround just do:

setterm -blank 0

After exiting cava

bdmillan commented 7 months ago

Thank you for the explanation. For my part, I am happy to just place the setterm -blank 0 at the top of the two or three scripts I might use in order to re-initialize the screen. Really, the problem was I didn't know the correct way to do it. I thought setterm -d would do the trick. In any event, I appreciate the response and the work you do on Cava.