Realtek audio card may really take some time to return audio device status. Visually it looks like svchost.exe process loads CPU up to 10-15% when SetupDiGetClassDevs API function is called. I haven't researched this issue in-depth, so not sure what the root of the issue is, but I suspect it has something to do with Realtek drivers or software.