Closed
Bug 1214239
Opened 9 years ago
Closed 9 years ago
[Web Audio] StereoPannerNode ignores input gain when pan is 0
Categories
(Core :: Web Audio, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: jyk2048, Assigned: dminor)
References
Details
Attachments
(1 file, 1 obsolete file)
4.04 KB,
patch
|
padenot
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36 Steps to reproduce: The problem can be observed using the following JSFiddle: https://jsfiddle.net/s_c_g/1arrbfcw/ For reference, here's the JSFiddle source: var context = new (window.AudioContext || window.webkitAudioContext)(); var source = context.createOscillator(); var gain = context.createGain(); var pan = context.createStereoPanner(); source.connect(gain); gain.connect(pan); pan.connect(context.destination); gain.gain.value = 0.01; //pan.pan.value = 0.01; source.start(0); I've tested this using 41.0.1 and 42.0b5, including with a new profile. Steps to reproduce are to open Firefox, paste the JSFiddle URL into the URL bar, and press enter. Actual results: The tone (generated by an oscillator node) plays at full volume. Expected results: As there is a gain node with gain set to 0.01, the tone should be quiet rather than loud. If the commented-out line is uncommented, the tone is quiet as expected. As such, it appears the incorrect behavior only occurs when pan is 0. Looking at the source code for StereoPannerNode, it looks like aInput.mVolume isn't factored in in the special-case path for pan = 0, which seems like it could be the cause of the issue.
Updated•9 years ago
|
Component: Untriaged → Web Audio
Product: Firefox → Core
Updated•9 years ago
|
Status: UNCONFIRMED → NEW
Rank: 25
Ever confirmed: true
Priority: -- → P2
Assignee | ||
Comment 1•9 years ago
|
||
Updated•9 years ago
|
Attachment #8676910 -
Attachment is patch: true
Comment 2•9 years ago
|
||
Comment on attachment 8676910 [details] [diff] [review] Apply gain when pan == 0.0f Review of attachment 8676910 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/media/webaudio/StereoPannerNode.cpp @@ -102,5 @@ > - AllocateAudioBlock(2, aOutput); > - const float* input = static_cast<const float*>(aInput.mChannelData[0]); > - for (uint32_t channel = 0; channel < 2; channel++) { > - float* output = aOutput->ChannelFloatsForWrite(channel); > - PodCopy(output, input, WEBAUDIO_BLOCK_SIZE); Can we not just use AudioBlockCopyChannelWithScale here ?
Attachment #8676910 -
Flags: review?(padenot)
Assignee | ||
Comment 3•9 years ago
|
||
I've restored the UpmixToStereoIfNeeded method which is what I think you were asking for here.
Attachment #8676910 -
Attachment is obsolete: true
Attachment #8678290 -
Flags: review?(padenot)
Updated•9 years ago
|
Attachment #8678290 -
Flags: review?(padenot) → review+
Assignee | ||
Comment 4•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=735cabd0f9bc
Assignee | ||
Comment 5•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/e5e91219c8a170204f7c1351939f449b7917479e Bug 1214239 - [Web Audio] StereoPannerNode ignores input gain when pan is 0 r=padenot
Comment 6•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/e5e91219c8a1
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in
before you can comment on or make changes to this bug.
Description
•