Changeset 65150 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Jan 5, 2017 12:07:11 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 112653
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r65149 r65150 328 328 { 329 329 /** Stream number (SDn). */ 330 uint8_t u8S trm;330 uint8_t u8SD; 331 331 /** Bus master registers of this stream. */ 332 332 AC97BMREGS Regs; … … 617 617 { 618 618 if (iIRQL) 619 pThis->glob_sta |= masks[pStream->u8S trm];619 pThis->glob_sta |= masks[pStream->u8SD]; 620 620 else 621 pThis->glob_sta &= ~masks[pStream->u8S trm];621 pThis->glob_sta &= ~masks[pStream->u8SD]; 622 622 623 623 LogFlowFunc(("Setting IRQ level=%d\n", iIRQL)); … … 638 638 AssertPtrReturn(pStream, false); 639 639 640 PAUDMIXSINK pSink = ichac97IndexToSink(pThis, pStream->u8S trm);640 PAUDMIXSINK pSink = ichac97IndexToSink(pThis, pStream->u8SD); 641 641 bool fIsEnabled = RT_BOOL(AudioMixerSinkGetStatus(pSink) & AUDMIXSINK_STS_RUNNING); 642 642 643 LogFunc(("[SD%RU8] fIsEnabled=%RTbool\n", pStream->u8S trm, fIsEnabled));643 LogFunc(("[SD%RU8] fIsEnabled=%RTbool\n", pStream->u8SD, fIsEnabled)); 644 644 return fIsEnabled; 645 645 } … … 686 686 { 687 687 /* First, enable or disable the stream and the stream's sink, if any. */ 688 rc = AudioMixerSinkCtl(ichac97IndexToSink(pThis, pStream->u8S trm),688 rc = AudioMixerSinkCtl(ichac97IndexToSink(pThis, pStream->u8SD), 689 689 fEnable ? AUDMIXSINKCMD_ENABLE : AUDMIXSINKCMD_DISABLE); 690 690 } … … 705 705 #endif 706 706 707 LogFunc(("[SD%RU8]: cStreamsActive=%RU8, rc=%Rrc\n", pStream->u8S trm, pThis->cStreamsActive, rc));707 LogFunc(("[SD%RU8]: cStreamsActive=%RU8, rc=%Rrc\n", pStream->u8SD, pThis->cStreamsActive, rc)); 708 708 return rc; 709 709 } … … 723 723 ichac97StreamLock(pStream); 724 724 725 LogFunc(("[SD%RU8]\n", pStream->u8S trm));726 727 AudioMixerSinkReset(ichac97IndexToSink(pThis, pStream->u8S trm));725 LogFunc(("[SD%RU8]\n", pStream->u8SD)); 726 727 AudioMixerSinkReset(ichac97IndexToSink(pThis, pStream->u8SD)); 728 728 729 729 if (pStream->State.pCircBuf) … … 762 762 LogFunc(("[SD%RU8] pStream=%p\n", u8Strm, pStream)); 763 763 764 pStream->u8S trm= u8Strm;764 pStream->u8SD = u8Strm; 765 765 766 766 int rc = RTCritSectInit(&pStream->State.CritSect); … … 780 780 static void ichac97StreamDestroy(PAC97STATE pThis, PAC97STREAM pStream) 781 781 { 782 LogFlowFunc(("[SD%RU8]\n", pStream->u8S trm));782 LogFlowFunc(("[SD%RU8]\n", pStream->u8SD)); 783 783 784 784 int rc2 = RTCritSectDelete(&pStream->State.CritSect); … … 981 981 AssertPtr(pCircBuf); 982 982 983 PAUDMIXSINK pMixSink = ichac97IndexToSink(pThis, pStream->u8S trm);983 PAUDMIXSINK pMixSink = ichac97IndexToSink(pThis, pStream->u8SD); 984 984 AssertPtr(pMixSink); 985 985 … … 988 988 RTThreadUserSignal(hThreadSelf); 989 989 990 LogFunc(("[SD%RU8]: Started\n", pStream->u8S trm));990 LogFunc(("[SD%RU8]: Started\n", pStream->u8SD)); 991 991 992 992 for (;;) 993 993 { 994 Log2Func(("[SD%RU8]: Waiting ...\n", pStream->u8S trm));994 Log2Func(("[SD%RU8]: Waiting ...\n", pStream->u8SD)); 995 995 996 996 int rc2 = RTSemEventWait(pAIO->Event, RT_INDEFINITE_WAIT); … … 1013 1013 uint32_t cbProcessed = 0; 1014 1014 1015 switch (pStream->u8S trm)1015 switch (pStream->u8SD) 1016 1016 { 1017 1017 /* Input. */ … … 1049 1049 } 1050 1050 1051 LogFunc(("[SD%RU8]: Ended\n", pStream->u8S trm));1051 LogFunc(("[SD%RU8]: Ended\n", pStream->u8SD)); 1052 1052 1053 1053 ASMAtomicXchgBool(&pAIO->fStarted, false); … … 1082 1082 1083 1083 char szThreadName[64]; 1084 RTStrPrintf2(szThreadName, sizeof(szThreadName), "ac97AIO%RU8", pStream->u8S trm);1084 RTStrPrintf2(szThreadName, sizeof(szThreadName), "ac97AIO%RU8", pStream->u8SD); 1085 1085 1086 1086 rc = RTThreadCreate(&pAIO->Thread, ichac97StreamAsyncIOThread, &Ctx, … … 1094 1094 rc = VINF_SUCCESS; 1095 1095 1096 LogFunc(("[SD%RU8]: Returning %Rrc\n", pStream->u8S trm, rc));1096 LogFunc(("[SD%RU8]: Returning %Rrc\n", pStream->u8SD, rc)); 1097 1097 return rc; 1098 1098 } … … 1134 1134 } 1135 1135 1136 LogFunc(("[SD%RU8]: Returning %Rrc\n", pStream->u8S trm, rc));1136 LogFunc(("[SD%RU8]: Returning %Rrc\n", pStream->u8SD, rc)); 1137 1137 return rc; 1138 1138 } … … 1149 1149 RT_NOREF(pThis); 1150 1150 1151 LogFunc(("[SD%RU8]\n", pStream->u8S trm));1151 LogFunc(("[SD%RU8]\n", pStream->u8SD)); 1152 1152 return RTSemEventSignal(pStream->State.AIO.Event); 1153 1153 } … … 1220 1220 ichac97StreamLock(pStream); 1221 1221 1222 PAUDMIXSINK pMixSink = ichac97IndexToSink(pThis, pStream->u8S trm);1222 PAUDMIXSINK pMixSink = ichac97IndexToSink(pThis, pStream->u8SD); 1223 1223 AssertPtr(pMixSink); 1224 1224 … … 1235 1235 uint8_t cTransfers = 0; 1236 1236 1237 Log2Func(("[SD%RU8] Started\n", pStream->u8S trm));1237 Log2Func(("[SD%RU8] Started\n", pStream->u8SD)); 1238 1238 1239 1239 while (!fDone) … … 1242 1242 uint32_t cbDMA = 0; 1243 1243 1244 if (pStream->u8S trm== AC97SOUNDSOURCE_PO_INDEX) /* Output. */1244 if (pStream->u8SD == AC97SOUNDSOURCE_PO_INDEX) /* Output. */ 1245 1245 { 1246 1246 STAM_PROFILE_START(&pThis->StatOut, a); … … 1261 1261 && RTCircBufFree(pCircBuf)) 1262 1262 { 1263 Log3Func(("[SD%RU8] cbLeft=%RU32\n", pStream->u8S trm, cbDMALeft));1263 Log3Func(("[SD%RU8] cbLeft=%RU32\n", pStream->u8SD, cbDMALeft)); 1264 1264 1265 1265 void *pvDst; … … 1294 1294 if (cbUsed) 1295 1295 { 1296 Log3Func(("[SD%RU8] cbUsed=%RU32\n", pStream->u8S trm, cbUsed));1296 Log3Func(("[SD%RU8] cbUsed=%RU32\n", pStream->u8SD, cbUsed)); 1297 1297 1298 1298 #ifdef VBOX_WITH_AUDIO_AC97_ASYNC_IO … … 1323 1323 STAM_PROFILE_STOP(&pThis->StatOut, a); 1324 1324 } 1325 else if ( pStream->u8S trm== AC97SOUNDSOURCE_PI_INDEX /* Input. */1326 || pStream->u8S trm== AC97SOUNDSOURCE_MC_INDEX) /* Input. */1325 else if ( pStream->u8SD == AC97SOUNDSOURCE_PI_INDEX /* Input. */ 1326 || pStream->u8SD == AC97SOUNDSOURCE_MC_INDEX) /* Input. */ 1327 1327 { 1328 1328 STAM_PROFILE_START(&pThis->StatIn, a); … … 1374 1374 } /* while !fDone */ 1375 1375 1376 Log2Func(("[SD%RU8] End\n", pStream->u8S trm));1376 Log2Func(("[SD%RU8] End\n", pStream->u8SD)); 1377 1377 1378 1378 ichac97StreamUnlock(pStream); … … 1582 1582 int rc = VINF_SUCCESS; 1583 1583 1584 LogFunc(("[SD%RU8]\n", pStream->u8S trm));1584 LogFunc(("[SD%RU8]\n", pStream->u8SD)); 1585 1585 1586 1586 PDMAUDIOSTREAMCFG streamCfg; … … 1589 1589 PAUDMIXSINK pMixSink = NULL; 1590 1590 1591 switch (pStream->u8S trm)1591 switch (pStream->u8SD) 1592 1592 { 1593 1593 case AC97SOUNDSOURCE_PI_INDEX: … … 1648 1648 } 1649 1649 1650 LogFlowFunc(("[SD%RU8] rc=%Rrc\n", pStream->u8S trm, rc));1650 LogFlowFunc(("[SD%RU8] rc=%Rrc\n", pStream->u8SD, rc)); 1651 1651 return rc; 1652 1652 } … … 1664 1664 RT_NOREF(pStream); 1665 1665 1666 LogFlowFunc(("[SD%RU8]\n", pStream->u8S trm));1666 LogFlowFunc(("[SD%RU8]\n", pStream->u8SD)); 1667 1667 1668 1668 return VINF_SUCCESS; … … 1679 1679 static int ichac97StreamReOpen(PAC97STATE pThis, PAC97STREAM pStream) 1680 1680 { 1681 LogFlowFunc(("[SD%RU8]\n", pStream->u8S trm));1681 LogFlowFunc(("[SD%RU8]\n", pStream->u8SD)); 1682 1682 1683 1683 int rc = ichac97StreamClose(pThis, pStream); … … 2103 2103 2104 2104 /* Do we need to kick the timer again? */ 2105 if ( AudioMixerSinkIsActive(ichac97IndexToSink(pThis, pThis->StreamLineIn.u8S trm))2106 || AudioMixerSinkIsActive(ichac97IndexToSink(pThis, pThis->StreamMicIn.u8S trm))2107 || AudioMixerSinkIsActive(ichac97IndexToSink(pThis, pThis->StreamOut.u8S trm)))2105 if ( AudioMixerSinkIsActive(ichac97IndexToSink(pThis, pThis->StreamLineIn.u8SD)) 2106 || AudioMixerSinkIsActive(ichac97IndexToSink(pThis, pThis->StreamMicIn.u8SD)) 2107 || AudioMixerSinkIsActive(ichac97IndexToSink(pThis, pThis->StreamOut.u8SD))) 2108 2108 { 2109 2109 fKickTimer = true; … … 2185 2185 if (pRegs->cr & AC97_CR_RPBM) /* Bus master operation starts. */ 2186 2186 { 2187 switch (pStream->u8S trm)2187 switch (pStream->u8SD) 2188 2188 { 2189 2189 case AC97SOUNDSOURCE_PO_INDEX: … … 2205 2205 if (pRegs->sr & AC97_SR_BCIS) 2206 2206 { 2207 Log3Func(("[SD%RU8] BCIS set\n", pStream->u8S trm));2207 Log3Func(("[SD%RU8] BCIS set\n", pStream->u8SD)); 2208 2208 2209 2209 if (pcbProcessed) … … 2219 2219 int rc = VINF_SUCCESS; 2220 2220 2221 Log3Func(("[SD%RU8] cbToProcess=%RU32, cbLeft=%RU32\n", pStream->u8S trm, cbToProcess, cbLeft));2221 Log3Func(("[SD%RU8] cbToProcess=%RU32, cbLeft=%RU32\n", pStream->u8SD, cbToProcess, cbLeft)); 2222 2222 2223 2223 while (cbLeft) … … 2253 2253 Assert(cbChunk); 2254 2254 2255 switch (pStream->u8S trm)2255 switch (pStream->u8SD) 2256 2256 { 2257 2257 case AC97SOUNDSOURCE_PO_INDEX: /* Output */ … … 2271 2271 2272 2272 default: 2273 AssertMsgFailed(("Stream #%RU8 not supported\n", pStream->u8S trm));2273 AssertMsgFailed(("Stream #%RU8 not supported\n", pStream->u8SD)); 2274 2274 rc = VERR_NOT_SUPPORTED; 2275 2275 break; … … 2282 2282 RTFILE fh; 2283 2283 RTFileOpen(&fh, 2284 pStream->u8S trm== AC97SOUNDSOURCE_PO_INDEX2284 pStream->u8SD == AC97SOUNDSOURCE_PO_INDEX 2285 2285 ? AC97_DEBUG_DUMP_PCM_DATA_PATH "ac97DMARead.pcm" : AC97_DEBUG_DUMP_PCM_DATA_PATH "ac97DMAWrite.pcm", 2286 2286 RTFILE_O_OPEN_CREATE | RTFILE_O_APPEND | RTFILE_O_WRITE | RTFILE_O_DENY_NONE); … … 2302 2302 2303 2303 LogFlowFunc(("[SD%RU8]: cbChunk=%RU32, cbLeft=%RU32, cbTotal=%RU32, rc=%Rrc\n", 2304 pStream->u8S trm, cbChunk, cbLeft, cbTotal, rc));2304 pStream->u8SD, cbChunk, cbLeft, cbTotal, rc)); 2305 2305 2306 2306 if (!pRegs->picb) … … 2552 2552 } 2553 2553 pRegs->lvi = u32 % 32; 2554 Log3Func(("[SD%RU8] LVI <- %#x\n", pStream->u8S trm, u32));2554 Log3Func(("[SD%RU8] LVI <- %#x\n", pStream->u8SD, u32)); 2555 2555 break; 2556 2556 } … … 2563 2563 case MC_CR: 2564 2564 { 2565 Log3Func(("[SD%RU8] CR <- %#x (cr %#x)\n", pStream->u8S trm, u32, pRegs->cr));2565 Log3Func(("[SD%RU8] CR <- %#x (cr %#x)\n", pStream->u8SD, u32, pRegs->cr)); 2566 2566 2567 2567 if (u32 & AC97_CR_RR) /* Busmaster reset. */ 2568 2568 { 2569 Log3Func(("[SD%RU8] Reset\n", pStream->u8S trm));2569 Log3Func(("[SD%RU8] Reset\n", pStream->u8SD)); 2570 2570 2571 2571 /* Make sure that Run/Pause Bus Master bit (RPBM) is cleared (0). */ … … 2583 2583 if (!(pRegs->cr & AC97_CR_RPBM)) 2584 2584 { 2585 Log3Func(("[SD%RU8] Disable\n", pStream->u8S trm));2585 Log3Func(("[SD%RU8] Disable\n", pStream->u8SD)); 2586 2586 2587 2587 ichac97StreamEnable(pThis, pStream, false /* fEnable */); … … 2591 2591 else 2592 2592 { 2593 Log3Func(("[SD%RU8] Enable\n", pStream->u8S trm));2593 Log3Func(("[SD%RU8] Enable\n", pStream->u8SD)); 2594 2594 2595 2595 pRegs->civ = pRegs->piv; … … 2616 2616 pRegs->sr |= u32 & ~(AC97_SR_RO_MASK | AC97_SR_WCLEAR_MASK); 2617 2617 ichac97StreamUpdateSR(pThis, pStream, pRegs->sr & ~(u32 & AC97_SR_WCLEAR_MASK)); 2618 Log3Func(("[SD%RU8] SR <- %#x (sr %#x)\n", pStream->u8S trm, u32, pRegs->sr));2618 Log3Func(("[SD%RU8] SR <- %#x (sr %#x)\n", pStream->u8SD, u32, pRegs->sr)); 2619 2619 break; 2620 2620 } … … 2637 2637 pRegs->sr |= u32 & ~(AC97_SR_RO_MASK | AC97_SR_WCLEAR_MASK); 2638 2638 ichac97StreamUpdateSR(pThis, pStream, pRegs->sr & ~(u32 & AC97_SR_WCLEAR_MASK)); 2639 Log3Func(("[SD%RU8] SR <- %#x (sr %#x)\n", pStream->u8S trm, u32, pRegs->sr));2639 Log3Func(("[SD%RU8] SR <- %#x (sr %#x)\n", pStream->u8SD, u32, pRegs->sr)); 2640 2640 break; 2641 2641 default:
Note:
See TracChangeset
for help on using the changeset viewer.