Closed Bug 1384805 Opened 7 years ago Closed 7 years ago

Content process hang while waiting for MediaStreamGraph messages executed

Categories

(Core :: Audio/Video: MediaStreamGraph, enhancement, P2)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1392930

People

(Reporter: mchiang, Assigned: padenot)

References

Details

Steps:

1) Choose a PC or laptop without any built-in audio input device (microphone). In my case, I use a PC running Windows 7.
2) Plug in a USB mic or USB webcam with mic
3) Connect to https://webrtc.github.io/samples/src/content/getusermedia/audio/ and run gUM
4) Remove the USB mic during gUM streaming
5) Close Firefox

MediaStreamGraph is driven by AudioCallbackDriver / cubeb (when audio track exists). When the external microphone is removed and there is no other input device, cubeb won't drive MediaStreamGraph anymore. The upcoming messages appended to MSG won't be executed.

This can lead to different kind of problems depending on the upcoming operation.
For example, if the user tries to close Firefox, all messages appended in the below functions will not be executed.

MediaStream::RemoveVideoOutput
MediaStream::RemoveListener
MediaStreamGraphImpl::CloseAudioInput
MediaStream::RemoveTrackListener
MediaInputPort::Destroy()
MediaStream::Destroy()

Content process will hang on NS_ProcessNextEvent(nsIThread* aThread, bool aMayWait)
Rank: 20
Component: WebRTC: Audio/Video → Audio/Video: MediaStreamGraph
Priority: -- → P2
Assignee: nobody → padenot
Munro, would you be able to try this when bug 1392930 lands? It should be fixed.
Depends on: 1392930
Flags: needinfo?(mchiang)
Hi Paul,

It seems that this patch addresses the issue of audio output device switch.
Is it also helpful for input device case? (no further callback from AudioCallbackDriver / cubeb if the last input device is disconnected.)

Anyway, I will give it a try.
Flags: needinfo?(mchiang) → needinfo?(padenot)
Yes, this works for input and output.
Flags: needinfo?(padenot)
It works! Fantastic!
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.