Changeset 89575 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Jun 9, 2021 9:16:59 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 145012
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioTestService.cpp
r89567 r89575 905 905 * Initialize the transport layer. 906 906 */ 907 int rc = pThis->pTransport->pfnInit(&pThis->TransportInst, pszBindAddr ? pszBindAddr : "127.0.0.1",908 uBindPort ? uBindPort : ATS_TCP_ DEFAULT_PORT);907 int rc = pThis->pTransport->pfnInit(&pThis->TransportInst, pszBindAddr ? pszBindAddr : ATS_TCP_HOST_DEFAULT_ADDR_STR, 908 uBindPort ? uBindPort : ATS_TCP_HOST_DEFAULT_PORT); 909 909 if (RT_SUCCESS(rc)) 910 910 { -
trunk/src/VBox/Devices/Audio/AudioTestService.h
r89541 r89575 25 25 26 26 27 /** Default TCP/IP port the ATS (Audio Test Service) is running on. */ 28 #define ATS_TCP_DEFAULT_PORT 6052 29 /** Alternative TCP/IP port the ATS (Audio Test Service) is running on. */ 30 #define ATS_TCP_ALT_PORT 6042 27 /** Default TCP/IP port the host ATS (Audio Test Service) is running on. */ 28 #define ATS_TCP_HOST_DEFAULT_PORT 6052 29 /** Default TCP/IP address the host ATS (Audio Test Service) is running on. */ 30 #define ATS_TCP_HOST_DEFAULT_ADDR_STR "127.0.0.1" 31 /** Default TCP/IP port the guest ATS (Audio Test Service) is running on. */ 32 #define ATS_TCP_GUEST_DEFAULT_PORT 6042 31 33 32 34 /** -
trunk/src/VBox/Devices/Audio/AudioTestServiceClient.cpp
r89541 r89575 294 294 audioTestSvcClientInit(pClient); 295 295 296 /* For simplicity we always run on the same port, localhost only. */ 297 int rc = RTTcpClientConnect(pszAddr ? pszAddr : "127.0.0.1", uPort == 0 ? ATS_TCP_DEFAULT_PORT : uPort, &pClient->hSock); 296 int rc = RTTcpClientConnect(pszAddr ? pszAddr : ATS_TCP_HOST_DEFAULT_ADDR_STR, uPort == 0 ? ATS_TCP_HOST_DEFAULT_PORT : uPort, &pClient->hSock); 298 297 if (RT_SUCCESS(rc)) 299 298 { -
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r89567 r89575 21 21 *********************************************************************************************************************************/ 22 22 #define LOG_GROUP LOG_GROUP_DRV_HOST_AUDIO 23 #include <iprt/dir.h> 23 24 #include <iprt/env.h> 24 25 #include <iprt/mem.h> … … 196 197 } 197 198 199 /** @copydoc ATSCALLBACKS::pfnTestSetBegin */ 198 200 static DECLCALLBACK(int) drvHostValKitTestSetBegin(void const *pvUser, const char *pszTag) 199 201 { … … 201 203 202 204 LogRel(("Audio: Validation Kit: Beginning test set '%s'\n", pszTag)); 203 204 205 return AudioTestSetCreate(&pThis->Set, pThis->szPathTemp, pszTag); 205 206 } 207 206 } 207 208 /** @copydoc ATSCALLBACKS::pfnTestSetEnd */ 208 209 static DECLCALLBACK(int) drvHostValKitTestSetEnd(void const *pvUser, const char *pszTag) 209 210 { … … 239 240 * 240 241 * Creates and registers a new test tone guest recording test. 242 * This backend will play (inject) input data to the guest. 241 243 */ 242 244 static DECLCALLBACK(int) drvHostValKitRegisterGuestRecTest(void const *pvUser, PAUDIOTESTTONEPARMS pToneParms) … … 273 275 * 274 276 * Creates and registers a new test tone guest playback test. 277 * This backend will record the guest output data. 275 278 */ 276 279 static DECLCALLBACK(int) drvHostValKitRegisterGuestPlayTest(void const *pvUser, PAUDIOTESTTONEPARMS pToneParms) … … 283 286 memcpy(&pTestData->t.TestTone.Parms, pToneParms, sizeof(AUDIOTESTTONEPARMS)); 284 287 285 pTestData->t.TestTone.u. Rec.cbToWrite= PDMAudioPropsMilliToBytes(&pToneParms->Props,288 pTestData->t.TestTone.u.Play.cbToRead = PDMAudioPropsMilliToBytes(&pToneParms->Props, 286 289 pTestData->t.TestTone.Parms.msDuration); 287 290 int rc = RTCritSectEnter(&pThis->CritSect); … … 289 292 { 290 293 LogRel(("Audio: Validation Kit: Registered guest playback test (%RU32ms, %RU64 bytes)\n", 291 pTestData->t.TestTone.Parms.msDuration, pTestData->t.TestTone.u. Rec.cbToWrite));294 pTestData->t.TestTone.Parms.msDuration, pTestData->t.TestTone.u.Play.cbToRead)); 292 295 293 296 RTListAppend(&pThis->lstTestsPlay, &pTestData->Node); … … 501 504 AUDIOTESTPARMS Parms; 502 505 RT_ZERO(Parms); 506 Parms.enmDir = PDMAUDIODIR_IN; 507 Parms.enmType = AUDIOTESTTYPE_TESTTONE_RECORD; 503 508 Parms.TestTone = pTst->t.TestTone.Parms; 504 509 … … 513 518 pTst->msStartedTS = RTTimeMilliTS(); 514 519 LogRel(("Audio: Validation Kit: Recording audio data (%RU16Hz, %RU32ms) started\n", 515 (uint16_t)pTst->t.TestTone.Tone.rdFreqHz, 516 pTst->t.TestTone.Parms.msDuration)); 520 (uint16_t)Parms.TestTone.dbFreqHz, Parms.TestTone.msDuration)); 517 521 } 518 522 } … … 523 527 { 524 528 uint32_t cbToRead = RT_MIN(cbBuf, 525 pTst->t.TestTone.u.Play.cbToRead - pTst->t.TestTone.u.Play.cbRead);529 pTst->t.TestTone.u.Play.cbToRead - pTst->t.TestTone.u.Play.cbRead); 526 530 527 531 rc = AudioTestSetObjWrite(pTst->pObj, pvBuf, cbToRead); … … 544 548 drvHostValKiUnregisterPlayTest(pThis, pTst); 545 549 550 pThis->pTestCur = NULL; 551 546 552 int rc2 = RTCritSectLeave(&pThis->CritSect); 547 553 AssertRC(rc2); 548 554 } 549 555 } 556 557 cbWritten = cbToRead; 550 558 } 551 559 } … … 597 605 AUDIOTESTPARMS Parms; 598 606 RT_ZERO(Parms); 607 Parms.enmDir = PDMAUDIODIR_OUT; 608 Parms.enmType = AUDIOTESTTYPE_TESTTONE_PLAY; 599 609 Parms.TestTone = pTst->t.TestTone.Parms; 600 610 … … 622 632 rc = AudioTestToneGenerate(&pTst->t.TestTone.Tone, pvBuf, RT_MIN(cbToWrite, cbBuf), &cbRead); 623 633 if ( RT_SUCCESS(rc) 624 && cb ToWrite)634 && cbRead) 625 635 { 626 rc = AudioTestSetObjWrite(pTst->pObj, pvBuf, cb ToWrite);636 rc = AudioTestSetObjWrite(pTst->pObj, pvBuf, cbRead); 627 637 if (RT_SUCCESS(rc)) 628 638 { … … 641 651 { 642 652 drvHostValKiUnregisterRecTest(pThis, pTst); 653 654 pThis->pTestCur = NULL; 643 655 644 656 int rc2 = RTCritSectLeave(&pThis->CritSect); … … 730 742 731 743 /** @todo Make this configurable via CFGM. */ 732 const char *pszTcpAddr = "127.0.0.1";733 uint32_t uTcpPort = ATS_TCP_ DEFAULT_PORT;744 const char *pszTcpAddr = ATS_TCP_HOST_DEFAULT_ADDR_STR; 745 uint32_t uTcpPort = ATS_TCP_HOST_DEFAULT_PORT; 734 746 735 747 LogRel(("Audio: Validation Kit: Starting Audio Test Service (ATS) at %s:%RU32...\n", … … 798 810 else 799 811 LogRel(("Audio: Validation Kit: Shutdown of Audio Test Service failed, rc=%Rrc\n", rc)); 812 813 /* Try cleaning up a bit. */ 814 RTDirRemove(pThis->szPathTemp); 815 RTDirRemove(pThis->szPathOut); 800 816 801 817 if (RTCritSectIsInitialized(&pThis->CritSect))
Note:
See TracChangeset
for help on using the changeset viewer.