- Timestamp:
- May 19, 2021 11:52:08 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r89184 r89191 151 151 uintptr_t uMagic; 152 152 153 /** List entry in DRVAUDIO:: lstStreams. */153 /** List entry in DRVAUDIO::LstStreams. */ 154 154 RTLISTNODE ListEntry; 155 155 … … 304 304 char szPathOut[RTPATH_MAX]; 305 305 } Dbg; 306 } DRVAUDIOCFG, *PDRVAUDIOCFG; 306 } DRVAUDIOCFG; 307 /** Pointer to tweakable audio configuration. */ 308 typedef DRVAUDIOCFG *PDRVAUDIOCFG; 309 /** Pointer to const tweakable audio configuration. */ 310 typedef DRVAUDIOCFG const *PCDRVAUDIOCFG; 311 307 312 308 313 /** … … 313 318 typedef struct DRVAUDIO 314 319 { 315 /** Friendly name of the driver. */316 char szName[64];317 /** Critical section for serializing access.318 * @todo r=bird: This needs to be split up and introduce stream-level locking so319 * that different AIO threads can work in parallel (e.g. input &320 * output, or two output streams). Maybe put a critect in321 * PDMAUDIOSTREAM? */320 /** Critical section for protecting: 321 * - LstStreams 322 * - In.fEnabled 323 * - In.cStreamsFree 324 * - Out.fEnabled 325 * - Out.cStreamsFree 326 */ 322 327 RTCRITSECT CritSect; 323 /** Shutdown indicator. */ 324 bool fTerminate; 328 /** List of audio streams (DRVAUDIOSTREAM). */ 329 RTLISTANCHOR LstStreams; 330 struct 331 { 332 /** Whether this driver's input streams are enabled or not. 333 * This flag overrides all the attached stream statuses. */ 334 bool fEnabled; 335 /** Max. number of free input streams. 336 * UINT32_MAX for unlimited streams. */ 337 uint32_t cStreamsFree; 338 } In; 339 struct 340 { 341 /** Whether this driver's output streams are enabled or not. 342 * This flag overrides all the attached stream statuses. */ 343 bool fEnabled; 344 /** Max. number of free output streams. 345 * UINT32_MAX for unlimited streams. */ 346 uint32_t cStreamsFree; 347 } Out; 348 349 /** Audio configuration settings retrieved from the backend. 350 * The szName field is used for the DriverName config value till we get the 351 * authoritative name from the backend (only for logging). */ 352 PDMAUDIOBACKENDCFG BackendCfg; 325 353 /** Our audio connector interface. */ 326 354 PDMIAUDIOCONNECTOR IAudioConnector; … … 331 359 /** Pointer to audio driver below us. */ 332 360 PPDMIHOSTAUDIO pHostDrvAudio; 333 /** List of audio streams (DRVAUDIOSTREAM). */334 RTLISTANCHOR lstStreams;335 /** Audio configuration settings retrieved from the backend. */336 PDMAUDIOBACKENDCFG BackendCfg;337 struct338 {339 /** Whether this driver's input streams are enabled or not.340 * This flag overrides all the attached stream statuses. */341 bool fEnabled;342 /** Max. number of free input streams.343 * UINT32_MAX for unlimited streams. */344 uint32_t cStreamsFree;345 /** The driver's input confguration (tweakable via CFGM). */346 DRVAUDIOCFG Cfg;347 } In;348 struct349 {350 /** Whether this driver's output streams are enabled or not.351 * This flag overrides all the attached stream statuses. */352 bool fEnabled;353 /** Max. number of free output streams.354 * UINT32_MAX for unlimited streams. */355 uint32_t cStreamsFree;356 /** The driver's output confguration (tweakable via CFGM). */357 DRVAUDIOCFG Cfg;358 /** Number of times underruns triggered re-(pre-)buffering. */359 STAMCOUNTER StatsReBuffering;360 } Out;361 361 362 362 /** Request pool if the backend needs it for async stream creation. */ 363 363 RTREQPOOL hReqPool; 364 365 #ifdef VBOX_WITH_AUDIO_ENUM366 /** Handle to the timer for delayed re-enumeration of backend devices. */367 TMTIMERHANDLE hEnumTimer;368 /** Unique name for the the disable-iteration timer. */369 char szEnumTimerName[24];370 #endif371 364 372 365 #ifdef VBOX_WITH_STATISTICS … … 381 374 } Stats; 382 375 #endif 376 377 #ifdef VBOX_WITH_AUDIO_ENUM 378 /** Handle to the timer for delayed re-enumeration of backend devices. */ 379 TMTIMERHANDLE hEnumTimer; 380 /** Unique name for the the disable-iteration timer. */ 381 char szEnumTimerName[24]; 382 #endif 383 384 /** Input audio configuration values (static). */ 385 DRVAUDIOCFG CfgIn; 386 /** Output audio configuration values (static). */ 387 DRVAUDIOCFG CfgOut; 383 388 } DRVAUDIO; 384 389 /** Pointer to the instance data of an audio driver. */ 385 390 typedef DRVAUDIO *PDRVAUDIO; 391 /** Pointer to const instance data of an audio driver. */ 392 typedef DRVAUDIO const *PCDRVAUDIO; 386 393 387 394 … … 700 707 { 701 708 if (fLog) 702 LogRel(("Audio: Found %RU16 devices for driver '%s'\n", DevEnum.cDevices, pThis-> szName));709 LogRel(("Audio: Found %RU16 devices for driver '%s'\n", DevEnum.cDevices, pThis->BackendCfg.szName)); 703 710 704 711 PPDMAUDIOHOSTDEV pDev; … … 724 731 { 725 732 if (fLog) 726 LogRel(("Audio: Device enumeration for driver '%s' failed with %Rrc\n", pThis-> szName, rc));733 LogRel(("Audio: Device enumeration for driver '%s' failed with %Rrc\n", pThis->BackendCfg.szName, rc)); 727 734 /* Not fatal. */ 728 735 } … … 733 740 734 741 if (fLog) 735 LogRel2(("Audio: Host driver '%s' does not support audio device enumeration, skipping\n", pThis-> szName));742 LogRel2(("Audio: Host driver '%s' does not support audio device enumeration, skipping\n", pThis->BackendCfg.szName)); 736 743 } 737 744 … … 775 782 { 776 783 LogRel(("Audio: %s %s for driver '%s'\n", 777 fEnable ? "Enabling" : "Disabling", enmDir == PDMAUDIODIR_IN ? "input" : "output", pThis-> szName));784 fEnable ? "Enabling" : "Disabling", enmDir == PDMAUDIODIR_IN ? "input" : "output", pThis->BackendCfg.szName)); 778 785 779 786 /* … … 793 800 */ 794 801 PDRVAUDIOSTREAM pStreamEx; 795 RTListForEach(&pThis-> lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)802 RTListForEach(&pThis->LstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry) 796 803 { 797 804 if (pStreamEx->Core.enmDir == enmDir) … … 977 984 * @param pszName Stream name to use when logging warnings and errors. 978 985 */ 979 static int drvAudioStreamAdjustConfig(P DRVAUDIO pThis, PPDMAUDIOSTREAMCFG pCfgReq, const char *pszName)986 static int drvAudioStreamAdjustConfig(PCDRVAUDIO pThis, PPDMAUDIOSTREAMCFG pCfgReq, const char *pszName) 980 987 { 981 988 /* Get the right configuration for the stream to be created. */ 982 P DRVAUDIOCFG pDrvCfg = pCfgReq->enmDir == PDMAUDIODIR_IN ? &pThis->In.Cfg : &pThis->Out.Cfg;989 PCDRVAUDIOCFG pDrvCfg = pCfgReq->enmDir == PDMAUDIODIR_IN ? &pThis->CfgIn: &pThis->CfgOut; 983 990 984 991 /* Fill in the tweakable parameters into the requested host configuration. … … 1773 1780 bool fDone = true; 1774 1781 PDRVAUDIOSTREAM pIt; 1775 RTListForEach(&pThis-> lstStreams, pIt, DRVAUDIOSTREAM, ListEntry)1782 RTListForEach(&pThis->LstStreams, pIt, DRVAUDIOSTREAM, ListEntry) 1776 1783 { 1777 1784 if (strcmp(pIt->Core.szName, pStreamEx->Core.szName) == 0) … … 1815 1822 * We're good. 1816 1823 */ 1817 RTListAppend(&pThis-> lstStreams, &pStreamEx->ListEntry);1824 RTListAppend(&pThis->LstStreams, &pStreamEx->ListEntry); 1818 1825 STAM_COUNTER_INC(&pThis->Stats.TotalStreamsCreated); 1819 1826 *ppStream = &pStreamEx->Core; … … 1824 1831 if (pCfgHost->enmDir == PDMAUDIODIR_IN) 1825 1832 { 1826 if (pThis-> In.Cfg.Dbg.fEnabled)1833 if (pThis->CfgIn.Dbg.fEnabled) 1827 1834 { 1828 AudioHlpFileCreateAndOpen(&pStreamEx->In.Dbg.pFileCaptureNonInterleaved, pThis-> In.Cfg.Dbg.szPathOut,1835 AudioHlpFileCreateAndOpen(&pStreamEx->In.Dbg.pFileCaptureNonInterleaved, pThis->CfgIn.Dbg.szPathOut, 1829 1836 "DrvAudioCapNonInt", pThis->pDrvIns->iInstance, &pStreamEx->Host.Cfg.Props); 1830 AudioHlpFileCreateAndOpen(&pStreamEx->In.Dbg.pFileStreamRead, pThis-> In.Cfg.Dbg.szPathOut,1837 AudioHlpFileCreateAndOpen(&pStreamEx->In.Dbg.pFileStreamRead, pThis->CfgIn.Dbg.szPathOut, 1831 1838 "DrvAudioRead", pThis->pDrvIns->iInstance, &pStreamEx->Host.Cfg.Props); 1832 1839 } … … 1834 1841 else /* Out */ 1835 1842 { 1836 if (pThis-> Out.Cfg.Dbg.fEnabled)1843 if (pThis->CfgOut.Dbg.fEnabled) 1837 1844 { 1838 AudioHlpFileCreateAndOpen(&pStreamEx->Out.Dbg.pFilePlayNonInterleaved, pThis-> Out.Cfg.Dbg.szPathOut,1845 AudioHlpFileCreateAndOpen(&pStreamEx->Out.Dbg.pFilePlayNonInterleaved, pThis->CfgOut.Dbg.szPathOut, 1839 1846 "DrvAudioPlayNonInt", pThis->pDrvIns->iInstance, &pStreamEx->Host.Cfg.Props); 1840 AudioHlpFileCreateAndOpen(&pStreamEx->Out.Dbg.pFileStreamWrite, pThis-> Out.Cfg.Dbg.szPathOut,1847 AudioHlpFileCreateAndOpen(&pStreamEx->Out.Dbg.pFileStreamWrite, pThis->CfgOut.Dbg.szPathOut, 1841 1848 "DrvAudioWrite", pThis->pDrvIns->iInstance, &pStreamEx->Host.Cfg.Props); 1842 1849 } … … 1976 1983 if (pStreamEx->Core.enmDir == PDMAUDIODIR_IN) 1977 1984 { 1978 if (pThis-> In.Cfg.Dbg.fEnabled)1985 if (pThis->CfgIn.Dbg.fEnabled) 1979 1986 { 1980 1987 AudioHlpFileDestroy(pStreamEx->In.Dbg.pFileCaptureNonInterleaved); … … 1988 1995 { 1989 1996 Assert(pStreamEx->Core.enmDir == PDMAUDIODIR_OUT); 1990 if (pThis-> Out.Cfg.Dbg.fEnabled)1997 if (pThis->CfgOut.Dbg.fEnabled) 1991 1998 { 1992 1999 AudioHlpFileDestroy(pStreamEx->Out.Dbg.pFilePlayNonInterleaved); … … 3217 3224 { 3218 3225 if (fDisabled) 3219 LogRel(("Audio: Input for driver '%s' has been disabled, returning silence\n", pThis-> szName));3226 LogRel(("Audio: Input for driver '%s' has been disabled, returning silence\n", pThis->BackendCfg.szName)); 3220 3227 else 3221 3228 LogRel(("Audio: Warning: Input for stream '%s' of driver '%s' not ready (current input status is %s), returning silence\n", 3222 pStreamEx->Core.szName, pThis-> szName, PDMHostAudioStreamStateGetName(enmBackendState) ));3229 pStreamEx->Core.szName, pThis->BackendCfg.szName, PDMHostAudioStreamStateGetName(enmBackendState) )); 3223 3230 3224 3231 pStreamEx->Core.fWarningsShown |= PDMAUDIOSTREAM_WARN_FLAGS_DISABLED; … … 3536 3543 } 3537 3544 3538 if (!pThis-> Out.Cfg.Dbg.fEnabled || RT_FAILURE(rc))3545 if (!pThis->CfgOut.Dbg.fEnabled || RT_FAILURE(rc)) 3539 3546 { /* likely */ } 3540 3547 else … … 3628 3635 if (cfReadTotal) 3629 3636 { 3630 if (pThis-> In.Cfg.Dbg.fEnabled)3637 if (pThis->CfgIn.Dbg.fEnabled) 3631 3638 AudioHlpFileWrite(pStreamEx->In.Dbg.pFileStreamRead, 3632 3639 pvBuf, AUDIOMIXBUF_F2B(&pStreamEx->Guest.MixBuf, cfReadTotal), 0 /* fFlags */); … … 3734 3741 } 3735 3742 3736 if (pThis-> In.Cfg.Dbg.fEnabled)3743 if (pThis->CfgIn.Dbg.fEnabled) 3737 3744 AudioHlpFileWrite(pStreamEx->In.Dbg.pFileCaptureNonInterleaved, abChunk, cbCaptured, 0 /* fFlags */); 3738 3745 … … 4039 4046 PDRVAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVAUDIO, IHostAudioPort); 4040 4047 AssertReturnVoid(enmDir == PDMAUDIODIR_IN || enmDir == PDMAUDIODIR_OUT); 4041 LogRel(("Audio: The %s device for %s is changing.\n", enmDir == PDMAUDIODIR_IN ? "input" : "output", pThis-> szName));4048 LogRel(("Audio: The %s device for %s is changing.\n", enmDir == PDMAUDIODIR_IN ? "input" : "output", pThis->BackendCfg.szName)); 4042 4049 4043 4050 RTCritSectEnter(&pThis->CritSect); 4044 4051 PDRVAUDIOSTREAM pStreamEx; 4045 RTListForEach(&pThis-> lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)4052 RTListForEach(&pThis->LstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry) 4046 4053 { 4047 4054 if (pStreamEx->Core.enmDir == enmDir) … … 4219 4226 { 4220 4227 PDRVAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVAUDIO, IHostAudioPort); 4221 LogRel(("Audio: Device configuration of driver '%s' has changed\n", pThis-> szName));4228 LogRel(("Audio: Device configuration of driver '%s' has changed\n", pThis->BackendCfg.szName)); 4222 4229 4223 4230 #ifdef RT_OS_DARWIN /** @todo Remove legacy behaviour: */ … … 4225 4232 /* Mark all host streams to re-initialize. */ 4226 4233 PDRVAUDIOSTREAM pStreamEx; 4227 RTListForEach(&pThis-> lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)4234 RTListForEach(&pThis->LstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry) 4228 4235 { 4229 4236 drvAudioStreamMarkNeedReInit(pStreamEx, __PRETTY_FUNCTION__); … … 4289 4296 */ 4290 4297 PDRVAUDIOSTREAM pStreamEx; 4291 RTListForEach(&pThis-> lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)4298 RTListForEach(&pThis->LstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry) 4292 4299 { 4293 4300 drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE); … … 4321 4328 AssertRC(rc); 4322 4329 4323 LogFunc(("%s (detached %p, hReqPool=%p)\n", pThis-> szName, pThis->pHostDrvAudio, pThis->hReqPool));4330 LogFunc(("%s (detached %p, hReqPool=%p)\n", pThis->BackendCfg.szName, pThis->pHostDrvAudio, pThis->hReqPool)); 4324 4331 4325 4332 /* … … 4383 4390 /* 4384 4391 * Get the backend configuration. 4385 */ 4386 int rc = pIHostDrvAudio->pfnGetConfig(pIHostDrvAudio, &pThis->BackendCfg); 4387 if (RT_FAILURE(rc)) 4388 { 4389 LogRel(("Audio: Getting configuration for driver '%s' failed with %Rrc\n", pThis->szName, rc)); 4392 * Note! Take care not to wipe the DriverName config value on failure. 4393 */ 4394 PDMAUDIOBACKENDCFG BackendCfg; 4395 RT_ZERO(BackendCfg); 4396 int rc = pIHostDrvAudio->pfnGetConfig(pIHostDrvAudio, &BackendCfg); 4397 if (RT_SUCCESS(rc)) 4398 { 4399 if (LogIsEnabled() && strcmp(BackendCfg.szName, pThis->BackendCfg.szName) != 0) 4400 LogFunc(("BackendCfg.szName: '%s' -> '%s'\n", pThis->BackendCfg.szName, BackendCfg.szName)); 4401 pThis->BackendCfg = BackendCfg; 4402 pThis->In.cStreamsFree = BackendCfg.cMaxStreamsIn; 4403 pThis->Out.cStreamsFree = BackendCfg.cMaxStreamsOut; 4404 4405 LogFlowFunc(("cStreamsFreeIn=%RU8, cStreamsFreeOut=%RU8\n", pThis->In.cStreamsFree, pThis->Out.cStreamsFree)); 4406 } 4407 else 4408 { 4409 LogRel(("Audio: Getting configuration for driver '%s' failed with %Rrc\n", pThis->BackendCfg.szName, rc)); 4390 4410 return VERR_AUDIO_BACKEND_INIT_FAILED; 4391 4411 } 4392 4412 4393 pThis->In.cStreamsFree = pThis->BackendCfg.cMaxStreamsIn;4394 pThis->Out.cStreamsFree = pThis->BackendCfg.cMaxStreamsOut;4395 4396 LogFlowFunc(("cStreamsFreeIn=%RU8, cStreamsFreeOut=%RU8\n", pThis->In.cStreamsFree, pThis->Out.cStreamsFree));4397 4398 4413 LogRel2(("Audio: Host driver '%s' supports %RU32 input streams and %RU32 output streams at once.\n", 4399 pThis-> szName, pThis->In.cStreamsFree, pThis->Out.cStreamsFree));4414 pThis->BackendCfg.szName, pThis->In.cStreamsFree, pThis->Out.cStreamsFree)); 4400 4415 4401 4416 #ifdef VBOX_WITH_AUDIO_ENUM … … 4486 4501 else 4487 4502 { 4488 LogRel(("Audio: Failed to query interface for underlying host driver '%s'\n", pThis-> szName));4503 LogRel(("Audio: Failed to query interface for underlying host driver '%s'\n", pThis->BackendCfg.szName)); 4489 4504 rc = PDMDRV_SET_ERROR(pThis->pDrvIns, VERR_PDM_MISSING_INTERFACE_BELOW, 4490 4505 N_("The host audio driver does not implement PDMIHOSTAUDIO!")); … … 4506 4521 /* Complain: */ 4507 4522 LogRel(("DrvAudio: Host audio driver '%s' init failed with %Rrc. Switching to the NULL driver for now.\n", 4508 pThis-> szName, rc));4523 pThis->BackendCfg.szName, rc)); 4509 4524 PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "HostAudioNotResponding", 4510 4525 N_("Host audio backend (%s) initialization has failed. Selecting the NULL audio backend with the consequence that no sound is audible"), 4511 pThis-> szName);4526 pThis->BackendCfg.szName); 4512 4527 4513 4528 /* Replace with null audio: */ 4514 4529 pThis->pHostDrvAudio = (PPDMIHOSTAUDIO)&g_DrvHostAudioNull; 4515 RTStrCopy(pThis-> szName, sizeof(pThis->szName), "NULL");4530 RTStrCopy(pThis->BackendCfg.szName, sizeof(pThis->BackendCfg.szName), "NULL"); 4516 4531 rc = drvAudioHostInit(pThis); 4517 4532 AssertRC(rc); 4518 4533 } 4519 4534 4520 LogFunc(("[%s] rc=%Rrc\n", pThis-> szName, rc));4535 LogFunc(("[%s] rc=%Rrc\n", pThis->BackendCfg.szName, rc)); 4521 4536 return rc; 4522 4537 } … … 4533 4548 PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns); 4534 4549 PDRVAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIO); 4535 LogFunc(("%s\n", pThis-> szName));4550 LogFunc(("%s\n", pThis->BackendCfg.szName)); 4536 4551 4537 4552 int rc = RTCritSectEnter(&pThis->CritSect); … … 4563 4578 { 4564 4579 PDRVAUDIOSTREAM pStreamEx; 4565 RTListForEach(&pThis-> lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)4580 RTListForEach(&pThis->LstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry) 4566 4581 { 4567 4582 drvAudioStreamControlInternal(pThis, pStreamEx, enmCmd); … … 4626 4641 4627 4642 PDRVAUDIOSTREAM pStreamEx, pStreamExNext; 4628 RTListForEachSafe(&pThis-> lstStreams, pStreamEx, pStreamExNext, DRVAUDIOSTREAM, ListEntry)4643 RTListForEachSafe(&pThis->LstStreams, pStreamEx, pStreamExNext, DRVAUDIOSTREAM, ListEntry) 4629 4644 { 4630 4645 int rc = drvAudioStreamUninitInternal(pThis, pStreamEx); … … 4637 4652 4638 4653 /* Sanity. */ 4639 Assert(RTListIsEmpty(&pThis-> lstStreams));4654 Assert(RTListIsEmpty(&pThis->LstStreams)); 4640 4655 4641 4656 if (RTCritSectIsInitialized(&pThis->CritSect)) … … 4648 4663 } 4649 4664 4650 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Out.StatsReBuffering);4651 4665 #ifdef VBOX_WITH_STATISTICS 4652 4666 PDMDrvHlpSTAMDeregister(pDrvIns, &pThis->Stats.TotalStreamsActive); … … 4682 4696 * Basic instance init. 4683 4697 */ 4684 RTListInit(&pThis-> lstStreams);4698 RTListInit(&pThis->LstStreams); 4685 4699 pThis->hReqPool = NIL_RTREQPOOL; 4686 4700 … … 4713 4727 "In|Out"); 4714 4728 4715 int rc = CFGMR3QueryStringDef(pCfg, "DriverName", pThis-> szName, sizeof(pThis->szName), "Untitled");4729 int rc = CFGMR3QueryStringDef(pCfg, "DriverName", pThis->BackendCfg.szName, sizeof(pThis->BackendCfg.szName), "Untitled"); 4716 4730 AssertLogRelRCReturn(rc, rc); 4717 4731 … … 4724 4738 4725 4739 /* Debug stuff (same for both directions). */ 4726 rc = CFGMR3QueryBoolDef(pCfg, "DebugEnabled", &pThis-> In.Cfg.Dbg.fEnabled, false);4740 rc = CFGMR3QueryBoolDef(pCfg, "DebugEnabled", &pThis->CfgIn.Dbg.fEnabled, false); 4727 4741 AssertLogRelRCReturn(rc, rc); 4728 4742 4729 rc = CFGMR3QueryStringDef(pCfg, "DebugPathOut", pThis-> In.Cfg.Dbg.szPathOut, sizeof(pThis->In.Cfg.Dbg.szPathOut), "");4743 rc = CFGMR3QueryStringDef(pCfg, "DebugPathOut", pThis->CfgIn.Dbg.szPathOut, sizeof(pThis->CfgIn.Dbg.szPathOut), ""); 4730 4744 AssertLogRelRCReturn(rc, rc); 4731 if (pThis-> In.Cfg.Dbg.szPathOut[0] == '\0')4732 { 4733 rc = RTPathTemp(pThis-> In.Cfg.Dbg.szPathOut, sizeof(pThis->In.Cfg.Dbg.szPathOut));4745 if (pThis->CfgIn.Dbg.szPathOut[0] == '\0') 4746 { 4747 rc = RTPathTemp(pThis->CfgIn.Dbg.szPathOut, sizeof(pThis->CfgIn.Dbg.szPathOut)); 4734 4748 if (RT_FAILURE(rc)) 4735 4749 { 4736 4750 LogRel(("Audio: Warning! Failed to retrieve temporary directory: %Rrc - disabling debugging.\n", rc)); 4737 pThis->In.Cfg.Dbg.szPathOut[0] = '\0'; 4738 pThis->In.Cfg.Dbg.fEnabled = false; 4739 } 4740 } 4741 if (pThis->In.Cfg.Dbg.fEnabled) 4742 LogRel(("Audio: Debugging for driver '%s' enabled (audio data written to '%s')\n", pThis->szName, pThis->In.Cfg.Dbg.szPathOut)); 4751 pThis->CfgIn.Dbg.szPathOut[0] = '\0'; 4752 pThis->CfgIn.Dbg.fEnabled = false; 4753 } 4754 } 4755 if (pThis->CfgIn.Dbg.fEnabled) 4756 LogRel(("Audio: Debugging for driver '%s' enabled (audio data written to '%s')\n", 4757 pThis->BackendCfg.szName, pThis->CfgIn.Dbg.szPathOut)); 4743 4758 4744 4759 /* Copy debug setup to the output direction. */ 4745 pThis-> Out.Cfg.Dbg = pThis->In.Cfg.Dbg;4746 4747 LogRel2(("Audio: Verbose logging for driver '%s' is probably enabled too.\n", pThis-> szName));4760 pThis->CfgOut.Dbg = pThis->CfgIn.Dbg; 4761 4762 LogRel2(("Audio: Verbose logging for driver '%s' is probably enabled too.\n", pThis->BackendCfg.szName)); 4748 4763 /* This ^^^^^^^ is the *WRONG* place for that kind of statement. Verbose logging might only be enabled for DrvAudio. */ 4749 4764 LogRel2(("Audio: Initial status for driver '%s' is: input is %s, output is %s\n", 4750 pThis-> szName, pThis->In.fEnabled ? "enabled" : "disabled", pThis->Out.fEnabled ? "enabled" : "disabled"));4765 pThis->BackendCfg.szName, pThis->In.fEnabled ? "enabled" : "disabled", pThis->Out.fEnabled ? "enabled" : "disabled")); 4751 4766 4752 4767 /* … … 4757 4772 { 4758 4773 char szNm[48]; 4759 PDRVAUDIOCFG pAudioCfg = iDir == 0 ? &pThis-> In.Cfg : &pThis->Out.Cfg;4774 PDRVAUDIOCFG pAudioCfg = iDir == 0 ? &pThis->CfgIn : &pThis->CfgOut; 4760 4775 const char *pszDir = iDir == 0 ? "In" : "Out"; 4761 4776 … … 4840 4855 AssertRCReturn(rc, rc); 4841 4856 4842 pThis->fTerminate = false;4843 4857 pThis->pDrvIns = pDrvIns; 4844 4858 /* IBase. */ … … 4874 4888 * Statistics. 4875 4889 */ 4876 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Out.StatsReBuffering, "OutputReBuffering",4877 STAMUNIT_COUNT, "Number of times the output stream was re-buffered after starting.");4878 4879 4890 #ifdef VBOX_WITH_STATISTICS 4880 4891 PDMDrvHlpSTAMRegCounterEx(pDrvIns, &pThis->Stats.TotalStreamsActive, "TotalStreamsActive",
Note:
See TracChangeset
for help on using the changeset viewer.