Closed Bug 1103824 Opened 6 years ago Closed 8 months ago
Investigate first initialization of IAudio
Client used in libcubeb
While looking at bug 1096717, I noticed that the IAudioClient docs have the following warning: Note: In Windows 8, the first use of IAudioClient to access the audio device should be on the STA thread. Calls from an MTA thread may result in undefined behavior. It doesn't look like we do anything special to ensure this happens in libcubeb, so we'll need to address this at some stage to avoid surprises.
Initialize (and discard, to avoid keeping resources alive via sCubebContext that may never be used) a cubeb context on the main thread. Change cubeb's auto_com to treat RPC_E_CHANGED_MODE as an error, since that's really telling us that we're asking for (and not getting) MTA on a thread that has already been initialized as STA. Check that we get an STA initialization in cubeb_init the first time it's called, and use that opportunity to completely initialize (and then discard) an IAudioClient.
Assignee: nobody → kinetik
Status: NEW → ASSIGNED
Attachment #8605670 - Flags: review?(padenot)
Try push looks okay: https://treeherder.mozilla.org/#/jobs?repo=try&revision=52e645df36d1
Attachment #8605670 - Flags: review?(padenot) → review+
I looked at the OpenSL failures but not sure what the cause is yet. I'll reland this with the CubebUtils.cpp changes wrapped in an XP_WIN ifdef (this issue only matters on Windows) and file a followup to address the OpenSL issues.
sorry had to back this out since this seems to have caused somehow https://treeherder.mozilla.org/logviewer.html#?job_id=9992633&repo=mozilla-inbound
Will repush once I've found the cause.
Rather than init and destroy a context in CubebUtils::InitLibrary(), I explicitly make the first CubebUtils::GetCubebContext() from the main thread for the users of libcubeb. This looks good on try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=47a6687a973f
5 years ago
Depends on: 1176499
I backed this out due to the regression reported in bug 1176499, along with the fact that this fix was speculative.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
backed out also from m-c in https://hg.mozilla.org/mozilla-central/rev/b10c59539ec8
5 years ago
Component: Audio/Video: MediaStreamGraph → Audio/Video: cubeb
Mass change P2->P3 to align with new Mozilla triage process.
Priority: P2 → P3
Status: REOPENED → RESOLVED
Closed: 5 years ago → 8 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.