VirtualBox

Changeset 91126 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 6, 2021 3:39:41 PM (3 years ago)
Author:
vboxsync
Message:

Audio/Validation Kit: Added a bit more diagnosis to the audio data verification process. ​bugref:10008

File:
1 edited

Legend:

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

    r91051 r91126  
    19701970 *
    19711971 * @returns Number of differences. 0 means they are equal (but not necessarily identical).
     1972 * @param   pVerJob             Verification job to verify PCM data for.
    19721973 * @param   pCmpA               File comparison parameters to file A to compare file B with.
    19731974 * @param   pCmpB               File comparison parameters to file B to compare file A with.
    19741975 * @param   pToneParms          Tone parameters to use for comparison.
    19751976 */
    1976 static uint32_t audioTestFilesFindDiffsBinary(PAUDIOTESTFILECMPPARMS pCmpA, PAUDIOTESTFILECMPPARMS pCmpB,
     1977static uint32_t audioTestFilesFindDiffsBinary(PAUDIOTESTVERIFYJOB pVerJob,
     1978                                              PAUDIOTESTFILECMPPARMS pCmpA, PAUDIOTESTFILECMPPARMS pCmpB,
    19771979                                              PAUDIOTESTTONEPARMS pToneParms)
    19781980{
     
    20152017            if (cDiffs)
    20162018            {
    2017                 Log2Func(("Chunk A [%RU64-%RU64] vs. chunk B [%RU64-%RU64] (%RU64 bytes)\n",
    2018                           pCmpA->offStart + offLastDiff, pCmpA->offStart + offCur,
    2019                           pCmpB->offStart + offLastDiff, pCmpB->offStart + offCur, offCur - offLastDiff));
     2019                int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Chunks differ: A [%RU64-%RU64] vs. B [%RU64-%RU64] (%RU64 bytes, %RU64us)",
     2020                                                                                     pCmpA->offStart + offLastDiff, pCmpA->offStart + offCur,
     2021                                                                                     pCmpB->offStart + offLastDiff, pCmpB->offStart + offCur, offCur - offLastDiff,
     2022                                                                                     PDMAudioPropsBytesToMicro(&pToneParms->Props, offCur - offLastDiff));
     2023                AssertRC(rc2);
    20202024            }
    20212025            offLastDiff = 0;
     
    21072111        size_t const cbDiffAbs = cbSizeA > cbSizeB ? cbSizeA - cbSizeB : cbSizeB - cbSizeA;
    21082112
    2109         int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %zu bytes (%zums)",
    2110                                             ObjA.szName, cbSizeA, PDMAudioPropsBytesToMilli(&pVerJob->PCMProps, cbSizeA));
     2113        int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %zu bytes (%RU64us)",
     2114                                            ObjA.szName, cbSizeA, PDMAudioPropsBytesToMicro(&pVerJob->PCMProps, cbSizeA));
    21112115        AssertRC(rc2);
    2112         rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %zu bytes (%zums)",
    2113                                         ObjB.szName, cbSizeB, PDMAudioPropsBytesToMilli(&pVerJob->PCMProps, cbSizeB));
     2116        rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %zu bytes (%RU64us)",
     2117                                        ObjB.szName, cbSizeB, PDMAudioPropsBytesToMicro(&pVerJob->PCMProps, cbSizeB));
    21142118        AssertRC(rc2);
    21152119
    2116         rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %u%% (%zu bytes, %zums) %s than '%s'",
     2120        rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File '%s' is %u%% (%zu bytes, %RU64us) %s than '%s'",
    21172121                                        ObjA.szName,
    21182122                                        cbSizeA > cbSizeB ? 100 - ((cbSizeB * 100) / cbSizeA) : 100 - ((cbSizeA * 100) / cbSizeB),
    2119                                         cbDiffAbs, PDMAudioPropsBytesToMilli(&pVerJob->PCMProps, (uint32_t)cbDiffAbs),
     2123                                        cbDiffAbs, PDMAudioPropsBytesToMicro(&pVerJob->PCMProps, (uint32_t)cbDiffAbs),
    21202124                                        cbSizeA > cbSizeB ? "bigger" : "smaller",
    21212125                                        ObjB.szName);
     
    21472151                             cbSizeB);
    21482152
    2149     Log2Func(("Test #%RU32\n", pVerJob->idxTest));
    2150     Log2Func(("File A ('%s'): cbOff=%RU64  cbSize=%RU64, cbFileSize=%RU64\n", ObjA.szName, FileA.offStart, FileA.cbSize, cbSizeA));
    2151     Log2Func(("File B ('%s'): cbOff=%RU64, cbSize=%RU64, cbFileSize=%RU64\n", ObjB.szName, FileB.offStart, FileB.cbSize, cbSizeB));
    2152 
    2153     uint32_t const cDiffs = audioTestFilesFindDiffsBinary(&FileA, &FileB, &ToneParmsA);
    2154 
    2155     int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Files '%s' and '%s' are %s (%RU32 different chunks, threshold is %RU32)",
    2156                                         ObjA.szName, ObjB.szName, cDiffs == 0 ? "equal" : "different", cDiffs, pVerJob->cThresholdDiff);
     2153    int rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File A ('%s'): cbOff=%RU64  cbSize=%RU64, cbFileSize=%RU64\n",
     2154                                        ObjA.szName, FileA.offStart, FileA.cbSize, cbSizeA);
     2155    AssertRC(rc2);
     2156
     2157    rc = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "File B ('%s'): cbOff=%RU64, cbSize=%RU64, cbFileSize=%RU64\n",
     2158                                   ObjB.szName, FileB.offStart, FileB.cbSize, cbSizeB);
     2159    AssertRC(rc2);
     2160
     2161    uint32_t const cDiffs = audioTestFilesFindDiffsBinary(pVerJob, &FileA, &FileB, &ToneParmsA);
     2162
     2163    rc2 = audioTestErrorDescAddInfo(pVerJob->pErr, pVerJob->idxTest, "Files '%s' and '%s' are %s (%RU32 different chunks, threshold is %RU32)",
     2164                                    ObjA.szName, ObjB.szName, cDiffs == 0 ? "equal" : "different", cDiffs, pVerJob->cThresholdDiff);
    21572165    AssertRC(rc2);
    21582166
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