VirtualBox

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


Ignore:
Timestamp:
Nov 10, 2021 5:20:27 PM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: More bugfixes for the Validation Kit audio driver, dealing with overlapping playback data. bugref:10008

File:
1 edited

Legend:

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

    r92327 r92335  
    10961096    uint8_t *auBuf     = (uint8_t *)pvBuf;
    10971097
     1098    uint64_t const msStartedTS = RTTimeMilliTS();
     1099
    10981100    while (cbWritten < cbBuf)
    10991101    {
     
    11161118                    bool const fStarted = AudioTestBeaconGetRemaining(pBeacon) == AudioTestBeaconGetSize(pBeacon);
    11171119
    1118                     size_t off = 0; /* Points at the data right *after the found beacon data on return. */
     1120                    size_t off = 0; /* Points at the data right *after* the found beacon data on return. */
    11191121                    rc2 = AudioTestBeaconAddConsecutive(pBeacon, auBuf, cbBuf - cbWritten, &off);
    11201122                    if (RT_SUCCESS(rc2))
     
    11221124                        cbWritten += (uint32_t)off;
    11231125                        auBuf     += off;
     1126                    }
     1127                    else /* No beacon data found. */
     1128                    {
     1129                        LogRel2(("ValKit: Test #%RU32: Warning: Beacon data for '%s' not found (%Rrc) - Skipping ...\n",
     1130                                 pTst->idxTest, AudioTestBeaconTypeGetName(pBeacon->enmType), rc2));
     1131                        cbWritten = cbBuf; /* Skip all. */
     1132                        break;
    11241133                    }
    11251134
     
    11511160                         pTst->idxTest, cbRemaining, PDMAudioPropsBytesToMilli(&pStream->pStream->Cfg.Props, cbRemaining)));
    11521161
    1153                 /* Whether we count all silence as recorded data or not.
    1154                  * Currently we don't, as otherwise consequtively played tones will be cut off in the end. */
    1155                 if (!fIsAllSilence)
    1156                 {
    1157                     /* Don't read more than we're told to.
    1158                      * After the actual test tone data there might come a post beacon which also
    1159                      * needs to be handled in the AUDIOTESTSTATE_POST state then. */
    1160                     const uint32_t cbData = RT_MIN(cbBuf - cbWritten, cbRemaining);
    1161 
    1162                     pTst->t.TestTone.u.Play.cbRead += cbData;
    1163 
    1164                     cbWritten += cbData;
    1165                     auBuf     += cbData;
    1166                 }
     1162                /* Don't read more than we're told to.
     1163                 * After the actual test tone data there might come a post beacon which also
     1164                 * needs to be handled in the AUDIOTESTSTATE_POST state then. */
     1165                const uint32_t cbData = RT_MIN(cbBuf - cbWritten, cbRemaining);
     1166
     1167                pTst->t.TestTone.u.Play.cbRead += cbData;
     1168
     1169                cbWritten += cbData;
     1170                auBuf     += cbData;
    11671171
    11681172                const bool fComplete = pTst->t.TestTone.u.Play.cbRead >= pTst->t.TestTone.u.Play.cbToRead;
     
    11721176                            pTst->idxTest, RTTimeMilliTS() - pTst->msStartedTS));
    11731177
    1174                     if (pTst->t.TestTone.u.Play.cbRead > pTst->t.TestTone.u.Play.cbToRead)
    1175                         LogRel(("ValKit: Test #%RU32: Warning: Read %RU32 bytes more than announced\n",
    1176                                 pTst->idxTest, pTst->t.TestTone.u.Play.cbRead - pTst->t.TestTone.u.Play.cbToRead));
    1177 
    11781178                    pTst->enmState = AUDIOTESTSTATE_POST;
     1179
    11791180                    /* Re-use the beacon object, but this time it's the post beacon. */
    11801181                    AudioTestBeaconInit(&pTst->t.TestTone.Beacon, AUDIOTESTTONEBEACONTYPE_PLAY_POST, &pTst->t.TestTone.Parms.Props);
     
    11961197        if (pTst->enmState == AUDIOTESTSTATE_DONE)
    11971198            break;
     1199
     1200        if (RTTimeMilliTS() - msStartedTS > RT_MS_30SEC)
     1201        {
     1202            LogRel(("ValKit: Test #%RU32: Error: Playback processing timed out -- please report this bug!\n", pTst->idxTest));
     1203            break;
     1204        }
    11981205    }
    11991206
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