Trouble with audio device

Error message:

  • in english: "A device ID has been used that is out of range for your system"
  • in french: "Un numéro de périphérique en dehors de la portée de votre système a été employé."

This error message comes from the WinMM stack and is error code 2.

My context is as follows, but apparently this can happen with various other hardware/software combinations so this is really for the sake of reference.

VMware Player with an Ubuntu 11.04 Natty Narwahl guest on a Windows 7 64-bit host fails to connect or keep connected the guest virtual soundcard to the host. Although it does not quite matter the sound card is a Realtek HDA on a Dell XPS desktop machine.

It appears there is some sort of mismatch between what the host provides and what the guest asks for. This seems to happen when the host card and driver knows if things are pluggen in each of its jack ports, reports it to the OS, which then refuses to proceed with some sound system initialization. This can also happen when something went wrong somewhere in the driver system (e.g broken or mismatched registry settings).

The workaround for me was to disable all audio input in the virtual machine. To do so, go to Sound Preferences, go to the Hardware tab, and select a Profile in the list which matches what you want. I selected "Analog Stereo Output" instead of "Analog Stereo Duplex". This way VMware won't try to access a nonexistent microphone. I also had to reenable and then redisable the login screen sound for that sound not to play and therefore the soundcard not to disconnect when reaching the login screen, as apparently this area of the system does not respect sound settings.

Others have reported that plugging a microphone or speakers in the proper ports could fix the issue. There are also reports that disabling a number of enhancement features  like noise cancellation would work too. Another solution in case the driver system went broken somehow is to uninstall/remove the device from the Windows Device Manager and/or try to switch or reinstall drivers. For my soundcard, Realtek HDA drivers were installed and I uninstalled them, then Windows found some generic HDA ones straight from Microsoft. This last step did not fix anything for me but interestingly enough this removed the crapfest that is the Realtek sound panel.