Open Bug 1796782 Opened 2 years ago Updated 2 years ago

Setting AudioBufferSourceNode's buffer detaches channelData Float32Array

Categories

(Core :: Web Audio, defect)

Firefox 105
x86_64
All
defect

Tracking

()

People

(Reporter: bartel.wilhelm, Unassigned)

References

(Depends on 1 open bug)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:105.0) Gecko/20100101 Firefox/105.0

Steps to reproduce:

see code and demo: https://github.com/RSWilli/audiobuffer-firefox-bug-repro

  1. extract channelData from an existing AudioBuffer x
  2. set the buffer of an AudioBufferSourceNode to x

Actual results:

after 2. the Float32Array from the channeldata becomes detached

a workaround is to copy the channeldata before setting the buffer of the SourceNode

Expected results:

don't detach the ArrayBuffer

does not seem to be a regression, I tested the following versions of Firefox via https://hub.docker.com/r/jlesage/firefox

Firefox 101
Firefox 94
Firefox 74

Component: Untriaged → Web Audio
OS: Unspecified → Linux
Product: Firefox → Core
Hardware: Unspecified → x86_64

Yes, the detach should occur only in one of these cases:

  1. When AudioBufferSourceNode.start is called, it acquires the contents of the node’s buffer. If the operation fails, nothing is played.
  2. When the buffer of an AudioBufferSourceNode is set and AudioBufferSourceNode.start has been previously called, the setter acquires the content of the AudioBuffer. If the operation fails, nothing is played.

This is the same issue as bug 1655336, but I'll keep this one open for now because the symptoms described are different.
Firefox's behavior has been this way since it was first implemented:
https://hg.mozilla.org/mozilla-central/rev/05cec405039374656a75bae5ff9019fd60510bee

Blocks: 864164
Severity: -- → S3
Status: UNCONFIRMED → NEW
Depends on: 1655336
Ever confirmed: true
OS: Linux → All
You need to log in before you can comment on or make changes to this bug.