VirtualBox

Changeset 89209 in vbox


Ignore:
Timestamp:
May 20, 2021 9:55:29 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144550
Message:

DrvHostAudioCoreAudio: More logging around creation and destruction of streams. bugref:9890

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp

    r89188 r89209  
    15131513                orc = AudioQueueNewInput(&pStreamCA->BasicStreamDesc, drvHostAudioCaInputQueueBufferCallback, pStreamCA,
    15141514                                         hRunLoop, hRunLoopMode, 0 /*fFlags - MBZ*/, &pStreamCA->hAudioQueue);
     1515            LogFlowFunc(("AudioQueueNew%s -> %#x\n", pCfgReq->enmDir == PDMAUDIODIR_OUT ? "Output" : "Input", orc));
    15151516            if (orc == noErr)
    15161517            {
     
    15201521                UInt32 uSize = sizeof(pDev->UUID);
    15211522                orc = AudioQueueSetProperty(pStreamCA->hAudioQueue, kAudioQueueProperty_CurrentDevice, &pDev->UUID, uSize);
     1523                LogFlowFunc(("AudioQueueSetProperty -> %#x\n", orc));
    15221524                if (orc == noErr)
    15231525                {
     
    15651567                        pStreamCA->cBuffers = cQueueBuffers;
    15661568
     1569                        const size_t cbQueueBuffer = PDMAudioPropsFramesToBytes(&pStreamCA->Cfg.Props, cFramesQueueBuffer);
     1570                        LogFlowFunc(("Allocating %u, each %#x bytes / %u frames\n", cQueueBuffers, cbQueueBuffer, cFramesQueueBuffer));
    15671571                        cFramesBufferSize = 0;
    1568                         const size_t cbQueueBuffer = PDMAudioPropsFramesToBytes(&pStreamCA->Cfg.Props, cFramesQueueBuffer);
    15691572                        for (uint32_t iBuf = 0; iBuf < cQueueBuffers; iBuf++)
    15701573                        {
     
    16441647    PCOREAUDIOSTREAM pStreamCA = (PCOREAUDIOSTREAM)pStream;
    16451648    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
    16461653
    16471654    /*
     
    16731680        /*
    16741681         * 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.
    16751685         */
    16761686#ifdef CORE_AUDIO_WITH_BREAKPOINT_TIMER
     
    16801690        uint64_t nsStart = RTTimeNanoTS();
    16811691#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        }
    16821700
    16831701        if (pStreamCA->paBuffers)
     
    17241742        LogFunc(("Wrong stream init state for %p: %d - leaking it\n", pStream, enmInitState));
    17251743
    1726     LogFunc(("returns\n"));
     1744    LogFunc(("returns (took %'RU64 ns)\n", RTTimeNanoTS() - nsStart));
    17271745    return VINF_SUCCESS;
    17281746}
     
    18371855    if (pStreamCA->fStarted)
    18381856    {
     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
    18391864        OSStatus orc = AudioQueueStop(pStreamCA->hAudioQueue, TRUE /*inImmediate*/);
    18401865        LogFlowFunc(("AudioQueueStop(%s,TRUE) returns %#x (%d)\n", pStreamCA->Cfg.szName, orc, orc));
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette