Changeset 92211 in vbox
- Timestamp:
- Nov 4, 2021 2:15:01 PM (3 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioTest.cpp
r92210 r92211 2470 2470 uint32_t const cbFrameSize = PDMAudioPropsFrameSize(&pBeacon->Props); /* Use the audio frame size as chunk size. */ 2471 2471 2472 if (cbBuf < cbFrameSize) 2472 if (cbBuf < cbFrameSize) /* Fend-off data which isn't at least one full frame. */ 2473 2473 return 0; 2474 2474 … … 2476 2476 ("Buffer size must be frame-aligned"), 0); 2477 2477 2478 uint8_t const byBeacon = AudioTestBeaconByteFromType(pBeacon->enmType); 2479 /*bool fInBeacon = false; 2480 uint32_t cbBeacon = 0; 2481 size_t offLastBeacon = 0;*/ 2482 size_t offGap = 0; 2483 2484 unsigned const cbStep = cbFrameSize; 2485 uint32_t const cbProcessedInitial = pBeacon->cbUsed; 2478 uint8_t const byBeacon = AudioTestBeaconByteFromType(pBeacon->enmType); 2479 unsigned const cbStep = cbFrameSize; 2480 uint32_t const cbUsedInitial = pBeacon->cbUsed; 2486 2481 2487 2482 for (size_t i = 0; i < cbBuf; i += cbStep) … … 2492 2487 && pauBuf[i + 3] == byBeacon) 2493 2488 { 2494 if (offGap)2495 {2496 pBeacon->cbUsed = 0;2497 }2498 2489 pBeacon->cbUsed += cbStep; 2499 offGap = 0; 2490 2491 if (pBeacon->cbUsed > pBeacon->cbSize) 2492 pBeacon->cbUsed -= pBeacon->cbSize; 2500 2493 } 2501 2494 else 2502 offGap = i; 2503 } 2504 2505 Assert(pBeacon->cbUsed >= cbProcessedInitial); 2506 return pBeacon->cbUsed - cbProcessedInitial; 2495 { 2496 /* If beacon is not complete yet, we detected a gap here. Start all over then. */ 2497 if (pBeacon->cbUsed < pBeacon->cbSize) 2498 pBeacon->cbUsed = 0; 2499 } 2500 } 2501 2502 if (!pBeacon->cbUsed) 2503 return 0; 2504 2505 AssertMsg(pBeacon->cbUsed >= cbUsedInitial, ("cbUsed (%RU32) < cbUsedInitial (%RU32)\n", pBeacon->cbUsed, cbUsedInitial)); 2506 return pBeacon->cbUsed - cbUsedInitial; 2507 2507 } 2508 2508 … … 3041 3041 #undef CHECK_RC_MAYBE_RET 3042 3042 #undef CHECK_RC_MSG_MAYBE_RET 3043 3044 /** 3045 * Converts an audio test state enum value to a string. 3046 * 3047 * @returns Pointer to read-only internal test state string on success, 3048 * "illegal" if invalid command value. 3049 * @param enmState The state to convert. 3050 */ 3051 const char *AudioTestStateToStr(AUDIOTESTSTATE enmState) 3052 { 3053 switch (enmState) 3054 { 3055 case AUDIOTESTSTATE_INIT: return "init"; 3056 case AUDIOTESTSTATE_PRE: return "pre"; 3057 case AUDIOTESTSTATE_RUN: return "run"; 3058 case AUDIOTESTSTATE_POST: return "post"; 3059 case AUDIOTESTSTATE_DONE: return "done"; 3060 case AUDIOTESTSTATE_32BIT_HACK: 3061 break; 3062 } 3063 AssertMsgFailedReturn(("Invalid test state: #%x\n", enmState), "illegal"); 3064 } 3043 3065 3044 3066 -
trunk/src/VBox/Devices/Audio/AudioTest.h
r92210 r92211 353 353 typedef AUDIOTESTERRORDESC const *PCAUDIOTESTERRORDESC; 354 354 355 /** 356 * Enumeration specifying an internal test state. 357 */ 358 typedef enum AUDIOTESTSTATE 359 { 360 /** Test is initializing. */ 361 AUDIOTESTSTATE_INIT = 0, 362 /** Test is in pre-run phase. */ 363 AUDIOTESTSTATE_PRE, 364 /** Test is running */ 365 AUDIOTESTSTATE_RUN, 366 /** Test is in post-run phase. */ 367 AUDIOTESTSTATE_POST, 368 /** Test has been run. */ 369 AUDIOTESTSTATE_DONE, 370 /** The usual 32-bit hack. */ 371 AUDIOTESTSTATE_32BIT_HACK = 0x7fffffff 372 } AUDIOTESTSTATE; 373 355 374 double AudioTestToneInit(PAUDIOTESTTONE pTone, PPDMAUDIOPCMPROPS pProps, double dbFreq); 356 375 double AudioTestToneInitRandom(PAUDIOTESTTONE pTone, PPDMAUDIOPCMPROPS pProps); … … 410 429 411 430 void AudioTestErrorDescDestroy(PAUDIOTESTERRORDESC pErr); 431 432 const char *AudioTestStateToStr(AUDIOTESTSTATE enmState); 412 433 413 434 /** @name Wave File Accessors -
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r92206 r92211 99 99 100 100 /** 101 * Enumeration specifying an internal test state.102 */103 typedef enum VALKITTESTSTATE104 {105 /** Test is initializing. */106 VALKITTESTSTATE_INIT = 0,107 /** Test is in pre-run phase. */108 VALKITTESTSTATE_PRE,109 /** Test is running */110 VALKITTESTSTATE_RUN,111 /** Test is in post-run phase. */112 VALKITTESTSTATE_POST,113 /** Test has been run. */114 VALKITTESTSTATE_DONE115 } VALKITTESTSTATE;116 117 /**118 101 * Structure keeping a single Validation Kit test. 119 102 */ … … 127 110 PAUDIOTESTENTRY pEntry; 128 111 /** Current test state. */ 129 VALKITTESTSTATEenmState;112 AUDIOTESTSTATE enmState; 130 113 /** Current test object to process. */ 131 114 AUDIOTESTOBJ Obj; … … 216 199 217 200 /** 218 * Converts an internal test state enum value to a string.219 *220 * @returns Pointer to read-only internal test state string on success,221 * "illegal" if invalid command value.222 * @param enmState The state to convert.223 */224 DECLINLINE(const char *) drvHostValKitTestStatusToStr(VALKITTESTSTATE enmState)225 {226 switch (enmState)227 {228 case VALKITTESTSTATE_INIT: return "init";229 case VALKITTESTSTATE_PRE: return "pre";230 case VALKITTESTSTATE_RUN: return "run";231 case VALKITTESTSTATE_POST: return "post";232 case VALKITTESTSTATE_DONE: return "done";233 /* no default: */234 break;235 }236 AssertMsgFailedReturn(("Invalid test state: #%x\n", enmState), "illegal");237 }238 239 /**240 201 * Unregisters a ValKit test, common code. 241 202 * … … 333 294 RTListForEachSafe(&pThis->lstTestsRec, pTst, pTstNext, VALKITTESTDATA, Node) 334 295 { 335 if (pTst->enmState != VALKITTESTSTATE_DONE)296 if (pTst->enmState != AUDIOTESTSTATE_DONE) 336 297 LogRel(("ValKit: \tWarning: Test #%RU32 (recording) not done yet (state is '%s')\n", 337 pTst->idxTest, drvHostValKitTestStatusToStr(pTst->enmState)));298 pTst->idxTest, AudioTestStateToStr(pTst->enmState))); 338 299 339 300 size_t const cbOutstanding = pTst->t.TestTone.u.Rec.cbToWrite - pTst->t.TestTone.u.Rec.cbWritten; … … 350 311 RTListForEachSafe(&pThis->lstTestsPlay, pTst, pTstNext, VALKITTESTDATA, Node) 351 312 { 352 if (pTst->enmState != VALKITTESTSTATE_DONE)313 if (pTst->enmState != AUDIOTESTSTATE_DONE) 353 314 LogRel(("ValKit: \tWarning: Test #%RU32 (playback) not done yet (state is '%s')\n", 354 pTst->idxTest, drvHostValKitTestStatusToStr(pTst->enmState)));315 pTst->idxTest, AudioTestStateToStr(pTst->enmState))); 355 316 356 317 size_t const cbOutstanding = pTst->t.TestTone.u.Play.cbToRead - pTst->t.TestTone.u.Play.cbRead; … … 449 410 { 450 411 LogRel(("ValKit: Waiting for all tests of set '%s' to end ...\n", pszTag)); 451 rc = RTSemEventWait(pThis->EventSemEnded, RT_MS_ 1MIN);412 rc = RTSemEventWait(pThis->EventSemEnded, RT_MS_5SEC); 452 413 if (RT_FAILURE(rc)) 453 414 { … … 528 489 AssertPtrReturn(pTestData, VERR_NO_MEMORY); 529 490 530 pTestData->enmState = VALKITTESTSTATE_INIT;491 pTestData->enmState = AUDIOTESTSTATE_INIT; 531 492 532 493 memcpy(&pTestData->t.TestTone.Parms, pToneParms, sizeof(AUDIOTESTTONEPARMS)); … … 585 546 AssertPtrReturn(pTestData, VERR_NO_MEMORY); 586 547 587 pTestData->enmState = VALKITTESTSTATE_INIT;548 pTestData->enmState = AUDIOTESTSTATE_INIT; 588 549 589 550 memcpy(&pTestData->t.TestTone.Parms, pToneParms, sizeof(AUDIOTESTTONEPARMS)); … … 879 840 880 841 if ( pTst 881 && pTst->enmState == VALKITTESTSTATE_INIT) /* Test not started yet? */842 && pTst->enmState == AUDIOTESTSTATE_INIT) /* Test not started yet? */ 882 843 { 883 844 AUDIOTESTPARMS Parms; … … 909 870 LogRel2(("ValKit: Now total of %RU32 bytes available for capturing\n", pStrmValKit->cbAvail)); 910 871 911 pTst->enmState = VALKITTESTSTATE_PRE;872 pTst->enmState = AUDIOTESTSTATE_PRE; 912 873 } 913 874 … … 1037 998 } 1038 999 1039 if (pTst->enmState == VALKITTESTSTATE_INIT) /* Test not started yet? */1000 if (pTst->enmState == AUDIOTESTSTATE_INIT) /* Test not started yet? */ 1040 1001 { 1041 1002 AUDIOTESTPARMS Parms; … … 1061 1022 LogRel(("ValKit: Test created (caller UTC): %s\n", szTimeCreated)); 1062 1023 1063 pTst->enmState = VALKITTESTSTATE_PRE;1024 pTst->enmState = AUDIOTESTSTATE_PRE; 1064 1025 } 1065 1026 } … … 1075 1036 switch (pTst->enmState) 1076 1037 { 1077 case VALKITTESTSTATE_PRE:1038 case AUDIOTESTSTATE_PRE: 1078 1039 RT_FALL_THROUGH(); 1079 case VALKITTESTSTATE_POST:1040 case AUDIOTESTSTATE_POST: 1080 1041 { 1081 1042 PAUDIOTESTTONEBEACON pBeacon = &pTst->t.TestTone.Beacon; … … 1085 1046 bool const fStarted = AudioTestBeaconGetRemaining(pBeacon) == AudioTestBeaconGetSize(pBeacon); 1086 1047 1048 /* Limit adding data to the beacon size. */ 1087 1049 uint32_t const cbToAddMax = RT_MIN(cbBuf, AudioTestBeaconGetRemaining(pBeacon)); 1088 1050 1089 1051 AudioTestBeaconAddConsecutive(pBeacon, (uint8_t *)pvBuf, cbToAddMax); 1052 /** @todo Take left-over data into account (and stash them away for the test tone)? */ 1090 1053 1091 1054 if (fStarted) 1092 LogRel2(("ValKit: Test #%RU32: Detection of %s playbackbeacon started (%RU32ms played so far)\n",1055 LogRel2(("ValKit: Test #%RU32: Detection of %s beacon started (%RU32ms played so far)\n", 1093 1056 pTst->idxTest, AudioTestBeaconTypeGetName(pBeacon->enmType), 1094 1057 PDMAudioPropsBytesToMilli(&pStream->pStream->Cfg.Props, pThis->cbPlayedTotal))); 1095 1058 if (AudioTestBeaconIsComplete(pBeacon)) 1096 1059 { 1097 LogRel2(("ValKit: Test #%RU32: Detection of %s playbackbeacon ended\n",1060 LogRel2(("ValKit: Test #%RU32: Detection of %s beacon ended\n", 1098 1061 pTst->idxTest, AudioTestBeaconTypeGetName(pBeacon->enmType))); 1099 1062 1100 if (pTst->enmState == VALKITTESTSTATE_PRE)1101 pTst->enmState = VALKITTESTSTATE_RUN;1102 else if (pTst->enmState == VALKITTESTSTATE_POST)1103 pTst->enmState = VALKITTESTSTATE_DONE;1063 if (pTst->enmState == AUDIOTESTSTATE_PRE) 1064 pTst->enmState = AUDIOTESTSTATE_RUN; 1065 else if (pTst->enmState == AUDIOTESTSTATE_POST) 1066 pTst->enmState = AUDIOTESTSTATE_DONE; 1104 1067 } 1105 1068 } 1106 1069 else /* Go to the next state. */ 1070 pTst->enmState = AUDIOTESTSTATE_RUN; 1107 1071 break; 1108 1072 } 1109 1073 1110 case VALKITTESTSTATE_RUN:1074 case AUDIOTESTSTATE_RUN: 1111 1075 { 1112 1076 /* Whether we count all silence as recorded data or not. … … 1125 1089 pTst->idxTest, pTst->t.TestTone.u.Play.cbRead - pTst->t.TestTone.u.Play.cbToRead)); 1126 1090 1127 pTst->enmState = VALKITTESTSTATE_POST;1091 pTst->enmState = AUDIOTESTSTATE_POST; 1128 1092 /* Re-use the beacon object, but this time it's the post beacon. */ 1129 1093 AudioTestBeaconInit(&pTst->t.TestTone.Beacon, AUDIOTESTTONEBEACONTYPE_PLAY_POST, &pTst->t.TestTone.Parms.Props); … … 1132 1096 } 1133 1097 1134 case VALKITTESTSTATE_DONE:1098 case AUDIOTESTSTATE_DONE: 1135 1099 { 1136 1100 /* Handled below. */ … … 1147 1111 } 1148 1112 1149 if (pTst->enmState == VALKITTESTSTATE_DONE)1113 if (pTst->enmState == AUDIOTESTSTATE_DONE) 1150 1114 { 1151 1115 AudioTestSetTestDone(pTst->pEntry); … … 1238 1202 switch (pTst->enmState) 1239 1203 { 1240 case VALKITTESTSTATE_PRE:1204 case AUDIOTESTSTATE_PRE: 1241 1205 RT_FALL_THROUGH(); 1242 case VALKITTESTSTATE_POST:1206 case AUDIOTESTSTATE_POST: 1243 1207 { 1244 1208 PAUDIOTESTTONEBEACON pBeacon = &pTst->t.TestTone.Beacon; … … 1266 1230 pTst->idxTest, AudioTestBeaconTypeGetName(pBeacon->enmType))); 1267 1231 1268 if (pTst->enmState == VALKITTESTSTATE_PRE)1269 pTst->enmState = VALKITTESTSTATE_RUN;1270 else if (pTst->enmState == VALKITTESTSTATE_POST)1271 pTst->enmState = VALKITTESTSTATE_DONE;1232 if (pTst->enmState == AUDIOTESTSTATE_PRE) 1233 pTst->enmState = AUDIOTESTSTATE_RUN; 1234 else if (pTst->enmState == AUDIOTESTSTATE_POST) 1235 pTst->enmState = AUDIOTESTSTATE_DONE; 1272 1236 } 1273 1237 } 1238 else /* Go to the next state. */ 1239 pTst->enmState = AUDIOTESTSTATE_RUN; 1274 1240 break; 1275 1241 } 1276 1242 1277 case VALKITTESTSTATE_RUN:1243 case AUDIOTESTSTATE_RUN: 1278 1244 { 1279 1245 uint32_t const cbToWrite = RT_MIN(cbBuf, pTst->t.TestTone.u.Rec.cbToWrite - pTst->t.TestTone.u.Rec.cbWritten); … … 1301 1267 pTst->idxTest, RTTimeMilliTS() - pTst->msStartedTS)); 1302 1268 1303 pTst->enmState = VALKITTESTSTATE_POST;1269 pTst->enmState = AUDIOTESTSTATE_POST; 1304 1270 /* Re-use the beacon object, but this time it's the post beacon. */ 1305 1271 AudioTestBeaconInit(&pTst->t.TestTone.Beacon, AUDIOTESTTONEBEACONTYPE_PLAY_POST, &pTst->t.TestTone.Parms.Props); … … 1309 1275 } 1310 1276 1311 case VALKITTESTSTATE_DONE:1277 case AUDIOTESTSTATE_DONE: 1312 1278 { 1313 1279 /* Handled below. */ … … 1327 1293 } 1328 1294 1329 if (pTst->enmState == VALKITTESTSTATE_DONE)1295 if (pTst->enmState == AUDIOTESTSTATE_DONE) 1330 1296 { 1331 1297 AudioTestSetTestDone(pTst->pEntry); -
trunk/src/VBox/ValidationKit/utils/audio/vkatCommon.cpp
r92195 r92211 744 744 if (RT_SUCCESS(rc)) 745 745 { 746 uint64_t cbRecTotal = 0; /* Counts everything, including silence / whatever. */ 747 uint64_t cbTestToRec = PDMAudioPropsMilliToBytes(&pStream->Cfg.Props, pParms->msDuration); 746 uint32_t cbRecTotal = 0; /* Counts everything, including silence / whatever. */ 747 uint32_t cbTestToRec = PDMAudioPropsMilliToBytes(&pStream->Cfg.Props, pParms->msDuration); 748 uint32_t cbTestRec = 0; 749 750 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Recording %RU32 bytes total\n", cbTestToRec); 748 751 749 752 /* We expect a pre + post beacon before + after the actual test tone. … … 754 757 uint32_t const cbBeacon = AudioTestBeaconGetSize(&Beacon); 755 758 if (cbBeacon) 756 {757 759 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Expecting 2 x %RU32 bytes pre/post beacons\n", cbBeacon); 758 cbTestToRec = cbBeacon * 2 /* Pre + post beacon */;759 }760 760 761 761 AudioTestObjAddMetadataStr(Obj, "beacon_type=%RU32\n", (uint32_t)AudioTestBeaconGetType(&Beacon)); … … 769 769 AudioTestObjAddMetadataStr(Obj, "device_scheduling_hint_ms=%RU32\n", pIoOpts->cMsSchedulingHint); 770 770 771 RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Recording %RU32 bytes total\n", cbTestToRec);772 773 771 uint8_t abSamples[16384]; 774 772 uint32_t const cbSamplesAligned = PDMAudioPropsFloorBytesToFrame(pMix->pProps, sizeof(abSamples)); 775 uint64_t cbTestRec = 0;776 773 777 774 uint64_t const nsStarted = RTTimeNanoTS(); … … 780 777 uint64_t nsLastMsgCantRead = 0; /* Timestamp (in ns) when the last message of an unreadable stream was shown. */ 781 778 782 while (!g_fTerminate && cbTestRec < cbTestToRec) 779 AUDIOTESTSTATE enmState = AUDIOTESTSTATE_PRE; 780 781 while (!g_fTerminate) 783 782 { 784 783 uint64_t const nsNow = RTTimeNanoTS(); … … 799 798 if (RT_SUCCESS(rc)) 800 799 { 801 if (cbRecorded) 800 /* Flag indicating whether the whole block we're going to play is silence or not. */ 801 bool const fIsAllSilence = PDMAudioPropsIsBufferSilence(&pStream->pStream->Cfg.Props, abSamples, cbRecorded); 802 803 cbRecTotal += cbRecorded; /* Do a bit of accounting. */ 804 805 /* Always write (record) everything, no matter if the current audio contains complete silence or not. 806 * Might be also become handy later if we want to have a look at start/stop timings and so on. */ 807 rc = AudioTestObjWrite(Obj, abSamples, cbRecorded); 808 AssertRCBreak(rc); 809 810 switch (enmState) 802 811 { 803 cbRecTotal += cbRecorded; 804 805 rc = AudioTestObjWrite(Obj, abSamples, cbRecorded); 806 if (RT_SUCCESS(rc)) 812 case AUDIOTESTSTATE_PRE: 813 RT_FALL_THROUGH(); 814 case AUDIOTESTSTATE_POST: 807 815 { 808 if (AudioTestBeaconGetSize(&Beacon)) 816 if ( AudioTestBeaconGetSize(&Beacon) 817 && !AudioTestBeaconIsComplete(&Beacon)) 809 818 { 810 if (!AudioTestBeaconIsComplete(&Beacon)) 819 bool const fStarted = AudioTestBeaconGetRemaining(&Beacon) == AudioTestBeaconGetSize(&Beacon); 820 821 /* Limit adding data to the beacon size. */ 822 uint32_t const cbToAddMax = RT_MIN(cbRecorded, AudioTestBeaconGetRemaining(&Beacon)); 823 824 AudioTestBeaconAddConsecutive(&Beacon, abSamples, cbToAddMax); 825 /** @todo Take left-over data into account (and stash them away for the test tone)? */ 826 827 if ( fStarted 828 && g_uVerbosity >= 2) 829 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, 830 "Detection of %s beacon started (%RU32ms recorded so far)\n", 831 AudioTestBeaconTypeGetName(Beacon.enmType), 832 PDMAudioPropsBytesToMilli(&pStream->pStream->Cfg.Props, cbRecTotal)); 833 834 if (AudioTestBeaconIsComplete(&Beacon)) 811 835 { 812 bool const fStarted = AudioTestBeaconGetRemaining(&Beacon) == AudioTestBeaconGetSize(&Beacon); 813 814 uint32_t const cbToAddMax = RT_MIN(cbRecorded, AudioTestBeaconGetRemaining(&Beacon)); 815 816 uint32_t const cbAdded = AudioTestBeaconAddConsecutive(&Beacon, abSamples, cbToAddMax); 817 if (cbAdded) 818 cbTestRec += cbAdded; /* Only count data which belongs to a (complete test tone). */ 819 820 if ( fStarted 821 && g_uVerbosity >= 2) 822 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, 823 "Detection of %s playback beacon started (%RU32ms recorded so far)\n", 824 AudioTestBeaconTypeGetName(Beacon.enmType), 825 PDMAudioPropsBytesToMilli(&pStream->pStream->Cfg.Props, cbRecTotal)); 826 827 if (AudioTestBeaconIsComplete(&Beacon)) 828 { 829 if (g_uVerbosity >= 2) 830 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Detection of %s playback beacon ended\n", 831 AudioTestBeaconTypeGetName(Beacon.enmType)); 832 } 833 } 834 else 835 { 836 uint32_t const cbTestToneToRec = cbTestToRec - cbTestRec - cbBeacon; 837 if (cbTestToneToRec == 0) /* Done recording the test tone? */ 838 { 839 AudioTestBeaconInit(&Beacon, AUDIOTESTTONEBEACONTYPE_PLAY_POST, &pStream->Cfg.Props); 840 } 841 else /* Count test tone data. */ 842 cbTestRec += cbRecorded; 836 if (g_uVerbosity >= 2) 837 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Detection of %s beacon ended\n", 838 AudioTestBeaconTypeGetName(Beacon.enmType)); 839 840 if (enmState == AUDIOTESTSTATE_PRE) 841 enmState = AUDIOTESTSTATE_RUN; 842 else if (enmState == AUDIOTESTSTATE_POST) 843 enmState = AUDIOTESTSTATE_DONE; 843 844 } 844 845 } 846 break; 845 847 } 848 849 case AUDIOTESTSTATE_RUN: 850 { 851 /* Whether we count all silence as recorded data or not. 852 * Currently we don't, as otherwise consequtively played tones will be cut off in the end. */ 853 if (!fIsAllSilence) 854 cbTestRec += cbRecorded; 855 856 if (cbTestToRec - cbTestRec == 0) /* Done recording the test tone? */ 857 { 858 enmState = AUDIOTESTSTATE_POST; 859 /* Re-use the beacon object, but this time it's the post beacon. */ 860 AudioTestBeaconInit(&Beacon, AUDIOTESTTONEBEACONTYPE_PLAY_POST, &pStream->Cfg.Props); 861 } 862 } 863 864 case AUDIOTESTSTATE_DONE: 865 { 866 /* Nothing to do here. */ 867 break; 868 } 869 870 default: 871 AssertFailed(); 872 break; 846 873 } 847 874 } 875 876 if (enmState == AUDIOTESTSTATE_DONE) 877 break; 848 878 } 849 879 else if (AudioTestMixStreamIsOkay(pMix)) … … 874 904 } 875 905 906 if (g_uVerbosity >= 2) 907 RTTestPrintf(g_hTest, RTTESTLVL_ALWAYS, "Recorded %RU32 bytes total\n", cbRecTotal); 876 908 if (cbTestRec != cbTestToRec) 909 { 877 910 RTTestFailed(g_hTest, "Recording ended unexpectedly (%RU32/%RU32 recorded)\n", cbTestRec, cbTestToRec); 911 rc = VERR_WRONG_ORDER; /** @todo Find a better rc. */ 912 } 913 914 if (RT_FAILURE(rc)) 915 RTTestFailed(g_hTest, "Recording failed (state is '%s')\n", AudioTestStateToStr(enmState)); 878 916 879 917 int rc2 = AudioTestMixStreamDisable(pMix);
Note:
See TracChangeset
for help on using the changeset viewer.