Closed Bug 1060311 Opened 8 years ago Closed 8 years ago

No sound in Unity/Unreal games

Categories

(Core :: Audio/Video, defect)

x86_64
Windows 7
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla34
Tracking Status
firefox34 --- verified

People

(Reporter: pauly, Assigned: padenot)

References

(Blocks 1 open bug)

Details

(Keywords: regression)

Attachments

(2 files)

There is no sound when playing the following games:
http://files.unity3d.com/jonas/DT2/
https://www.unrealengine.com/html5/
There might be other games that reproduce the problem.

This a recent regression:
Last good revision: dd2018a5f894 (2014-08-27)
First bad revision: 3be45b58fc47 (2014-08-28)
Pushlog:
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=dd2018a5f894&tochange=3be45b58fc47

Last good revision: fff4d503ad88
First bad revision: a71337656d0c
Pushlog:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=fff4d503ad88&tochange=a71337656d0c

Not repro on 33.0a2 (2014-08-28).
Repro on Win and Mac, but not on Linux.
Flags: needinfo?(paul)
I'm on it.

I can repro, and I found that if you reload the page, it works.
Flags: needinfo?(paul)
This makes the driver switching logic more robust against other bugs.
Attachment #8481271 - Flags: review?(rjesup)
Assignee: nobody → paul
This prevent a bug where the graph would be using a SystemClockDriver even if it
was rendering Web Audio API content.

It went like this:
- An AudioContext was created.
- Some AudioNodeStream (Web Audio API MediaStreams) were created, but their
MediaStreamTrack was not added yet
- During the stream ordering, we would see that we were running an
AudioCallbackDriver (because the MSG was created using an AudioContext, and we
pass in hints regarding the type of MediaStreams that will be added in the
future, to open the audio stream as early as we can, because it can take some
time, the MSG was created directly using an AudioCallbackDriver)
- Also during the stream ordering, we see that none of our MediaStream have an
MediaStreamTrack with an audio track. This triggers a switch to a
SystemClockDriver, because the graph thinks there is no audio.
- During CreateAndDestroyAudioNode, we would not switch to an
AudioCallbackDriver on the first iteration (right after the UpdateStreamOrder
call), because we would be switching, and not during the iterations after,
because we thought we already switched (the first patch makes this more robust).

This basically forces an AudioCallbackDriver if there is an AudioNodeStream,
which prevents unnecessary GraphDriver switches (and save threads creation
destruction, audio stream create and destruction, and all other resources
associated with a GraphDriver).
Attachment #8481274 - Flags: review?(rjesup)
Attachment #8481274 - Flags: review?(rjesup) → review+
Attachment #8481271 - Flags: review?(rjesup) → review+
Relanded part one, it's enough to fix this.

https://hg.mozilla.org/integration/mozilla-inbound/rev/8fbff7a08820
https://hg.mozilla.org/mozilla-central/rev/8fbff7a08820
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Verified fixed 34.0a1 (2014-09-02), Win 7 x64, OS X 10.8.5
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.