Changeset 53567 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Dec 18, 2014 12:42:45 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 97327
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp
r53486 r53567 1051 1051 void audioMixBufUnlink(PPDMAUDIOMIXBUF pMixBuf) 1052 1052 { 1053 if (!pMixBuf )1053 if (!pMixBuf || !pMixBuf->pszName) 1054 1054 return; 1055 1055 -
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r53512 r53567 55 55 #endif 56 56 57 #ifdef DEBUG 57 58 //#define DEBUG_LUN 58 #ifdef DEBUG_LUN 59 # define DEBUG_LUN_NUM 1 60 #endif 59 # ifdef DEBUG_LUN 60 # define DEBUG_LUN_NUM 1 61 # endif 62 #endif /* DEBUG */ 61 63 62 64 #define AC97_SSM_VERSION 1 … … 218 220 /** Pointer to AC97 controller (state). */ 219 221 PAC97STATE pAC97State; 222 /** Driver flags. */ 223 PDMAUDIODRVFLAGS Flags; 220 224 /** LUN # to which this driver has been assigned. */ 221 225 uint8_t uLUN; … … 2087 2091 pDrv->uLUN = uLUN; 2088 2092 2089 LogFlowFunc(("LUN #%u is using connector %p\n", uLUN, pDrv->pConnector)); 2090 2093 /* 2094 * For now we always set the driver at LUN 0 as our primary 2095 * host backend. This might change in the future. 2096 */ 2097 if (pDrv->uLUN == 0) 2098 pDrv->Flags |= PDMAUDIODRVFLAG_PRIMARY; 2099 2100 LogFunc(("LUN #%u: pCon=%p, drvFlags=0x%x\n", 2101 uLUN, pDrv->pConnector, pDrv->Flags)); 2102 2091 2103 pThis->paDrv[uLUN] = pDrv; 2092 2104 pThis->cLUNs++; … … 2105 2117 RTStrFree(pszDesc); 2106 2118 2107 LogF lowFunc(("iLUN=%u, fFlags=0x%x, rc=%Rrc\n", uLUN, fFlags, rc));2119 LogFunc(("iLUN=%u, fFlags=0x%x, rc=%Rrc\n", uLUN, fFlags, rc)); 2108 2120 return rc; 2109 2121 } … … 2195 2207 rc = PDMDevHlpDriverAttach(pDevIns, 0, &pThis->IBase, &pThis->pDrvBase, "Audio Driver Port"); 2196 2208 if (rc == VERR_PDM_NO_ATTACHED_DRIVER) 2197 Log (("ac97: No attached driver!\n"));2209 LogFunc(("ac97: No attached driver!\n")); 2198 2210 else if (RT_FAILURE(rc)) 2199 2211 { … … 2221 2233 for (uint8_t lun = 0; lun < pThis->cLUNs; lun++) 2222 2234 { 2223 if ( !pThis->paDrv[lun]->pConnector->pfnIsInputOK(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pStrmIn) 2224 && !pThis->paDrv[lun]->pConnector->pfnIsOutputOK(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pStrmOut) 2225 && !pThis->paDrv[lun]->pConnector->pfnIsInputOK(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pStrmMic)) 2226 { 2227 /* Was not able initialize *any* stream. Select the NULL audio driver instead. */ 2228 pThis->paDrv[lun]->pConnector->pfnCloseIn(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pStrmIn); 2229 pThis->paDrv[lun]->pConnector->pfnCloseOut(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pStrmOut); 2230 pThis->paDrv[lun]->pConnector->pfnCloseIn(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pStrmMic); 2231 2232 pThis->paDrv[lun]->pStrmOut = NULL; 2233 pThis->paDrv[lun]->pStrmIn = NULL; 2234 pThis->paDrv[lun]->pStrmMic = NULL; 2235 2236 pThis->paDrv[lun]->pConnector->pfnInitNull(pThis->paDrv[lun]->pConnector); 2235 PAC97DRIVER pDrv = pThis->paDrv[lun]; 2236 AssertPtr(pDrv); 2237 2238 /* Only primary drivers are critical for the VM to run. Everything else 2239 * might not worth showing an own error message box in the GUI. */ 2240 if (!(pDrv->Flags & PDMAUDIODRVFLAG_PRIMARY)) 2241 continue; 2242 2243 PPDMIAUDIOCONNECTOR pCon = pThis->paDrv[lun]->pConnector; 2244 AssertPtr(pCon); 2245 if ( !pCon->pfnIsInputOK (pCon, pDrv->pStrmIn) 2246 && !pCon->pfnIsOutputOK(pCon, pDrv->pStrmOut) 2247 && !pCon->pfnIsInputOK (pCon, pDrv->pStrmMic)) 2248 { 2249 LogRel(("AC97: Selecting NULL driver\n")); 2250 2251 /* Was not able initialize *any* stream. 2252 * Select the NULL audio driver instead. */ 2253 pCon->pfnCloseIn (pCon, pDrv->pStrmIn); 2254 pCon->pfnCloseOut(pCon, pDrv->pStrmOut); 2255 pCon->pfnCloseIn (pCon, pDrv->pStrmMic); 2256 2257 pDrv->pStrmOut = NULL; 2258 pDrv->pStrmIn = NULL; 2259 pDrv->pStrmMic = NULL; 2260 2261 pCon->pfnInitNull(pCon); 2237 2262 ac97Reset(pDevIns); 2238 2263 … … 2241 2266 "with the consequence that no sound is audible")); 2242 2267 } 2243 else if ( !p This->paDrv[lun]->pConnector->pfnIsInputOK(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pStrmIn)2244 || !p This->paDrv[lun]->pConnector->pfnIsOutputOK(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pStrmOut)2245 || !p This->paDrv[lun]->pConnector->pfnIsInputOK(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pStrmMic))2268 else if ( !pCon->pfnIsInputOK (pCon, pDrv->pStrmIn) 2269 || !pCon->pfnIsOutputOK(pCon, pDrv->pStrmOut) 2270 || !pCon->pfnIsInputOK (pCon, pDrv->pStrmMic)) 2246 2271 { 2247 2272 char szMissingStreams[128]; 2248 2273 size_t len = 0; 2249 if (!pThis->paDrv[lun]->pConnector->pfnIsInputOK(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pStrmIn)) 2250 len = RTStrPrintf(szMissingStreams, sizeof(szMissingStreams), "PCM Input"); 2251 if (!pThis->paDrv[lun]->pConnector->pfnIsOutputOK(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pStrmOut)) 2252 len += RTStrPrintf(szMissingStreams + len, sizeof(szMissingStreams) - len, len ? ", PCM Output" : "PCM Output"); 2253 if (!pThis->paDrv[lun]->pConnector->pfnIsInputOK(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pStrmMic)) 2254 len += RTStrPrintf(szMissingStreams + len, sizeof(szMissingStreams) - len, len ? ", PCM Mic" : "PCM Mic"); 2274 if (!pCon->pfnIsInputOK (pCon, pDrv->pStrmIn)) 2275 len = RTStrPrintf(szMissingStreams, 2276 sizeof(szMissingStreams), "PCM Input"); 2277 if (!pCon->pfnIsOutputOK(pCon, pDrv->pStrmOut)) 2278 len += RTStrPrintf(szMissingStreams + len, 2279 sizeof(szMissingStreams) - len, len ? ", PCM Output" : "PCM Output"); 2280 if (!pCon->pfnIsInputOK (pCon, pDrv->pStrmMic)) 2281 len += RTStrPrintf(szMissingStreams + len, 2282 sizeof(szMissingStreams) - len, len ? ", PCM Mic" : "PCM Mic"); 2255 2283 2256 2284 PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "HostAudioNotResponding", -
trunk/src/VBox/Devices/Audio/DevIchHda.cpp
r53507 r53567 57 57 #include "DevIchHdaCodec.h" 58 58 59 #ifdef DEBUG 60 #define DEBUG_LUN 61 # ifdef DEBUG_LUN 62 # define DEBUG_LUN_NUM 0 63 # endif 64 #endif /* DEBUG */ 65 59 66 /******************************************************************************* 60 67 * Defined Constants And Macros * … … 62 69 //#define HDA_AS_PCI_EXPRESS 63 70 #define VBOX_WITH_INTEL_HDA 71 72 #if (defined(DEBUG) && defined(DEBUG_andy)) 73 /* Enables experimental support for separate mic-in handling. 74 Do not enable this yet for regular builds, as this needs more testing first! */ 75 # define VBOX_WITH_HDA_MIC_IN 76 #endif 64 77 65 78 #if defined(VBOX_WITH_HP_HDA) … … 560 573 /** Pointer to HDA controller (state). */ 561 574 PHDASTATE pHDAState; 575 /** Driver flags. */ 576 PDMAUDIODRVFLAGS Flags; 562 577 /** LUN to which this driver has been assigned. */ 563 578 uint8_t uLUN; … … 1484 1499 break; 1485 1500 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 1501 # ifdef VBOX_WITH_HDA_MIC_IN 1486 1502 case HDA_REG_SD2CTL: 1487 1503 u8Strm = 2; 1488 1504 pBdle = &pThis->StMicBdle; 1489 1505 break; 1506 # endif 1490 1507 #endif 1491 1508 case HDA_REG_SD4CTL: … … 1524 1541 break; 1525 1542 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 1543 # ifdef VBOX_WITH_HDA_MIC_IN 1526 1544 case HDA_REG_SD2CTL: 1527 1545 for (uint8_t lun = 0; lun < pThis->cLUNs; lun++) 1528 1546 pThis->paDrv[lun]->pConnector->pfnEnableIn(pThis->paDrv[lun]->pConnector, 1529 1547 pThis->paDrv[lun]->pStrmMic, fRun); 1530 #else 1531 1548 # endif 1532 1549 #endif /* VBOX_WITH_PDM_AUDIO_DRIVER */ 1533 1550 break; … … 1757 1774 rc = hdaCodecOpenStream(pThis->pCodec, PI_INDEX, &as); 1758 1775 break; 1759 case HDA_REG_SD4FMT: 1776 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 1777 # ifdef VBOX_WITH_HDA_MIC_IN 1778 case HDA_REG_SD2FMT: 1760 1779 for (uint8_t lun = 0; lun < pThis->cLUNs; lun++) 1761 rc = hdaCodecOpenStream(pThis->pCodec, PO_INDEX, &as);1780 rc = hdaCodecOpenStream(pThis->pCodec, MC_INDEX, &as); 1762 1781 break; 1782 # endif 1783 #endif 1763 1784 default: 1764 1785 LogFunc(("Warning: Attempt to change format on register %d\n", iReg)); … … 2021 2042 * where it might happen. 2022 2043 */ 2023 Assert((cbCopied == pBdle->cbUnderFifoW + cbArranged2Copy)); /* we assume that we write the entire buffer including unreported bytes */ 2044 AssertMsg((cbCopied == pBdle->cbUnderFifoW + cbArranged2Copy), /* we assume that we write the entire buffer including unreported bytes */ 2045 ("cbCopied=%RU32 != pBdle->cbUnderFifoW=%RU32 + cbArranged2Copy=%RU32\n", 2046 cbCopied, pBdle->cbUnderFifoW, cbArranged2Copy)); 2024 2047 if ( pBdle->cbUnderFifoW 2025 2048 && pBdle->cbUnderFifoW <= cbCopied) … … 2272 2295 int rc; 2273 2296 uint32_t cbWritten; 2274 for (uint8_t lun = 0; lun < pThis->cLUNs; lun++) 2297 # ifdef DEBUG_LUN 2298 uint8_t lun = DEBUG_LUN_NUM; 2299 # else 2300 for (uint8_t lun = 0; lun < 1; lun++) 2275 2301 { 2302 # endif 2276 2303 rc = pThis->paDrv[lun]->pConnector->pfnWrite(pThis->paDrv[lun]->pConnector, pThis->paDrv[lun]->pGstStrmOut, 2277 2304 pBdle->au8HdaBuffer, cb2Copy + pBdle->cbUnderFifoW, 2278 2305 &cbWritten); 2306 # ifndef DEBUG_LUN 2279 2307 if (RT_FAILURE(rc)) 2280 2308 continue; 2281 2309 # endif 2282 2310 cbWrittenMax = RT_MAX(cbWrittenMax, cbWritten); 2311 # ifndef DEBUG_LUN 2283 2312 } 2313 # endif 2284 2314 #else 2285 2315 cbWrittenMax = AUD_write (pThis->pCodec->SwVoiceOut, pBdle->au8HdaBuffer, cb2Copy + pBdle->cbUnderFifoW); … … 2352 2382 2353 2383 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 2384 # ifdef VBOX_WITH_HDA_MIC_IN 2354 2385 static void hdaMicInputCallback(void *pvDrv, uint32_t cbAvail) 2355 2386 { … … 2357 2388 hdaTransfer(pThis, MC_INDEX, cbAvail); 2358 2389 } 2390 # endif /* VBOX_WITH_HDA_MIC_IN */ 2359 2391 2360 2392 static void hdaLineInputCallback(void *pvDrv, uint32_t cbAvail) … … 2379 2411 switch (enmRecSource) 2380 2412 { 2413 # ifdef VBOX_WITH_HDA_MIC_IN 2381 2414 case PDMAUDIORECSOURCE_MIC: 2382 2415 pfnCallback = hdaMicInputCallback; 2383 2416 pSink = pThis->pSinkMicIn; 2384 2417 break; 2418 # endif 2385 2419 case PDMAUDIORECSOURCE_LINE_IN: 2386 2420 pfnCallback = hdaLineInputCallback; … … 2490 2524 } 2491 2525 2526 #ifdef VBOX_WITH_HDA_MIC_IN 2492 2527 case MC_INDEX: 2493 2528 { … … 2496 2531 break; 2497 2532 } 2498 2533 #endif 2499 2534 case PO_INDEX: 2500 2535 { … … 2524 2559 2525 2560 *StreamDesc.pu32Sts |= HDA_REG_FIELD_FLAG_MASK(SDSTS, FIFORDY); 2526 Assert(( cbAvail >= 0 && (StreamDesc.u32Cbl >= (*StreamDesc.pu32Lpib)))); /* sanity */2561 Assert((StreamDesc.u32Cbl >= (*StreamDesc.pu32Lpib))); /* sanity */ 2527 2562 uint32_t u32CblLimit = StreamDesc.u32Cbl - (*StreamDesc.pu32Lpib); 2528 2563 Assert((u32CblLimit > hdaFifoWToSz(pThis, &StreamDesc))); … … 2552 2587 break; 2553 2588 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 2589 # ifdef VBOX_WITH_HDA_MIC_IN 2554 2590 case MC_INDEX: 2555 2591 pSink = pThis->pSinkMicIn; 2556 2592 cb = hdaReadAudio(pThis, pSink, pBdle, &StreamDesc, &cbAvail, &fStop, u32CblLimit); 2557 2593 break; 2594 # endif 2558 2595 #endif /* VBOX_WITH_PDM_AUDIO_DRIVER */ 2559 2596 default: … … 3524 3561 pDrv->uLUN = uLUN; 3525 3562 3563 /* 3564 * For now we always set the driver at LUN 0 as our primary 3565 * host backend. This might change in the future. 3566 */ 3567 if (pDrv->uLUN == 0) 3568 pDrv->Flags |= PDMAUDIODRVFLAG_PRIMARY; 3569 3570 LogFunc(("LUN #%u: pCon=%p, drvFlags=0x%x\n", 3571 uLUN, pDrv->pConnector, pDrv->Flags)); 3572 3526 3573 pThis->paDrv[uLUN] = pDrv; 3527 3574 pThis->cLUNs++; … … 3540 3587 RTStrFree(pszDesc); 3541 3588 3542 LogF lowFunc(("iLUN=%u, fFlags=0x%x, rc=%Rrc\n", uLUN, fFlags, rc));3589 LogFunc(("iLUN=%u, fFlags=0x%x, rc=%Rrc\n", uLUN, fFlags, rc)); 3543 3590 return rc; 3544 3591 } -
trunk/src/VBox/Devices/Audio/DevIchHdaCodec.cpp
r53442 r53567 2305 2305 case PI_INDEX: 2306 2306 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 2307 /* old and new stream settings are not same. Then only call open */2308 //if (!hdaCodecCompareAudioSettings(&(pThis->SwVoiceIn)->info, pAudioSettings) && !pThis->SwVoiceIn)2309 2307 rc = pThis->pfnOpenIn(pThis->pHDAState, "hda.in", 2310 2308 PDMAUDIORECSOURCE_LINE_IN, pCfg); … … 2325 2323 2326 2324 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 2325 # ifdef VBOX_WITH_HDA_MIC_IN 2327 2326 case MC_INDEX: 2328 /* old and new stream settings are not same. Then only call open */ 2329 //if (!hdaCodecCompareAudioSettings(&(pThis->SwVoiceIn)->info, pAudioSettings) && !pThis->SwVoiceIn) 2330 rc = pThis->pfnOpenIn(pThis->pHDAState, "hda.mc", 2331 PDMAUDIORECSOURCE_MIC, pCfg); 2332 break; 2327 rc = pThis->pfnOpenIn(pThis->pHDAState, "hda.mc", 2328 PDMAUDIORECSOURCE_MIC, pCfg); 2329 break; 2330 # endif 2333 2331 #endif /* VBOX_WITH_PDM_AUDIO_DRIVER */ 2334 2332 … … 2481 2479 hdaCodecOpenStream(pThis, PI_INDEX, &as); 2482 2480 hdaCodecOpenStream(pThis, PO_INDEX, &as); 2481 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER 2482 # ifdef VBOX_WITH_HDA_MIC_IN 2483 hdaCodecOpenStream(pThis, MC_INDEX, &as); 2484 # endif 2485 #endif /* VBOX_WITH_PDM_AUDIO_DRIVER */ 2483 2486 2484 2487 pThis->paNodes[1].node.au32F00_param[0xA] |= CODEC_F00_0A_44_1KHZ; … … 2494 2497 hdaCodecToAudVolume(pThis, &pThis->paNodes[pThis->u8DacLineOut].dac.B_params, PDMAUDIOMIXERCTL_VOLUME); 2495 2498 hdaCodecToAudVolume(pThis, &pThis->paNodes[pThis->u8AdcVolsLineIn].adcvol.B_params, PDMAUDIOMIXERCTL_LINE_IN); 2499 2500 2496 2501 #else 2497 2502 hdaCodecToAudVolume(&pThis->paNodes[pThis->u8DacLineOut].dac.B_params, AUD_MIXER_VOLUME); -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r53442 r53567 573 573 if (RT_FAILURE(rc)) 574 574 { 575 LogFlowFunc(("Initializing host driverfailed with rc=%Rrc\n", rc));575 LogFlowFunc(("Initializing host backend failed with rc=%Rrc\n", rc)); 576 576 break; 577 577 } … … 682 682 if (RT_FAILURE(rc)) 683 683 { 684 LogFlowFunc(("Failed to add host audio input stream, rc=%Rrc\n", rc)); 684 LogFunc(("Failed to add host audio input stream \"%s\", rc=%Rrc\n", 685 pszName, rc)); 685 686 686 687 RTMemFree(pGstStrmIn); … … 876 877 if (RT_SUCCESS(rc)) 877 878 { 879 /* Return the number of samples which actually have been mixed 880 * down to the parent, regardless how much samples were written 881 * into the children buffer. */ 878 882 if (pcbWritten) 879 883 *pcbWritten = AUDIOMIXBUF_S2B(&pGstStrmOut->MixBuf, cMixed); … … 993 997 cSamplesLive = 0; 994 998 995 /* Has this st eam marked as disabled but there still were guest streams relying999 /* Has this stream marked as disabled but there still were guest streams relying 996 1000 * on it? Check if this stream now can be closed and do so, if possible. */ 997 1001 if ( pHstStrmOut->fPendingDisable … … 1589 1593 } 1590 1594 1591 static DECLCALLBACK(bool) drvAudioIsInputOK(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn) 1592 { 1593 if (pGstStrmIn == NULL) 1594 return false; 1595 1596 return true; 1597 } 1598 1599 static DECLCALLBACK(bool) drvAudioIsOutputOK(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut) 1600 { 1601 if (pGstStrmOut == NULL) 1602 return false; 1603 1604 return true; 1595 static DECLCALLBACK(bool) drvAudioIsInputOK(PPDMIAUDIOCONNECTOR pInterface, 1596 PPDMAUDIOGSTSTRMIN pGstStrmIn) 1597 { 1598 return (pGstStrmIn != NULL); 1599 } 1600 1601 static DECLCALLBACK(bool) drvAudioIsOutputOK(PPDMIAUDIOCONNECTOR pInterface, 1602 PPDMAUDIOGSTSTRMOUT pGstStrmOut) 1603 { 1604 return (pGstStrmOut != NULL); 1605 1605 } 1606 1606 … … 1615 1615 AssertPtrReturn(pszName, VERR_INVALID_POINTER); 1616 1616 AssertPtrReturn(pCfg, VERR_INVALID_POINTER); 1617 AssertPtrReturn(ppGstStrmIn, VERR_INVALID_POINTER); 1617 1618 1618 1619 PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface); … … 1679 1680 AssertPtrReturn(pszName, VERR_INVALID_POINTER); 1680 1681 AssertPtrReturn(pCfg, VERR_INVALID_POINTER); 1682 AssertPtrReturn(ppGstStrmOut, VERR_INVALID_POINTER); 1681 1683 1682 1684 PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface); … … 1700 1702 1701 1703 #if 0 1704 /* Any live samples that need to be updated after 1705 * we set the new parameters? */ 1702 1706 PPDMAUDIOGSTSTRMOUT pOldGstStrmOut = NULL; 1703 1707 uint32_t cLiveSamples = 0; … … 1724 1728 } 1725 1729 1730 int rc; 1726 1731 if (pGstStrmOut) 1727 1732 { … … 1731 1736 drvAudioGstOutFreeRes(pGstStrmOut); 1732 1737 1733 int rc2 = drvAudioGstOutInit(pGstStrmOut, pHstStrmOut, pszName, pCfg); 1734 if (RT_FAILURE(rc2)) 1735 return rc2; 1738 rc = drvAudioGstOutInit(pGstStrmOut, pHstStrmOut, pszName, pCfg); 1736 1739 } 1737 1740 else 1738 1741 { 1739 int rc2 = drvAudioCreateStreamPairOut(pThis, pszName, pCfg, &pGstStrmOut); 1740 if (RT_FAILURE(rc2)) 1741 { 1742 LogFunc(("Failed to create output stream \"%s\", rc=%Rrc\n", pszName, rc2)); 1743 return rc2; 1744 } 1745 } 1746 1747 if (pGstStrmOut) 1748 { 1749 pGstStrmOut->State.uVolumeLeft = nominal_volume.l; 1742 rc = drvAudioCreateStreamPairOut(pThis, pszName, pCfg, &pGstStrmOut); 1743 if (RT_FAILURE(rc)) 1744 LogFunc(("Failed to create output stream \"%s\", rc=%Rrc\n", pszName, rc)); 1745 } 1746 1747 if (RT_SUCCESS(rc)) 1748 { 1749 AssertPtr(pGstStrmOut); 1750 pGstStrmOut->State.uVolumeLeft = nominal_volume.l; 1750 1751 pGstStrmOut->State.uVolumeRight = nominal_volume.r; 1751 pGstStrmOut->State.fMuted = RT_BOOL(nominal_volume.mute);1752 pGstStrmOut->Callback.fn = fnCallback;1752 pGstStrmOut->State.fMuted = RT_BOOL(nominal_volume.mute); 1753 pGstStrmOut->Callback.fn = fnCallback; 1753 1754 pGstStrmOut->Callback.pvContext = pvCallback; 1754 1755 1756 *ppGstStrmOut = pGstStrmOut; 1755 1757 #if 0 1758 /* Update remaining live samples with new rate. */ 1756 1759 if (cLiveSamples) 1757 1760 { … … 1766 1769 } 1767 1770 #endif 1768 } 1769 1770 *ppGstStrmOut = pGstStrmOut; 1771 1772 return VINF_SUCCESS; 1771 } 1772 1773 LogFlowFuncLeaveRC(rc); 1774 return rc; 1773 1775 } 1774 1776 -
trunk/src/VBox/Devices/Audio/DrvHostOSSAudio.cpp
r53562 r53567 213 213 if (close(*phFile)) 214 214 { 215 LogRel((" Audio: Closing descriptor failed: %s\n",215 LogRel(("OSS: Closing descriptor failed: %s\n", 216 216 strerror(errno))); 217 217 rc = VERR_GENERAL_FAILURE; /** @todo */ … … 242 242 if (!pszDev) 243 243 { 244 LogRel((" Audio: Invalid or no %s device name set\n",244 LogRel(("OSS: Invalid or no %s device name set\n", 245 245 fIn ? "input" : "output")); 246 246 rc = VERR_INVALID_PARAMETER; … … 251 251 if (hFile == -1) 252 252 { 253 LogRel((" Audio: Failed to open %s: %s\n", pszDev, strerror(errno)));253 LogRel(("OSS: Failed to open %s: %s\n", pszDev, strerror(errno))); 254 254 rc = RTErrConvertFromErrno(errno); 255 255 break; … … 259 259 if (ioctl(hFile, SNDCTL_DSP_SAMPLESIZE, &iFormat)) 260 260 { 261 LogRel((" Audio: Failed to set audio format to %ld\n",261 LogRel(("OSS: Failed to set audio format to %ld\n", 262 262 iFormat, strerror(errno))); 263 263 rc = RTErrConvertFromErrno(errno); … … 268 268 if (ioctl(hFile, SNDCTL_DSP_CHANNELS, &cChannels)) 269 269 { 270 LogRel((" Audio: Failed to set number of audio channels (%d): %s\n",270 LogRel(("OSS: Failed to set number of audio channels (%d): %s\n", 271 271 pReq->cChannels, strerror(errno))); 272 272 rc = RTErrConvertFromErrno(errno); … … 277 277 if (ioctl(hFile, SNDCTL_DSP_SPEED, &freq)) 278 278 { 279 LogRel((" Audio: Failed to set audio frequency (%dHZ): %s\n",279 LogRel(("OSS: Failed to set audio frequency (%dHZ): %s\n", 280 280 pReq->uFreq, strerror(errno))); 281 281 rc = RTErrConvertFromErrno(errno); … … 287 287 if (ioctl(hFile, SNDCTL_DSP_NONBLOCK)) 288 288 { 289 LogRel((" Audio: Failed to set non-blocking mode: %s\n",289 LogRel(("OSS: Failed to set non-blocking mode: %s\n", 290 290 strerror(errno))); 291 291 rc = RTErrConvertFromErrno(errno); … … 296 296 if (ioctl(hFile, SNDCTL_DSP_SETFRAGMENT, &mmmmssss)) 297 297 { 298 LogRel((" Audio: Failed to set %RU16 fragments to %RU32 bytes each: %s\n",298 LogRel(("OSS: Failed to set %RU16 fragments to %RU32 bytes each: %s\n", 299 299 pReq->cFragments, pReq->cbFragmentSize, strerror(errno))); 300 300 rc = RTErrConvertFromErrno(errno); … … 306 306 &abinfo)) 307 307 { 308 LogRel((" Audio: Failed to retrieve buffer length: %s\n", strerror(errno)));308 LogRel(("OSS: Failed to retrieve buffer length: %s\n", strerror(errno))); 309 309 rc = RTErrConvertFromErrno(errno); 310 310 break; … … 370 370 if (ioctl(pThisStrmOut->hFile, SNDCTL_DSP_SETTRIGGER, &mask) < 0) 371 371 { 372 LogRel((" Audio: Failed to enable output stream: %s\n",372 LogRel(("OSS: Failed to enable output stream: %s\n", 373 373 strerror(errno))); 374 374 rc = RTErrConvertFromErrno(errno); … … 383 383 if (ioctl(pThisStrmOut->hFile, SNDCTL_DSP_SETTRIGGER, &mask) < 0) 384 384 { 385 LogRel((" Audio: Failed to disable output stream: %s\n",385 LogRel(("OSS: Failed to disable output stream: %s\n", 386 386 strerror(errno))); 387 387 rc = RTErrConvertFromErrno(errno); … … 588 588 { 589 589 if (obtStream.cFragments * obtStream.cbFragmentSize & pHstStrmIn->Props.uAlign) 590 LogRel((" Audio: Warning: Misaligned DAC output buffer: Size = %zu, Alignment = %u\n",590 LogRel(("OSS: Warning: Misaligned DAC output buffer: Size = %zu, Alignment = %u\n", 591 591 obtStream.cFragments * obtStream.cbFragmentSize, 592 592 pHstStrmIn->Props.uAlign + 1)); … … 616 616 if (!pThisStrmIn->pvBuf) 617 617 { 618 LogRel((" Audio: Failed allocating ADC buffer with %RU32 samples, each %d bytes\n",618 LogRel(("OSS: Failed allocating ADC buffer with %RU32 samples, each %d bytes\n", 619 619 cSamples, 1 << pHstStrmIn->Props.cShift)); 620 620 rc = VERR_NO_MEMORY; … … 665 665 { 666 666 if (obtStream.cFragments * obtStream.cbFragmentSize & pHstStrmOut->Props.uAlign) 667 LogRel((" Audio: Warning: Misaligned DAC output buffer: Size = %zu, Alignment = %u\n",667 LogRel(("OSS: Warning: Misaligned DAC output buffer: Size = %zu, Alignment = %u\n", 668 668 obtStream.cFragments * obtStream.cbFragmentSize, 669 669 pHstStrmOut->Props.uAlign + 1)); … … 693 693 if (pThisStrmOut->pvPCMBuf == MAP_FAILED) 694 694 { 695 LogRel((" Audio: Failed to memory map %zu bytes of DAC output file: %s\n",695 LogRel(("OSS: Failed to memory map %zu bytes of DAC output file: %s\n", 696 696 cSamples << pHstStrmOut->Props.cShift, strerror(errno))); 697 697 rc = RTErrConvertFromErrno(errno); … … 703 703 if (ioctl(hFile, SNDCTL_DSP_SETTRIGGER, &mask) < 0) 704 704 { 705 LogRel((" Audio: Failed to retrieve initial trigger mask: %s\n",705 LogRel(("OSS: Failed to retrieve initial trigger mask: %s\n", 706 706 strerror(errno))); 707 707 rc = RTErrConvertFromErrno(errno); … … 713 713 if (ioctl (hFile, SNDCTL_DSP_SETTRIGGER, &mask) < 0) 714 714 { 715 LogRel((" Audio: Failed to retrieve PCM_ENABLE_OUTPUT mask: %s\n",716 strerror(errno)));715 LogRel(("OSS: Failed to retrieve PCM_ENABLE_OUTPUT mask: %s\n", 716 strerror(errno))); 717 717 rc = RTErrConvertFromErrno(errno); 718 718 /* Note: No break here, need to unmap file first! */ … … 727 727 cSamples << pHstStrmOut->Props.cShift); 728 728 if (rc2) 729 LogRel((" Audio: Failed to unmap DAC output file: %s\n",729 LogRel(("OSS: Failed to unmap DAC output file: %s\n", 730 730 strerror(errno))); 731 731 … … 745 745 if (!pThisStrmOut->pvPCMBuf) 746 746 { 747 LogRel((" Audio: Failed allocating DAC buffer with %RU32 samples, each %d bytes\n",747 LogRel(("OSS: Failed allocating DAC buffer with %RU32 samples, each %d bytes\n", 748 748 cSamples, 1 << pHstStrmOut->Props.cShift)); 749 749 rc = VERR_NO_MEMORY; … … 793 793 if (!rc2) 794 794 { 795 LogRel((" Audio: Failed to retrieve current playback pointer: %s\n",795 LogRel(("OSS: Failed to retrieve current playback pointer: %s\n", 796 796 strerror(errno))); 797 797 rc = RTErrConvertFromErrno(errno); … … 820 820 if (rc2 < 0) 821 821 { 822 LogRel((" Audio: Failed to retrieve current playback buffer: %s\n",822 LogRel(("OSS: Failed to retrieve current playback buffer: %s\n", 823 823 strerror(errno))); 824 824 rc = RTErrConvertFromErrno(errno); … … 865 865 if (cbWritten == -1) 866 866 { 867 LogRel((" Audio: Failed writing output data %s\n", strerror(errno)));867 LogRel(("OSS: Failed writing output data %s\n", strerror(errno))); 868 868 rc = RTErrConvertFromErrno(errno); 869 869 break;
Note:
See TracChangeset
for help on using the changeset viewer.