Bug 215868 - Add support for sub-sample accurate start for AudioBufferSourceNode
Summary: Add support for sub-sample accurate start for AudioBufferSourceNode
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://chromium-review.googlesource....
Keywords: InRadar
Depends on:
Blocks: 212611
  Show dependency treegraph
 
Reported: 2020-08-26 14:53 PDT by Chris Dumez
Modified: 2020-08-27 08:54 PDT (History)
10 users (show)

See Also:


Attachments
Patch (975.06 KB, patch)
2020-08-26 15:22 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (994.33 KB, patch)
2020-08-26 16:12 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (994.34 KB, patch)
2020-08-26 16:30 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2020-08-26 14:53:31 PDT
Add support for sub-sample accurate start for AudioBufferSourceNode.
Comment 1 Chris Dumez 2020-08-26 15:22:44 PDT
Created attachment 407344 [details]
Patch
Comment 2 Chris Dumez 2020-08-26 16:12:27 PDT
Created attachment 407350 [details]
Patch
Comment 3 Chris Dumez 2020-08-26 16:30:21 PDT
Created attachment 407354 [details]
Patch
Comment 4 Darin Adler 2020-08-26 18:29:44 PDT
Comment on attachment 407354 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=407354&action=review

Crash looks like it is related?

ASSERTION FAILED: m_finishedNodes.isEmpty()
./Modules/webaudio/BaseAudioContext.cpp(188) : virtual WebCore::BaseAudioContext::~BaseAudioContext()

> Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp:82
> +    size_t endFrame =  0;

Stray space after the "=" here.

> Source/WebCore/platform/audio/AudioUtilities.cpp:85
> +    double frame = round(time * sampleRate * oversampleFactor) / oversampleFactor;
> +
> +    switch (rounding) {
> +    case SampleFrameRounding::Nearest:
> +        frame = round(frame);
> +        break;
> +    case SampleFrameRounding::Down:
> +        frame = floor(frame);
> +        break;
> +    case SampleFrameRounding::Up:
> +        frame = ceil(frame);
> +        break;
> +    }

std::round/floor/ceil? Should not matter here since it’s all double.
Comment 5 EWS 2020-08-26 21:28:35 PDT
Committed r266221: <https://trac.webkit.org/changeset/266221>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 407354 [details].
Comment 6 Radar WebKit Bug Importer 2020-08-26 21:29:20 PDT
<rdar://problem/67849532>
Comment 7 Chris Dumez 2020-08-27 08:54:55 PDT
(In reply to Darin Adler from comment #4)
> Comment on attachment 407354 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=407354&action=review
> 
> Crash looks like it is related?
> 
> ASSERTION FAILED: m_finishedNodes.isEmpty()
> ./Modules/webaudio/BaseAudioContext.cpp(188) : virtual
> WebCore::BaseAudioContext::~BaseAudioContext()
> 
> > Source/WebCore/Modules/webaudio/AudioScheduledSourceNode.cpp:82
> > +    size_t endFrame =  0;
> 
> Stray space after the "=" here.
> 
> > Source/WebCore/platform/audio/AudioUtilities.cpp:85
> > +    double frame = round(time * sampleRate * oversampleFactor) / oversampleFactor;
> > +
> > +    switch (rounding) {
> > +    case SampleFrameRounding::Nearest:
> > +        frame = round(frame);
> > +        break;
> > +    case SampleFrameRounding::Down:
> > +        frame = floor(frame);
> > +        break;
> > +    case SampleFrameRounding::Up:
> > +        frame = ceil(frame);
> > +        break;
> > +    }
> 
> std::round/floor/ceil? Should not matter here since it’s all double.

Sorry, I missed those comments before landing. I applied those fixes in <https://trac.webkit.org/changeset/266234>.