stsaz / fmedia

fast audio player/recorder/converter
BSD 2-Clause "Simplified" License
216 stars 21 forks source link

Record IAudioClient_Initialize 0x80070005 Access is denied #71

Closed tomoyo255 closed 2 years ago

tomoyo255 commented 2 years ago

Hello,

I regularly use fmedia (which I upgraded to latest 1.27.2 AMD64) to record audio over a Steinberg UR22C audio interface. Since recently, it doesn't work anymore. Recording now always leads to this error message:

21:06:08.876 :29e4 [error] wasapi.in: *2:   open device #0: IAudioClient_Initialize: -2147024891 (0x80070005) Access is denied.   format:int16/44100/2

My Windows version:

Microsoft Windows [Version 10.0.19043.1645]

Would you have any clue on what's happening? If you need more information, please don't hesitate asking.

Thanks. Regards.

stsaz commented 2 years ago

Hello!

Microsoft Windows [Version 10.0.19043.1645]

Seems like a recent update, April 2022.

First, try to search for answers with IAudioClient_Initialize E_ACCESSDENIED. I found this:

https://social.msdn.microsoft.com/Forums/en-US/2485e1e4-ac0a-4c79-af79-0e4b9e0d3588/iaudioclientinitialize-with-audclntsharemodeshared-fails-with-eaccessdenied

MS says the microphone can be disabled in Windows settings - is this the issue?

Next, try to fiddle with the Windows's audio settings for Recording Devices.

Next, try to force fmedia to use exclusive mode. Set exclusive_mode 2 in fmedia.conf here:

mod_conf "wasapi.in" {
...
    exclusive_mode 0

I won't be able to reproduce the problem myself, because I don't have the same Windows 10 version. (On my Windows PC fmedia works fine.)

tomoyo255 commented 2 years ago

Hello!

Microsoft Windows [Version 10.0.19043.1645]

Seems like a recent update, April 2022. (...) MS says the microphone can be disabled in Windows settings - is this the issue? (...)

Indeed, I didn't know about Microphone Privacy Settings. One of the latest updates must have either introduced it or reconfigure protection to disable access to the microphone to all apps.

The configuration has a big switch in the first place that says on/off at a global scale (Allow apps to access your microphone). It was off.

Then, the configuration allows to opt in/out apps of the Microsoft Store on an app basis on the one hand and, on the other hand, to opt in/out globally desktop apps (the usual exes) (Allow desktop apps to access your microphone). When grayed out it was obviously off, but when I enabled aforementioned big switch on, this was already implicitly on actually.

Thanks. Regards.

MicrophonePrivacyBigSwitch MicrophonePrivacyDesktopAppSwitch MicrophonePrivacyFMedia

stsaz commented 2 years ago

Nice! I'm gonna include it into Troubleshooting document.

stsaz commented 2 years ago

95cf945