Changeset 59470 in vbox for trunk/src/VBox
- Timestamp:
- Jan 26, 2016 11:32:46 AM (9 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r59376 r59470 2239 2239 } 2240 2240 else if (rc == VERR_PDM_NO_ATTACHED_DRIVER) 2241 {2242 2241 LogFunc(("No attached driver for LUN #%u\n", uLUN)); 2243 }2244 else if (RT_FAILURE(rc))2245 AssertMsgFailed(("Failed to attach AC'97 LUN #%u (\"%s\"), rc=%Rrc\n",2246 uLUN, pszDesc, rc));2247 2242 2248 2243 if (RT_FAILURE(rc)) … … 2539 2534 AssertPtr(pCon); 2540 2535 2541 uint8_t cFailed = 0; 2542 if (!pCon->pfnIsValidIn (pCon, pDrv->LineIn.pStrmIn)) 2543 cFailed++; 2544 if (!pCon->pfnIsValidIn (pCon, pDrv->MicIn.pStrmIn)) 2545 cFailed++; 2546 if (!pCon->pfnIsValidOut(pCon, pDrv->Out.pStrmOut)) 2547 cFailed++; 2548 2549 if (cFailed == 3) 2536 bool fValidLineIn = pCon->pfnIsValidIn(pCon, pDrv->LineIn.pStrmIn); 2537 bool fValidMicIn = pCon->pfnIsValidIn (pCon, pDrv->MicIn.pStrmIn); 2538 bool fValidOut = pCon->pfnIsValidOut(pCon, pDrv->Out.pStrmOut); 2539 2540 if ( !fValidLineIn 2541 && !fValidMicIn 2542 && !fValidOut) 2550 2543 { 2551 2544 LogRel(("AC97: Falling back to NULL backend (no sound audible)\n")); … … 2558 2551 "with the consequence that no sound is audible")); 2559 2552 } 2560 else if (cFailed)2553 else 2561 2554 { 2562 if (!pDrv->pConnector->pfnIsValidIn (pCon, pDrv->LineIn.pStrmIn)) 2563 LogRel(("AC97: WARNING: Unable to open PCM line input for LUN #%RU32!\n", pDrv->uLUN)); 2564 if (!pDrv->pConnector->pfnIsValidIn (pCon, pDrv->MicIn.pStrmIn)) 2565 LogRel(("AC97: WARNING: Unable to open PCM microphone input for LUN #%RU32!\n", pDrv->uLUN)); 2566 if (!pDrv->pConnector->pfnIsValidOut(pCon, pDrv->Out.pStrmOut)) 2567 LogRel(("AC97: WARNING: Unable to open PCM output for LUN #%RU32!\n", pDrv->uLUN)); 2568 2569 char szMissingStreams[255]; 2570 size_t len = 0; 2571 if (!pCon->pfnIsValidIn (pCon, pDrv->LineIn.pStrmIn)) 2572 len = RTStrPrintf(szMissingStreams, 2573 sizeof(szMissingStreams), "PCM Input"); 2574 if (!pCon->pfnIsValidIn (pCon, pDrv->MicIn.pStrmIn)) 2575 len += RTStrPrintf(szMissingStreams + len, 2576 sizeof(szMissingStreams) - len, len ? ", PCM Microphone" : "PCM Microphone"); 2577 if (!pCon->pfnIsValidOut(pCon, pDrv->Out.pStrmOut)) 2578 len += RTStrPrintf(szMissingStreams + len, 2579 sizeof(szMissingStreams) - len, len ? ", PCM Output" : "PCM Output"); 2580 2581 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", 2582 N_("Some AC'97 audio streams (%s) could not be opened. Guest applications generating audio " 2583 "output or depending on audio input may hang. Make sure your host audio device " 2584 "is working properly. Check the logfile for error messages of the audio " 2585 "subsystem"), szMissingStreams); 2555 bool fWarn = false; 2556 2557 PDMAUDIOBACKENDCFG backendCfg; 2558 int rc2 = pCon->pfnGetConfiguration(pCon, &backendCfg); 2559 if (RT_SUCCESS(rc2)) 2560 { 2561 if (backendCfg.cMaxHstStrmsIn) 2562 { 2563 /* If the audio backend supports two or more input streams at once, 2564 * warn if one of our two inputs (microphone-in and line-in) failed to initialize. */ 2565 if (backendCfg.cMaxHstStrmsIn >= 2) 2566 fWarn = !fValidLineIn || !fValidMicIn; 2567 /* If the audio backend only supports one input stream at once (e.g. pure ALSA, and 2568 * *not* ALSA via PulseAudio plugin!), only warn if both of our inputs failed to initialize. 2569 * One of the two simply is not in use then. */ 2570 else if (backendCfg.cMaxHstStrmsIn == 1) 2571 fWarn = !fValidLineIn && !fValidMicIn; 2572 /* Don't warn if our backend is not able of supporting any input streams at all. */ 2573 } 2574 2575 if ( !fWarn 2576 && backendCfg.cMaxHstStrmsOut) 2577 { 2578 fWarn = !fValidOut; 2579 } 2580 } 2581 else 2582 AssertReleaseMsgFailed(("Unable to retrieve audio backend configuration for LUN #%RU8, rc=%Rrc\n", 2583 pDrv->uLUN, rc2)); 2584 2585 if (fWarn) 2586 { 2587 char szMissingStreams[255]; 2588 size_t len = 0; 2589 if (!fValidLineIn) 2590 { 2591 LogRel(("AC97: WARNING: Unable to open PCM line input for LUN #%RU8!\n", pDrv->uLUN)); 2592 len = RTStrPrintf(szMissingStreams, sizeof(szMissingStreams), "PCM Input"); 2593 } 2594 if (!fValidMicIn) 2595 { 2596 LogRel(("AC97: WARNING: Unable to open PCM microphone input for LUN #%RU8!\n", pDrv->uLUN)); 2597 len += RTStrPrintf(szMissingStreams + len, 2598 sizeof(szMissingStreams) - len, len ? ", PCM Microphone" : "PCM Microphone"); 2599 } 2600 if (!fValidOut) 2601 { 2602 LogRel(("AC97: WARNING: Unable to open PCM output for LUN #%RU8!\n", pDrv->uLUN)); 2603 len += RTStrPrintf(szMissingStreams + len, 2604 sizeof(szMissingStreams) - len, len ? ", PCM Output" : "PCM Output"); 2605 } 2606 2607 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", 2608 N_("Some AC'97 audio streams (%s) could not be opened. Guest applications generating audio " 2609 "output or depending on audio input may hang. Make sure your host audio device " 2610 "is working properly. Check the logfile for error messages of the audio " 2611 "subsystem"), szMissingStreams); 2612 } 2586 2613 } 2587 2614 } -
trunk/src/VBox/Devices/Audio/DevIchHda.cpp
r59457 r59470 4419 4419 } 4420 4420 else if (rc == VERR_PDM_NO_ATTACHED_DRIVER) 4421 {4422 4421 LogFunc(("No attached driver for LUN #%u\n", uLUN)); 4423 }4424 else if (RT_FAILURE(rc))4425 AssertMsgFailed(("Failed to attach HDA LUN #%u (\"%s\"), rc=%Rrc\n",4426 uLUN, pszDesc, rc));4427 4422 4428 4423 if (RT_FAILURE(rc)) … … 4783 4778 AssertPtr(pCon); 4784 4779 4785 uint8_t cFailed = 0; 4786 if (!pCon->pfnIsValidIn (pCon, pDrv->LineIn.pStrmIn)) 4787 cFailed++; 4780 bool fValidLineIn = pCon->pfnIsValidIn(pCon, pDrv->LineIn.pStrmIn); 4788 4781 #ifdef VBOX_WITH_HDA_MIC_IN 4789 if (!pCon->pfnIsValidIn (pCon, pDrv->MicIn.pStrmIn)) 4790 cFailed++; 4791 #endif 4792 if (!pCon->pfnIsValidOut(pCon, pDrv->Out.pStrmOut)) 4793 cFailed++; 4794 4782 bool fValidMicIn = pCon->pfnIsValidIn (pCon, pDrv->MicIn.pStrmIn); 4783 #endif 4784 bool fValidOut = pCon->pfnIsValidOut(pCon, pDrv->Out.pStrmOut); 4785 4786 if ( !fValidLineIn 4795 4787 #ifdef VBOX_WITH_HDA_MIC_IN 4796 if (cFailed == 3) 4797 #else 4798 if (cFailed == 2) 4799 #endif 4788 && !fValidMicIn 4789 #endif 4790 && !fValidOut) 4800 4791 { 4801 4792 LogRel(("HDA: Falling back to NULL backend (no sound audible)\n")); … … 4808 4799 "with the consequence that no sound is audible")); 4809 4800 } 4810 else if (cFailed)4801 else 4811 4802 { 4812 if (!pDrv->pConnector->pfnIsValidIn (pDrv->pConnector, pDrv->LineIn.pStrmIn)) 4813 LogRel(("HDA: WARNING: Unable to open PCM line input for LUN #%RU32!\n", pDrv->uLUN)); 4803 bool fWarn = false; 4804 4805 PDMAUDIOBACKENDCFG backendCfg; 4806 int rc2 = pCon->pfnGetConfiguration(pCon, &backendCfg); 4807 if (RT_SUCCESS(rc2)) 4808 { 4809 if (backendCfg.cMaxHstStrmsIn) 4810 { 4814 4811 #ifdef VBOX_WITH_HDA_MIC_IN 4815 if (!pDrv->pConnector->pfnIsValidIn (pDrv->pConnector, pDrv->MicIn.pStrmIn)) 4816 LogRel(("HDA: WARNING: Unable to open PCM microphone input for LUN #%RU32!\n", pDrv->uLUN)); 4817 #endif 4818 if (!pDrv->pConnector->pfnIsValidOut(pDrv->pConnector, pDrv->Out.pStrmOut)) 4819 LogRel(("HDA: WARNING: Unable to open PCM output for LUN #%RU32!\n", pDrv->uLUN)); 4820 4821 char szMissingStreams[255]; 4822 size_t len = 0; 4823 if (!pCon->pfnIsValidIn (pCon, pDrv->LineIn.pStrmIn)) 4824 len = RTStrPrintf(szMissingStreams, 4825 sizeof(szMissingStreams), "PCM Input"); 4812 /* If the audio backend supports two or more input streams at once, 4813 * warn if one of our two inputs (microphone-in and line-in) failed to initialize. */ 4814 if (backendCfg.cMaxHstStrmsIn >= 2) 4815 fWarn = !fValidLineIn || !fValidMicIn; 4816 /* If the audio backend only supports one input stream at once (e.g. pure ALSA, and 4817 * *not* ALSA via PulseAudio plugin!), only warn if both of our inputs failed to initialize. 4818 * One of the two simply is not in use then. */ 4819 else if (backendCfg.cMaxHstStrmsIn == 1) 4820 fWarn = !fValidLineIn && !fValidMicIn; 4821 /* Don't warn if our backend is not able of supporting any input streams at all. */ 4822 #else 4823 /* We only have line-in as input source. */ 4824 fWarn = !fValidLineIn; 4825 #endif 4826 } 4827 4828 if ( !fWarn 4829 && backendCfg.cMaxHstStrmsOut) 4830 { 4831 fWarn = !fValidOut; 4832 } 4833 } 4834 else 4835 AssertReleaseMsgFailed(("Unable to retrieve audio backend configuration for LUN #%RU8, rc=%Rrc\n", 4836 pDrv->uLUN, rc2)); 4837 4838 if (fWarn) 4839 { 4840 char szMissingStreams[255]; 4841 size_t len = 0; 4842 if (!fValidLineIn) 4843 { 4844 LogRel(("HDA: WARNING: Unable to open PCM line input for LUN #%RU8!\n", pDrv->uLUN)); 4845 len = RTStrPrintf(szMissingStreams, sizeof(szMissingStreams), "PCM Input"); 4846 } 4826 4847 #ifdef VBOX_WITH_HDA_MIC_IN 4827 if (!pCon->pfnIsValidIn (pCon, pDrv->MicIn.pStrmIn)) 4828 len += RTStrPrintf(szMissingStreams + len, 4829 sizeof(szMissingStreams) - len, len ? ", PCM Microphone" : "PCM Microphone"); 4830 #endif 4831 if (!pCon->pfnIsValidOut(pCon, pDrv->Out.pStrmOut)) 4832 len += RTStrPrintf(szMissingStreams + len, 4833 sizeof(szMissingStreams) - len, len ? ", PCM Output" : "PCM Output"); 4834 4835 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", 4836 N_("Some HDA audio streams (%s) could not be opened. Guest applications generating audio " 4837 "output or depending on audio input may hang. Make sure your host audio device " 4838 "is working properly. Check the logfile for error messages of the audio " 4839 "subsystem"), szMissingStreams); 4848 if (!fValidMicIn) 4849 { 4850 LogRel(("HDA: WARNING: Unable to open PCM microphone input for LUN #%RU8!\n", pDrv->uLUN)); 4851 len += RTStrPrintf(szMissingStreams + len, 4852 sizeof(szMissingStreams) - len, len ? ", PCM Microphone" : "PCM Microphone"); 4853 } 4854 #endif 4855 if (!fValidOut) 4856 { 4857 LogRel(("HDA: WARNING: Unable to open PCM output for LUN #%RU8!\n", pDrv->uLUN)); 4858 len += RTStrPrintf(szMissingStreams + len, 4859 sizeof(szMissingStreams) - len, len ? ", PCM Output" : "PCM Output"); 4860 } 4861 4862 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", 4863 N_("Some HDA audio streams (%s) could not be opened. Guest applications generating audio " 4864 "output or depending on audio input may hang. Make sure your host audio device " 4865 "is working properly. Check the logfile for error messages of the audio " 4866 "subsystem"), szMissingStreams); 4867 } 4840 4868 } 4841 4869 } -
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r59376 r59470 2317 2317 AssertPtr(pCon); 2318 2318 2319 uint8_t cFailed = 0; 2320 if (!pCon->pfnIsValidOut(pCon, pDrv->Out.pStrmOut)) 2321 cFailed++; 2322 2323 if (cFailed) 2319 /* Note: No input streams available for SB16 yet. */ 2320 bool fValidOut = pCon->pfnIsValidOut(pCon, pDrv->Out.pStrmOut); 2321 if (fValidOut) 2324 2322 { 2325 2323 LogRel(("SB16: Falling back to NULL backend (no sound audible)\n")); -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r59420 r59470 8 8 9 9 /* 10 * Copyright (C) 2006-201 5Oracle Corporation10 * Copyright (C) 2006-2016 Oracle Corporation 11 11 * 12 12 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1636 1636 1637 1637 uint32_t cMaxHstStrmsOut = pThis->BackendCfg.cMaxHstStrmsOut; 1638 uint32_t cbHstStrmsOut = pThis->BackendCfg.cbStreamOut;1638 uint32_t cbHstStrmsOut = pThis->BackendCfg.cbStreamOut; 1639 1639 1640 1640 if (cbHstStrmsOut) 1641 1641 { 1642 pThis->cFreeOutputStreams = 1; /** @todo Make this configurable. */ 1643 if (pThis->cFreeOutputStreams > cMaxHstStrmsOut) 1644 { 1645 LogRel(("Audio: Warning: %RU32 output streams were requested, host driver only supports %RU32\n", 1646 pThis->cFreeOutputStreams, cMaxHstStrmsOut)); 1647 pThis->cFreeOutputStreams = cMaxHstStrmsOut; 1648 } 1642 pThis->cFreeOutputStreams = cMaxHstStrmsOut; 1649 1643 } 1650 1644 else … … 1652 1646 1653 1647 uint32_t cMaxHstStrmsIn = pThis->BackendCfg.cMaxHstStrmsIn; 1654 uint32_t cbHstStrmIn = pThis->BackendCfg.cbStreamIn;1648 uint32_t cbHstStrmIn = pThis->BackendCfg.cbStreamIn; 1655 1649 1656 1650 if (cbHstStrmIn) … … 1658 1652 /* 1659 1653 * Note: 1660 * - Our AC'97 emulation has two inputs, line ( P.IN) and microphone (P.MIC).1661 * * @todo Document HDA.1654 * - Our AC'97 emulation has two inputs, line (ac97.pi) and microphone (ac97.mc). 1655 * - Our HDA emulation currently has only line input (hda.pi). 1662 1656 */ 1663 pThis->cFreeInputStreams = 2; /** @todo Make this configurable. */ 1664 if (pThis->cFreeInputStreams > cMaxHstStrmsIn) 1665 { 1666 LogRel(("Audio: Warning: %RU32 input streams were requested, host driver only supports %RU32\n", 1667 pThis->cFreeInputStreams, cMaxHstStrmsIn)); 1668 pThis->cFreeInputStreams = cMaxHstStrmsIn; 1669 } 1657 pThis->cFreeInputStreams = cMaxHstStrmsIn; 1670 1658 } 1671 1659 else … … 1677 1665 LogFlowFunc(("cFreeInputStreams=%RU8, cFreeOutputStreams=%RU8\n", 1678 1666 pThis->cFreeInputStreams, pThis->cFreeOutputStreams)); 1667 1668 LogRel(("Audio: Host audio backend supports %RU32 output streams and %RU32 input streams at once\n", 1669 /* Clamp for logging. Unlimited streams are defined by UINT32_MAX. */ 1670 RT_MIN(64, cMaxHstStrmsOut), RT_MIN(64, cMaxHstStrmsIn))); 1679 1671 1680 1672 LogFlowFuncLeave(); … … 2031 2023 rc = drvAudioCreateStreamPairIn(pThis, pszName, enmRecSource, pCfg, &pGstStrmIn); 2032 2024 2033 if (pGstStrmIn) 2034 *ppGstStrmIn = pGstStrmIn; 2025 if (RT_SUCCESS(rc)) 2026 { 2027 if (pGstStrmIn) 2028 *ppGstStrmIn = pGstStrmIn; 2029 } 2030 else 2031 { 2032 switch (rc) 2033 { 2034 case VERR_NO_MORE_HANDLES: /** @todo Find a better rc. */ 2035 LogRel(("Audio: Skipping to create input stream \"%s\", " \ 2036 "as the host audio backend reached its maximum of concurrent audio input streams\n", pszName)); 2037 break; 2038 2039 default: 2040 break; 2041 } 2042 } 2035 2043 2036 2044 int rc2 = RTCritSectLeave(&pThis->CritSect); … … 2128 2136 if (RT_SUCCESS(rc)) 2129 2137 { 2130 AssertPtr(pGstStrmOut);2131 *ppGstStrmOut = pGstStrmOut;2138 if (pGstStrmOut) 2139 *ppGstStrmOut = pGstStrmOut; 2132 2140 #if 0 2133 2141 /* Update remaining live samples with new rate. */ … … 2145 2153 #endif 2146 2154 } 2155 else 2156 { 2157 switch (rc) 2158 { 2159 case VERR_NO_MORE_HANDLES: /** @todo Find a better rc. */ 2160 LogRel(("Audio: Skipping to create output stream \"%s\", " \ 2161 "as the host audio backend reached its maximum of concurrent audio output streams\n", pszName)); 2162 break; 2163 2164 default: 2165 break; 2166 } 2167 } 2168 2169 int rc2 = RTCritSectLeave(&pThis->CritSect); 2170 if (RT_SUCCESS(rc)) 2171 rc = rc2; 2172 2173 LogFlowFuncLeaveRC(rc); 2174 return rc; 2175 } 2176 2177 static DECLCALLBACK(int) drvAudioGetConfiguration(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOBACKENDCFG pCfg) 2178 { 2179 AssertPtrReturn(pInterface, VERR_INVALID_POINTER); 2180 AssertPtrReturn(pCfg, VERR_INVALID_POINTER); 2181 2182 PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface); 2183 2184 int rc = RTCritSectEnter(&pThis->CritSect); 2185 if (RT_FAILURE(rc)) 2186 return rc; 2187 2188 memcpy(pCfg, &pThis->BackendCfg, sizeof(PDMAUDIOBACKENDCFG)); 2147 2189 2148 2190 int rc2 = RTCritSectLeave(&pThis->CritSect); … … 2310 2352 pThis->IAudioConnector.pfnRead = drvAudioRead; 2311 2353 pThis->IAudioConnector.pfnWrite = drvAudioWrite; 2354 pThis->IAudioConnector.pfnGetConfiguration = drvAudioGetConfiguration; 2312 2355 pThis->IAudioConnector.pfnIsActiveIn = drvAudioIsActiveIn; 2313 2356 pThis->IAudioConnector.pfnIsActiveOut = drvAudioIsActiveOut; -
trunk/src/VBox/Devices/Audio/DrvAudio.h
r59420 r59470 94 94 /** List of host output streams. */ 95 95 RTLISTANCHOR lstHstStrmOut; 96 /** Max. number of free input streams. */ 97 uint8_t cFreeInputStreams; 98 /** Max. number of free output streams. */ 99 uint8_t cFreeOutputStreams; 96 /** Max. number of free input streams. 97 * UINT32_MAX for unlimited streams. */ 98 uint32_t cFreeInputStreams; 99 /** Max. number of free output streams. 100 * UINT32_MAX for unlimited streams. */ 101 uint32_t cFreeOutputStreams; 100 102 /** Audio configuration settings retrieved from the backend. */ 101 103 PDMAUDIOBACKENDCFG BackendCfg; -
trunk/src/VBox/Devices/Audio/DrvHostALSAAudio.cpp
r59375 r59470 171 171 if (rc2) 172 172 { 173 LogRel(("ALSA: Closing PCM descriptor failed: %s\n", 174 snd_strerror(rc2))); 173 LogRel(("ALSA: Closing PCM descriptor failed: %s\n", snd_strerror(rc2))); 175 174 rc = VERR_GENERAL_FAILURE; /** @todo */ 176 175 } … … 386 385 if (!pszDev) 387 386 { 388 LogRel(("ALSA: Invalid or no %s device name set\n", 389 fIn ? "input" : "output")); 387 LogRel(("ALSA: Invalid or no %s device name set\n", fIn ? "input" : "output")); 390 388 rc = VERR_INVALID_PARAMETER; 391 389 break; … … 397 395 if (err < 0) 398 396 { 399 LogRel(("ALSA: Failed to open \"%s\" as %s: %s\n", pszDev, 400 fIn ? "ADC" : "DAC", snd_strerror(err))); 397 LogRel(("ALSA: Failed to open \"%s\" as %s device: %s\n", pszDev, fIn ? "input" : "output", snd_strerror(err))); 401 398 rc = VERR_AUDIO_BACKEND_INIT_FAILED; 402 399 break; 403 400 } 401 402 LogRel(("ALSA: Using %s device \"%s\"\n", fIn ? "input" : "output", pszDev)); 404 403 405 404 snd_pcm_hw_params_t *pHWParms; … … 408 407 if (err < 0) 409 408 { 410 LogRel(("ALSA: Failed to initialize hardware parameters: %s\n", 411 snd_strerror(err))); 409 LogRel(("ALSA: Failed to initialize hardware parameters: %s\n", snd_strerror(err))); 412 410 rc = VERR_AUDIO_BACKEND_INIT_FAILED; 413 411 break; … … 426 424 if (err < 0) 427 425 { 428 LogRel(("ALSA: Failed to set audio format to %d: %s\n", 429 pCfgReq->fmt, snd_strerror(err))); 426 LogRel(("ALSA: Failed to set audio format to %d: %s\n", pCfgReq->fmt, snd_strerror(err))); 430 427 rc = VERR_AUDIO_BACKEND_INIT_FAILED; 431 428 break; … … 435 432 if (err < 0) 436 433 { 437 LogRel(("ALSA: Failed to set frequency to %dHz: %s\n", 438 pCfgReq->freq, snd_strerror(err))); 434 LogRel(("ALSA: Failed to set frequency to %uHz: %s\n", pCfgReq->freq, snd_strerror(err))); 439 435 rc = VERR_AUDIO_BACKEND_INIT_FAILED; 440 436 break; … … 706 702 if (err < 0) 707 703 { 708 LogFunc(("Failed to recover stream %p: %s\n", 709 phPCM, snd_strerror(err))); 704 LogFunc(("Failed to recover stream %p: %s\n", phPCM, snd_strerror(err))); 710 705 return VERR_ACCESS_DENIED; /** @todo Find a better rc. */ 711 706 } … … 721 716 if (err < 0) 722 717 { 723 LogFunc(("Failed to resume stream %p: %s\n", 724 phPCM, snd_strerror(err))); 718 LogFunc(("Failed to resume stream %p: %s\n", phPCM, snd_strerror(err))); 725 719 return VERR_ACCESS_DENIED; /** @todo Find a better rc. */ 726 720 } … … 737 731 if (err < 0) 738 732 { 739 LogFlow(("Error stopping stream %p: %s\n", 740 phPCM, snd_strerror(err))); 733 LogRel(("ALSA: Error stopping stream %p: %s\n", phPCM, snd_strerror(err))); 741 734 return VERR_ACCESS_DENIED; 742 735 } … … 744 737 else 745 738 { 746 err = snd_pcm_prepare 739 err = snd_pcm_prepare(phPCM); 747 740 if (err < 0) 748 741 { 749 LogFlow(("Error preparing stream %p: %s\n", 750 phPCM, snd_strerror(err))); 742 LogRel(("ALSA: Error preparing stream %p: %s\n", phPCM, snd_strerror(err))); 751 743 return VERR_ACCESS_DENIED; 752 744 } … … 856 848 857 849 case -EAGAIN: 850 { 858 851 /* 859 852 * Don't set error here because EAGAIN means there are no further frames … … 863 856 cbToRead = 0; 864 857 break; 858 } 865 859 866 860 case -EPIPE: … … 875 869 876 870 default: 871 { 877 872 LogFunc(("Failed to read input frames: %s\n", snd_strerror(cRead))); 878 rc = VERR_AUDIO_BACKEND_INIT_FAILED; 879 VERR_GENERAL_FAILURE; /** @todo Fudge! */ 873 rc = VERR_GENERAL_FAILURE; /** @todo Fudge! */ 880 874 break; 875 } 881 876 } 882 877 } … … 1295 1290 AssertPtrReturn(pCfg, VERR_INVALID_POINTER); 1296 1291 1297 pCfg->cbStreamOut = sizeof(ALSAAUDIOSTREAMOUT); 1298 pCfg->cbStreamIn = sizeof(ALSAAUDIOSTREAMIN); 1299 pCfg->cMaxHstStrmsOut = INT_MAX; 1300 pCfg->cMaxHstStrmsIn = INT_MAX; 1292 pCfg->cbStreamIn = sizeof(ALSAAUDIOSTREAMIN); 1293 pCfg->cbStreamOut = sizeof(ALSAAUDIOSTREAMOUT); 1294 1295 /* ALSA only allows one input and one output used at a time for 1296 * the selected device. */ 1297 pCfg->cMaxHstStrmsIn = 1; 1298 pCfg->cMaxHstStrmsOut = 1; 1301 1299 1302 1300 return VINF_SUCCESS; -
trunk/src/VBox/Devices/Audio/DrvHostCoreAudio.cpp
r59434 r59470 5 5 6 6 /* 7 * Copyright (C) 2010-201 5Oracle Corporation7 * Copyright (C) 2010-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as -
trunk/src/VBox/Devices/Audio/DrvHostDSound.cpp
r59421 r59470 5 5 6 6 /* 7 * Copyright (C) 2006-201 5Oracle Corporation7 * Copyright (C) 2006-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as -
trunk/src/VBox/Devices/Audio/DrvHostPulseAudio.cpp
r59375 r59470 5 5 6 6 /* 7 * Copyright (C) 2006-201 5Oracle Corporation7 * Copyright (C) 2006-2016 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 1102 1102 AssertPtrReturn(pCfg, VERR_INVALID_POINTER); 1103 1103 1104 pCfg->cbStreamOut = sizeof(PULSEAUDIOSTREAM);1105 pCfg->cbStreamIn = sizeof(PULSEAUDIOSTREAM);1106 pCfg->cMaxHstStrmsOut = INT_MAX;1107 pCfg->cMaxHstStrmsIn = INT_MAX;1104 pCfg->cbStreamOut = sizeof(PULSEAUDIOSTREAM); 1105 pCfg->cbStreamIn = sizeof(PULSEAUDIOSTREAM); 1106 pCfg->cMaxHstStrmsOut = UINT32_MAX; 1107 pCfg->cMaxHstStrmsIn = UINT32_MAX; 1108 1108 1109 1109 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.