Changeset 89209 in vbox
- Timestamp:
- May 20, 2021 9:55:29 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144550
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp
r89188 r89209 1513 1513 orc = AudioQueueNewInput(&pStreamCA->BasicStreamDesc, drvHostAudioCaInputQueueBufferCallback, pStreamCA, 1514 1514 hRunLoop, hRunLoopMode, 0 /*fFlags - MBZ*/, &pStreamCA->hAudioQueue); 1515 LogFlowFunc(("AudioQueueNew%s -> %#x\n", pCfgReq->enmDir == PDMAUDIODIR_OUT ? "Output" : "Input", orc)); 1515 1516 if (orc == noErr) 1516 1517 { … … 1520 1521 UInt32 uSize = sizeof(pDev->UUID); 1521 1522 orc = AudioQueueSetProperty(pStreamCA->hAudioQueue, kAudioQueueProperty_CurrentDevice, &pDev->UUID, uSize); 1523 LogFlowFunc(("AudioQueueSetProperty -> %#x\n", orc)); 1522 1524 if (orc == noErr) 1523 1525 { … … 1565 1567 pStreamCA->cBuffers = cQueueBuffers; 1566 1568 1569 const size_t cbQueueBuffer = PDMAudioPropsFramesToBytes(&pStreamCA->Cfg.Props, cFramesQueueBuffer); 1570 LogFlowFunc(("Allocating %u, each %#x bytes / %u frames\n", cQueueBuffers, cbQueueBuffer, cFramesQueueBuffer)); 1567 1571 cFramesBufferSize = 0; 1568 const size_t cbQueueBuffer = PDMAudioPropsFramesToBytes(&pStreamCA->Cfg.Props, cFramesQueueBuffer);1569 1572 for (uint32_t iBuf = 0; iBuf < cQueueBuffers; iBuf++) 1570 1573 { … … 1644 1647 PCOREAUDIOSTREAM pStreamCA = (PCOREAUDIOSTREAM)pStream; 1645 1648 AssertPtrReturn(pStreamCA, VERR_INVALID_POINTER); 1649 LogFunc(("%p: %s\n", pStreamCA, pStreamCA->Cfg.szName)); 1650 #ifdef LOG_ENABLED 1651 uint64_t const nsStart = RTTimeNanoTS(); 1652 #endif 1646 1653 1647 1654 /* … … 1673 1680 /* 1674 1681 * Free the queue buffers and the queue. 1682 * 1683 * This may take a while. The AudioQueueReset call seems to helps 1684 * reducing time stuck in AudioQueueDispose. 1675 1685 */ 1676 1686 #ifdef CORE_AUDIO_WITH_BREAKPOINT_TIMER … … 1680 1690 uint64_t nsStart = RTTimeNanoTS(); 1681 1691 #endif 1692 1693 /* Resetting the queue helps prevent AudioQueueDispose from taking a long time. */ 1694 if (pStreamCA->hAudioQueue) 1695 { 1696 LogFlowFunc(("Calling AudioQueueReset ...\n")); 1697 orc = AudioQueueReset(pStreamCA->hAudioQueue); 1698 LogFlowFunc(("AudioQueueReset -> %#x\n", orc)); 1699 } 1682 1700 1683 1701 if (pStreamCA->paBuffers) … … 1724 1742 LogFunc(("Wrong stream init state for %p: %d - leaking it\n", pStream, enmInitState)); 1725 1743 1726 LogFunc(("returns \n"));1744 LogFunc(("returns (took %'RU64 ns)\n", RTTimeNanoTS() - nsStart)); 1727 1745 return VINF_SUCCESS; 1728 1746 } … … 1837 1855 if (pStreamCA->fStarted) 1838 1856 { 1857 #if 0 1858 OSStatus orc2 = AudioQueueReset(pStreamCA->hAudioQueue); 1859 LogFlowFunc(("AudioQueueReset(%s) returns %#x (%d)\n", pStreamCA->Cfg.szName, orc2, orc2)); RT_NOREF(orc2); 1860 orc2 = AudioQueueFlush(pStreamCA->hAudioQueue); 1861 LogFlowFunc(("AudioQueueFlush(%s) returns %#x (%d)\n", pStreamCA->Cfg.szName, orc2, orc2)); RT_NOREF(orc2); 1862 #endif 1863 1839 1864 OSStatus orc = AudioQueueStop(pStreamCA->hAudioQueue, TRUE /*inImmediate*/); 1840 1865 LogFlowFunc(("AudioQueueStop(%s,TRUE) returns %#x (%d)\n", pStreamCA->Cfg.szName, orc, orc));
Note:
See TracChangeset
for help on using the changeset viewer.