HDD access all the time to play sounds(FMOD related?)

12
Comment below rating threshold, click here to show it.

BlobPower

Senior Member

12-26-2011

Summary:
The game uses the audio streaming feature from the FMOD libary for most if not all sounds. This means the sounds are loaded when they are played, freezing the game until they are loaded. The libary would also allow to load all needed sounds before the match, play them from memory and not freeze anything.

As it is now, the game runs better if somebody has a better HDD, but it should be very easy for the devs to change that. A PC with slow HDD would run the game faster after the change, than a PC with a fast HDD does now.

--------------------------------------------------------------------------------------------------

When playing LoL, the game accesses these 3 files over and over:
LoL\RADS\projects\lol_game_client\filearchives\0.0 .0.37\Archive_66209360.raf.dat
LoL\RADS\projects\lol_game_client\filearchives\0.0 .0.43\Archive_66209680.raf.dat
LoL\RADS\projects\lol_game_client_en_us\managedfil es\0.0.0.59\DATA\Sounds\FMOD\VOBank_en_US.fsb

This can easily be confirmed with Process Monitor from Sysinternals(Microsoft).

If the all sounds are disabled the sounds access does not happen. If all sounds are muted, but not disabled, then all HDD access still happens. So this isssue is clearly related to the sound code of the game.

The amount of data that is read here is so small, so that it wouldn't be a problem to completely read it into memory and play the sounds from there. That shouldn't even be a problem on 1GB RAM systems. Since riot ignored this issue for months now, i'm trying to explain why this HDD access is bad:
1. It slows down the game. Maybe not much, but the slower the HDD, the more the slowdown. File access has an access time of a few ms, and then the data needs to be read into memory, which also takes a few ms. If the sounds were already in memory those 2 steps could be skipped. And they might happen on every sound or voice that is played.
2. It could cause lag when abilities are used, especially if the HDD is busy with something else at this time, like reading a bunch of other sounds in team fights. Also, anybody listening music in the background?
3. It wears down the HDD. Ok, i think that it's really just a tiny bit, but still worth mentioning in my eyes.

Leage of Legends uses FMOD Ex Programmers API version 4.32.07 to play its sounds. That version is almost a year old, but that doesn't have to be a bad thing by itself. I can't determine if it's LoL or FMOD causing this issue, using version
4.32.00 doesn't get me any sounds
4.34.00 only gets me voices, but no sound effects. The game only accesses the 3rd file with this and is constantly logging the error that it can't play the other sounds. This looks like a change in FMOD and not like a problem(just saying).
4.38.05 doesn't start the game at all. Again, this looks like a change in FMOD, not like a problem.

Anyways, this is everything i can test and from this i can't tell if the HDD access is riot's or FMOD's fault. There are 2 changes in FMOD that might be worth looking into though:
- Add asynchronous I/O support
- Streams that have priority 0 now are -not- affected by FMOD_INIT_VOL0_BECOMES_VIRTUAL flag. Saves pointless disk access.
Both changes on 4.33.00.

Maybe the FMOD_INIT_VOL0_BECOMES_VIRTUAL flag or some similar flag is causing the engine to load the sounds on demand instead of loading them into memory and playing them from there. Asynchronous reads would be better than non asynchronous reads, but using those would only be a half fix, because the HDD access all the time would remain.

So, and now riot can continue to ignore this, thank you for reading.


Comment below rating threshold, click here to show it.

BlobPower

Senior Member

12-30-2011

Bump.


Comment below rating threshold, click here to show it.

I BE MATT

Senior Member

12-30-2011

so what does all that mean lol, i dont understand it :P


Comment below rating threshold, click here to show it.

BlobPower

Senior Member

12-31-2011

This means the game could run smoother, especially on systems with slow HDDs. And from a technical point of view, it's a trivial solution that shouldn't need to even be mentioned.


Comment below rating threshold, click here to show it.

BlobPower

Senior Member

01-24-2012

It's totally understandable that this and other stuff was ignored in the last few weeks, holidays and a patch with the color blind mode, 1 new champion and 1 champion rework do not leave room for much else. But now there should be time to look at this. Maybe some newer FMOD version also improves the performance and/or overall stability, just saying.


Comment below rating threshold, click here to show it.

BlobPower

Senior Member

02-01-2012

Update:
Thanks to the nice people on the official FMOD forum, now i know 2 things:
1. This is not a FMOD issue
2. The game is using streaming audio, which is a nice feature for lots of sounds, including background music for example

And it's highly possible that this a non issue overall, but i'm not 100% convinced yet.

Since the game is reading from the archive files and the VOBank_en_US.fsb file, i believe, it's streaming 2 different kinds of sounds. So i think, it's streaming the background music AND voices or sound effects. Streaming the backgound music is perfectly fine, but streaming sounds for things that are linked to events, that sounds bad.

A red reply telling which kind of sounds are streamed would be nice. And if more than the background music is streamed, i like to hear the reasoning behind this. Maybe there's a good reason for this, and then i'd like to understand it.


Comment below rating threshold, click here to show it.

BlobPower

Senior Member

03-05-2012

Update:
Now i'm sure this issue has lost me many early game fights. And now i know that the game has not finished loading after ... wait for it ... finishing loading.

Test:
1. Start a custom game with Teemo and 9 bots
2. While loading, start copying some big file(several GB) on the HDD where LoL is installed to the same HDD
3. Notice that the loading stays really long at 100%
4. Notice that the game lags horribly for the 1st 10 seconds of the game. Without copying a file it's < 3 seconds for me, and i always thought my GPU was too slow to display some graphics effect.
5. Go to the golems and level blind
6. When the golems spawn cast blind on them and notice that it lags. Edit: Without copying something, there's no lag. But sometimes there are 4 champons using their 1st skill for the 1st time + summoner spells in a very short time, that might lag even with an ok HDD.
7. Go into the bush and repeat
8. To see that only the 1st time you use blind it lags. But this could be related to my system caching the read in my RAM, there's no way to check if it actually tries to read the sound again.

So the game DOES LAG when you use skills for the 1st time, and it IS related to the HDD. This is not proof that loading the sounds is responsible for this, but if it isn't then what is causing this? Is the game also loading graphics only when actually(...) needed? That would make even less sense than loading the sounds from HDD while playing.

PS: I'm 100% sure it's the same with almost all champions if not all
PPS: I have enountered a few bug splats at step 4 in normal games when opening the shop early. This might be related, maybe not, but since i wait until 10 seconds into the game, i don't have any bug splats anymore.
PPPS: The fps are at around 30 with and without copying a file


Comment below rating threshold, click here to show it.

BlobPower

Senior Member

03-20-2012

Bump.

Summary:
The game uses the audio streaming feature from the FMOD libary for most if not all sounds. This means the sounds are loaded when they are played, freezing the game until they are loaded. The libary would also allow to load all needed sounds before the match, play them from memory and not freeze anything.

As it is now, the game runs better if somebody has a better HDD, but it should be very easy for the devs to change that. A PC with slow HDD would run the game faster after the change, than a PC with a fast HDD does now.


Comment below rating threshold, click here to show it.

BlobPower

Senior Member

03-23-2012

bump


Comment below rating threshold, click here to show it.

BlobPower

Senior Member

03-28-2012

Bump.


12