- Timestamp:
- Jan 11, 2011 1:45:20 PM (14 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevCodec.cpp
r35353 r35487 2137 2137 } 2138 2138 2139 int codecConstruct( CODECState *pState, ENMCODEC enmCodec)2139 int codecConstruct(PPDMDEVINS pDevIns, CODECState *pState, ENMCODEC enmCodec) 2140 2140 { 2141 2141 audsettings_t as; … … 2229 2229 codecToAudVolume(&pState->pNodes[pState->u8AdcVolsLineIn].adcvol.B_params, AUD_MIXER_LINE_IN); 2230 2230 2231 #ifdef VBOX_WITH_AUDIO_FLEXIBLE_FORMAT 2232 /* @todo If no host voices were created, then fallback to nul audio. */ 2233 #else 2234 /* If no host voices were created, then fallback to nul audio. */ 2235 if (!AUD_is_host_voice_in_ok(pState->SwVoiceIn)) 2236 LogRel (("HDA: WARNING: Unable to open PCM IN!\n")); 2237 if (!AUD_is_host_voice_in_ok(pState->voice_mc)) 2238 LogRel (("HDA: WARNING: Unable to open PCM MC!\n")); 2239 if (!AUD_is_host_voice_out_ok(pState->SwVoiceOut)) 2240 LogRel (("HDA: WARNING: Unable to open PCM OUT!\n")); 2241 2242 if ( !AUD_is_host_voice_in_ok(pState->SwVoiceIn) 2243 && !AUD_is_host_voice_out_ok(pState->SwVoiceOut) 2244 && !AUD_is_host_voice_in_ok(pState->voice_mc)) 2245 { 2246 /* Was not able initialize *any* voice. Select the NULL audio driver instead */ 2247 AUD_close_in (&pState->card, pState->SwVoiceIn); 2248 AUD_close_out (&pState->card, pState->SwVoiceOut); 2249 AUD_close_in (&pState->card, pState->voice_mc); 2250 pState->SwVoiceOut = NULL; 2251 pState->SwVoiceIn = NULL; 2252 pState->voice_mc = NULL; 2253 AUD_init_null (); 2254 2255 PDMDevHlpVMSetRuntimeError (pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", 2256 N_ ("No audio devices could be opened. Selecting the NULL audio backend " 2257 "with the consequence that no sound is audible")); 2258 } 2259 else if ( !AUD_is_host_voice_in_ok(pState->SwVoiceIn) 2260 || !AUD_is_host_voice_out_ok(pState->SwVoiceOut) 2261 || !AUD_is_host_voice_in_ok(pState->voice_mc)) 2262 { 2263 char szMissingVoices[128]; 2264 size_t len = 0; 2265 if (!AUD_is_host_voice_in_ok(pState->SwVoiceIn)) 2266 len = RTStrPrintf (szMissingVoices, sizeof(szMissingVoices), "PCM_in"); 2267 if (!AUD_is_host_voice_out_ok(pState->SwVoiceOut)) 2268 len += RTStrPrintf (szMissingVoices + len, sizeof(szMissingVoices) - len, len ? ", PCM_out" : "PCM_out"); 2269 if (!AUD_is_host_voice_in_ok(pState->voice_mc)) 2270 len += RTStrPrintf (szMissingVoices + len, sizeof(szMissingVoices) - len, len ? ", PCM_mic" : "PCM_mic"); 2271 2272 PDMDevHlpVMSetRuntimeError (pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", 2273 N_ ("Some audio devices (%s) could not be opened. Guest applications generating audio " 2274 "output or depending on audio input may hang. Make sure your host audio device " 2275 "is working properly. Check the logfile for error messages of the audio " 2276 "subsystem"), szMissingVoices); 2277 } 2278 #endif /* VBOX_WITH_AUDIO_FLEXIBLE_FORMAT */ 2279 2231 2280 return VINF_SUCCESS; 2232 2281 } -
trunk/src/VBox/Devices/Audio/DevCodec.h
r34933 r35487 490 490 } CODECState; 491 491 492 int codecConstruct( CODECState *pCodecState, ENMCODEC enmCodec);492 int codecConstruct(PPDMDEVINS pDevIns, CODECState *pCodecState, ENMCODEC enmCodec); 493 493 int codecDestruct(CODECState *pCodecState); 494 494 int codecSaveState(CODECState *pCodecState, PSSMHANDLE pSSMHandle); -
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r35353 r35487 1634 1634 ac97Reset (pDevIns); 1635 1635 1636 if (! s->voice_pi)1636 if (!AUD_is_host_voice_in_ok(s->voice_pi)) 1637 1637 LogRel (("AC97: WARNING: Unable to open PCM IN!\n")); 1638 if (! s->voice_mc)1638 if (!AUD_is_host_voice_in_ok(s->voice_mc)) 1639 1639 LogRel (("AC97: WARNING: Unable to open PCM MC!\n")); 1640 if (! s->voice_po)1640 if (!AUD_is_host_voice_out_ok(s->voice_po)) 1641 1641 LogRel (("AC97: WARNING: Unable to open PCM OUT!\n")); 1642 1642 1643 if (!s->voice_pi && !s->voice_po && !s->voice_mc) 1643 if ( !AUD_is_host_voice_in_ok(s->voice_pi) 1644 && !AUD_is_host_voice_out_ok(s->voice_po) 1645 && !AUD_is_host_voice_in_ok(s->voice_mc)) 1644 1646 { 1645 1647 /* Was not able initialize *any* voice. Select the NULL audio driver instead */ … … 1657 1659 "with the consequence that no sound is audible")); 1658 1660 } 1659 else if (!s->voice_pi || !s->voice_po || !s->voice_mc) 1661 else if ( !AUD_is_host_voice_in_ok(s->voice_pi) 1662 || !AUD_is_host_voice_out_ok(s->voice_po) 1663 || !AUD_is_host_voice_in_ok(s->voice_mc)) 1660 1664 { 1661 1665 char szMissingVoices[128]; 1662 1666 size_t len = 0; 1663 if (! s->voice_pi)1667 if (!AUD_is_host_voice_in_ok(s->voice_pi)) 1664 1668 len = RTStrPrintf (szMissingVoices, sizeof(szMissingVoices), "PCM_in"); 1665 if (! s->voice_po)1669 if (!AUD_is_host_voice_out_ok(s->voice_po)) 1666 1670 len += RTStrPrintf (szMissingVoices + len, sizeof(szMissingVoices) - len, len ? ", PCM_out" : "PCM_out"); 1667 if (! s->voice_mc)1671 if (!AUD_is_host_voice_in_ok(s->voice_mc)) 1668 1672 len += RTStrPrintf (szMissingVoices + len, sizeof(szMissingVoices) - len, len ? ", PCM_mic" : "PCM_mic"); 1669 1673 -
trunk/src/VBox/Devices/Audio/DevIchIntelHDA.cpp
r35353 r35487 2159 2159 2160 2160 pThis->hda.Codec.pHDAState = (void *)&pThis->hda; 2161 rc = codecConstruct( &pThis->hda.Codec, /* ALC885_CODEC */ STAC9220_CODEC);2161 rc = codecConstruct(pDevIns, &pThis->hda.Codec, /* ALC885_CODEC */ STAC9220_CODEC); 2162 2162 if (RT_FAILURE(rc)) 2163 2163 AssertRCReturn(rc, rc); -
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r35353 r35487 1900 1900 legacy_reset(s); 1901 1901 1902 if (! s->voice)1902 if (!AUD_is_host_voice_out_ok(s->voice)) 1903 1903 { 1904 LogRel (("SB16: WARNING: Unable to open PCM OUT!\n")); 1904 1905 AUD_close_out(&s->card, s->voice); 1905 1906 s->voice = NULL; -
trunk/src/VBox/Devices/Audio/audio.c
r35353 r35487 1948 1948 { 1949 1949 LogRel(("Audio: set_record_source ars=%d als=%d (not implemented)\n", *ars, *als)); 1950 } 1951 1952 int AUD_is_host_voice_in_ok(SWVoiceIn *sw) 1953 { 1954 AudioState *s = &glob_audio_state; 1955 1956 if (sw == NULL) { 1957 return 0; 1958 } 1959 1960 return filteraudio_is_host_voice_in_ok(s->drv, sw->hw); 1961 } 1962 1963 int AUD_is_host_voice_out_ok(SWVoiceOut *sw) 1964 { 1965 AudioState *s = &glob_audio_state; 1966 1967 if (sw == NULL) { 1968 return 0; 1969 } 1970 1971 return filteraudio_is_host_voice_out_ok(s->drv, sw->hw); 1950 1972 } 1951 1973 -
trunk/src/VBox/Devices/Audio/audio.h
r6140 r35487 200 200 #endif 201 201 202 int AUD_is_host_voice_in_ok(SWVoiceIn *hw); 203 int AUD_is_host_voice_out_ok(SWVoiceOut *hw); 204 202 205 #endif /* audio.h */ -
trunk/src/VBox/Devices/Audio/audio_int.h
r35116 r35487 333 333 334 334 struct audio_driver *filteraudio_install(struct audio_driver *pDrv, void *pDrvOpaque); 335 int filteraudio_is_host_voice_in_ok(struct audio_driver *pDrv, HWVoiceIn *phw); 336 int filteraudio_is_host_voice_out_ok(struct audio_driver *pDrv, HWVoiceOut *phw); 335 337 336 338 #endif /* audio_int.h */ -
trunk/src/VBox/Devices/Audio/filteraudio.c
r35427 r35487 891 891 filter_conf.pDrv->fini(opaque); 892 892 filter_conf.pDrv = NULL; 893 filter_conf.pDrvOpaque = NULL; 893 894 } 894 895 } … … 944 945 return &filteraudio_audio_driver; 945 946 } 947 948 int filteraudio_is_host_voice_in_ok(struct audio_driver *pDrv, HWVoiceIn *phw) 949 { 950 filterVoiceIn *pVoice; 951 952 if (pDrv != &filteraudio_audio_driver) 953 { 954 /* This is not the driver for which the filter was installed. 955 * The filter has no idea and assumes that if the voice 956 * is not NULL then it is a valid host voice. 957 */ 958 return (phw != NULL); 959 } 960 961 if (!filter_conf.pDrv) 962 { 963 AssertFailed(); 964 return (phw != NULL); 965 } 966 967 pVoice = (filterVoiceIn *)((uint8_t *)phw + filter_conf.pDrv->voice_size_in); 968 969 return pVoice->fHostOK; 970 } 971 972 int filteraudio_is_host_voice_out_ok(struct audio_driver *pDrv, HWVoiceOut *phw) 973 { 974 /* Output is not yet implemented and there are no filter voices. 975 * The filter has no idea and assumes that if the voice 976 * is not NULL then it is a valid host voice. 977 * 978 * @todo: similar to filteraudio_is_host_voice_in_ok 979 */ 980 NOREF(pDrv); 981 return (phw != NULL); 982 }
Note:
See TracChangeset
for help on using the changeset viewer.