Closed nullpainter closed 6 years ago
Actually sounds great - I also use this on a laptop and it hits the fan hard. I wonder also, maybe MAME can be run as a lower priority thread? I wonder if that would have an effect?
I wonder if some things mentioned here might also have an effect on how high the CPU usage is while MAME is running... https://wiki.mamedev.org/index.php/FAQ:Performance
MAME itself also has many options that can increase your speed:
- Lower the sound quality. Try adding -sr 11025 to the command line, which will decrease sound playback quality and use less processor time. This mostly affects games that use discrete audio.
- Disable the joystick and use the keyboard (-nojoy).
- Use frameskip to speed up animation. Frameskip skips a certain number of frames per second, so your system does less work. Sometimes the trade-off is choppy animation; sometimes the difference is negligible. Experiment. While playing, press F8 / F9 to control frameskip; or set global frameskip in mame.ini. Some games don't benefit from frameskip though, for example the newer Williams bitmap graphics games or the Atari filled polygon games.
None of these things will help with switching off the screen but might help with the cpu usage while the screensaver is running...
Interesting there seem to be other command line options which could be used maybe to make MAME not so intensive: https://docs.mamedev.org/commandline/commandline-all.html#core-performance-options
I think in my case, the 50 Chrome tabs and 3 VS instances may not be helping 😉
I'm less concerned about high CPU during screensaver operation - after all, those can all be set by the user in their mame.ini
or in the screensaver configuration - and more about the screensaver not being a good citizen and doing what it ought with power saving.
I've turned my PoC into production-ready code and will send a PR over later today.
It's working really well and I've added logging to make its operation obvious. The only thing I noticed is that after switching from AC to DC and disconnecting external displays, the current MAME instance freezes. Not sure yet whether this is an us issue or a MAME issue. In any case, the sleep timer still runs so probably not something to worry too much about.
Yeah true - all these can be set by the user - plus after playing with the settings none of them really helped - the fan still spun like mad - so not much use there...
@andyvans and I were chatting the other day about power management, as it doesn't make much sense for MAME to keep running while the screen has gone to sleep. Apart from environmental concerns, my laptop's fan ends up sounding like a jet engine in the morning.
Unfortunately it appears that MAME prevents the screen (and computer!) from going to sleep so the obvious solution of interrogating power events won't work.
Instead, I have a PoC which:
What do you think? It's not the most beautiful approach, but it seems to work well. We can also extend this to read computer sleep configuration.