vbox的更動 88851 路徑 trunk/src/VBox/Devices/Audio/DrvAudio.cpp
- 時間撮記:
- 2021-5-3 下午10:12:53 (4 年 以前)
- svn:sync-xref-src-repo-rev:
- 144185
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r88825 r88851 353 353 static int drvAudioStreamControlInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx, PDMAUDIOSTREAMCMD enmStreamCmd); 354 354 static int drvAudioStreamUninitInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx); 355 static uint32_t drvAudioStreamRetainInternal(PDRVAUDIOSTREAM pStreamEx); 355 356 static uint32_t drvAudioStreamReleaseInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx, bool fMayDestroy); 356 357 static int drvAudioStreamIterateInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx); 357 358 358 /** Buffer size for d bgAudioStreamStatusToStr. */359 /** Buffer size for drvAudioStreamStatusToStr. */ 359 360 # define DRVAUDIO_STATUS_STR_MAX sizeof("INITIALIZED ENABLED PAUSED PENDING_DISABLED NEED_REINIT BACKEND_READY PREPARING_SWITCH 0x12345678") 360 361 … … 367 368 * @param fStatus Stream status flags to convert. 368 369 */ 369 static const char *d bgAudioStreamStatusToStr(char pszDst[DRVAUDIO_STATUS_STR_MAX], uint32_t fStatus)370 static const char *drvAudioStreamStatusToStr(char pszDst[DRVAUDIO_STATUS_STR_MAX], uint32_t fStatus) 370 371 { 371 372 static const struct … … 969 970 970 971 /** 972 * Common worker for synchronizing the ENABLED and PAUSED status bits with the 973 * backend after it becomes ready. 974 * 975 * Used by async init and re-init. 976 */ 977 static int drvAudioStreamUpdateBackendOnStatus(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx, const char *pszWhen) 978 { 979 int rc = VINF_SUCCESS; 980 if (pStreamEx->fStatus & PDMAUDIOSTREAM_STS_ENABLED) 981 { 982 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_ENABLE); 983 if (RT_SUCCESS(rc)) 984 { 985 if (pStreamEx->fStatus & PDMAUDIOSTREAM_STS_PAUSED) 986 { 987 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_PAUSE); 988 if (RT_FAILURE(rc)) 989 LogRelMax(64, ("Audio: Failed to pause stream '%s' after %s: %Rrc\n", pStreamEx->Core.szName, pszWhen, rc)); 990 } 991 } 992 else 993 LogRelMax(64, ("Audio: Failed to enable stream '%s' after %s: %Rrc\n", pStreamEx->Core.szName, pszWhen, rc)); 994 } 995 return rc; 996 } 997 998 999 /** 971 1000 * For performing PDMIHOSTAUDIO::pfnStreamInitAsync on a worker thread. 972 1001 * … … 1014 1043 pStreamEx->fStatus |= PDMAUDIOSTREAM_STS_BACKEND_READY; /* before the backend control call! */ 1015 1044 1016 if (pStreamEx->fStatus & PDMAUDIOSTREAM_STS_ENABLED) 1017 { 1018 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_ENABLE); 1019 if (RT_SUCCESS(rc)) 1020 { 1021 if (pStreamEx->fStatus & PDMAUDIOSTREAM_STS_PAUSED) 1022 { 1023 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_PAUSE); 1024 if (RT_FAILURE(rc)) 1025 LogRelMax(64, ("Audio: Failed to pause stream '%s' after initialization completed: %Rrc\n", 1026 pStreamEx->Core.szName, rc)); 1027 } 1028 } 1029 else 1030 LogRelMax(64, ("Audio: Failed to enable stream '%s' after initialization completed: %Rrc\n", 1031 pStreamEx->Core.szName, rc)); 1032 } 1045 rc = drvAudioStreamUpdateBackendOnStatus(pThis, pStreamEx, "asynchronous initialization completed"); 1033 1046 1034 1047 /* … … 1662 1675 char szStreamSts[DRVAUDIO_STATUS_STR_MAX]; 1663 1676 #endif 1664 LogFunc(("[%s] fStatus=%s\n", pStreamEx->Core.szName, d bgAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus)));1677 LogFunc(("[%s] fStatus=%s\n", pStreamEx->Core.szName, drvAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus))); 1665 1678 1666 1679 if (pStreamEx->fStatus & PDMAUDIOSTREAM_STS_INITIALIZED) … … 1729 1742 char szStreamSts[DRVAUDIO_STATUS_STR_MAX]; 1730 1743 LogFunc(("[%s] Warning: Still has %s set when uninitializing\n", 1731 pStreamEx->Core.szName, d bgAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus)));1744 pStreamEx->Core.szName, drvAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus))); 1732 1745 } 1733 1746 #endif … … 1859 1872 char szStatus[DRVAUDIO_STATUS_STR_MAX], szBackendStatus[DRVAUDIO_STATUS_STR_MAX]; 1860 1873 LogRel2(("Audio: Destroying stream '%s': cRefs=%u; status: %s; backend: %s; hReqInitAsync=%p\n", 1861 pStreamEx->Core.szName, pStreamEx->cRefs, d bgAudioStreamStatusToStr(szStatus, pStreamEx->fStatus),1862 d bgAudioStreamStatusToStr(szBackendStatus, drvAudioStreamGetBackendStatus(pThis, pStreamEx)),1874 pStreamEx->Core.szName, pStreamEx->cRefs, drvAudioStreamStatusToStr(szStatus, pStreamEx->fStatus), 1875 drvAudioStreamStatusToStr(szBackendStatus, drvAudioStreamGetBackendStatus(pThis, pStreamEx)), 1863 1876 pStreamEx->hReqInitAsync)); 1864 1877 … … 1907 1920 * Drops all audio data (and associated state) of a stream. 1908 1921 * 1909 * Used by drvAudioStreamIterateInternal(), drvAudioStreamReset Internal(), and1922 * Used by drvAudioStreamIterateInternal(), drvAudioStreamResetOnDisable(), and 1910 1923 * drvAudioStreamReInitInternal(). 1911 1924 * 1912 1925 * @param pStreamEx Stream to drop data for. 1913 1926 */ 1914 static void drvAudioStream DropInternal(PDRVAUDIOSTREAM pStreamEx)1927 static void drvAudioStreamResetInternal(PDRVAUDIOSTREAM pStreamEx) 1915 1928 { 1916 1929 LogFunc(("[%s]\n", pStreamEx->Core.szName)); … … 1930 1943 pStreamEx->Out.offPreBuf = 0; 1931 1944 pStreamEx->Out.enmPlayState = pStreamEx->Out.cbPreBufThreshold > 0 1932 1945 ? DRVAUDIOPLAYSTATE_PREBUF : DRVAUDIOPLAYSTATE_PLAY; 1933 1946 } 1934 1947 } … … 1950 1963 static int drvAudioStreamReInitInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx) 1951 1964 { 1952 AssertPtr(pThis); 1953 AssertPtr(pStreamEx); 1954 1955 LogFlowFunc(("[%s]\n", pStreamEx->Core.szName)); 1956 1957 /* 1958 * Gather current stream status. 1959 */ 1960 const bool fIsEnabled = RT_BOOL(pStreamEx->fStatus & PDMAUDIOSTREAM_STS_ENABLED); /* Stream is enabled? */ 1961 1962 /** @todo r=bird: this is retried a bit too indiscriminately for my taste ... */ 1965 char szTmp[RT_MAX(PDMAUDIOSTRMCFGTOSTRING_MAX, DRVAUDIO_STATUS_STR_MAX)]; 1966 LogFlowFunc(("[%s] status: %s\n", pStreamEx->Core.szName, drvAudioStreamStatusToStr(szTmp, pStreamEx->fStatus) )); 1967 1963 1968 /* 1964 1969 * Destroy and re-create stream on backend side. 1965 1970 */ 1966 int rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE); 1967 if (RT_SUCCESS(rc)) 1968 { 1969 rc = drvAudioStreamDestroyInternalBackend(pThis, pStreamEx); 1971 if ( (pStreamEx->fStatus & (PDMAUDIOSTREAM_STS_ENABLED | PDMAUDIOSTREAM_STS_INITIALIZED | PDMAUDIOSTREAM_STS_BACKEND_READY)) 1972 == (PDMAUDIOSTREAM_STS_ENABLED | PDMAUDIOSTREAM_STS_INITIALIZED | PDMAUDIOSTREAM_STS_BACKEND_READY)) 1973 drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE); 1974 1975 if (pStreamEx->fStatus & PDMAUDIOSTREAM_STS_INITIALIZED) 1976 drvAudioStreamDestroyInternalBackend(pThis, pStreamEx); 1977 1978 int rc = VERR_AUDIO_STREAM_NOT_READY; 1979 if (!(pStreamEx->fStatus & PDMAUDIOSTREAM_STS_INITIALIZED)) 1980 { 1981 drvAudioStreamResetInternal(pStreamEx); 1982 1983 PDMAUDIOSTREAMCFG CfgHostAcq; 1984 rc = drvAudioStreamCreateInternalBackend(pThis, pStreamEx, &pStreamEx->Host.Cfg, &CfgHostAcq); 1970 1985 if (RT_SUCCESS(rc)) 1971 1986 { 1972 PDMAUDIOSTREAMCFG CfgHostAcq; 1973 rc = drvAudioStreamCreateInternalBackend(pThis, pStreamEx, &pStreamEx->Host.Cfg, &CfgHostAcq); 1974 /** @todo Validate (re-)acquired configuration with pStreamEx->Core.Host.Cfg? */ 1975 if (RT_SUCCESS(rc)) 1987 LogFunc(("[%s] Acquired host format:\n", pStreamEx->Core.szName, 1988 PDMAudioStrmCfgToString(&CfgHostAcq, szTmp, sizeof(szTmp)) )); 1989 if (true) /** @todo Validate (re-)acquired configuration with pStreamEx->Core.Host.Cfg? */ 1976 1990 { 1977 #ifdef LOG_ENABLED 1978 LogFunc(("[%s] Acquired host format:\n", pStreamEx->Core.szName)); 1979 PDMAudioStrmCfgLog(&CfgHostAcq); 1980 #endif 1991 /* 1992 * Kick off the asynchronous init. 1993 */ 1994 if (!pStreamEx->fNeedAsyncInit) 1995 { 1996 pStreamEx->fStatus |= PDMAUDIOSTREAM_STS_BACKEND_READY; 1997 PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->fStatus); 1998 } 1999 else 2000 { 2001 drvAudioStreamRetainInternal(pStreamEx); 2002 int rc2 = RTReqPoolCallEx(pThis->hReqPool, 0 /*cMillies*/, &pStreamEx->hReqInitAsync, 2003 RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT, 2004 (PFNRT)drvAudioStreamInitAsync, 2, pThis, pStreamEx); 2005 LogFlowFunc(("hReqInitAsync=%p rc2=%Rrc\n", pStreamEx->hReqInitAsync, rc2)); 2006 AssertRCStmt(rc2, drvAudioStreamInitAsync(pThis, pStreamEx)); 2007 } 2008 2009 /* 2010 * Update the backend on the stream state if it's ready, otherwise 2011 * let the worker thread do it after the async init has completed. 2012 */ 2013 if ( (pStreamEx->fStatus & (PDMAUDIOSTREAM_STS_BACKEND_READY | PDMAUDIOSTREAM_STS_INITIALIZED)) 2014 == (PDMAUDIOSTREAM_STS_BACKEND_READY | PDMAUDIOSTREAM_STS_INITIALIZED)) 2015 { 2016 rc = drvAudioStreamUpdateBackendOnStatus(pThis, pStreamEx, "re-initializing"); 2017 /** @todo not sure if we really need to care about this status code... */ 2018 } 2019 else if (pStreamEx->fStatus & PDMAUDIOSTREAM_STS_INITIALIZED) 2020 { 2021 Assert(pStreamEx->hReqInitAsync != NIL_RTREQ); 2022 LogFunc(("Asynchronous stream init (%p) ...\n", pStreamEx->hReqInitAsync)); 2023 } 2024 else 2025 { 2026 LogRel(("Audio: Re-initializing stream '%s' somehow failed, status: %s\n", pStreamEx->Core.szName, 2027 drvAudioStreamStatusToStr(szTmp, pStreamEx->fStatus) )); 2028 AssertFailed(); 2029 rc = VERR_AUDIO_STREAM_COULD_NOT_CREATE; 2030 } 1981 2031 } 1982 2032 } 1983 } 1984 1985 /** @todo r=bird: Why do we do the dropping and re-enabling of the stream 1986 * regardless of how the above went? It'll overwrite any above 1987 * failures for starters... */ 1988 /* Drop all old data. */ 1989 drvAudioStreamDropInternal(pStreamEx); 1990 1991 /* 1992 * Restore previous stream state. 1993 */ 1994 /** @todo this isn't taking PAUSED or PENDING_DISABLE into consideration. */ 1995 if (fIsEnabled) 1996 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_ENABLE); 1997 1998 if (RT_FAILURE(rc)) 1999 LogRel(("Audio: Re-initializing stream '%s' failed with %Rrc\n", pStreamEx->Core.szName, rc)); 2033 else 2034 LogRel(("Audio: Re-initializing stream '%s' failed with %Rrc\n", pStreamEx->Core.szName, rc)); 2035 } 2036 else 2037 { 2038 LogRel(("Audio: Re-initializing stream '%s' failed to destroy previous backend.\n", pStreamEx->Core.szName)); 2039 AssertFailed(); 2040 } 2000 2041 2001 2042 LogFunc(("[%s] Returning %Rrc\n", pStreamEx->Core.szName, rc)); … … 2022 2063 if (pStreamEx->fStatus & PDMAUDIOSTREAM_STS_NEED_REINIT) 2023 2064 { 2024 const unsigned cMaxTries = 3; /** @todo Make this configurable? */ 2025 const uint64_t tsNowNs = RTTimeNanoTS(); 2026 2027 /** @todo r=bird: Must postpone if hReqInitAsync isn't NIL or cancellable. */ 2065 const unsigned cMaxTries = 5; 2066 const uint64_t nsNow = RTTimeNanoTS(); 2028 2067 2029 2068 /* Throttle re-initializing streams on failure. */ 2030 2069 if ( pStreamEx->cTriesReInit < cMaxTries 2070 && pStreamEx->hReqInitAsync == NIL_RTREQ 2031 2071 && ( pStreamEx->nsLastReInit == 0 2032 || tsNowNs - pStreamEx->nsLastReInit >= RT_NS_1SEC * pStreamEx->cTriesReInit)) /** @todo Ditto. */ 2033 { 2034 #ifdef VBOX_WITH_AUDIO_ENUM 2035 /** @todo do this elsewhere. */ 2036 if (pThis->fEnumerateDevices) 2037 { 2038 /* Make sure to leave the driver's critical section before enumerating host stuff. */ 2039 int rc2 = RTCritSectLeave(&pThis->CritSect); 2040 AssertRC(rc2); 2041 2042 /* Re-enumerate all host devices. */ 2043 drvAudioDevicesEnumerateInternal(pThis, true /* fLog */, NULL /* pDevEnum */); 2044 2045 /* Re-enter the critical section again. */ 2046 rc2 = RTCritSectEnter(&pThis->CritSect); 2047 AssertRC(rc2); 2048 2049 pThis->fEnumerateDevices = false; 2050 } 2051 #endif /* VBOX_WITH_AUDIO_ENUM */ 2052 2072 || nsNow - pStreamEx->nsLastReInit >= RT_NS_1SEC * pStreamEx->cTriesReInit)) 2073 { 2053 2074 rc = drvAudioStreamReInitInternal(pThis, pStreamEx); 2054 2075 if (RT_SUCCESS(rc)) … … 2060 2081 else 2061 2082 { 2083 pStreamEx->nsLastReInit = nsNow; 2062 2084 pStreamEx->cTriesReInit++; 2063 pStreamEx->nsLastReInit = tsNowNs; 2085 2086 /* Did we exceed our tries re-initializing the stream? 2087 * Then this one is dead-in-the-water, so disable it for further use. */ 2088 if (pStreamEx->cTriesReInit >= cMaxTries) 2089 { 2090 LogRel(("Audio: Re-initializing stream '%s' exceeded maximum retries (%u), leaving as disabled\n", 2091 pStreamEx->Core.szName, cMaxTries)); 2092 2093 /* Don't try to re-initialize anymore and mark as disabled. */ 2094 /** @todo should mark it as not-initialized too, shouldn't we? */ 2095 pStreamEx->fStatus &= ~(PDMAUDIOSTREAM_STS_NEED_REINIT | PDMAUDIOSTREAM_STS_ENABLED); 2096 PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->fStatus); 2097 2098 /* Note: Further writes to this stream go to / will be read from the bit bucket (/dev/null) from now on. */ 2099 } 2064 2100 } 2065 2101 } 2066 2102 else 2067 { 2068 /* Did we exceed our tries re-initializing the stream? 2069 * Then this one is dead-in-the-water, so disable it for further use. */ 2070 /** @todo r=bird: This should be done above when drvAudioStreamReInitInternal fails! Duh^2! */ 2071 if (pStreamEx->cTriesReInit == cMaxTries) 2072 { 2073 LogRel(("Audio: Re-initializing stream '%s' exceeded maximum retries (%u), leaving as disabled\n", 2074 pStreamEx->Core.szName, cMaxTries)); 2075 2076 /* Don't try to re-initialize anymore and mark as disabled. */ 2077 /** @todo should mark it as not-initialized too, shouldn't we? */ 2078 pStreamEx->fStatus &= ~(PDMAUDIOSTREAM_STS_NEED_REINIT | PDMAUDIOSTREAM_STS_ENABLED); 2079 PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->fStatus); 2080 2081 /* Note: Further writes to this stream go to / will be read from the bit bucket (/dev/null) from now on. */ 2082 } 2083 } 2103 Log8Func(("cTriesReInit=%d hReqInitAsync=%p nsLast=%RU64 nsNow=%RU64 nsDelta=%RU64\n", pStreamEx->cTriesReInit, 2104 pStreamEx->hReqInitAsync, pStreamEx->nsLastReInit, nsNow, nsNow - pStreamEx->nsLastReInit)); 2084 2105 2085 2106 #ifdef LOG_ENABLED 2086 2107 char szStreamSts[DRVAUDIO_STATUS_STR_MAX]; 2087 2108 #endif 2088 Log3Func(("[%s] fStatus=%s\n", pStreamEx->Core.szName, d bgAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus)));2109 Log3Func(("[%s] fStatus=%s\n", pStreamEx->Core.szName, drvAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus))); 2089 2110 } 2090 2111 else … … 2094 2115 } 2095 2116 2117 #ifdef VBOX_WITH_AUDIO_ENUM 2118 /** @todo do this elsewhere. What if stuff changes when there are no open 2119 * streams to re-init? */ 2120 if (pThis->fEnumerateDevices) 2121 { 2122 /* Make sure to leave the driver's critical section before enumerating host stuff. */ 2123 int rc2 = RTCritSectLeave(&pThis->CritSect); 2124 AssertRC(rc2); 2125 2126 /* Re-enumerate all host devices. */ 2127 drvAudioDevicesEnumerateInternal(pThis, true /* fLog */, NULL /* pDevEnum */); 2128 2129 /* Re-enter the critical section again. */ 2130 rc2 = RTCritSectEnter(&pThis->CritSect); 2131 AssertRC(rc2); 2132 2133 pThis->fEnumerateDevices = false; 2134 } 2135 #endif /* VBOX_WITH_AUDIO_ENUM */ 2136 2096 2137 RTCritSectLeave(&pThis->CritSect); 2138 2097 2139 LogFlowFuncLeaveRC(rc); 2098 2140 return rc; … … 2177 2219 LogRel2(("Audio: %s stream '%s' backend (%s is %s; status: %s; backend-status: %s)\n", 2178 2220 PDMAudioStrmCmdGetName(enmStreamCmd), pStreamEx->Core.szName, PDMAudioDirGetName(pStreamEx->Core.enmDir), 2179 fDirEnabled ? "enabled" : "disabled", d bgAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus),2180 d bgAudioStreamStatusToStr(szBackendStreamSts, fBackendStatus) ));2221 fDirEnabled ? "enabled" : "disabled", drvAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus), 2222 drvAudioStreamStatusToStr(szBackendStreamSts, fBackendStatus) )); 2181 2223 2182 2224 if (fDirEnabled) … … 2238 2280 * @param pStreamEx Stream to reset. 2239 2281 */ 2240 static void drvAudioStreamReset Internal(PDRVAUDIOSTREAM pStreamEx)2241 { 2242 drvAudioStream DropInternal(pStreamEx);2282 static void drvAudioStreamResetOnDisable(PDRVAUDIOSTREAM pStreamEx) 2283 { 2284 drvAudioStreamResetInternal(pStreamEx); 2243 2285 2244 2286 LogFunc(("[%s]\n", pStreamEx->Core.szName)); … … 2327 2369 #endif 2328 2370 LogFunc(("[%s] enmStreamCmd=%s fStatus=%s\n", pStreamEx->Core.szName, PDMAudioStrmCmdGetName(enmStreamCmd), 2329 d bgAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus)));2371 drvAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus))); 2330 2372 2331 2373 int rc = VINF_SUCCESS; … … 2401 2443 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE); 2402 2444 if (RT_SUCCESS(rc)) 2403 drvAudioStreamReset Internal(pStreamEx);2445 drvAudioStreamResetOnDisable(pStreamEx); 2404 2446 } 2405 2447 } … … 2704 2746 pStreamEx->offInternal, pStreamEx->Core.szName, pStreamEx->Out.cbPreBuffered - cbLeft, 2705 2747 pStreamEx->Out.cbPreBuffered, cbBuf, rc, *pcbWritten, drvAudioPlayStateName(pStreamEx->Out.enmPlayState) )); 2706 AssertMsg(pStreamEx->Out.enmPlayState == DRVAUDIOPLAYSTATE_PREBUF_COMMITTING || RT_FAILURE(rc), 2707 ("Buggy host driver buffer reporting? cbLeft=%#x cbPreBuffered=%#x\n", cbLeft, pStreamEx->Out.cbPreBuffered)); 2748 AssertMsg( pStreamEx->Out.enmPlayState == DRVAUDIOPLAYSTATE_PREBUF_COMMITTING 2749 || pStreamEx->Out.enmPlayState == DRVAUDIOPLAYSTATE_PREBUF 2750 || RT_FAILURE(rc), 2751 ("Buggy host driver buffer reporting? cbLeft=%#x cbPreBuffered=%#x enmPlayState=%s\n", 2752 cbLeft, pStreamEx->Out.cbPreBuffered, drvAudioPlayStateName(pStreamEx->Out.enmPlayState) )); 2708 2753 2709 2754 pStreamEx->Out.cbPreBuffered = cbLeft; … … 2733 2778 char szStreamSts[DRVAUDIO_STATUS_STR_MAX]; 2734 2779 #endif 2735 Log3Func(("[%s] fStatus=%s\n", pStreamEx->Core.szName, d bgAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus)));2780 Log3Func(("[%s] fStatus=%s\n", pStreamEx->Core.szName, drvAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus))); 2736 2781 2737 2782 /* Not enabled or paused? Skip iteration. */ … … 2832 2877 pStreamEx->fStatus &= ~(PDMAUDIOSTREAM_STS_ENABLED | PDMAUDIOSTREAM_STS_PENDING_DISABLE); 2833 2878 PDMAUDIOSTREAM_STS_ASSERT_VALID(pStreamEx->fStatus); 2834 drvAudioStream DropInternal(pStreamEx); /* Not a DROP command, just a stream reset. */2879 drvAudioStreamResetInternal(pStreamEx); 2835 2880 } 2836 2881 /** @todo r=bird: This log entry sounds a rather fishy to be honest... Any … … 3087 3132 char szStreamSts[DRVAUDIO_STATUS_STR_MAX]; 3088 3133 #endif 3089 Log3Func(("[%s] %s\n", pStreamEx->Core.szName, d bgAudioStreamStatusToStr(szStreamSts, fStrmStatus)));3134 Log3Func(("[%s] %s\n", pStreamEx->Core.szName, drvAudioStreamStatusToStr(szStreamSts, fStrmStatus))); 3090 3135 return fStrmStatus; 3091 3136 } … … 3329 3374 if (cbBuf + pStreamEx->Out.cbPreBuffered < pStreamEx->Out.cbPreBufThreshold) 3330 3375 rc = drvAudioStreamPlayToPreBuffer(pStreamEx, pvBuf, cbBuf, pStreamEx->Out.cbPreBufThreshold, pcbWritten); 3331 else if (fBackendStatus & PDMAUDIOSTREAM_STS_INITIALIZED) 3376 else if ( (fBackendStatus & PDMAUDIOSTREAM_STS_INITIALIZED) 3377 && (pStreamEx->fStatus & PDMAUDIOSTREAM_STS_BACKEND_READY)) 3332 3378 { 3333 3379 Log3Func(("[%s] Pre-buffering completing: cbBuf=%#x cbPreBuffered=%#x => %#x vs cbPreBufThreshold=%#x\n", … … 3347 3393 3348 3394 case DRVAUDIOPLAYSTATE_PREBUF_OVERDUE: 3349 Assert( !(pStreamEx->fStatus & PDMAUDIOSTREAM_STS_BACKEND_READY));3350 Assert(!(fBackendStatus & PDMAUDIOSTREAM_STS_INITIALIZED));3395 Assert( !(pStreamEx->fStatus & PDMAUDIOSTREAM_STS_BACKEND_READY) 3396 || !(fBackendStatus & PDMAUDIOSTREAM_STS_INITIALIZED)); 3351 3397 RT_FALL_THRU(); 3352 3398 case DRVAUDIOPLAYSTATE_PREBUF_SWITCHING: … … 3364 3410 pStreamEx->offInternal += cbBuf; 3365 3411 Log3Func(("[%s] Discarding the data, backend state: %s\n", pStreamEx->Core.szName, 3366 d bgAudioStreamStatusToStr(szState, fBackendStatus) ));3412 drvAudioStreamStatusToStr(szState, fBackendStatus) )); 3367 3413 break; 3368 3414 … … 3699 3745 char szStreamSts[DRVAUDIO_STATUS_STR_MAX]; 3700 3746 #endif 3701 Log3Func(("[%s] fStatus=%s\n", pStreamEx->Core.szName, d bgAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus)));3747 Log3Func(("[%s] fStatus=%s\n", pStreamEx->Core.szName, drvAudioStreamStatusToStr(szStreamSts, pStreamEx->fStatus))); 3702 3748 3703 3749 /*
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器