Changeset 88723 in vbox
- Timestamp:
- Apr 27, 2021 10:03:19 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmaudioifs.h
r88720 r88723 910 910 * that this is an enabled stream! */ 911 911 #define PDMAUDIOSTREAMSTS_FLAGS_PAUSED RT_BIT_32(2) 912 /** Whether this stream was marked as being disabled 912 /** Indicates that the stream is draining (output only). 913 * Whether this stream was marked as being disabled 913 914 * but there are still associated guest output streams 914 915 * which rely on its data. */ 915 916 #define PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE RT_BIT_32(3) 916 /** Whether this stream is in re-initialization phase. 917 * All other bits remain untouched to be able to restore 918 * the stream's state after the re-initialization bas been 919 * finished. */ 920 #define PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT RT_BIT_32(4) 917 /** Whether this stream is in re-initialization phase and requires the device 918 * to call pfnStreamReInit. 919 * 920 * All other bits remain untouched to be able to restore the stream's state 921 * after the re-initialization has been completed. */ 922 #define PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT RT_BIT_32(4) 921 923 /** Validation mask. */ 922 924 #define PDMAUDIOSTREAMSTS_VALID_MASK UINT32_C(0x0000001F) … … 1080 1082 PPDMAUDIOSTREAMCFG pCfgGuest, PPDMAUDIOSTREAM *ppStream)); 1081 1083 1084 1082 1085 /** 1083 1086 * Destroys an audio stream. … … 1087 1090 */ 1088 1091 DECLR3CALLBACKMEMBER(int, pfnStreamDestroy, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream)); 1092 1093 /** 1094 * Re-initializes the stream in response to PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT. 1095 * 1096 * @returns VBox status code. 1097 * @param pInterface Pointer to this interface. 1098 * @param pStream The audio stream needing re-initialization. 1099 */ 1100 DECLR3CALLBACKMEMBER(int, pfnStreamReInit, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream)); 1089 1101 1090 1102 /** … … 1204 1216 1205 1217 /** PDMIAUDIOCONNECTOR interface ID. */ 1206 #define PDMIAUDIOCONNECTOR_IID " 00ee6f8e-16ab-4e9a-977c-d506c163be77"1218 #define PDMIAUDIOCONNECTOR_IID "ff6788cc-1a4d-4d4b-a2e0-9f56fce9b397" 1207 1219 1208 1220 -
trunk/include/VBox/vmm/pdmaudioinline.h
r88626 r88723 435 435 | PDMAUDIOSTREAMSTS_FLAGS_ENABLED 436 436 | PDMAUDIOSTREAMSTS_FLAGS_PAUSED 437 | PDMAUDIOSTREAMSTS_FLAGS_ PENDING_REINIT ))437 | PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT )) 438 438 == ( PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED 439 439 | PDMAUDIOSTREAMSTS_FLAGS_ENABLED); … … 459 459 | PDMAUDIOSTREAMSTS_FLAGS_PAUSED 460 460 | PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE 461 | PDMAUDIOSTREAMSTS_FLAGS_ PENDING_REINIT))461 | PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT)) 462 462 == ( PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED 463 463 | PDMAUDIOSTREAMSTS_FLAGS_ENABLED); … … 479 479 return (fStatus & ( PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED 480 480 | PDMAUDIOSTREAMSTS_FLAGS_ENABLED 481 | PDMAUDIOSTREAMSTS_FLAGS_ PENDING_REINIT))481 | PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT)) 482 482 == ( PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED 483 483 | PDMAUDIOSTREAMSTS_FLAGS_ENABLED); -
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r88720 r88723 2086 2086 static int audioMixerStreamUpdateStatus(PAUDMIXSTREAM pMixStream) 2087 2087 { 2088 /* 2089 * Reset the mixer status to start with. 2090 */ 2088 2091 pMixStream->fStatus = AUDMIXSTREAM_STATUS_NONE; 2089 2092 2090 if (pMixStream->pConn) /* Audio connector available? */ 2091 { 2092 const uint32_t fStreamStatus = pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream); 2093 2093 PPDMIAUDIOCONNECTOR const pConn = pMixStream->pConn; 2094 if (pConn) /* Audio connector available? */ 2095 { 2096 PPDMAUDIOSTREAM const pStream = pMixStream->pStream; 2097 PAUDMIXSINK const pSink = pMixStream->pSink; 2098 AssertPtr(pSink); 2099 2100 /* 2101 * Get the stream status. 2102 * Do re-init if needed and fetch the status again afterwards. 2103 */ 2104 uint32_t fStreamStatus = pConn->pfnStreamGetStatus(pConn, pStream); 2105 if (!(fStreamStatus & PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT)) 2106 { /* likely */ } 2107 else 2108 { 2109 LogFunc(("[%s] needs re-init...\n", pMixStream->pszName)); 2110 int rc = pConn->pfnStreamReInit(pConn, pStream); 2111 fStreamStatus = pConn->pfnStreamGetStatus(pConn, pStream); 2112 LogFunc(("[%s] re-init returns %Rrc and %#x.\n", pMixStream->pszName, rc, fStreamStatus)); RT_NOREF(rc); 2113 if (pSink->enmDir == AUDMIXSINKDIR_OUTPUT) 2114 { 2115 rc = AudioMixBufInitPeekState(&pSink->MixBuf, &pMixStream->PeekState, &pStream->Props); 2116 /** @todo we need to remember this, don't we? */ 2117 AssertRCReturn(rc, VINF_SUCCESS); 2118 } 2119 } 2120 2121 /* 2122 * Translate the status to mixer speak. 2123 */ 2094 2124 if (PDMAudioStrmStatusIsReady(fStreamStatus)) 2095 2125 pMixStream->fStatus |= AUDMIXSTREAM_STATUS_ENABLED; 2096 2126 2097 AssertPtr(pMixStream->pSink); 2098 switch (pMixStream->pSink->enmDir) 2127 switch (pSink->enmDir) 2099 2128 { 2100 2129 case AUDMIXSINKDIR_INPUT: -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r88720 r88723 308 308 static int drvAudioStreamControlInternalBackend(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx, PDMAUDIOSTREAMCMD enmStreamCmd); 309 309 static int drvAudioStreamControlInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx, PDMAUDIOSTREAMCMD enmStreamCmd); 310 static int drvAudioStreamCreateInternalBackend(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx, PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq);311 static int drvAudioStreamDestroyInternalBackend(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx);312 310 static int drvAudioStreamUninitInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx); 313 311 static int drvAudioStreamIterateInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx); … … 341 339 { RT_STR_TUPLE("PAUSED "), PDMAUDIOSTREAMSTS_FLAGS_PAUSED }, 342 340 { RT_STR_TUPLE("PENDING_DISABLE "), PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE }, 343 { RT_STR_TUPLE(" PENDING_REINIT "), PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT},341 { RT_STR_TUPLE("NEED_REINIT "), PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT }, 344 342 }; 345 343 if (!fStatus) … … 418 416 419 417 420 #ifdef VBOX_WITH_AUDIO_CALLBACKS421 /**422 * Schedules a re-initialization of all current audio streams.423 * The actual re-initialization will happen at some later point in time.424 *425 * @param pThis Pointer to driver instance.426 */427 static void drvAudioScheduleReInitInternal(PDRVAUDIO pThis)428 {429 LogFunc(("\n"));430 431 /* Mark all host streams to re-initialize. */432 PDRVAUDIOSTREAM pStreamEx;433 RTListForEach(&pThis->lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)434 {435 pStreamEx->Core.fStatus |= PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT;436 pStreamEx->cTriesReInit = 0;437 pStreamEx->nsLastReInit = 0;438 }439 440 # ifdef VBOX_WITH_AUDIO_ENUM441 /* Re-enumerate all host devices as soon as possible. */442 pThis->fEnumerateDevices = true;443 # endif444 }445 #endif /* VBOX_WITH_AUDIO_CALLBACKS */446 447 448 /**449 * Re-initializes an audio stream with its existing host and guest stream450 * configuration.451 *452 * This might be the case if the backend told us we need to re-initialize453 * because something on the host side has changed.454 *455 * @note Does not touch the stream's status flags.456 *457 * @returns VBox status code.458 * @param pThis Pointer to driver instance.459 * @param pStreamEx Stream to re-initialize.460 */461 static int drvAudioStreamReInitInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx)462 {463 AssertPtr(pThis);464 AssertPtr(pStreamEx);465 466 LogFlowFunc(("[%s]\n", pStreamEx->Core.szName));467 468 /*469 * Gather current stream status.470 */471 const bool fIsEnabled = RT_BOOL(pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_ENABLED); /* Stream is enabled? */472 473 /*474 * Destroy and re-create stream on backend side.475 */476 int rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE);477 if (RT_SUCCESS(rc))478 {479 rc = drvAudioStreamDestroyInternalBackend(pThis, pStreamEx);480 if (RT_SUCCESS(rc))481 {482 PDMAUDIOSTREAMCFG CfgHostAcq;483 rc = drvAudioStreamCreateInternalBackend(pThis, pStreamEx, &pStreamEx->Host.Cfg, &CfgHostAcq);484 /** @todo Validate (re-)acquired configuration with pStreamEx->Core.Host.Cfg? */485 if (RT_SUCCESS(rc))486 {487 #ifdef LOG_ENABLED488 LogFunc(("[%s] Acquired host format:\n", pStreamEx->Core.szName));489 PDMAudioStrmCfgLog(&CfgHostAcq);490 #endif491 }492 }493 }494 495 /* Drop all old data. */496 drvAudioStreamDropInternal(pThis, pStreamEx);497 498 /*499 * Restore previous stream state.500 */501 if (fIsEnabled)502 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_ENABLE);503 504 if (RT_FAILURE(rc))505 LogRel(("Audio: Re-initializing stream '%s' failed with %Rrc\n", pStreamEx->Core.szName, rc));506 507 LogFunc(("[%s] Returning %Rrc\n", pStreamEx->Core.szName, rc));508 return rc;509 }510 511 512 418 /** 513 419 * Resets the given audio stream. … … 541 447 AssertFailed(); 542 448 #endif 543 }544 545 546 /**547 * Re-initializes the given stream if it is scheduled for this operation.548 *549 * @note This caller must have entered the critical section of the driver instance,550 * needed for the host device (re-)enumeration.551 *552 * @param pThis Pointer to driver instance.553 * @param pStreamEx Stream to check and maybe re-initialize.554 */555 static void drvAudioStreamMaybeReInit(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx)556 {557 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT)558 {559 const unsigned cMaxTries = 3; /** @todo Make this configurable? */560 const uint64_t tsNowNs = RTTimeNanoTS();561 562 /* Throttle re-initializing streams on failure. */563 if ( pStreamEx->cTriesReInit < cMaxTries564 && tsNowNs - pStreamEx->nsLastReInit >= RT_NS_1SEC * pStreamEx->cTriesReInit) /** @todo Ditto. */565 {566 #ifdef VBOX_WITH_AUDIO_ENUM567 if (pThis->fEnumerateDevices)568 {569 /* Make sure to leave the driver's critical section before enumerating host stuff. */570 int rc2 = RTCritSectLeave(&pThis->CritSect);571 AssertRC(rc2);572 573 /* Re-enumerate all host devices. */574 drvAudioDevicesEnumerateInternal(pThis, true /* fLog */, NULL /* pDevEnum */);575 576 /* Re-enter the critical section again. */577 rc2 = RTCritSectEnter(&pThis->CritSect);578 AssertRC(rc2);579 580 pThis->fEnumerateDevices = false;581 }582 #endif /* VBOX_WITH_AUDIO_ENUM */583 584 int rc = drvAudioStreamReInitInternal(pThis, pStreamEx);585 if (RT_FAILURE(rc))586 {587 pStreamEx->cTriesReInit++;588 pStreamEx->nsLastReInit = tsNowNs;589 }590 else591 {592 /* Remove the pending re-init flag on success. */593 pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT;594 }595 }596 else597 {598 /* Did we exceed our tries re-initializing the stream?599 * Then this one is dead-in-the-water, so disable it for further use. */600 if (pStreamEx->cTriesReInit == cMaxTries)601 {602 LogRel(("Audio: Re-initializing stream '%s' exceeded maximum retries (%u), leaving as disabled\n",603 pStreamEx->Core.szName, cMaxTries));604 605 /* Don't try to re-initialize anymore and mark as disabled. */606 pStreamEx->Core.fStatus &= ~(PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT | PDMAUDIOSTREAMSTS_FLAGS_ENABLED);607 608 /* Note: Further writes to this stream go to / will be read from the bit bucket (/dev/null) from now on. */609 }610 }611 612 #ifdef LOG_ENABLED613 char szStreamSts[DRVAUDIO_STATUS_STR_MAX];614 #endif615 Log3Func(("[%s] fStatus=%s\n", pStreamEx->Core.szName, dbgAudioStreamStatusToStr(szStreamSts, pStreamEx->Core.fStatus)));616 }617 449 } 618 450 … … 1807 1639 1808 1640 /** 1641 * Re-initializes an audio stream with its existing host and guest stream 1642 * configuration. 1643 * 1644 * This might be the case if the backend told us we need to re-initialize 1645 * because something on the host side has changed. 1646 * 1647 * @note Does not touch the stream's status flags. 1648 * 1649 * @returns VBox status code. 1650 * @param pThis Pointer to driver instance. 1651 * @param pStreamEx Stream to re-initialize. 1652 */ 1653 static int drvAudioStreamReInitInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx) 1654 { 1655 AssertPtr(pThis); 1656 AssertPtr(pStreamEx); 1657 1658 LogFlowFunc(("[%s]\n", pStreamEx->Core.szName)); 1659 1660 /* 1661 * Gather current stream status. 1662 */ 1663 const bool fIsEnabled = RT_BOOL(pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_ENABLED); /* Stream is enabled? */ 1664 1665 /* 1666 * Destroy and re-create stream on backend side. 1667 */ 1668 int rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE); 1669 if (RT_SUCCESS(rc)) 1670 { 1671 rc = drvAudioStreamDestroyInternalBackend(pThis, pStreamEx); 1672 if (RT_SUCCESS(rc)) 1673 { 1674 PDMAUDIOSTREAMCFG CfgHostAcq; 1675 rc = drvAudioStreamCreateInternalBackend(pThis, pStreamEx, &pStreamEx->Host.Cfg, &CfgHostAcq); 1676 /** @todo Validate (re-)acquired configuration with pStreamEx->Core.Host.Cfg? */ 1677 if (RT_SUCCESS(rc)) 1678 { 1679 #ifdef LOG_ENABLED 1680 LogFunc(("[%s] Acquired host format:\n", pStreamEx->Core.szName)); 1681 PDMAudioStrmCfgLog(&CfgHostAcq); 1682 #endif 1683 } 1684 } 1685 } 1686 1687 /* Drop all old data. */ 1688 drvAudioStreamDropInternal(pThis, pStreamEx); 1689 1690 /* 1691 * Restore previous stream state. 1692 */ 1693 if (fIsEnabled) 1694 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_ENABLE); 1695 1696 if (RT_FAILURE(rc)) 1697 LogRel(("Audio: Re-initializing stream '%s' failed with %Rrc\n", pStreamEx->Core.szName, rc)); 1698 1699 LogFunc(("[%s] Returning %Rrc\n", pStreamEx->Core.szName, rc)); 1700 return rc; 1701 } 1702 1703 1704 /** 1705 * @interface_method_impl{PDMIAUDIOCONNECTOR,pfnStreamReInit} 1706 */ 1707 static DECLCALLBACK(int) drvAudioStreamReInit(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream) 1708 { 1709 PDRVAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVAUDIO, IAudioConnector); 1710 PDRVAUDIOSTREAM pStreamEx = (PDRVAUDIOSTREAM)pStream; 1711 AssertPtrReturn(pStreamEx, VERR_INVALID_POINTER); 1712 AssertReturn(pStreamEx->Core.uMagic == PDMAUDIOSTREAM_MAGIC, VERR_INVALID_MAGIC); 1713 AssertReturn(pStreamEx->uMagic == DRVAUDIOSTREAM_MAGIC, VERR_INVALID_MAGIC); 1714 AssertReturn(pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT, VERR_INVALID_STATE); 1715 LogFlowFunc(("\n")); 1716 1717 int rc = RTCritSectEnter(&pThis->CritSect); 1718 AssertRCReturn(rc, rc); 1719 1720 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT) 1721 { 1722 const unsigned cMaxTries = 3; /** @todo Make this configurable? */ 1723 const uint64_t tsNowNs = RTTimeNanoTS(); 1724 1725 /* Throttle re-initializing streams on failure. */ 1726 if ( pStreamEx->cTriesReInit < cMaxTries 1727 && tsNowNs - pStreamEx->nsLastReInit >= RT_NS_1SEC * pStreamEx->cTriesReInit) /** @todo Ditto. */ 1728 { 1729 #ifdef VBOX_WITH_AUDIO_ENUM 1730 if (pThis->fEnumerateDevices) 1731 { 1732 /* Make sure to leave the driver's critical section before enumerating host stuff. */ 1733 int rc2 = RTCritSectLeave(&pThis->CritSect); 1734 AssertRC(rc2); 1735 1736 /* Re-enumerate all host devices. */ 1737 drvAudioDevicesEnumerateInternal(pThis, true /* fLog */, NULL /* pDevEnum */); 1738 1739 /* Re-enter the critical section again. */ 1740 rc2 = RTCritSectEnter(&pThis->CritSect); 1741 AssertRC(rc2); 1742 1743 pThis->fEnumerateDevices = false; 1744 } 1745 #endif /* VBOX_WITH_AUDIO_ENUM */ 1746 1747 rc = drvAudioStreamReInitInternal(pThis, pStreamEx); 1748 if (RT_SUCCESS(rc)) 1749 { 1750 /* Remove the pending re-init flag on success. */ 1751 pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT; 1752 } 1753 else 1754 { 1755 pStreamEx->cTriesReInit++; 1756 pStreamEx->nsLastReInit = tsNowNs; 1757 } 1758 } 1759 else 1760 { 1761 /* Did we exceed our tries re-initializing the stream? 1762 * Then this one is dead-in-the-water, so disable it for further use. */ 1763 if (pStreamEx->cTriesReInit == cMaxTries) 1764 { 1765 LogRel(("Audio: Re-initializing stream '%s' exceeded maximum retries (%u), leaving as disabled\n", 1766 pStreamEx->Core.szName, cMaxTries)); 1767 1768 /* Don't try to re-initialize anymore and mark as disabled. */ 1769 pStreamEx->Core.fStatus &= ~(PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT | PDMAUDIOSTREAMSTS_FLAGS_ENABLED); 1770 1771 /* Note: Further writes to this stream go to / will be read from the bit bucket (/dev/null) from now on. */ 1772 } 1773 } 1774 1775 #ifdef LOG_ENABLED 1776 char szStreamSts[DRVAUDIO_STATUS_STR_MAX]; 1777 #endif 1778 Log3Func(("[%s] fStatus=%s\n", pStreamEx->Core.szName, dbgAudioStreamStatusToStr(szStreamSts, pStreamEx->Core.fStatus))); 1779 } 1780 else 1781 { 1782 AssertFailed(); 1783 rc = VERR_INVALID_STATE; 1784 } 1785 1786 RTCritSectLeave(&pThis->CritSect); 1787 LogFlowFuncLeaveRC(rc); 1788 return rc; 1789 } 1790 1791 1792 /** 1809 1793 * @interface_method_impl{PDMIAUDIOCONNECTOR,pfnStreamRetain} 1810 1794 */ … … 2287 2271 if (!pThis->pHostDrvAudio) 2288 2272 return VINF_SUCCESS; 2289 2290 /* Is the stream scheduled for re-initialization? Do so now. */2291 drvAudioStreamMaybeReInit(pThis, pStreamEx);2292 2273 2293 2274 #ifdef LOG_ENABLED … … 2363 2344 * Okay, disable it. 2364 2345 */ 2365 LogFunc(("[%s] Closing pending stream\n", pStreamEx->Core.szName));2346 LogFunc(("[%s] Disabling pending stream\n", pStreamEx->Core.szName)); 2366 2347 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE); 2367 2348 if (RT_SUCCESS(rc)) … … 2581 2562 AssertRCReturn(rc, PDMAUDIOSTREAMSTS_FLAGS_NONE); 2582 2563 2583 /* Is the stream scheduled for re-initialization? Do so now. */2584 drvAudioStreamMaybeReInit(pThis, pStreamEx);2585 2586 2564 PDMAUDIOSTREAMSTS fStrmStatus = pStreamEx->Core.fStatus; 2587 2565 … … 3054 3032 *********************************************************************************************************************************/ 3055 3033 #ifdef VBOX_WITH_AUDIO_CALLBACKS 3034 3035 /** 3036 * Schedules a re-initialization of all current audio streams. 3037 * The actual re-initialization will happen at some later point in time. 3038 * 3039 * @param pThis Pointer to driver instance. 3040 */ 3041 static void drvAudioScheduleReInitInternal(PDRVAUDIO pThis) 3042 { 3043 LogFunc(("\n")); 3044 3045 /* Mark all host streams to re-initialize. */ 3046 PDRVAUDIOSTREAM pStreamEx; 3047 RTListForEach(&pThis->lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry) 3048 { 3049 pStreamEx->Core.fStatus |= PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT; 3050 pStreamEx->cTriesReInit = 0; 3051 pStreamEx->nsLastReInit = 0; 3052 } 3053 3054 # ifdef VBOX_WITH_AUDIO_ENUM 3055 /* Re-enumerate all host devices as soon as possible. */ 3056 pThis->fEnumerateDevices = true; 3057 # endif 3058 } 3059 3060 3056 3061 /** 3057 3062 * @interface_method_impl{PDMIAUDIONOTIFYFROMHOST,pfnNotifyDevicesChanged} … … 3542 3547 pThis->IAudioConnector.pfnStreamCreate = drvAudioStreamCreate; 3543 3548 pThis->IAudioConnector.pfnStreamDestroy = drvAudioStreamDestroy; 3549 pThis->IAudioConnector.pfnStreamReInit = drvAudioStreamReInit; 3544 3550 pThis->IAudioConnector.pfnStreamRetain = drvAudioStreamRetain; 3545 3551 pThis->IAudioConnector.pfnStreamRelease = drvAudioStreamRelease;
Note:
See TracChangeset
for help on using the changeset viewer.