I've had a pretty rough week;
My hard drive crashed. Luckily I was able to recover my data and learned an important (and expensive) lesson on backing up your data. But I needed to get a new hard drive and a Windows 10 license. After getting all my ducks in a row in regards to my data, I decided to upgrade my Visual Studio to the latest, seeing as I was working with 2012. This seems to have caused a huge problem.
Prior to this, my little game ran smoothly. Now however, it is an unplayable slideshow. The culprit appears to be my audio system. This system has an update method which loops through my sources and streams audio to them if need be. This function is called constantly in a separate thread, using a unique_lock and a mutex. Playing/Pausing/Stopping audio or altering audio source properties would make use of the unique_lock and mutex as well.
I have a moving audio source in a test scene. As such, it updates its position constantly, grabbing the lock. Before the crash the program ran perfectly fine; now its pretty much frozen. I was aware that contests for mutexes are somewhat slow, but now its having issues for entire seconds. And the longer the program goes on, the more slow it seems to get. Removing the mutex makes the game run smoother, but of course errors abound that way.
I am driving myself mad trying to suss out what's happening here. Things were perfectly fine a week ago. What can I do?