Any way to force loading of all sound assets into cache?

Need help running G/Q/ZDoom/ECWolf/Zandronum/3DGE/EDuke32/Raze? Did your computer break? Ask here.

Moderator: GZDoom Developers

Forum rules
Contrary to popular belief, we are not all-knowing-all-seeing magical beings!

If you want help you're going to have to provide lots of info. Like what is your hardware, what is your operating system, what version of GZDoom/LZDoom/whatever you're using, what mods you're loading, how you're loading it, what you've already tried for fixing the problem, and anything else that is even remotely relevant to the problem.

We can't magically figure out what it is if you're going to be vague, and if we feel like you're just wasting our time with guessing games we will act like that's what you're really doing and won't help you.
Post Reply
User avatar
Korell
Posts: 439
Joined: Sun May 28, 2017 1:01 pm

Any way to force loading of all sound assets into cache?

Post by Korell »

I'm just wondering if there is any way of forcibly loading all of the IWAD and PWAD sound assets into cache. Why do I ask? Well, I've noticed that at certain points whilst playing the game will momentarily pause (which I imagine is whilst it loads up the sound) and then plays the sound and carries on as normal. Typically I notice this the first time I come across a secret and the secret sound plays, but it only happens once and then any other secrets don't cause this momentary pause, which is why I believe it is to do with GZDoom loading the sound file into cache. I've also noticed this behaviour when playing with some mods (notably weapon mods) when some new sound needs to be played for the first time.

This is something that I've seen happening on a number of GZDoom versions for quite some time now, I think maybe even going back to the 2.x.x versions. But if there's a way of forcing all sounds to be loaded when starting the game then maybe it would stop any momentary pauses during gameplay.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Any way to force loading of all sound assets into cache?

Post by Rachael »

This has been asked before and again and again the response is always "no, there's not".

But one thing you can do is try and copy the wad files to "nul" in the command prompt to force Windows to load it into the file cache. It works, at least for a little bit, until Windows has to purge the cache to make room.

Alternatively, you can use a RAM Disk as a backing store for your mods while you are playing them.
User avatar
Nash
 
 
Posts: 17433
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Any way to force loading of all sound assets into cache?

Post by Nash »

I also face the same problem as OP, but it's not just limited to GZDoom. Other games show a similar problem too. But it happens more frequently with GZDoom. Especially that "secret found" sound. :P
User avatar
Caligari87
Admin
Posts: 6174
Joined: Thu Feb 26, 2004 3:02 pm
Preferred Pronouns: He/Him
Contact:

Re: Any way to force loading of all sound assets into cache?

Post by Caligari87 »

I suppose if you really wanted, you could make a fake loading screen at the beginning of the map and play each possible sound off a list at zero or essentially-inaudible volume.

8-)
Blue Shadow
Posts: 4949
Joined: Sun Nov 14, 2010 12:59 am

Re: Any way to force loading of all sound assets into cache?

Post by Blue Shadow »

Caligari87 wrote:I suppose if you really wanted, you could make a fake loading screen at the beginning of the map and play each possible sound off a list at zero or essentially-inaudible volume.

8-)
For that you could instead use PrecacheSounds in [wiki=GameInfo_definition]the gameinfo block of MAPINFO[/wiki].
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Any way to force loading of all sound assets into cache?

Post by Graf Zahl »

I had similar problems with various software when I was still using a magnetic hard drive. Once I switched to an SSD all these HD access issues magically disappeared.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Any way to force loading of all sound assets into cache?

Post by Rachael »

That may be, but not everyone can afford SSD's, and for those who can't, but who have a lot of RAM to spare, IMDisk is a very good solution.

You can create a 512 MB RAM disk, put your mods and GZDoom inside of it, and run GZDoom from that. Everything is guaranteed to remain cached in memory at all times, provided of course you told the driver to do that (and to not use the paging file).

Things get a bit more touchy if your computer crashes or loses power - but provided that doesn't happen you can always move the save games off the drive (or alternatively, save the drive as an image file to load back later).

I actually use a RAMDisk myself to store my Temp folder - read a file once, it's utterly senseless to use the disk to store things that are meant to be removed later.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Any way to force loading of all sound assets into cache?

Post by Graf Zahl »

Rachael wrote: I actually use a RAMDisk myself to store my Temp folder - read a file once, it's utterly senseless to use the disk to store things that are meant to be removed later.
True. Especially when you consider how much software doesn't delete its temporary data. I have to do monthly manual cleanup on that.

Regarding magnetic HDs, is it just me or do the OS makers put less focus on making them run well as a system drive? It wouldn't surprise me if a few years down the line it will become impossible to run an OS from them at all.
User avatar
Rachael
Posts: 13530
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Any way to force loading of all sound assets into cache?

Post by Rachael »

I think it's true actually, regardless of legitimate continued use of magnetic hard drives. Don't ever buy a gaming system with one though - it simply will not run well anyway.

And I can speak from personal experience when I say SSHD's are shit. They're basically a rip off - a magnetic HDD with a SSD chip to act as a cache. There's nothing there that RAM can't solve and a decent disk cache such as what Windows has solves all the problems this was supposed to solve to start with anyway - the performance gain from such things is marginal at best.
Post Reply

Return to “Technical Issues”