Game rot... from a windows update? idk. OpenAL suddenly very slow. Tons of IO operations.

Started by
1 comment, last by JoeJ 1 year, 5 months ago

So I finished my c++ OpenGL/OpenAL in ~Dec 2-0-2-2-~ EDIT: I meant Dec 2020

I was reminiscing on that hard work. I made the engine from scratch and feel a bit of pride on that project. So I decided to play it again.

Now I haven't touched this project in roughly 2 years. I haven't changed computers. I haven't updated OS. I still have the same hardware with windows 10. I've done some windows 10 updates… but other than that nothing has changed.

I load up the first level in the campaign… and instead of my buttery 60 frames per second. I am presented with horrific audio clipping and gameplay at the frame rate of something like 5 FPS.

I test on 2 other computers I have. Same result. Something has destroyed my game's performance.

I break out the original visual studio .sln and compile the project. same issues.
So I drop a breakpoint in the main loop, tell visual studio to capture cpu performance, and let the game run for a bit.
I hit that break point, stop the CPU capture.

And the issue is right there in my face… 99% of time is spent doing IO operations.
So what in the world – I haven't touched anything?
All of the symbols are missing, and I get random addresses in some dll.
But fortunately, drilling down deep enough, I see it is coming from something related to audio…

Since it is related to IO – I assume it is some disk operations… I comment out the code that loads my audio files into buffers for OpenAL.
My performance issues disappear.

My project isn't set up the greatest, it is just using a OpenAL32.dll I built from OpenALSoft.
So I decide to rebuild the dlls.
Turns out, I think I was using a debug OpenAL32.dll – but nevertheless I never had performance issues.
I built a new debug dll and got a .pdb from it, so I can read debug symbols.

Sure enough, profiling in visual studio with symbols shows OpenAL callstacks.
Going into windows sound code. (I forget the names).
I saw a lot of stl code… mutex locks… I didn't look to deeply.

I compiled the release version of OpenAL soft's code and put that next to my executable.
my game is suddenly back to 60fps…
I test it on my other computer, and it isn't quite 60FPS. (it used to be).

So I'm not sure what exactly changed, but something did.
I still have performance that isn't as great as it used to be.
But at least I can play the game I poured so much time into.

I'm still pretty upset that – maybe a windows update? – was detrimental to my game.
My project is definitely set up poorly.
I need to set it up to be a proper cmake project, so I can build it on other platforms.
I'm assuming the OpenAL32.dll is reading some windows dll internally – that got updated with a windows/visual studio update.
Maybe if I had static linked OpenAL it would have compiled the old code into its library and not depended on whatever got updated. idk.

So, that's the end of my story.
Not sure there is any real moral to it.
Other than maybe set up a project properly.
And record a video/stats/csv of previous performance to be able to quantify performance regressions.

Because today I learned, you don't even have to touch your project for a bug to arise.

My tutorials on youtube: https://www.youtube.com/channel/UC9CQOdT1A9JlAks0-PF5vvw
Latest Tutorials:
A simple and intuitive ray triangle intersection algorithm https://youtu.be/XgUhgSlQvic

Möller Trumbore ray triangle intersection explained visually https://youtu.be/fK1RPmF_zjQ

Setting up OpenAL c++ visual studio https://youtu.be/WvND0djMcfE

Advertisement

mattstone2728 said:
Because today I learned, you don't even have to touch your project for a bug to arise.

I can confirm it's normal projects tend to rot if you don't touch them for years. Mostly due to libraries or other 3rd party stuff.
The last big issue i've had was with Havok physics. I've used its math lib a lot, but due to changes on MSVC the old dlls became incompatible and i had to replace all of it, just because of some silly C string function Havok had used for logging.
It's a good idea to compile and update old projects once a year to prevent a total loss.

But it's not really that bad i think. It forced me to do some work i've had postponed over many years.
And you have found an issue with using a debug dll by accident. Likely it also shows you another issue, e.g. loading many small audio files during gameplay, which may require a better solution for future projects.

mattstone2728 said:
I've done some windows 10 updates…

I doubt that you did this.
Having no more control over doing updates or not is a main reason i'm no longer willing to pay for Windows. I use a free evaluation version which needs reinstall each 3 months.
Which isn't that bad either, as it forces me to keep a clean and fresh system. \:D/

This topic is closed to new replies.

Advertisement