Dn-FamiTracker icon indicating copy to clipboard operation
Dn-FamiTracker copied to clipboard

Properly terminate stuck audio thread when closing the program

Open nyanpasu64 opened this issue 3 years ago • 0 comments

I observed the audio thread to get stuck waiting for room to write audio, on a Windows 7 machine with an stuck audio daemon (audiodg.exe). It happens intermittently due to either bad apps, a broken audiodg.exe or APO plugin, or bad sound drivers (not sure which).

To make it work, I had to switch CSoundGen to shared_ptr ownership, which is an improvement to code maintainability in general (avoids the possibility of dangling pointers). This is a prerequisite for future refactorings.

I also fixed the audio thread burning CPU when audio isn't running (due to no audio devices, an audio initialization error, etc.).

This should be correct? I'm not confident lol

nyanpasu64 avatar Aug 03 '22 20:08 nyanpasu64