Changeset 71752 in vbox for trunk/src/VBox
- Timestamp:
- Apr 9, 2018 12:53:45 AM (7 years ago)
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r71751 r71752 270 270 uint8_t piv; /** ro 0, Prefetched index value. */ 271 271 uint8_t cr; /** rw 0, Control register. */ 272 int 272 int32_t bd_valid; /** Whether current BDLE is initialized or not. */ 273 273 AC97BDLE bd; /** Current Buffer Descriptor List Entry (BDLE). */ 274 } AC97BMREGS, *PAC97BMREGS; 274 } AC97BMREGS; 275 AssertCompileSizeAlignment(AC97BMREGS, 8); 276 /** Pointer to the BM registers of an audio stream. */ 277 typedef AC97BMREGS *PAC97BMREGS; 275 278 276 279 #ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO … … 301 304 typedef struct AC97STREAMSTATE 302 305 { 306 /** Criticial section for this stream. */ 307 RTCRITSECT CritSect; 303 308 /** Circular buffer (FIFO) for holding DMA'ed data. */ 304 309 R3PTRTYPE(PRTCIRCBUF) pCircBuf; 305 /** Criticial section for this stream. */ 306 RTCRITSECT CritSect; 310 #if HC_ARCH_BITS == 32 311 uint32_t Padding; 312 #endif 307 313 /** The stream's current configuration. */ 308 PDMAUDIOSTREAMCFG Cfg; 309 uint32_t Padding; 314 PDMAUDIOSTREAMCFG Cfg; //+96 310 315 #ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO 311 316 /** Asynchronous I/O state members. */ 312 317 AC97STREAMSTATEAIO AIO; 313 318 #endif 314 } AC97STREAMSTATE, *PAC97STREAMSTATE; 319 } AC97STREAMSTATE; 320 AssertCompileSizeAlignment(AC97STREAMSTATE, 8); 321 /** Pointer to internal state of an AC'97 stream. */ 322 typedef AC97STREAMSTATE *PAC97STREAMSTATE; 315 323 316 324 /** … … 321 329 /** Stream number (SDn). */ 322 330 uint8_t u8SD; 331 uint8_t abPadding[7]; 323 332 /** Bus master registers of this stream. */ 324 333 AC97BMREGS Regs; … … 326 335 AC97STREAMSTATE State; 327 336 } AC97STREAM, *PAC97STREAM; 337 AssertCompileSizeAlignment(AC97STREAM, 8); 338 /** Pointer to an AC'97 stream (registers + state). */ 339 typedef AC97STREAM *PAC97STREAM; 328 340 329 341 typedef struct AC97STATE *PAC97STATE; … … 404 416 /** Set if R0/RC is enabled. */ 405 417 bool fRZEnabled; 418 bool afPadding0[3]; 406 419 /** Global Control (Bus Master Control Register). */ 407 420 uint32_t glob_cnt; … … 462 475 /** Codec model. */ 463 476 uint32_t uCodecModel; 464 } AC97STATE, *PAC97STATE; 477 } AC97STATE; 478 AssertCompileMemberAlignment(AC97STATE, StreamLineIn, 8); 479 /** Pointer to a AC'97 state. */ 480 typedef AC97STATE *PAC97STATE; 465 481 466 482 /** … … 563 579 * Internal Functions * 564 580 *********************************************************************************************************************************/ 565 DECLINLINE(PAC97STREAM) ichac97GetStreamFromIdx(PAC97STATE pThis, uint32_t uIdx); 581 #ifdef IN_RING3 566 582 static int ichac97StreamCreate(PAC97STATE pThis, PAC97STREAM pStream, uint8_t u8Strm); 567 583 static void ichac97StreamDestroy(PAC97STATE pThis, PAC97STREAM pStream); … … 578 594 579 595 static DECLCALLBACK(void) ichac97Reset(PPDMDEVINS pDevIns); 580 # ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS596 # ifndef VBOX_WITH_AUDIO_AC97_CALLBACKS 581 597 static int ichac97TimerStart(PAC97STATE pThis); 582 598 static int ichac97TimerMaybeStart(PAC97STATE pThis); … … 585 601 static void ichac97TimerMain(PAC97STATE pThis); 586 602 static DECLCALLBACK(void) ichac97Timer(PPDMDEVINS pDevIns, PTMTIMER pTimer, void *pvUser); 587 # endif603 # endif 588 604 static void ichac97DoTransfers(PAC97STATE pThis); 589 605 … … 593 609 static void ichac97MixerRemoveDrvStreams(PAC97STATE pThis, PAUDMIXSINK pMixSink, PDMAUDIODIR enmDir, PDMAUDIODESTSOURCE dstSrc); 594 610 595 # ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO611 # ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO 596 612 static DECLCALLBACK(int) ichac97StreamAsyncIOThread(RTTHREAD hThreadSelf, void *pvUser); 597 613 static int ichac97StreamAsyncIOCreate(PAC97STATE pThis, PAC97STREAM pStream); … … 601 617 static void ichac97StreamAsyncIOUnlock(PAC97STREAM pStream); 602 618 static void ichac97StreamAsyncIOEnable(PAC97STREAM pStream, bool fEnable); 603 # endif604 619 # endif 620 #endif /* IN_RING3 */ 605 621 606 622 -
trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp
r70878 r71752 42 42 43 43 /* 44100Hz, 2 Channels, S16 */ 44 PDMAUDIOPCMPROPS config = 45 { 44 PDMAUDIOPCMPROPS config = PDMAUDIOPCMPROPS_INITIALIZOR( 46 45 16, /* Bits */ 47 46 true, /* Signed */ … … 50 49 PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(16 /* Bits */, 2 /* Channels */), /* Shift */ 51 50 false /* Swap Endian */ 52 };51 ); 53 52 54 53 RTTESTI_CHECK(DrvAudioHlpPCMPropsAreValid(&config)); … … 164 163 165 164 /* 44100Hz, 2 Channels, S16 */ 166 PDMAUDIOPCMPROPS cfg_p = 167 { 165 PDMAUDIOPCMPROPS cfg_p = PDMAUDIOPCMPROPS_INITIALIZOR( 168 166 16, /* Bits */ 169 167 true, /* Signed */ … … 172 170 PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(16 /* Bits */, 2 /* Channels */), /* Shift */ 173 171 false /* Swap Endian */ 174 };172 ); 175 173 176 174 RTTESTI_CHECK(DrvAudioHlpPCMPropsAreValid(&cfg_p)); … … 180 178 181 179 /* 22050Hz, 2 Channels, S16 */ 182 PDMAUDIOPCMPROPS cfg_c1 = /* Upmixing to parent */ 183 { 180 PDMAUDIOPCMPROPS cfg_c1 = PDMAUDIOPCMPROPS_INITIALIZOR(/* Upmixing to parent */ 184 181 16, /* Bits */ 185 182 true, /* Signed */ … … 188 185 PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(16 /* Bits */, 2 /* Channels */), /* Shift */ 189 186 false /* Swap Endian */ 190 };187 ); 191 188 192 189 RTTESTI_CHECK(DrvAudioHlpPCMPropsAreValid(&cfg_c1)); … … 200 197 201 198 /* 48000Hz, 2 Channels, S16 */ 202 PDMAUDIOPCMPROPS cfg_c2 = /* Downmixing to parent */ 203 { 199 PDMAUDIOPCMPROPS cfg_c2 = PDMAUDIOPCMPROPS_INITIALIZOR(/* Downmixing to parent */ 204 200 16, /* Bits */ 205 201 true, /* Signed */ … … 208 204 PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(16 /* Bits */, 2 /* Channels */), /* Shift */ 209 205 false /* Swap Endian */ 210 };206 ); 211 207 212 208 RTTESTI_CHECK(DrvAudioHlpPCMPropsAreValid(&cfg_c2)); … … 315 311 316 312 /* 44100Hz, 1 Channel, U8 */ 317 PDMAUDIOPCMPROPS cfg_p = 318 { 313 PDMAUDIOPCMPROPS cfg_p = PDMAUDIOPCMPROPS_INITIALIZOR( 319 314 8, /* Bits */ 320 315 false, /* Signed */ … … 323 318 PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(8 /* Bits */, 1 /* Channels */), /* Shift */ 324 319 false /* Swap Endian */ 325 };320 ); 326 321 327 322 RTTESTI_CHECK(DrvAudioHlpPCMPropsAreValid(&cfg_p)); … … 339 334 340 335 /* 22050Hz, 1 Channel, U8 */ 341 PDMAUDIOPCMPROPS cfg_c = /* Upmixing to parent */ 342 { 336 PDMAUDIOPCMPROPS cfg_c = PDMAUDIOPCMPROPS_INITIALIZOR( /* Upmixing to parent */ 343 337 8, /* Bits */ 344 338 false, /* Signed */ … … 347 341 PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(8 /* Bits */, 1 /* Channels */), /* Shift */ 348 342 false /* Swap Endian */ 349 };343 ); 350 344 351 345 RTTESTI_CHECK(DrvAudioHlpPCMPropsAreValid(&cfg_c)); … … 422 416 423 417 /* 44100Hz, 1 Channel, S16 */ 424 PDMAUDIOPCMPROPS cfg_p = 425 { 418 PDMAUDIOPCMPROPS cfg_p = PDMAUDIOPCMPROPS_INITIALIZOR( 426 419 16, /* Bits */ 427 420 true, /* Signed */ … … 430 423 PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(16 /* Bits */, 1 /* Channels */), /* Shift */ 431 424 false /* Swap Endian */ 432 };425 ); 433 426 434 427 RTTESTI_CHECK(DrvAudioHlpPCMPropsAreValid(&cfg_p)); … … 438 431 439 432 /* 22050Hz, 1 Channel, S16 */ 440 PDMAUDIOPCMPROPS cfg_c = /* Upmixing to parent */ 441 { 433 PDMAUDIOPCMPROPS cfg_c = PDMAUDIOPCMPROPS_INITIALIZOR( /* Upmixing to parent */ 442 434 16, /* Bits */ 443 435 true, /* Signed */ … … 446 438 PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(16 /* Bits */, 1 /* Channels */), /* Shift */ 447 439 false /* Swap Endian */ 448 };440 ); 449 441 450 442 RTTESTI_CHECK(DrvAudioHlpPCMPropsAreValid(&cfg_c)); … … 521 513 /* Same for parent/child. */ 522 514 /* 44100Hz, 2 Channels, S16 */ 523 PDMAUDIOPCMPROPS cfg = 524 { 515 PDMAUDIOPCMPROPS cfg = PDMAUDIOPCMPROPS_INITIALIZOR( 525 516 16, /* Bits */ 526 517 true, /* Signed */ … … 529 520 PDMAUDIOPCMPROPS_MAKE_SHIFT_PARMS(16 /* Bits */, 2 /* Channels */), /* Shift */ 530 521 false /* Swap Endian */ 531 };522 ); 532 523 533 524 RTTESTI_CHECK(DrvAudioHlpPCMPropsAreValid(&cfg));
Note:
See TracChangeset
for help on using the changeset viewer.