Changeset 59102 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Dec 11, 2015 4:27:22 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 104668
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r59085 r59102 1203 1203 rc = pDrv->pConnector->pfnPlayOut(pDrv->pConnector, NULL /* cSamplesPlayed */); 1204 1204 1205 uint32_t cSamplesMin = (int)((2 * uTicksElapsed * pDrv->Out.pStrmOut->Props.uHz + uTicksPerSec) / uTicksPerSec / 2); 1206 uint32_t cbSamplesMin = AUDIOMIXBUF_S2B(&pDrv->Out.pStrmOut->MixBuf, cSamplesMin); 1207 1208 LogFlowFunc(("LUN#%RU8: rc=%Rrc, cbOut=%RU32, cSamplesMin=%RU32, cbSamplesMin=%RU32\n", 1209 pDrv->uLUN, rc, cbOut, cSamplesMin, cbSamplesMin)); 1210 1205 #ifdef DEBUG_TIMER 1206 LogFlowFunc(("LUN#%RU8: rc=%Rrc, cbIn=%RU32, cbOut=%RU32\n", pDrv->uLUN, rc, cbIn, cbOut)); 1207 #endif 1208 const bool fIsActiveOut = pDrv->pConnector->pfnIsActiveOut(pDrv->pConnector, pDrv->Out.pStrmOut); 1209 1210 /* If we there was an error handling (available) output or there simply is no output available, 1211 * then calculate the minimum data rate which must be processed by the device emulation in order 1212 * to function correctly. 1213 * 1214 * This is not the optimal solution, but as we have to deal with this on a timer-based approach 1215 * (until we have the audio callbacks) we need to have device' DMA engines running. */ 1211 1216 if ( RT_FAILURE(rc) 1212 && cbSamplesMin > cbOut) 1213 { 1214 LogFlowFunc(("LUN#%RU8: Adj: %RU32 -> %RU32\n", pDrv->uLUN, cbOut, cbSamplesMin)); 1215 cbOut = cbSamplesMin; 1217 || !fIsActiveOut) 1218 { 1219 uint32_t cSamplesMin = (int)((2 * uTicksElapsed * pDrv->Out.pStrmOut->Props.uHz + uTicksPerSec) / uTicksPerSec / 2); 1220 uint32_t cbSamplesMin = AUDIOMIXBUF_S2B(&pDrv->Out.pStrmOut->MixBuf, cSamplesMin); 1221 1222 #ifdef DEBUG_TIMER 1223 LogFlowFunc(("\trc=%Rrc, cSamplesMin=%RU32, cbSamplesMin=%RU32\n", rc, cSamplesMin, cbSamplesMin)); 1224 #endif 1225 cbOut = RT_MAX(cbOut, cbSamplesMin); 1216 1226 } 1217 1227 -
trunk/src/VBox/Devices/Audio/DevIchHda.cpp
r59069 r59102 2905 2905 rc = pDrv->pConnector->pfnPlayOut(pDrv->pConnector, NULL /* cSamplesPlayed */); 2906 2906 2907 uint32_t cSamplesMin = (int)((2 * uTicksElapsed * pDrv->Out.pStrmOut->Props.uHz + uTicksPerSec) / uTicksPerSec / 2); 2908 uint32_t cbSamplesMin = AUDIOMIXBUF_S2B(&pDrv->Out.pStrmOut->MixBuf, cSamplesMin); 2909 2910 LogFlowFunc(("LUN#%RU8: rc=%Rrc, cbOut=%RU32, cSamplesMin=%RU32, cbSamplesMin=%RU32\n", 2911 pDrv->uLUN, rc, cbOut, cSamplesMin, cbSamplesMin)); 2912 2907 #ifdef DEBUG_TIMER 2908 LogFlowFunc(("LUN#%RU8: rc=%Rrc, cbIn=%RU32, cbOut=%RU32\n", pDrv->uLUN, rc, cbIn, cbOut)); 2909 #endif 2910 const bool fIsActiveOut = pDrv->pConnector->pfnIsActiveOut(pDrv->pConnector, pDrv->Out.pStrmOut); 2911 2912 /* If we there was an error handling (available) output or there simply is no output available, 2913 * then calculate the minimum data rate which must be processed by the device emulation in order 2914 * to function correctly. 2915 * 2916 * This is not the optimal solution, but as we have to deal with this on a timer-based approach 2917 * (until we have the audio callbacks) we need to have device' DMA engines running. */ 2913 2918 if ( RT_FAILURE(rc) 2914 && cbSamplesMin > cbOut) 2915 { 2916 LogFlowFunc(("LUN#%RU8: Adj: %RU32 -> %RU32\n", pDrv->uLUN, cbOut, cbSamplesMin)); 2917 cbOut = cbSamplesMin; 2919 || !fIsActiveOut) 2920 { 2921 uint32_t cSamplesMin = (int)((2 * uTicksElapsed * pDrv->Out.pStrmOut->Props.uHz + uTicksPerSec) / uTicksPerSec / 2); 2922 uint32_t cbSamplesMin = AUDIOMIXBUF_S2B(&pDrv->Out.pStrmOut->MixBuf, cSamplesMin); 2923 2924 #ifdef DEBUG_TIMER 2925 LogFlowFunc(("\trc=%Rrc, cSamplesMin=%RU32, cbSamplesMin=%RU32\n", rc, cSamplesMin, cbSamplesMin)); 2926 #endif 2927 cbOut = RT_MAX(cbOut, cbSamplesMin); 2918 2928 } 2919 2929 -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r59097 r59102 1245 1245 PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface); 1246 1246 1247 if (!pThis->pHostDrvAudio->pfnIsEnabled(pThis->pHostDrvAudio, PDMAUDIODIR_OUT))1248 return VERR_NOT_AVAILABLE;1249 1250 1247 int rc = VINF_SUCCESS; 1251 1248 uint32_t cSamplesLive = 0; … … 1299 1296 cbFree2 = RT_MIN(cbFree2, AUDIOMIXBUF_S2B_RATIO(&pGstStrmOut->MixBuf, 1300 1297 AudioMixBufFree(&pGstStrmOut->MixBuf))); 1301 1302 //LogFlowFunc(("\t[%s] cbFree=%RU32\n", pGstStrmOut->MixBuf.pszName, cbFree2)); 1298 #ifdef DEBUG_andy 1299 LogFlowFunc(("\t[%s] cbFreeOut=%RU32\n", pGstStrmOut->MixBuf.pszName, cbFree2)); 1300 #endif 1303 1301 } 1304 1302 } … … 1329 1327 cbAvailIn = RT_MAX(cbAvailIn, AUDIOMIXBUF_S2B(&pHstStrmIn->MixBuf, 1330 1328 AudioMixBufMixed(&pHstStrmIn->MixBuf))); 1331 1332 LogFlowFunc(("\t[%s] cbFree=%RU32\n", pHstStrmIn->MixBuf.pszName, cbAvailIn)); 1329 #ifdef DEBUG_andy 1330 LogFlowFunc(("\t[%s] cbAvailIn=%RU32\n", pHstStrmIn->MixBuf.pszName, cbAvailIn)); 1331 #endif 1333 1332 } 1334 1333 }
Note:
See TracChangeset
for help on using the changeset viewer.