Changeset 67505 in vbox
- Timestamp:
- Jun 20, 2017 1:31:15 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevHDA.cpp
r67504 r67505 5481 5481 if (hdaGetDirFromSD(pStream->u8SD) == PDMAUDIODIR_OUT) /* Output (SDO). */ 5482 5482 { 5483 /* Is the sinkready to be written (guest output data) to? If so, by how much? */5484 const uint32_t cb Writable = AudioMixerSinkGetWritable(pSink);5483 /* Is the HDA stream ready to be written (guest output data) to? If so, by how much? */ 5484 const uint32_t cbFree = hdaStreamGetFree(pStream); 5485 5485 5486 5486 if ( fInTimer 5487 && cbWritable) 5488 { 5489 Log3Func(("[SD%RU8] cbWritable=%RU32\n", pStream->u8SD, cbWritable)); 5490 5491 /* When running synchronously, do the DMA data transfers here. 5492 * Otherwise this will be done in the device timer. */ 5493 rc2 = hdaStreamTransfer(pThis, pStream, cbWritable); 5487 && cbFree) 5488 { 5489 Log3Func(("[SD%RU8] cbFree=%RU32\n", pStream->u8SD, cbFree)); 5490 5491 /* Do the DMA transfer. */ 5492 rc2 = hdaStreamTransfer(pThis, pStream, cbFree); 5494 5493 AssertRC(rc2); 5494 } 5495 5496 /* How much (guest output) data is available at the moment for the HDA stream? */ 5497 uint32_t cbUsed = hdaStreamGetUsed(pStream); 5495 5498 5496 5499 #ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO 5500 if ( fInTimer 5501 && cbUsed) 5502 { 5497 5503 rc2 = hdaStreamAsyncIONotify(pThis, pStream); 5498 5504 AssertRC(rc2); 5499 #endif 5500 } 5501 5502 #ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO 5503 if (!fInTimer) 5504 { 5505 #endif 5506 /* How much (guest output) data is available at the moment? */ 5507 uint32_t cbAvailable = hdaStreamGetUsed(pStream); 5505 } 5506 else 5507 { 5508 #endif 5509 const uint32_t cbSinkWritable = AudioMixerSinkGetWritable(pSink); 5508 5510 5509 5511 /* Do not write more than the sink can hold at the moment. 5510 5512 * The host sets the overall pace. */ 5511 if (cb Available > cbWritable)5512 cb Available = cbWritable;5513 5514 if (cb Available)5513 if (cbUsed > cbSinkWritable) 5514 cbUsed = cbSinkWritable; 5515 5516 if (cbUsed) 5515 5517 { 5516 5518 /* Read (guest output) data and write it to the stream's sink. */ 5517 rc2 = hdaStreamRead(pThis, pStream, cb Available, NULL /* pcbRead */);5519 rc2 = hdaStreamRead(pThis, pStream, cbUsed, NULL /* pcbRead */); 5518 5520 AssertRC(rc2); 5519 5521 }
Note:
See TracChangeset
for help on using the changeset viewer.