Tuesday, November 12, 2019

GAudio is very fun and... problematic

Month:1, Week: 3

Another week spent debugging and figuring out the reference system of GAudio and potential problems that can occur. The bugs that came out during testing are somewhat inconsistent and XAudio2 threading adds up to the difficulty of the problem.

Some of the flaws I observed in the “original” design with just the call to cleanup in GSound audio end event:
-If the sound was never played the event will never happen
-If decrement of the GSound happens after the sound ended and stopped, the full cleanup will never happen

The solution I ended up implementing fixed the memory leaks, but at the cost of flawed behavior (cuts the sound too early on deletion), so I need to find a middle ground solution that has the correct event system AND doesn't leak memory in some cases.

The problem seems to be pretty tough to fix and a lot of people seem to experience the same problems in the past with XAudio library, but at least I feel fairly confident in understanding GAudio library at this point and hopefully can figure out the proper implementation really soon.

No comments:

Post a Comment