VirtualBox

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


Ignore:
Timestamp:
Sep 1, 2021 9:08:56 AM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: More diagnostics / help for the Validation Kit audio driver. ​bugref:10008

Location:
trunk/src/VBox/Devices/Audio
Files:
3 edited

Legend:

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

    r91036 r91051  
    921921
    922922/**
     923 * Returns the total number of registered tests.
     924 *
     925 * @returns Total number of registered tests.
     926 * @param   pSet                Test set to return value for.
     927 */
     928uint32_t AudioTestSetGetTestsTotal(PAUDIOTESTSET pSet)
     929{
     930    return pSet->cTests;
     931}
     932
     933/**
     934 * Returns the total number of (still) running tests.
     935 *
     936 * @returns Total number of (still) running tests.
     937 * @param   pSet                Test set to return value for.
     938 */
     939uint32_t AudioTestSetGetTestsRunning(PAUDIOTESTSET pSet)
     940{
     941    return pSet->cTestsRunning;
     942}
     943
     944/**
     945 * Returns the total number of test failures occurred.
     946 *
     947 * @returns Total number of test failures occurred.
     948 * @param   pSet                Test set to return value for.
     949 */
     950uint32_t AudioTestSetGetTotalFailures(PAUDIOTESTSET pSet)
     951{
     952    return pSet->cTotalFailures;
     953}
     954
     955/**
    923956 * Creates a new audio test set.
    924957 *
     
    12161249        }
    12171250
    1218         RTFileClose(pSet->f.hFile);
    1219         pSet->f.hFile = NIL_RTFILE;
     1251        rc = RTFileClose(pSet->f.hFile);
     1252        if (RT_SUCCESS(rc))
     1253            pSet->f.hFile = NIL_RTFILE;
    12201254    }
    12211255    else if (pSet->enmMode == AUDIOTESTSETMODE_VERIFY)
     
    12261260        rc = VINF_SUCCESS;
    12271261    }
    1228     else /* Not supported, just skip. */
    1229         rc = VINF_SUCCESS;
     1262    else
     1263        AssertFailedStmt(rc = VERR_NOT_SUPPORTED);
    12301264
    12311265    return rc;
     
    15771611    AssertReturn(!audioTestManifestIsOpen(pSet), VERR_WRONG_ORDER);
    15781612
    1579     AssertMsgReturn(pSet->cTests, ("No tests run yet"), VERR_WRONG_ORDER);
    1580     AssertMsgReturn(pSet->cTestsRunning == 0 , ("Some tests are still running"), VERR_WRONG_ORDER);
     1613    AssertMsgReturn(pSet->cTests, ("No tests run yet"), VERR_INVALID_STATE);
     1614    AssertMsgReturn(pSet->cTestsRunning == 0 , ("Some tests are still running"), VERR_INVALID_STATE);
    15811615
    15821616    /** @todo Check and deny if \a pszOutDir is part of the set's path. */
  • trunk/src/VBox/Devices/Audio/AudioTest.h

    r89994 r91051  
    288288int    AudioTestSetWipe(PAUDIOTESTSET pSet);
    289289const char *AudioTestSetGetTag(PAUDIOTESTSET pSet);
     290uint32_t AudioTestSetGetTestsTotal(PAUDIOTESTSET pSet);
     291uint32_t AudioTestSetGetTestsRunning(PAUDIOTESTSET pSet);
     292uint32_t AudioTestSetGetTotalFailures(PAUDIOTESTSET pSet);
    290293bool   AudioTestSetIsPacked(const char *pszPath);
    291294bool   AudioTestSetIsRunning(PAUDIOTESTSET pSet);
  • trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp

    r91050 r91051  
    121121    /** Pointer to host audio interface. */
    122122    PDMIHOSTAUDIO       IHostAudio;
     123    /** Total number of bytes played since driver construction. */
     124    uint64_t            cbPlayedTotal;
     125    /** Total number of bytes recorded since driver construction. */
     126    uint64_t            cbRecordedTotal;
    123127    /** Temporary path to use. */
    124128    char                szPathTemp[RTPATH_MAX];
     
    236240        LogRel(("ValKit: Warning: %RU32 guest recording tests still outstanding:\n", pThis->cTestsRec));
    237241
     242    if (   pThis->cTestsTotal
     243        && (   !pThis->cbPlayedTotal
     244            && !pThis->cbRecordedTotal)
     245       )
     246    {
     247        LogRel(("ValKit: Warning: Did not get any audio data to play or record altough tests were configured -- audio stack misconfiguration / bug?\n"));
     248    }
     249
    238250    PVALKITTESTDATA pTst, pTstNext;
    239251    RTListForEachSafe(&pThis->lstTestsRec, pTst, pTstNext, VALKITTESTDATA, Node)
     
    241253        size_t const cbOutstanding = pTst->t.TestTone.u.Rec.cbToWrite - pTst->t.TestTone.u.Rec.cbWritten;
    242254        if (cbOutstanding)
    243             LogRel(("ValKit: \tRecording test #%RU32 has %RU64 bytes (%RU32ms) outstanding\n",
    244                     pTst->idxTest, cbOutstanding, PDMAudioPropsBytesToMilli(&pTst->t.TestTone.Parms.Props, (uint32_t)cbOutstanding)));
     255            LogRel(("ValKit: \tRecording test #%RU32 has %RU64 bytes (%RU32ms) outstanding (%RU8%% left)\n",
     256                    pTst->idxTest, cbOutstanding, PDMAudioPropsBytesToMilli(&pTst->t.TestTone.Parms.Props, (uint32_t)cbOutstanding),
     257                    (pTst->t.TestTone.u.Rec.cbWritten * 100) / RT_MAX(pTst->t.TestTone.u.Rec.cbToWrite, 1)));
    245258        drvHostValKiUnregisterRecTest(pThis, pTst);
    246259    }
     
    253266        size_t const cbOutstanding = pTst->t.TestTone.u.Play.cbToRead - pTst->t.TestTone.u.Play.cbRead;
    254267        if (cbOutstanding)
    255             LogRel(("ValKit: \tPlayback test #%RU32 has %RU64 bytes (%RU32ms) outstanding\n",
    256                     pTst->idxTest, cbOutstanding, PDMAudioPropsBytesToMilli(&pTst->t.TestTone.Parms.Props, (uint32_t)cbOutstanding)));
     268            LogRel(("ValKit: \tPlayback test #%RU32 has %RU64 bytes (%RU32ms) outstanding (%RU8%% left)\n",
     269                    pTst->idxTest, cbOutstanding, PDMAudioPropsBytesToMilli(&pTst->t.TestTone.Parms.Props, (uint32_t)cbOutstanding),
     270                    (pTst->t.TestTone.u.Play.cbRead * 100) / RT_MAX(pTst->t.TestTone.u.Play.cbToRead, 1)));
    257271        drvHostValKiUnregisterPlayTest(pThis, pTst);
    258272    }
     
    319333            }
    320334        }
     335
     336        LogRel(("ValKit: Test set has %RU32 tests total, %RU32 (still) running, %RU32 failures total\n",
     337                AudioTestSetGetTestsTotal(pSet), AudioTestSetGetTestsRunning(pSet), AudioTestSetGetTotalFailures(pSet)));
    321338
    322339        if (RT_SUCCESS(rc))
     
    797814    PVALKITTESTDATA     pTst  = NULL;
    798815
     816    pThis->cbPlayedTotal += cbBuf; /* Do a bit of accounting. */
     817
    799818    bool const fIsSilence = PDMAudioPropsIsBufferSilence(&pStream->pStream->Cfg.Props, pvBuf, cbBuf);
    800819
     
    929948    PVALKITAUDIOSTREAM  pStrmValKit = (PVALKITAUDIOSTREAM)pStream;
    930949    PVALKITTESTDATA     pTst        = NULL;
     950
     951    pThis->cbRecordedTotal += cbBuf; /* Do a bit of accounting. */
    931952
    932953    int rc = RTCritSectEnter(&pThis->CritSect);
     
    10911112    AssertRCReturn(rc, rc);
    10921113
     1114    pThis->cbPlayedTotal   = 0;
     1115    pThis->cbRecordedTotal = 0;
     1116
    10931117    pThis->fTestSetEnd = false;
    10941118
     
    11121136    const char *pszBindAddr = "127.0.0.1"; /* Only reachable for localhost for now. */
    11131137    uint32_t    uBindPort   = ATS_TCP_DEF_BIND_PORT_VALKIT;
     1138
     1139    LogRel2(("ValKit: Debug logging enabled\n"));
    11141140
    11151141    LogRel(("ValKit: Starting Audio Test Service (ATS) at %s:%RU32...\n",
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