BizHawk icon indicating copy to clipboard operation
BizHawk copied to clipboard

Feature Request: Load CDs fully into memory

Open Meerkov opened this issue 4 years ago • 7 comments

https://github.com/TASVideos/BizHawk/issues/2674

Summary

When loading CDs from hard drives, the hard drive will eventually spin down (possibly every few minutes). This causes 10+ seconds of stuttering while the emulator waits for the hard drive to spin back up.

This can be resolved by fully loading the CD into RAM.

Zeromus recommends that this should not be fixed, but instead should be an optional setting.

Recommendation

  1. Create an Option in the settings menu to load CDs into memory.
  2. Make that option the default for desktop builds (I'm assuming the reason we don't want it always on is for mobile builds with low RAM).
  3. Consider setting the option automatically based on system resources available

Meerkov avatar Mar 24 '21 20:03 Meerkov

Correction: the hard drive will eventually spin down on systems that have been configured to spin down the hard drive

  1. Don't hold your breath.
  2. Won't be done, as it takes a long time to load a big disk
  3. Won't be done, because it isn't about RAM but about loading lag.

Hope your expectations have been appropriately set.

zeromus avatar Mar 24 '21 20:03 zeromus

I'm not sure why the file can't be loaded into RAM asynchronously, and then swapped from live-disk to RAM when it's ready.

Meerkov avatar Mar 24 '21 20:03 Meerkov

I'm not sure why you think I said it can't be done

zeromus avatar Mar 24 '21 20:03 zeromus

I have a better idea. Let's read sector 0 repeatedly with a file opened with FILE_FLAG_NO_BUFFERING so the disk can never go to sleep

zeromus avatar Mar 24 '21 21:03 zeromus

Oh, this may be even better

https://stackoverflow.com/questions/8733457/how-to-programatically-prevent-windows-from-hard-disk-drive-spin-down

I would propose to simply add that as a general preference (not core specific) that you can check.

zeromus avatar Mar 24 '21 21:03 zeromus

Keep-aliving the disk occurred to me as an alternate solution as well. That solution is probably easier to implement. Keeping the disc on isn't optimal IMO, but it's probably sufficient as a solution.

Edit: The comment below points out that power consumption by the game itself likely dwarfs the power consumption of the disk. I think that reasoning sounds convincing.

Meerkov avatar Mar 24 '21 22:03 Meerkov

You're playing a video game, I couldn't care less about how much power is getting used by a disk. I think the solution may even by optimal from my POV

zeromus avatar Mar 24 '21 22:03 zeromus