StereoPanner does not handle a pan value of zero for mono signals

RESOLVED FIXED in Firefox 64

Status

()

defect
P2
normal
RESOLVED FIXED
7 months ago
5 months ago

People

(Reporter: chrisguttandin, Assigned: karlt)

Tracking

62 Branch
mozilla64
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox64 fixed)

Details

Attachments

(3 attachments)

Reporter

Description

7 months ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.67 Safari/537.36

Steps to reproduce:

const offlineAudioContext = new OfflineAudioContext(1, 1, 44100);
const constantSourceNode = new ConstantSourceNode(offlineAudioContext, { channelCount: 1, offset: 1 });
const stereoPanner = new StereoPannerNode(offlineAudioContext, { channelCount: 1 });

constantSourceNode.start();

constantSourceNode
    .connect(stereoPanner)
    .connect(offlineAudioContext.destination);

offlineAudioContext
    .startRendering()
    .then((buffer) => {
        const channelData = buffer.getChannelData(0);

        console.log(channelData[0]);
    });


Actual results:

The output of the snippet above is 1. The code sends a constant signal through a StereoPanner. In this case it is a mono signal that gets fed into the StereoPanner. After the rendering is done the first value of the rendered buffer gets printed to the console.


Expected results:

The output should be close to 0.707 as the algorithm for the StereoPanner requires the signal to be modified when the channelCount is 1 and the value of pan is 0.

https://webaudio.github.io/web-audio-api/#stereopanner-algorithm

Please let me know if I should provide more detailed information. Many thanks.
Paul can you please help me triage this?
Flags: needinfo?(padenot)
Whiteboard: [need info padenot 2018-10-18]
Assignee

Comment 2

7 months ago
Thank you for filing.  This is a discontinuity we don't want, and is reasonably easy to fix.
Assignee: nobody → karlt
Blocks: 1100349
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Flags: needinfo?(padenot)
Priority: -- → P2
Whiteboard: [need info padenot 2018-10-18]
Assignee

Comment 4

7 months ago
This is necessary for efficient processing of silence, and is consistent with
behavior of other nodes.

A null block current has a single channel of silence, which isn't aligned with
the current spec, but is consistent with the direction of
https://github.com/WebAudio/web-audio-api/issues/1471#issuecomment-405668690

Depends on D9210
Assignee

Comment 5

7 months ago
and re-use input buffer instead of copying.

Depends on D9211

Comment 8

7 months ago
Pushed by ktomlinson@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cc7ddb5861a8
correct expected result for monoPanningNoop tests r=padenot
https://hg.mozilla.org/integration/autoland/rev/17f777b16189
output null from StereoPannerNode when input is null r=padenot
https://hg.mozilla.org/integration/autoland/rev/01b1f806550b
correct mono-to-stereo panning at centre position r=padenot

Comment 9

7 months ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/cc7ddb5861a8
https://hg.mozilla.org/mozilla-central/rev/17f777b16189
https://hg.mozilla.org/mozilla-central/rev/01b1f806550b
Status: ASSIGNED → RESOLVED
Last Resolved: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Assignee

Updated

5 months ago
Flags: in-testsuite+
You need to log in before you can comment on or make changes to this bug.