Changeset 89737 in vbox
- Timestamp:
- Jun 16, 2021 8:40:21 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r89736 r89737 2158 2158 2159 2159 LogFlowFunc(("Stream %u: uTimerHz: %u -> %u; cMsSchedulingHint: %u -> %u; cbCircBuf: %#zx -> %#x (%u ms, cMsDmaMinBuf=%u)%s\n", 2160 pStreamCC->State.uTimerHz, uTimerHz, Cfg.Device.cMsSchedulingHint, cMsSchedulingHint,2160 pStreamCC->State.uTimerHz, uTimerHz, pStreamCC->State.Cfg.Device.cMsSchedulingHint, cMsSchedulingHint, 2161 2161 pStreamCC->State.pCircBuf ? RTCircBufSize(pStreamCC->State.pCircBuf) : 0, cbCircBuf, cMsCircBuf, cMsDmaMinBuf, 2162 2162 !pStreamCC->State.pCircBuf || RTCircBufSize(pStreamCC->State.pCircBuf) != cbCircBuf ? " - re-creating DMA buffer" : "")); 2163 2163 2164 2164 /* 2165 * Set the stream's timer rate and scheduling hint. 2165 * Update the stream's timer rate and scheduling hint, re-registering the AIO 2166 * update job if necessary. 2166 2167 */ 2168 if ( pStreamCC->State.Cfg.Device.cMsSchedulingHint != cMsSchedulingHint 2169 || !pStreamCC->State.fRegisteredAsyncUpdateJob) 2170 { 2171 if (pStreamCC->State.fRegisteredAsyncUpdateJob) 2172 AudioMixerSinkRemoveUpdateJob(pMixSink, ichac97R3StreamUpdateAsyncIoJob, pStreamCC); 2173 int rc2 = AudioMixerSinkAddUpdateJob(pMixSink, ichac97R3StreamUpdateAsyncIoJob, pStreamCC, 2174 pStreamCC->State.Cfg.Device.cMsSchedulingHint); 2175 AssertRC(rc2); 2176 pStreamCC->State.fRegisteredAsyncUpdateJob = RT_SUCCESS(rc2) || rc2 == VERR_ALREADY_EXISTS; 2177 } 2178 2167 2179 pStreamCC->State.uTimerHz = uTimerHz; 2168 2180 Cfg.Device.cMsSchedulingHint = cMsSchedulingHint; … … 2281 2293 2282 2294 int rc = VINF_SUCCESS; 2295 /* 2296 * Enable. 2297 */ 2283 2298 if (fEnable) 2284 2299 { … … 2288 2303 /* (Re-)Open the stream if necessary. */ 2289 2304 rc = ichac97R3StreamSetUp(pDevIns, pThis, pThisCC, pStream, pStreamCC, false /* fForce */); 2290 2291 /* Re-register the update job with the AIO thread with correct sched hint. 2292 Note! We do not unregister it on disable because of draining. */ 2293 if (pStreamCC->State.fRegisteredAsyncUpdateJob) 2294 AudioMixerSinkRemoveUpdateJob(pSink, ichac97R3StreamUpdateAsyncIoJob, pStreamCC); 2295 int rc2 = AudioMixerSinkAddUpdateJob(pSink, ichac97R3StreamUpdateAsyncIoJob, pStreamCC, 2296 pStreamCC->State.Cfg.Device.cMsSchedulingHint); 2297 AssertRC(rc2); 2298 pStreamCC->State.fRegisteredAsyncUpdateJob = RT_SUCCESS(rc2) || rc2 == VERR_ALREADY_EXISTS; 2299 2300 /* Open debug files: */ 2301 if (RT_LIKELY(!pStreamCC->Dbg.Runtime.fEnabled)) 2302 { /* likely */ } 2303 else 2305 if (RT_SUCCESS(rc)) 2304 2306 { 2305 if (!AudioHlpFileIsOpen(pStreamCC->Dbg.Runtime.pFileStream)) 2307 /* 2308 * Open debug files. 2309 */ 2310 if (RT_LIKELY(!pStreamCC->Dbg.Runtime.fEnabled)) 2311 { /* likely */ } 2312 else 2306 2313 { 2307 rc2 = AudioHlpFileOpen(pStreamCC->Dbg.Runtime.pFileStream, AUDIOHLPFILE_DEFAULT_OPEN_FLAGS, 2308 &pStreamCC->State.Cfg.Props); 2309 AssertRC(rc2); 2314 if (!AudioHlpFileIsOpen(pStreamCC->Dbg.Runtime.pFileStream)) 2315 AudioHlpFileOpen(pStreamCC->Dbg.Runtime.pFileStream, AUDIOHLPFILE_DEFAULT_OPEN_FLAGS, 2316 &pStreamCC->State.Cfg.Props); 2317 if (!AudioHlpFileIsOpen(pStreamCC->Dbg.Runtime.pFileDMA)) 2318 AudioHlpFileOpen(pStreamCC->Dbg.Runtime.pFileDMA, AUDIOHLPFILE_DEFAULT_OPEN_FLAGS, 2319 &pStreamCC->State.Cfg.Props); 2310 2320 } 2311 2321 2312 if (!AudioHlpFileIsOpen(pStreamCC->Dbg.Runtime.pFileDMA)) 2313 { 2314 rc2 = AudioHlpFileOpen(pStreamCC->Dbg.Runtime.pFileDMA, AUDIOHLPFILE_DEFAULT_OPEN_FLAGS, 2315 &pStreamCC->State.Cfg.Props); 2316 AssertRC(rc2); 2317 } 2322 /* 2323 * Do the actual enabling. 2324 */ 2325 rc = AudioMixerSinkStart(pSink); 2318 2326 } 2319 2320 if (RT_SUCCESS(rc))2321 rc = AudioMixerSinkStart(pSink);2322 }2327 } 2328 /* 2329 * Disable 2330 */ 2323 2331 else 2324 2332 {
Note:
See TracChangeset
for help on using the changeset viewer.