VirtualBox

Changeset 91071 in vbox


Ignore:
Timestamp:
Sep 1, 2021 5:12:41 PM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: Added some simple cumulative accounting for silent audio data blocks and audio data which does not belong to any registered audio tests. Silence now also will be treated as to-be-recorded audio data. ​bugref:10008

File:
1 edited

Legend:

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

    r91068 r91071  
    125125    /** Total number of bytes recorded since driver construction. */
    126126    uint64_t            cbRecordedTotal;
     127    /** Total number of bytes silence was played in a consequtive block so far.
     128     *  Will be reset once audible data is being played (again). */
     129    uint64_t            cbPlayedSilence;
     130    /** Total number of bytes audio (audible or not) was played while no active
     131     *  audio test was registered / available. */
     132    uint64_t            cbPlayedNoTest;
    127133    /** Temporary path to use. */
    128134    char                szPathTemp[RTPATH_MAX];
     
    842848    if (pTst == NULL) /* Empty list? */
    843849    {
    844 #ifdef DEBUG_andy
    845         if (!fIsSilence)
    846 #endif
    847             LogRel(("ValKit: Warning: Guest is playing back audio (%s, %RU32 bytes, %RU64ms) when no playback test is active\n",
    848                     fIsSilence ? "silence" : "audible", cbBuf, PDMAudioPropsBytesToMilli(&pStream->pStream->Cfg.Props, cbBuf)));
     850        pThis->cbPlayedNoTest += cbBuf;
    849851
    850852        *pcbWritten = cbBuf;
     
    852854    }
    853855
    854 #ifndef DEBUG_andy
     856    if (pThis->cbPlayedNoTest)
     857    {
     858        LogRel(("ValKit: Warning: Guest was playing back audio (%s, %RU32 bytes, %RU64ms) when no playback test is active\n",
     859                pThis->cbPlayedNoTest, PDMAudioPropsBytesToMilli(&pStream->pStream->Cfg.Props, pThis->cbPlayedNoTest)));
     860        pThis->cbPlayedNoTest = 0;
     861    }
     862
    855863    if (fIsSilence)
    856         LogRel2(("ValKit: Guest is playing back %RU32 bytes (%RU64ms) silence\n",
    857                  cbBuf, PDMAudioPropsBytesToMilli(&pStream->pStream->Cfg.Props, cbBuf)));
    858 #endif
    859 
    860     const bool fHandleSilence = false; /** @todo Skip blocks of entire silence for now. */
     864    {
     865        pThis->cbPlayedSilence += cbBuf;
     866    }
     867    else /* Audible data */
     868    {
     869        if (pThis->cbPlayedSilence)
     870            LogRel(("ValKit: Guest was playing back %RU32 bytes (%RU64ms) of silence\n",
     871                    pThis->cbPlayedSilence, PDMAudioPropsBytesToMilli(&pStream->pStream->Cfg.Props, pThis->cbPlayedSilence)));
     872        pThis->cbPlayedSilence = 0;
     873    }
     874
     875    const bool fHandleSilence = true;
    861876
    862877    if (pTst->pEntry == NULL) /* Test not started yet? */
     
    11201135    pThis->cbPlayedTotal   = 0;
    11211136    pThis->cbRecordedTotal = 0;
     1137    pThis->cbPlayedSilence = 0;
     1138    pThis->cbPlayedNoTest  = 0;
    11221139
    11231140    pThis->fTestSetEnd = false;
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