VirtualBox

Changeset 67520 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Jun 21, 2017 6:59:46 AM (8 years ago)
Author:
vboxsync
Message:

DrvHostPulseAudio: more debugging

File:
1 edited

Legend:

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

    r67518 r67520  
    273273 * Synchronously wait until an operation completed.
    274274 */
    275 static int paWaitForEx(PDRVHOSTPULSEAUDIO pThis, pa_operation *pOP, RTMSINTERVAL cMsTimeout)
     275static int paWaitForEx(PDRVHOSTPULSEAUDIO pThis, pa_operation *pOP, RTMSINTERVAL cMsTimeout, bool fDebug)
    276276{
    277277    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
     
    287287        {
    288288            AssertPtr(pThis->pMainLoop);
     289            if (fDebug)
     290                LogRel(("PulseAudio: pa_threaded_mainloop_wait\n"));
    289291            pa_threaded_mainloop_wait(pThis->pMainLoop);
     292            if (fDebug)
     293                LogRel(("PulseAudio: pa_threaded_mainloop_wait done\n"));
    290294            if (pThis->fAbortEnumLoop)
    291295                break;
     
    307311
    308312
    309 static int paWaitFor(PDRVHOSTPULSEAUDIO pThis, pa_operation *pOP)
    310 {
    311     return paWaitForEx(pThis, pOP, 10 * 1000 /* 10s timeout */);
     313static int paWaitFor(PDRVHOSTPULSEAUDIO pThis, pa_operation *pOP, bool fDebug = false)
     314{
     315    return paWaitForEx(pThis, pOP, 10 * 1000 /* 10s timeout */, fDebug);
    312316}
    313317
     
    935939static void paEnumSinkCb(pa_context *pCtx, const pa_sink_info *pInfo, int eol, void *pvUserData)
    936940{
     941    LogRel(("PulseAudio: entering paEnumSinkCb\n"));
    937942    if (eol > 0)
     943    {
     944        LogRel(("PulseAudio: paEnumSinkCb: eol=%d\n", eol));
    938945        return;
     946    }
    939947
    940948    PPULSEAUDIOENUMCBCTX pCbCtx = (PPULSEAUDIOENUMCBCTX)pvUserData;
     
    946954        pThis->fAbortEnumLoop = true;
    947955        pa_threaded_mainloop_signal(pCbCtx->pDrv->pMainLoop, 0);
     956        LogRel(("PulseAudio: paEnumSinkCb eol=%d, signalling\n", eol));
    948957        return;
    949958    }
     
    957966    pCbCtx->cDevOut++;
    958967
     968    LogRel(("PulseAudio: paEnumSinkCb signalling\n"));
    959969    pa_threaded_mainloop_signal(pCbCtx->pDrv->pMainLoop, 0);
    960970}
     
    963973static void paEnumSourceCb(pa_context *pCtx, const pa_source_info *pInfo, int eol, void *pvUserData)
    964974{
     975    LogRel(("PulseAudio: entering paEnumSourceCb\n"));
    965976    if (eol > 0)
     977    {
     978        LogRel(("PulseAudio: paEnumSourceCb: eol=%d\n", eol));
    966979        return;
     980    }
    967981
    968982    PPULSEAUDIOENUMCBCTX pCbCtx = (PPULSEAUDIOENUMCBCTX)pvUserData;
     
    974988        pThis->fAbortEnumLoop = true;
    975989        pa_threaded_mainloop_signal(pCbCtx->pDrv->pMainLoop, 0);
     990        LogRel(("PulseAudio: paEnumSourceCb eol=%d, signalling\n", eol));
    976991        return;
    977992    }
     
    9851000    pCbCtx->cDevIn++;
    9861001
     1002    LogRel(("PulseAudio: paEnumSourceCb signalling\n"));
    9871003    pa_threaded_mainloop_signal(pCbCtx->pDrv->pMainLoop, 0);
    9881004}
     
    9911007static void paEnumServerCb(pa_context *pCtx, const pa_server_info *pInfo, void *pvUserData)
    9921008{
     1009    LogRel(("PulseAudio: entering paEnumServerCb\n"));
     1010
    9931011    AssertPtrReturnVoid(pCtx);
    9941012    PPULSEAUDIOENUMCBCTX pCbCtx = (PPULSEAUDIOENUMCBCTX)pvUserData;
     
    10001018    {
    10011019        pThis->fAbortEnumLoop = true;
     1020        LogRel(("PulseAudio: paEnumServerCb no info, signalling\n"));
    10021021        pa_threaded_mainloop_signal(pCbCtx->pDrv->pMainLoop, 0);
    10031022        return;
     
    10161035    }
    10171036
     1037    LogRel(("PulseAudio: paEnumServerCb signalling\n"));
    10181038    pa_threaded_mainloop_signal(pThis->pMainLoop, 0);
    10191039}
     
    10411061    bool fLog = (fEnum & PULSEAUDIOENUMCBFLAGS_LOG);
    10421062
    1043     int rc = paWaitFor(pThis, pa_context_get_server_info(pThis->pContext, paEnumServerCb, &CbCtx));
     1063    LogRel(("PulseAudio: starting server enumeration\n"));
     1064    int rc = paWaitFor(pThis, pa_context_get_server_info(pThis->pContext, paEnumServerCb, &CbCtx), true);
     1065    LogRel(("PulseAudio: server enumeration done rc=%Rrc abort=%d\n", rc, pThis->fAbortEnumLoop));
    10441066    if (   RT_SUCCESS(rc)
    10451067        && pThis->fAbortEnumLoop)
     
    10521074                LogRel2(("PulseAudio: Default output sink is '%s'\n", CbCtx.pszDefaultSink));
    10531075
     1076            LogRel(("PulseAudio: starting sink enumeration\n"));
    10541077            rc = paWaitFor(pThis, pa_context_get_sink_info_by_name(pThis->pContext, CbCtx.pszDefaultSink,
    1055                                                                    paEnumSinkCb, &CbCtx));
     1078                                                                   paEnumSinkCb, &CbCtx), true);
     1079            LogRel(("PulseAudio: sink enumeration done rc=%Rrc abort=%d\n", rc, pThis->fAbortEnumLoop));
    10561080            if (   RT_SUCCESS(rc)
    10571081                && pThis->fAbortEnumLoop)
     
    10731097                    LogRel2(("PulseAudio: Default input source is '%s'\n", CbCtx.pszDefaultSource));
    10741098
     1099                LogRel(("PulseAudio: starting source enumeration\n"));
    10751100                rc = paWaitFor(pThis, pa_context_get_source_info_by_name(pThis->pContext, CbCtx.pszDefaultSource,
    1076                                                                          paEnumSourceCb, &CbCtx));
     1101                                                                         paEnumSourceCb, &CbCtx), true);
     1102                LogRel(("PulseAudio: source enumeration done rc=%Rrc abort=%d\n", rc, pThis->fAbortEnumLoop));
    10771103                if (   RT_FAILURE(rc)
    10781104                    && fLog)
Note: See TracChangeset for help on using the changeset viewer.

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