Index: /trunk/src/VBox/Devices/Audio/DevCodec.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevCodec.cpp	(revision 35486)
+++ /trunk/src/VBox/Devices/Audio/DevCodec.cpp	(revision 35487)
@@ -2137,5 +2137,5 @@
 }
 
-int codecConstruct(CODECState *pState, ENMCODEC enmCodec)
+int codecConstruct(PPDMDEVINS pDevIns, CODECState *pState, ENMCODEC enmCodec)
 {
     audsettings_t as;
@@ -2229,4 +2229,53 @@
     codecToAudVolume(&pState->pNodes[pState->u8AdcVolsLineIn].adcvol.B_params, AUD_MIXER_LINE_IN);
 
+#ifdef VBOX_WITH_AUDIO_FLEXIBLE_FORMAT
+    /* @todo If no host voices were created, then fallback to nul audio. */
+#else
+    /* If no host voices were created, then fallback to nul audio. */
+    if (!AUD_is_host_voice_in_ok(pState->SwVoiceIn))
+        LogRel (("HDA: WARNING: Unable to open PCM IN!\n"));
+    if (!AUD_is_host_voice_in_ok(pState->voice_mc))
+        LogRel (("HDA: WARNING: Unable to open PCM MC!\n"));
+    if (!AUD_is_host_voice_out_ok(pState->SwVoiceOut))
+        LogRel (("HDA: WARNING: Unable to open PCM OUT!\n"));
+
+    if (   !AUD_is_host_voice_in_ok(pState->SwVoiceIn)
+        && !AUD_is_host_voice_out_ok(pState->SwVoiceOut)
+        && !AUD_is_host_voice_in_ok(pState->voice_mc))
+    {
+        /* Was not able initialize *any* voice. Select the NULL audio driver instead */
+        AUD_close_in  (&pState->card, pState->SwVoiceIn);
+        AUD_close_out (&pState->card, pState->SwVoiceOut);
+        AUD_close_in  (&pState->card, pState->voice_mc);
+        pState->SwVoiceOut = NULL;
+        pState->SwVoiceIn = NULL;
+        pState->voice_mc = NULL;
+        AUD_init_null ();
+
+        PDMDevHlpVMSetRuntimeError (pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
+            N_ ("No audio devices could be opened. Selecting the NULL audio backend "
+                "with the consequence that no sound is audible"));
+    }
+    else if (   !AUD_is_host_voice_in_ok(pState->SwVoiceIn)
+             || !AUD_is_host_voice_out_ok(pState->SwVoiceOut)
+             || !AUD_is_host_voice_in_ok(pState->voice_mc))
+    {
+        char   szMissingVoices[128];
+        size_t len = 0;
+        if (!AUD_is_host_voice_in_ok(pState->SwVoiceIn))
+            len = RTStrPrintf (szMissingVoices, sizeof(szMissingVoices), "PCM_in");
+        if (!AUD_is_host_voice_out_ok(pState->SwVoiceOut))
+            len += RTStrPrintf (szMissingVoices + len, sizeof(szMissingVoices) - len, len ? ", PCM_out" : "PCM_out");
+        if (!AUD_is_host_voice_in_ok(pState->voice_mc))
+            len += RTStrPrintf (szMissingVoices + len, sizeof(szMissingVoices) - len, len ? ", PCM_mic" : "PCM_mic");
+
+        PDMDevHlpVMSetRuntimeError (pDevIns, 0 /*fFlags*/, "HostAudioNotResponding",
+            N_ ("Some audio devices (%s) could not be opened. Guest applications generating audio "
+                "output or depending on audio input may hang. Make sure your host audio device "
+                "is working properly. Check the logfile for error messages of the audio "
+                "subsystem"), szMissingVoices);
+    }
+#endif /* VBOX_WITH_AUDIO_FLEXIBLE_FORMAT */
+
     return VINF_SUCCESS;
 }
Index: /trunk/src/VBox/Devices/Audio/DevCodec.h
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevCodec.h	(revision 35486)
+++ /trunk/src/VBox/Devices/Audio/DevCodec.h	(revision 35487)
@@ -490,5 +490,5 @@
 } CODECState;
 
-int codecConstruct(CODECState *pCodecState, ENMCODEC enmCodec);
+int codecConstruct(PPDMDEVINS pDevIns, CODECState *pCodecState, ENMCODEC enmCodec);
 int codecDestruct(CODECState *pCodecState);
 int codecSaveState(CODECState *pCodecState, PSSMHANDLE pSSMHandle);
Index: /trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevIchAc97.cpp	(revision 35486)
+++ /trunk/src/VBox/Devices/Audio/DevIchAc97.cpp	(revision 35487)
@@ -1634,12 +1634,14 @@
     ac97Reset (pDevIns);
 
-    if (!s->voice_pi)
+    if (!AUD_is_host_voice_in_ok(s->voice_pi))
         LogRel (("AC97: WARNING: Unable to open PCM IN!\n"));
-    if (!s->voice_mc)
+    if (!AUD_is_host_voice_in_ok(s->voice_mc))
         LogRel (("AC97: WARNING: Unable to open PCM MC!\n"));
-    if (!s->voice_po)
+    if (!AUD_is_host_voice_out_ok(s->voice_po))
         LogRel (("AC97: WARNING: Unable to open PCM OUT!\n"));
 
-    if (!s->voice_pi && !s->voice_po && !s->voice_mc)
+    if (   !AUD_is_host_voice_in_ok(s->voice_pi)
+        && !AUD_is_host_voice_out_ok(s->voice_po)
+        && !AUD_is_host_voice_in_ok(s->voice_mc))
     {
         /* Was not able initialize *any* voice. Select the NULL audio driver instead */
@@ -1657,13 +1659,15 @@
                 "with the consequence that no sound is audible"));
     }
-    else if (!s->voice_pi || !s->voice_po || !s->voice_mc)
+    else if (   !AUD_is_host_voice_in_ok(s->voice_pi)
+             || !AUD_is_host_voice_out_ok(s->voice_po)
+             || !AUD_is_host_voice_in_ok(s->voice_mc))
     {
         char   szMissingVoices[128];
         size_t len = 0;
-        if (!s->voice_pi)
+        if (!AUD_is_host_voice_in_ok(s->voice_pi))
             len = RTStrPrintf (szMissingVoices, sizeof(szMissingVoices), "PCM_in");
-        if (!s->voice_po)
+        if (!AUD_is_host_voice_out_ok(s->voice_po))
             len += RTStrPrintf (szMissingVoices + len, sizeof(szMissingVoices) - len, len ? ", PCM_out" : "PCM_out");
-        if (!s->voice_mc)
+        if (!AUD_is_host_voice_in_ok(s->voice_mc))
             len += RTStrPrintf (szMissingVoices + len, sizeof(szMissingVoices) - len, len ? ", PCM_mic" : "PCM_mic");
 
Index: /trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp	(revision 35486)
+++ /trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp	(revision 35487)
@@ -2159,5 +2159,5 @@
 
     pThis->hda.Codec.pHDAState = (void *)&pThis->hda;
-    rc = codecConstruct(&pThis->hda.Codec, /* ALC885_CODEC */ STAC9220_CODEC);
+    rc = codecConstruct(pDevIns, &pThis->hda.Codec, /* ALC885_CODEC */ STAC9220_CODEC);
     if (RT_FAILURE(rc))
         AssertRCReturn(rc, rc);
Index: /trunk/src/VBox/Devices/Audio/DevSB16.cpp
===================================================================
--- /trunk/src/VBox/Devices/Audio/DevSB16.cpp	(revision 35486)
+++ /trunk/src/VBox/Devices/Audio/DevSB16.cpp	(revision 35487)
@@ -1900,6 +1900,7 @@
     legacy_reset(s);
 
-    if (!s->voice)
+    if (!AUD_is_host_voice_out_ok(s->voice))
     {
+        LogRel (("SB16: WARNING: Unable to open PCM OUT!\n"));
         AUD_close_out(&s->card, s->voice);
         s->voice = NULL;
Index: /trunk/src/VBox/Devices/Audio/audio.c
===================================================================
--- /trunk/src/VBox/Devices/Audio/audio.c	(revision 35486)
+++ /trunk/src/VBox/Devices/Audio/audio.c	(revision 35487)
@@ -1948,4 +1948,26 @@
 {
     LogRel(("Audio: set_record_source ars=%d als=%d (not implemented)\n", *ars, *als));
+}
+
+int AUD_is_host_voice_in_ok(SWVoiceIn *sw)
+{
+    AudioState *s = &glob_audio_state;
+
+    if (sw == NULL) {
+        return 0;
+    }
+
+    return filteraudio_is_host_voice_in_ok(s->drv, sw->hw);
+}
+
+int AUD_is_host_voice_out_ok(SWVoiceOut *sw)
+{
+    AudioState *s = &glob_audio_state;
+
+    if (sw == NULL) {
+        return 0;
+    }
+
+    return filteraudio_is_host_voice_out_ok(s->drv, sw->hw);
 }
 
Index: /trunk/src/VBox/Devices/Audio/audio.h
===================================================================
--- /trunk/src/VBox/Devices/Audio/audio.h	(revision 35486)
+++ /trunk/src/VBox/Devices/Audio/audio.h	(revision 35487)
@@ -200,3 +200,6 @@
 #endif
 
+int AUD_is_host_voice_in_ok(SWVoiceIn *hw);
+int AUD_is_host_voice_out_ok(SWVoiceOut *hw);
+
 #endif  /* audio.h */
Index: /trunk/src/VBox/Devices/Audio/audio_int.h
===================================================================
--- /trunk/src/VBox/Devices/Audio/audio_int.h	(revision 35486)
+++ /trunk/src/VBox/Devices/Audio/audio_int.h	(revision 35487)
@@ -333,4 +333,6 @@
 
 struct audio_driver *filteraudio_install(struct audio_driver *pDrv, void *pDrvOpaque);
+int filteraudio_is_host_voice_in_ok(struct audio_driver *pDrv, HWVoiceIn *phw);
+int filteraudio_is_host_voice_out_ok(struct audio_driver *pDrv, HWVoiceOut *phw);
 
 #endif /* audio_int.h */
Index: /trunk/src/VBox/Devices/Audio/filteraudio.c
===================================================================
--- /trunk/src/VBox/Devices/Audio/filteraudio.c	(revision 35486)
+++ /trunk/src/VBox/Devices/Audio/filteraudio.c	(revision 35487)
@@ -891,4 +891,5 @@
         filter_conf.pDrv->fini(opaque);
         filter_conf.pDrv = NULL;
+        filter_conf.pDrvOpaque = NULL;
     }
 }
@@ -944,2 +945,38 @@
     return &filteraudio_audio_driver;
 }
+
+int filteraudio_is_host_voice_in_ok(struct audio_driver *pDrv, HWVoiceIn *phw)
+{
+    filterVoiceIn *pVoice;
+
+    if (pDrv != &filteraudio_audio_driver)
+    {
+        /* This is not the driver for which the filter was installed.
+         * The filter has no idea and assumes that if the voice
+         * is not NULL then it is a valid host voice.
+         */
+        return (phw != NULL);
+    }
+
+    if (!filter_conf.pDrv)
+    {
+        AssertFailed();
+        return (phw != NULL);
+    }
+
+    pVoice = (filterVoiceIn *)((uint8_t *)phw + filter_conf.pDrv->voice_size_in);
+
+    return pVoice->fHostOK;
+}
+
+int filteraudio_is_host_voice_out_ok(struct audio_driver *pDrv, HWVoiceOut *phw)
+{
+    /* Output is not yet implemented and there are no filter voices.
+     * The filter has no idea and assumes that if the voice
+     * is not NULL then it is a valid host voice.
+     *
+     * @todo: similar to filteraudio_is_host_voice_in_ok
+     */
+    NOREF(pDrv);
+    return (phw != NULL);
+}
