System lockup when logging into RetroAchievements with WASAPI driver

Hi all,

I can certainly make a github issue for this but I wanted to see if anyone has ever experienced this since I what I think is the root cause is pretty unexpected (to me anyway).

After upgrading to 1.9.0, or compiling from source, every time I load content with RetroAchievements enabled, my computer will completely lock up. I have to hard reset the machine, and afterwards there is nothing in the RA log, in Windows event viewer, or in any memory dumps.

The lockup is also non-deterministic in that it happens at different frame counts - that is the content loads, but the freeze happens at different points after the game has started running. The second thing I noticed is that it will happen even if I remove my RetroAchievements username, password/token, or both. Here’s a picture of one instance:

This screenshot was from a test where I intentionally gave it a bad password. If I instead give it no password, a different error message appears ("“Missing RetroAchievements account information.”" which is expected) but I still get the freezeup. Sometimes the message won’t finish displaying before the freeze.

Using a default retroarch.cfg (edited to enable achievements), the problem went away. After methodically changing settings one at a time in my config, I finally found the culprit - WASAPI audio drivers being used in exclusive mode! Using another driver like xaudio, or starting Retroarch with wasapi running in shared mode both prevent the problem from occurring. Also, if you start running in exclusive mode and switch to shared before loading content, I still get the freeze.

Has anyone ever seen this or have any ideas on how an audio driver could cause a freeze when trying to connect to RetroAchievments? I am running Win 10 version 10.0.19041. Thanks!