Closed Bug 1100351 Opened 10 years ago Closed 9 years ago

AudioContext usage works on other browsers but does bad things with audio on the whole system in firefox

Categories

(Core :: Web Audio, defect, P2)

36 Branch
x86_64
All
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: huj56745, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: perf)

User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:36.0) Gecko/20100101 Firefox/36.0
Build ID: 20141116030212

Steps to reproduce:

http://www.galaxy-forces.com/web_replay2.php?Level=mission_hard&Place=1


Actual results:

Stuttering sound that messes up audio even for other running apps on nthe same machine (or just some clicks on another computer)


Expected results:


Google Chrome OK
Opera OK
IE AudioContext not implemented (silent)

The entire Dart Project is on (easy to build and test):
https://sourceforge.net/p/galaxyv2/code/HEAD/tree/other/web_replay2/
The sound impl on:
https://sourceforge.net/p/galaxyv2/code/HEAD/tree/other/web_replay2/web/C_Sound.dart

(Dart is compiled into JavaScript run in the browser)
Severity: normal → major
Priority: -- → P4
Summary: AudioContext usage works on other browsers but does bad things with audio on the whole system → AudioContext usage works on other browsers but does bad things with audio on the whole system in firefox
OS: Windows 8.1 → Windows 7
Hardware: x86 → x86_64
The step to reproduce has changed to


http://www.galaxy-forces.com/web_replay2.php?Level=mission_hard&Name=RH

Try having another tab open that is playing audio, or "media player classic" playing something for example, then they are silenced while the above address is open in a firefox tab.
Priority: P4 → P3
Priority: P3 → P2
Have tracked the issue further and it seems that it is the panning node that causes this problem.

oPanner = _m_oAudioContext.createPanner();  //<- if oPanner is remove from the chain sound is ok.
Component: Video/Audio → Web Audio
Fixed it by doing this

>   oPanner.panningModel = "equalpower";
>   oPanner.distanceModel = "linear";
>   oPanner.maxDistance = 1.1;
>   oPanner.setPosition(dPan, 0.0, 1.0 - dPan.abs());

Maybe this is the way to do it, but in all other browsers it was working before with only

>   oPanner.setPosition(dPan, 0.0, 0.0);

But it seams wrong that the default panner settings produces clicking/crackling sounds as well as much silence between. Also any audio playing in other applications become silent.
This must be related to our FFT/convolution code being slow (since changing from "HTRF" to "equalpower") "fixes" it.

I've filed bug 1157768 to have a better FFT on x86, and bug 926838 is about changing the FFT on ARM.
(also, I forgot to mention that it's know that spending too much time in an audio callback on windows can, depending on the windows version and patch level, break system audio).
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: perf
OS: Windows 7 → All
Depends on: 1157768
Paul, Ronnie: Can we retest this (in Nightly) since so many perf issues including FFT updates have landed?  Thanks
Rank: 25
Flags: needinfo?(padenot)
Flags: needinfo?(huj56745)
Firefox 41.0.1
Firefox 44.0a1 (2015-10-11)

Tested and both versions behaves ok! So this issue can probably be closed now.
Flags: needinfo?(huj56745)
Thanks Ronnie, closing this now. Feel free to open a new issue if you find other weirdness with Web Audio or anything else !
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: needinfo?(padenot)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.