Closed Bug 1783181 Opened 3 years ago Closed 3 years ago

Regression in StereoPannerNode on M1 Macs

Categories

(Core :: Web Audio, defect, P1)

Firefox 103
defect

Tracking

()

VERIFIED FIXED
105 Branch
Tracking Status
firefox105 --- verified

People

(Reporter: chrisguttandin, Assigned: padenot)

Details

Attachments

(2 files)

Steps to reproduce:

I ran the following script:

const length = 5;
const sampleRate = 44100;
const buffer = new AudioBuffer({ length, numberOfChannels: 2, sampleRate });

buffer.copyToChannel(new Float32Array([1, 0.5, 0, -0.5, -1]), 0);
buffer.copyToChannel(new Float32Array([-0.5, -0.25, 0, 0.25, 0.5]), 1);

const offlineAudioContext = new OfflineAudioContext({ length, sampleRate });
const audioBufferSourceNode = new AudioBufferSourceNode(offlineAudioContext, { buffer });
const stereoPannerNode = new StereoPannerNode(offlineAudioContext, { channelCount: 2 });

audioBufferSourceNode.connect(stereoPannerNode).connect(offlineAudioContext.destination);

stereoPannerNode.pan.setValueAtTime(0.5, 0);
stereoPannerNode.pan.setValueAtTime(0, 2 / offlineAudioContext.sampleRate);
stereoPannerNode.pan.linearRampToValueAtTime(1, 5 / offlineAudioContext.sampleRate);
stereoPannerNode.pan.cancelScheduledValues(3 / offlineAudioContext.sampleRate);

audioBufferSourceNode.start(0);

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

console.log(Array.from(channelData));

});

Actual results:

It logs [ 0.4571067690849304, 0.2285533845424652, 0, -0.125, -0.0732232928276062 ] when running it on an M1 Mac. The last number seems to be wrong.

Expected results:

It should log [ 0.4571067690849304, 0.2285533845424652, 0, -0.125, -0.25].

It does work on an older Intel Mac in Firefox v103. It also works in Chrome or Safari on any Apple processor architecture.

The Bugbug bot thinks this bug should belong to the 'Core::JavaScript Engine' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Component: JavaScript Engine → Web Audio
Attached file panner-m1.html

I can repro. The testcase in comment 0 is now attached.

Assignee: nobody → padenot
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by padenot@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1facaa986f25 Use correct scaling vector when panning the left channel values using NEON intrinsics. r=karlt
Severity: -- → S3
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
Flags: qe-verify+

Reproduced the issue with Firefox 103.0.2 (20220808125904) on macOS 11 mac M1 mini. After loading the test case the console displayed the following results: Array(5) [ 0.4571067690849304, 0.2285533845424652, 0, -0.125, -0.0732232928276062 ]
The issue is verified fixed with Firefox 105.0b8 on macOS11 mac M1 mini. The console displays the correct results as stated in comment 0: Array(5) [ 0.4571067690849304, 0.2285533845424652, 0, -0.125, -0.25 ]

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: