VirtualBox

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


Ignore:
Timestamp:
Jun 5, 2021 1:54:59 AM (4 years ago)
Author:
vboxsync
Message:

DrvHostAudioPulseAudio: Use the default BufAttr.minreq value (output only), otherwise I'm getting slightly distored output here on a builtin intel HDA device. Logging adjustments. bugref:9890

File:
1 edited

Legend:

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

    r89510 r89522  
    733733    int       fNegative  = 0;
    734734    int       rcPa = pa_stream_get_latency(pStream, &cUsLatency, &fNegative);
    735     Log2Func(("Requesting %zu bytes; Latency: %'RU64 us%s\n",
    736               cbLen, cUsLatency, rcPa == 0 ? " - pa_stream_get_latency failed!" : ""));
    737 }
    738 
    739 
    740 /**
    741  * Debug PA callback: Underflow.  This may happen when draing/corking.
     735    Log2Func(("Requesting %zu bytes; Latency: %'RU64 us (rcPa=%d n=%d)\n", cbLen, cUsLatency, rcPa, fNegative));
     736}
     737
     738
     739/**
     740 * Debug PA callback: Underflow.  This may happen when draining/corking.
    742741 */
    743742static void drvHstAudPaStreamUnderflowDebugCallback(pa_stream *pStream, void *pvContext)
     
    750749    LogRel2(("PulseAudio: Warning: Hit underflow #%RU32\n", pStrm->cUnderflows));
    751750
     751# if 0
    752752    if (   pStrm->cUnderflows >= 6                /** @todo Make this check configurable. */
    753753        && pStrm->cUsLatency  < 2U*RT_US_1SEC)
     
    766766        pStrm->cUnderflows = 0;
    767767    }
     768# endif
    768769
    769770    pa_usec_t cUsLatency = 0;
     
    788789
    789790/**
    790  * Debug PA callback: Overflow.  This may happen when draing/corking.
     791 * Debug PA callback: Overflow.  This may happen when draining/corking.
    791792 */
    792793static void drvHstAudPaStreamOverflowDebugCallback(pa_stream *pStream, void *pvContext)
     
    11671168            pStreamPA->cUsLatency        = PDMAudioPropsFramesToMicro(&pCfgAcq->Props, pCfgReq->Backend.cFramesBufferSize);
    11681169            pStreamPA->BufAttr.tlength   = pa_usec_to_bytes(pStreamPA->cUsLatency, &pStreamPA->SampleSpec);
     1170#if 0 /* bird: Bad bad idea. Messes up output via a "Intel Corporation 200 Series PCH HD Audio"
     1171               device here on fedora-32. Just use the default instead. */
    11691172            pStreamPA->BufAttr.minreq    = PDMAudioPropsFramesToBytes(&pCfgAcq->Props, pCfgReq->Backend.cFramesPeriod);
     1173#else
     1174            pStreamPA->BufAttr.minreq    = -1;
     1175#endif
    11701176            pStreamPA->BufAttr.prebuf    = pa_usec_to_bytes(PDMAudioPropsFramesToMicro(&pCfgAcq->Props,
    11711177                                                                                       pCfgReq->Backend.cFramesPreBuffering),
     
    16571663#ifdef LOG_ENABLED
    16581664    const pa_usec_t tsNowUs = pa_rtclock_now();
    1659     Log3Func(("play delta: %'RU64 us; cbBuf=%#x\n", tsNowUs - pStreamPA->tsLastReadWrittenUs, cbBuf));
     1665    Log3Func(("play delta: %'RI64 us; cbBuf=%#x\n",
     1666              pStreamPA->tsLastReadWrittenUs ? tsNowUs - pStreamPA->tsLastReadWrittenUs : -1, cbBuf));
    16601667    pStreamPA->tsLastReadWrittenUs = tsNowUs;
    16611668#endif
     
    17591766#ifdef LOG_ENABLED
    17601767    const pa_usec_t tsNowUs = pa_rtclock_now();
    1761     Log3Func(("capture delta: %'RU64 us; cbBuf=%#x\n", tsNowUs - pStreamPA->tsLastReadWrittenUs, cbBuf));
     1768    Log3Func(("capture delta: %'RI64 us; cbBuf=%#x\n",
     1769              pStreamPA->tsLastReadWrittenUs ? tsNowUs - pStreamPA->tsLastReadWrittenUs : -1, cbBuf));
    17621770    pStreamPA->tsLastReadWrittenUs = tsNowUs;
    17631771#endif
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