- Timestamp:
- May 30, 2021 2:33:49 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmaudioifs.h
r89372 r89379 503 503 504 504 /** 505 * Audio stream (data) layout.506 */507 typedef enum PDMAUDIOSTREAMLAYOUT508 {509 /** Invalid zero value as per usual (guards against using unintialized values). */510 PDMAUDIOSTREAMLAYOUT_INVALID = 0,511 /** Unknown access type; do not use (hdaR3StreamMapReset uses it). */512 PDMAUDIOSTREAMLAYOUT_UNKNOWN,513 /** Non-interleaved access, that is, consecutive access to the data.514 * @todo r=bird: For plain stereo this is actually interleaves left/right. What515 * I guess non-interleaved means, is that there are no additional516 * information interleaved next to the interleaved stereo.517 * https://stackoverflow.com/questions/17879933/whats-the-interleaved-audio */518 PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED,519 /** Interleaved access, where the data can be mixed together with data of other audio streams. */520 PDMAUDIOSTREAMLAYOUT_INTERLEAVED,521 /** Complex layout, which does not fit into the interleaved / non-interleaved layouts. */522 PDMAUDIOSTREAMLAYOUT_COMPLEX,523 /** Raw (pass through) data, with no data layout processing done.524 *525 * This means that this stream will operate on PDMAUDIOFRAME data526 * directly. Don't use this if you don't have to.527 *528 * @deprecated Replaced by S64 (signed, 64-bit sample size). */529 PDMAUDIOSTREAMLAYOUT_RAW,530 /** End of valid values. */531 PDMAUDIOSTREAMLAYOUT_END,532 /** Hack to blow the type up to 32-bit. */533 PDMAUDIOSTREAMLAYOUT_32BIT_HACK = 0x7fffffff534 } PDMAUDIOSTREAMLAYOUT;535 536 /**537 505 * Stream channel data block. 538 506 */ … … 718 686 /** The stream's PCM properties. */ 719 687 PDMAUDIOPCMPROPS Props; 720 /** The stream's audio data layout.721 * This indicates how the audio data buffers to/from the backend is being layouted.722 *723 * Currently, the following layouts are supported by the audio connector:724 *725 * PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED:726 * One stream at once. The consecutive audio data is exactly in the format and frame width727 * like defined in the PCM properties. This is the default.728 *729 * PDMAUDIOSTREAMLAYOUT_RAW:730 * Can be one or many streams at once, depending on the stream's mixing buffer setup.731 * The audio data will get handled as PDMAUDIOFRAME frames without any modification done.732 *733 * @todo r=bird: See PDMAUDIOSTREAMLAYOUT comments. */734 PDMAUDIOSTREAMLAYOUT enmLayout;735 688 /** Device emulation-specific data needed for the audio connector. */ 736 689 struct … … 760 713 uint32_t cFramesPreBuffering; 761 714 } Backend; 762 uint32_t u32Padding;763 715 /** Friendly name of the stream. */ 764 716 char szName[64]; … … 1185 1137 1186 1138 /** PDMIAUDIOCONNECTOR interface ID. */ 1187 #define PDMIAUDIOCONNECTOR_IID " 36fee65e-cbb3-4bb7-a028-e88e6acc1c46"1139 #define PDMIAUDIOCONNECTOR_IID "ae82616d-0da7-489a-aa4c-3e74d112ca9c" 1188 1140 1189 1141 … … 1479 1431 1480 1432 /** PDMIHOSTAUDIO interface ID. */ 1481 #define PDMIHOSTAUDIO_IID " da3c9d33-e532-415b-9156-db31521f59ef"1433 #define PDMIHOSTAUDIO_IID "b942d1cd-ffbf-490b-a296-74f30884bbd6" 1482 1434 1483 1435 … … 1564 1516 1565 1517 /** PDMIHOSTAUDIOPORT interface ID. */ 1566 #define PDMIHOSTAUDIOPORT_IID " 9f91ec59-95ba-4925-92dc-e75be1c63352"1518 #define PDMIHOSTAUDIOPORT_IID "d42144e9-867e-4d1c-86d4-acb92b47f013" 1567 1519 1568 1520 /** @} */ -
trunk/include/VBox/vmm/pdmaudioinline.h
r89342 r89379 946 946 return pCfg1->enmDir == pCfg2->enmDir 947 947 && pCfg1->enmPath == pCfg2->enmPath 948 && pCfg1->enmLayout == pCfg2->enmLayout949 948 && pCfg1->Device.cMsSchedulingHint == pCfg2->Device.cMsSchedulingHint 950 949 && pCfg1->Backend.cFramesPeriod == pCfg2->Backend.cFramesPeriod … … 980 979 { 981 980 AssertPtrReturn(pCfg, false); 982 AssertMsgReturn(pCfg->enmDir >= PDMAUDIODIR_UNKNOWN && pCfg->enmDir < PDMAUDIODIR_END, 983 ("%d\n", pCfg->enmDir), false); 984 AssertMsgReturn(pCfg->enmLayout >= PDMAUDIOSTREAMLAYOUT_UNKNOWN && pCfg->enmLayout < PDMAUDIOSTREAMLAYOUT_END, 985 ("%d\n", pCfg->enmLayout), false); 981 AssertMsgReturn(pCfg->enmDir >= PDMAUDIODIR_UNKNOWN && pCfg->enmDir < PDMAUDIODIR_END, ("%d\n", pCfg->enmDir), false); 986 982 return PDMAudioPropsAreValid(&pCfg->Props); 987 983 } -
trunk/src/VBox/Devices/Audio/AudioHlp.cpp
r89342 r89379 153 153 { 154 154 /* Ugly! HDA attach code calls us with uninitialized (all zero) config. */ 155 if ( pCfg->enmLayout != PDMAUDIOSTREAMLAYOUT_INVALID 156 || PDMAudioPropsHz(&pCfg->Props) != 0) 155 if (PDMAudioPropsHz(&pCfg->Props) != 0) 157 156 { 158 157 if (PDMAudioStrmCfgIsValid(pCfg)) … … 160 159 if ( pCfg->enmDir == PDMAUDIODIR_IN 161 160 || pCfg->enmDir == PDMAUDIODIR_OUT) 162 { 163 /* As stated elsewhere, the following is non-sense and must be eliminated. */ 164 if ( pCfg->enmLayout == PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED 165 || pCfg->enmLayout == PDMAUDIOSTREAMLAYOUT_INTERLEAVED 166 || pCfg->enmLayout == PDMAUDIOSTREAMLAYOUT_RAW) 167 return AudioHlpPcmPropsAreValid(&pCfg->Props); 168 } 161 return AudioHlpPcmPropsAreValid(&pCfg->Props); 169 162 } 170 163 } -
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r89371 r89379 2271 2271 CfgHost.enmDir = pSink->enmDir; 2272 2272 CfgHost.enmPath = pCfg->enmPath; 2273 CfgHost.enmLayout = pCfg->enmLayout;2274 2273 CfgHost.Device = pCfg->Device; 2275 2274 RTStrCopy(CfgHost.szName, sizeof(CfgHost.szName), pCfg->szName); -
trunk/src/VBox/Devices/Audio/DevHda.cpp
r89346 r89379 1673 1673 RTStrPrintf(pCfg->szName, RT_ELEMENTS(pCfg->szName), "Front"); 1674 1674 1675 pCfg->enmPath = PDMAUDIOPATH_OUT_FRONT; 1676 pCfg->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 1675 pCfg->enmPath = PDMAUDIOPATH_OUT_FRONT; 1677 1676 /// @todo PDMAudioPropsSetChannels(&pCfg->Props, 2); ? 1678 1677 … … 1686 1685 RTStrPrintf(pCfg->szName, RT_ELEMENTS(pCfg->szName), "Center/LFE"); 1687 1686 1688 pCfg->enmPath = PDMAUDIOPATH_OUT_CENTER_LFE; 1689 pCfg->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 1687 pCfg->enmPath = PDMAUDIOPATH_OUT_CENTER_LFE; 1690 1688 PDMAudioPropsSetChannels(&pCfg->Props, fUseCenter && fUseLFE ? 2 : 1); 1691 1689 … … 1698 1696 RTStrPrintf(pCfg->szName, RT_ELEMENTS(pCfg->szName), "Rear"); 1699 1697 1700 pCfg->enmPath = PDMAUDIOPATH_OUT_REAR; 1701 pCfg->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 1698 pCfg->enmPath = PDMAUDIOPATH_OUT_REAR; 1702 1699 PDMAudioPropsSetChannels(&pCfg->Props, 2); 1703 1700 … … 4402 4399 Cfg.enmDir = PDMAUDIODIR_OUT; 4403 4400 Cfg.enmPath = PDMAUDIOPATH_OUT_FRONT; 4404 Cfg.enmLayout = PDMAUDIOSTREAMLAYOUT_INTERLEAVED;4405 4401 Cfg.Device.cMsSchedulingHint = 10; 4406 4402 Cfg.Backend.cFramesPreBuffering = UINT32_MAX; -
trunk/src/VBox/Devices/Audio/DevHdaStream.cpp
r89302 r89379 548 548 # error "Implement me!" 549 549 # else 550 pCfg->enmPath = PDMAUDIOPATH_IN_LINE; 551 pCfg->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; 550 pCfg->enmPath = PDMAUDIOPATH_IN_LINE; 552 551 RTStrCopy(pCfg->szName, sizeof(pCfg->szName), "Line In"); 553 552 # endif -
trunk/src/VBox/Devices/Audio/DevHdaStream.h
r88943 r89379 158 158 uint32_t idxScheduleLoop; 159 159 160 uint64_t u64Padding; 160 161 /** Buffer descriptors and additional timer scheduling state. 161 162 * (Same as HDABDLEDESC, with more sensible naming.) */ -
trunk/src/VBox/Devices/Audio/DevHdaStreamMap.cpp
r88300 r89379 349 349 350 350 Assert(pMap->cbGuestFrame); /* Frame size must not be 0. */ 351 pMap->enmLayout = PDMAUDIOSTREAMLAYOUT_INTERLEAVED;352 351 return VINF_SUCCESS; 353 352 } … … 385 384 { 386 385 AssertPtrReturnVoid(pMap); 387 388 pMap->enmLayout = PDMAUDIOSTREAMLAYOUT_UNKNOWN;389 386 390 387 if (pMap->paMappings) -
trunk/src/VBox/Devices/Audio/DevHdaStreamMap.h
r88235 r89379 30 30 * The host properties are found in HDASTREAMSTATE::Cfg::Props. */ 31 31 PDMAUDIOPCMPROPS GuestProps; 32 /** The stream's layout. */33 PDMAUDIOSTREAMLAYOUT enmLayout;34 32 /** The guest side frame size in bytes. */ 35 33 uint8_t cbGuestFrame; … … 38 36 /** Number of mappings in paMappings. */ 39 37 uint8_t cMappings; 40 uint8_t aPadding[1 ];38 uint8_t aPadding[1+4]; 41 39 /** Array of stream mappings. 42 40 * Note: The mappings *must* be layed out in an increasing order, e.g. -
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r89371 r89379 1751 1751 Cfg.enmDir = PDMAUDIODIR_IN; 1752 1752 Cfg.enmPath = PDMAUDIOPATH_IN_LINE; 1753 Cfg.enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED;1754 1753 RTStrCopy(Cfg.szName, sizeof(Cfg.szName), "Line-In"); 1755 1754 … … 1764 1763 Cfg.enmDir = PDMAUDIODIR_IN; 1765 1764 Cfg.enmPath = PDMAUDIOPATH_IN_MIC; 1766 Cfg.enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED;1767 1765 RTStrCopy(Cfg.szName, sizeof(Cfg.szName), "Mic-In"); 1768 1766 … … 1777 1775 Cfg.enmDir = PDMAUDIODIR_OUT; 1778 1776 Cfg.enmPath = PDMAUDIOPATH_OUT_FRONT; 1779 Cfg.enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED;1780 1777 RTStrCopy(Cfg.szName, sizeof(Cfg.szName), "Output"); 1781 1778 -
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r89347 r89379 2185 2185 pStream->Cfg.enmDir = PDMAUDIODIR_OUT; 2186 2186 pStream->Cfg.enmPath = PDMAUDIOPATH_OUT_FRONT; 2187 pStream->Cfg.enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED;2188 2187 2189 2188 PDMAudioPropsInit(&pStream->Cfg.Props, 1 /* 8-bit */, false /* fSigned */, 1 /* Mono */, 11025 /* uHz */); … … 2224 2223 pStream->Cfg.enmDir = PDMAUDIODIR_OUT; 2225 2224 pStream->Cfg.enmPath = PDMAUDIOPATH_OUT_FRONT; 2226 pStream->Cfg.enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED;2227 2225 2228 2226 RTStrCopy(pStream->Cfg.szName, sizeof(pStream->Cfg.szName), "Output"); -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r89329 r89379 1562 1562 * @param pStreamEx Stream to initialize. 1563 1563 * @param pCfgHost Stream configuration to use for the host side (backend). 1564 * This will be adjusted. 1564 1565 * @param pCfgGuest Stream configuration to use for the guest side. 1565 1566 */ 1566 1567 static int drvAudioStreamInitInternal(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx, 1567 PPDMAUDIOSTREAMCFG pCfgHost, P PDMAUDIOSTREAMCFG pCfgGuest)1568 PPDMAUDIOSTREAMCFG pCfgHost, PCPDMAUDIOSTREAMCFG pCfgGuest) 1568 1569 { 1569 1570 /* … … 1571 1572 */ 1572 1573 pStreamEx->Core.uMagic = PDMAUDIOSTREAM_MAGIC; 1573 1574 /* Set the host's default audio data layout. */1575 /** @todo r=bird: Why, oh why? OTOH, the layout stuff is non-sense anyway. */1576 pCfgHost->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED;1577 1574 1578 1575 #ifdef LOG_ENABLED … … 1665 1662 AssertRC(rc); 1666 1663 1667 /* Set the guests's default audio data layout. */1668 pCfgGuest->enmLayout = PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED; /** @todo r=bird: WTF DO WE DO THIS? It's input and probably should've been const... */1669 1664 rc = PDMAudioStrmCfgCopy(&pStreamEx->Guest.Cfg, pCfgGuest); 1670 1665 AssertRC(rc); -
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r89258 r89379 313 313 * st_sample_t and PDMAUDIOFRAME). 314 314 */ 315 pCfgAcq->enmLayout = PDMAUDIOSTREAMLAYOUT_RAW;316 315 PDMAudioPropsInitEx(&pCfgAcq->Props, 8 /*64-bit*/, true /*fSigned*/, 2 /*stereo*/, 22050 /*Hz*/, 317 316 true /*fLittleEndian*/, true /*fRaw*/); … … 343 342 * see st_sample_t and PDMAUDIOFRAME). 344 343 */ 345 pCfgAcq->enmLayout = PDMAUDIOSTREAMLAYOUT_RAW;346 344 PDMAudioPropsInitEx(&pCfgAcq->Props, 8 /*64-bit*/, true /*fSigned*/, 2 /*stereo*/, 22050 /*Hz*/, 347 345 true /*fLittleEndian*/, true /*fRaw*/);
Note:
See TracChangeset
for help on using the changeset viewer.