Changeset 70117 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Dec 13, 2017 5:37:31 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 119666
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r70013 r70117 1322 1322 uSD, fRun, fInRun, fReset, fInReset, u32Value)); 1323 1323 1324 /* 1325 * Extract the stream tag the guest wants to use for this specific 1326 * stream descriptor (SDn). This only can happen if the stream is in a non-running 1327 * state, so we're doing the lookup and assignment here. 1328 * 1329 * So depending on the guest OS, SD3 can use stream tag 4, for example. 1330 */ 1331 uint8_t uTag = (u32Value >> HDA_SDCTL_NUM_SHIFT) & HDA_SDCTL_NUM_MASK; 1332 if (uTag > HDA_MAX_TAGS) 1333 { 1334 LogFunc(("[SD%RU8] Warning: Invalid stream tag %RU8 specified!\n", uSD, uTag)); 1335 1336 DEVHDA_UNLOCK_BOTH(pThis); 1337 return hdaRegWriteU24(pThis, iReg, u32Value); 1338 } 1339 1340 PHDATAG pTag = &pThis->aTags[uTag]; 1341 AssertPtr(pTag); 1342 1343 LogFunc(("[SD%RU8] Using stream tag=%RU8\n", uSD, uTag)); 1344 1345 /* Assign new values. */ 1346 pTag->uTag = uTag; 1347 pTag->pStream = hdaGetStreamFromSD(pThis, uSD); 1348 1349 PHDASTREAM pStream = pTag->pStream; 1350 AssertPtr(pStream); 1324 PHDASTREAM pStream = hdaGetStreamFromSD(pThis, uSD); 1325 AssertPtr(pStream); 1351 1326 1352 1327 if (fInReset) … … 1394 1369 1395 1370 hdaStreamLock(pStream); 1371 1372 /* 1373 * Extract the stream tag the guest wants to use for this specific 1374 * stream descriptor (SDn). This only can happen if the stream is in a non-running 1375 * state, so we're doing the lookup and assignment here. 1376 * 1377 * So depending on the guest OS, SD3 can use stream tag 4, for example. 1378 */ 1379 uint8_t uTag = (u32Value >> HDA_SDCTL_NUM_SHIFT) & HDA_SDCTL_NUM_MASK; 1380 1381 LogFunc(("[SD%RU8] Using stream tag=%RU8\n", uSD, uTag)); 1382 1383 if ( !uTag 1384 || uTag > HDA_MAX_TAGS) 1385 { 1386 LogRel(("HDA: Warning: Stream #%RU8 is using invalid stream tag %RU8, skipping SDCTL\n", uSD, uTag)); 1387 1388 DEVHDA_UNLOCK_BOTH(pThis); 1389 return hdaRegWriteU24(pThis, iReg, u32Value); 1390 } 1391 1392 LogRel2(("HDA: Stream #%RU8 is stream tag %RU8\n", uSD, uTag)); 1393 1394 /* Our internal mapping table is zero-based. */ 1395 PHDATAG pTag = &pThis->aTags[uTag - 1]; 1396 AssertPtr(pTag); 1397 1398 /* Assign new values. */ 1399 pTag->uTag = uTag; 1400 pTag->pStream = pStream; 1396 1401 1397 1402 # ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO -
trunk/src/VBox/Devices/Audio/DevHDACommon.cpp
r70013 r70117 224 224 } 225 225 226 /* First, check if the SD# is in our tag mapping and return the 227 * correlating stream instead. 228 * 229 * Note that our internal table is zero-based. */ 230 PHDASTREAM pStream = pThis->aTags[uSD ? uSD - 1 : 0].pStream; 231 if (pStream) 232 return pStream; 233 234 /* No tagged stream found, just return the plain non-tagged SD# stream. */ 226 235 return &pThis->aStreams[uSD]; 227 236 } -
trunk/src/VBox/Devices/Audio/HDAStream.cpp
r70073 r70117 242 242 243 243 /** @todo Use a more dynamic fragment size? */ 244 uint8_t cFragments = pStream->u16LVI ;244 uint8_t cFragments = pStream->u16LVI + 1; 245 245 if (cFragments <= 1) 246 246 cFragments = 2; /* At least two fragments (BDLEs) must be present. */
Note:
See TracChangeset
for help on using the changeset viewer.