Closed Bug 1182678 Opened 10 years ago Closed 9 years ago

cubeb initialization on the main thread can take a long time on the main thread

Categories

(Core :: Audio/Video: MediaStreamGraph, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: ehsan.akhgari, Unassigned)

References

Details

This can apparently take up to 8 minutes! anonymous namespace'::SafeRelease<IAudioClient>(IAudioClient *) (in xul.pdb) wasapi_init (in xul.pdb) cubeb_init (in xul.pdb) mozilla::CubebUtils::GetCubebContextUnlocked() (in xul.pdb) mozilla::CubebUtils::GetCubebContext() (in xul.pdb) mozilla::MediaDecoder::Init(mozilla::MediaDecoderOwner *) (in xul.pdb) mozilla::dom::HTMLMediaElement::InitializeDecoderForChannel(nsIChannel *,nsIStreamListener * *) (in xul.pdb) mozilla::dom::HTMLMediaElement::MediaLoadListener::OnStartRequest(nsIRequest *,nsISupports *) (in xul.pdb) nsJARChannel::OnStartRequest(nsIRequest *,nsISupports *) (in xul.pdb) nsInputStreamPump::OnStateStart() (in xul.pdb) nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream *) (in xul.pdb) nsInputStreamReadyEvent::Run() (in xul.pdb) nsThread::ProcessNextEvent(bool,bool *) (in xul.pdb) NS_ProcessNextEvent(nsIThread *,bool) (in xul.pdb) nsThread::Shutdown() (in xul.pdb) This information is coming from http://telemetry.mozilla.org/chromehangs/.
Well we should not init cubeb on the main thread, this is the real bug. Also, this is probably showing a stream that is failing to open, for whatever reason (SafeRelease at the bottom of the stack). Matthew, do you know why we would try to open a cubeb stream on the main thread here, apparently for media playback ? Something fishy is going on.
Flags: needinfo?(kinetik)
Also, we have normal telemetry for the time it takes to open the first stream (setting up IPC and everything else between firefox and the audio server), and the subsequent stream. I was aware of streams that take 8 seconds on OSX, but not 8 minutes on windows, heh.
Bug 1103824 was initializing cubeb on the main thread to meet the requirement of initializing the first IAudioClient in an STA thread, but the patch has been backed out because of exactly these initialization hangs.
Flags: needinfo?(kinetik)
Blocks: 1103824
Component: Audio/Video → Audio/Video: MSG/cubeb/GMP
This was fixed by bug 1103824 being reverted.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.