Changeset 89739 in vbox
- Timestamp:
- Jun 16, 2021 11:05:22 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r89737 r89739 382 382 * commits to proving actual audio input bytes. */ 383 383 bool fInputPreBuffered; 384 /** This is ZERO if stream setup succeeded, otherwise it's the RTTimeNanoTS() at 385 * which to retry setting it up. The latter applies only to same 386 * parameters. */ 387 uint64_t nsRetrySetup; 384 388 /** (Virtual) clock ticks per transfer. */ 385 389 uint64_t cTransferTicks; … … 1063 1067 1064 1068 PRTCIRCBUF pCircBuf = pStreamCC->State.pCircBuf; 1065 Assert Ptr(pCircBuf);1069 AssertReturnStmt(pCircBuf, ichac97R3StreamUnlock(pStreamCC), VINF_SUCCESS); 1066 1070 1067 1071 int rc = VINF_SUCCESS; … … 1865 1869 if (RT_SUCCESS(rc)) 1866 1870 { 1867 1868 1871 PAC97DRIVER pDrv; 1869 1872 RTListForEach(&pThisCC->lstDrv, pDrv, AC97DRIVER, Node) … … 2205 2208 int rc = VINF_SUCCESS; 2206 2209 if ( fForce 2207 || !PDMAudioStrmCfgMatchesProps(&Cfg, &pStreamCC->State.Cfg.Props)) 2210 || !PDMAudioStrmCfgMatchesProps(&Cfg, &pStreamCC->State.Cfg.Props) 2211 || (pStreamCC->State.nsRetrySetup && RTTimeNanoTS() >= pStreamCC->State.nsRetrySetup)) 2208 2212 { 2209 2213 LogRel2(("AC97: Setting up stream #%u: %s\n", pStreamCC->u8SD, PDMAudioStrmCfgToString(&Cfg, szTmp, sizeof(szTmp)) )); 2210 2214 2211 2215 ichac97R3MixerRemoveDrvStreams(pDevIns, pThisCC, pMixSink, Cfg.enmDir, Cfg.enmPath); 2216 2212 2217 rc = ichac97R3MixerAddDrvStreams(pDevIns, pThisCC, pMixSink, &Cfg); 2213 2218 if (RT_SUCCESS(rc)) 2214 2219 { 2215 2220 PDMAudioStrmCfgCopy(&pStreamCC->State.Cfg, &Cfg); 2221 pStreamCC->State.nsRetrySetup = 0; 2216 2222 LogFlowFunc(("[SD%RU8] success (uHz=%u)\n", pStreamCC->u8SD, rc, PDMAudioPropsHz(&Cfg.Props))); 2217 2223 } … … 2220 2226 LogFunc(("[SD%RU8] ichac97R3MixerAddDrvStreams failed: %Rrc (uHz=%u)\n", 2221 2227 pStreamCC->u8SD, rc, PDMAudioPropsHz(&Cfg.Props))); 2222 /** @todo r=bird: we should remember this somehow and prevent things from 2223 * working and ensure that we redo setup the next time the guest 2224 * tries to play/record something with this stream... */ 2228 pStreamCC->State.nsRetrySetup = RTTimeNanoTS() + 5*RT_NS_1SEC; /* retry in 5 seconds, unless config changes. */ 2225 2229 } 2226 2230 } … … 2301 2305 pStreamCC->State.fInputPreBuffered = false; 2302 2306 2303 /* (Re-)Open the stream if necessary. */2307 /* Set up (update) the AC'97 stream as needed. */ 2304 2308 rc = ichac97R3StreamSetUp(pDevIns, pThis, pThisCC, pStream, pStreamCC, false /* fForce */); 2305 2309 if (RT_SUCCESS(rc)) 2306 2310 { 2307 /* 2308 * Open debug files. 2309 */ 2311 /* Open debug files. */ 2310 2312 if (RT_LIKELY(!pStreamCC->Dbg.Runtime.fEnabled)) 2311 2313 { /* likely */ } … … 2320 2322 } 2321 2323 2322 /* 2323 * Do the actual enabling. 2324 */ 2324 /* Do the actual enabling (won't fail as long as pSink is valid). */ 2325 2325 rc = AudioMixerSinkStart(pSink); 2326 2326 } … … 2678 2678 PAC97BMREGS pRegs = &pStream->Regs; 2679 2679 2680 /** @todo r=bird: this locking is overkill, we don't need the timer lock 2681 * unless we're going to call ichac97R3TimerSet. */ 2680 2682 DEVAC97_LOCK_BOTH_RETURN(pDevIns, pThis, pStream, VINF_IOM_R3_IOPORT_WRITE); 2681 2683 switch (cb)
Note:
See TracChangeset
for help on using the changeset viewer.