VirtualBox

Changeset 90851 in vbox


Ignore:
Timestamp:
Aug 24, 2021 3:50:26 PM (3 years ago)
Author:
vboxsync
Message:

Audio/VKAT: Fail-safe for not trying too hard playing back stuff; logging. ​bugref:10008

Location:
trunk/src/VBox/ValidationKit/utils/audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/utils/audio/vkat.cpp

    r90830 r90851  
    575575            }
    576576
     577            RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Ending test set on guest ...\n");
    577578            int rc2 = AudioTestSvcClientTestSetEnd(&pTstEnv->u.Host.AtsClGuest, pTstEnv->szTag);
    578579            if (RT_FAILURE(rc2))
     
    583584            }
    584585
     586            RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Ending test set on host (Validation Kit audio driver) ...\n");
    585587            rc2 = AudioTestSvcClientTestSetEnd(&pTstEnv->u.Host.AtsClValKit, pTstEnv->szTag);
    586588            if (RT_FAILURE(rc2))
  • trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp

    r90845 r90851  
    300300
    301301        uint64_t        offStream          = 0;
     302        uint64_t        tsStartMs          = RTTimeMilliTS();
     303        RTMSINTERVAL    uTimeoutMs         = pParms->msDuration * 4; /* Four times the time playback should roughly take */
    302304
    303305        while (cbToPlayTotal)
     
    348350            Assert(cbToPlayTotal >= cbPlayed);
    349351            cbToPlayTotal -= cbPlayed;
     352
     353            /* Fail-safe in case something screwed up while playing back. */
     354            if (RTTimeMilliTS() - tsStartMs > uTimeoutMs)
     355            {
     356                RTTestFailed(g_hTest, "Playback took too long (%RU32ms exceeded), aborting\n", uTimeoutMs);
     357                rc = VERR_TIMEOUT;
     358                break;
     359            }
    350360        }
    351 
    352         if (RT_SUCCESS(rc))
    353             rc = AudioTestMixStreamDrain(&pStream->Mix, true /*fSync*/);
    354361
    355362        if (cbToPlayTotal != 0)
    356363            RTTestFailed(g_hTest, "Playback ended unexpectedly (%RU32 bytes left)\n", cbToPlayTotal);
     364
     365        if (RT_SUCCESS(rc))
     366        {
     367            RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Draining stream ...\n");
     368            rc = AudioTestMixStreamDrain(&pStream->Mix, true /*fSync*/);
     369        }
    357370    }
    358371    else
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