none
Access denied when calling IAudioClient::Initialize

    Question

  • I'm having trouble getting sound out of a system upgraded to Vista from XP and I believe it's related to the new Vista audio engine.  I tried completely removing my Audigy2 ZS and switched over to my on-board AC'97, but still no sound. However, a fresh install of Vista to another partition works perfectly. Vista level II support and I have tried everything: uninstalling drivers, re-installing drivers, even installing codecs.  I think they're going to give up on me soon.

    Being a software developer, I decided to take matters into my own hands.  I downloaded the Windows SDK for Vista and stepped through the WinAudio sample to see what I get back from the API.  It turns out when I call the IAudioClient::Initialize method it always returns E_ACCESSDENIED (0x80070005).

    Any ideas on what could cause this return value?  I'm thinking it's some kind of underlying registry or file system permissions problem. Is there any way to verify that the audio engine is installed correctly or re-install it?  Or is there a way to tell the Vista upgrade installer to re-install the engine?

    I want to keep this upgrade installation going and not start over fresh for sentimental reasons.  That's because this installtion is 13 years old!  That's right, I've been upgrading hardware and Windows versions in this installation since Windows 3.1!  Help me guys, I don't want Vista to be the one that breaks the streak!

    Saturday, March 24, 2007 7:48 AM

Answers

  • You guys should have hired me when you had the chance!  I solved this one on my own, the 13 year old partition survives yet another upgrade.  Looking at some of the diagrams of the audio engine architecture seemed to point out that exclusive mode is more of a direct connection to the driver, while shared mode connections go through a few components first.  Since E_ACCESSDENIED is a COM security error, I began to think that the problem was not in the security configuration of the file system or the registry, but of COM itself.  So I compared the default access permissions in Dcomcnfg of the upgrade Vista to the clean install Vista and noticed that the SELF user was missing from my list.  Deleting the following registry key restored the original default access permissions and also resolved my sound problem (along with a few other issues):

     

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole\DefaultAccessPermission

     

    I'm not sure how common of a problem this will be for Vista upgraders out there.  Since I'm a developer, perhaps I went in there one time long before Vista and modified things, but I don't remember doing so.  Therefore, if your sound isn't working after upgrading to Vista and you've tried uninstalling and re-installing drivers until blue in the face, give this a try.

    Wednesday, April 11, 2007 7:09 PM

All replies

  • Here's an interesting twist to my problem.  If I request exclusive mode AUDCLNT_SHAREMODE_EXCLUSIVE when I call the IAudioClient::Initialize method, it returns S_OK and the sound is played normally.  This was the first time my system made a peep since the upgrade, looks like my drivers were installed OK after all.  My guess would be that most applications don't use this exclusive mode, which might explain why I don't get any sound out of the rest of the system.  

    So then, this raises a bunch of questions in my mind about the shared/exclusive modes.  Is it possible that some application on my system has taken control over shared mode and denied access to everyone else?  That would seem to go against the concept of shared mode.  Is there some configurable limit to how many applications can use shared mode simultaneously, and my limit is set too low?  Is it possible that some other application on my system is using exclusive mode, denying access to everyone else?  But, then how could my WinAudio sample use exclusive mode?  I'm just throwing stuff out here, don't really know what's possible.

    Sunday, March 25, 2007 8:53 PM
  • I'd have to see your code to be sure if it's a security related problem.

     

    Have you tried running your application elevated? 

     

    If the app works when elevated but not when disabled, I'd appreciate being able to see the application that's failing.

     

    Wednesday, March 28, 2007 3:13 AM
  • Hi Larry, thanks for your help.  I'm using an unmodified copy of the WinAudio sample from the Windows SDK for Vista to try playing a wave file.  Line 120 of PlayWave.cpp calls IAudioClient::Initialize and, on my system, it always returns E_ACCESSDIENIED.  By running elevated, you mean right clicking the executable and selecting "Run as Administator"?  I just tried this wih no change in the results.

     

    No digitally generated sounds are coming from my system; wave files, MP3 files, Internet audio streams...  The analog parts of my Audigy sound card do work, such as the line in jack and the microphone.  I can even control the volume through the Sound control panel.  However, the only way I can get a digitally generated sound out of my system is if I change line 120 to initialize in exclusive mode.  Then I'm able to play a wave file.

    Wednesday, March 28, 2007 4:55 PM
  • You guys should have hired me when you had the chance!  I solved this one on my own, the 13 year old partition survives yet another upgrade.  Looking at some of the diagrams of the audio engine architecture seemed to point out that exclusive mode is more of a direct connection to the driver, while shared mode connections go through a few components first.  Since E_ACCESSDENIED is a COM security error, I began to think that the problem was not in the security configuration of the file system or the registry, but of COM itself.  So I compared the default access permissions in Dcomcnfg of the upgrade Vista to the clean install Vista and noticed that the SELF user was missing from my list.  Deleting the following registry key restored the original default access permissions and also resolved my sound problem (along with a few other issues):

     

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole\DefaultAccessPermission

     

    I'm not sure how common of a problem this will be for Vista upgraders out there.  Since I'm a developer, perhaps I went in there one time long before Vista and modified things, but I don't remember doing so.  Therefore, if your sound isn't working after upgrading to Vista and you've tried uninstalling and re-installing drivers until blue in the face, give this a try.

    Wednesday, April 11, 2007 7:09 PM
  • I have encountered the same loss of audio as Arthur describes, and yes I have tried uninstalling/reinstalling drivers, changing sound control panel settings, etc. to no avail.   But I'm not using Vista---this is Windows Server 2008 R2.   The system and audio were working fine until I recently had a DRAM stick go bad, causing BSOD.   I replaced the memory and everything is back to normal except for no audio. 

    The registry key Arthur mentioned does not exist in 2008.

      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole\DefaultAccessPermission

    Is there a different key or another solution?  

    Thanks,
    Ted
    Friday, April 10, 2009 7:46 PM
  • This sounds like a different problem to me.

    Can you describe the contents of your Sound control panel and Device Manager "Sound, video and game controllers"?  If you like you can send screenshots to mateer at microsoft dot com.
    Matthew van Eerde
    Friday, April 10, 2009 8:12 PM
    Moderator