RESOLVED FIXED 217921
[Media in GPU Process] Some WebAudio layout tests generate strange noises
https://bugs.webkit.org/show_bug.cgi?id=217921
Summary [Media in GPU Process] Some WebAudio layout tests generate strange noises
Peng Liu
Reported 2020-10-19 14:58:18 PDT
When running some WebAudio layout tests, we can hear strange noises, which does not happen before r268632. I can reproduce the issue by keep reloading https://webaudioapi.com/samples/oscillator/ The issue only happens on Mac.
Attachments
Patch (10.05 KB, patch)
2020-10-20 10:01 PDT, Peng Liu
eric.carlson: review+
Patch for landing (8.60 KB, patch)
2020-10-20 12:35 PDT, Peng Liu
no flags
Radar WebKit Bug Importer
Comment 1 2020-10-19 14:58:53 PDT
Peng Liu
Comment 2 2020-10-20 10:01:32 PDT
Eric Carlson
Comment 3 2020-10-20 10:10:27 PDT
Comment on attachment 411879 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411879&action=review > Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:120 > + if (m_isPlaying == isPlaying) > + return; Is this necessary? > Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:161 > + uint64_t start = 0; > + uint64_t end = 0; > + m_ringBuffer->getCurrentFrameBounds(start, end); getCurrentFrameBounds always updates start and end, so I don't think they need to be initialized.
Chris Dumez
Comment 4 2020-10-20 10:10:55 PDT
Comment on attachment 411879 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411879&action=review > Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:119 > + if (m_isPlaying == isPlaying) This check does not seem worth it for a simple boolean assignment.
Peng Liu
Comment 5 2020-10-20 10:20:54 PDT
Comment on attachment 411879 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411879&action=review >> Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:119 >> + if (m_isPlaying == isPlaying) > > This check does not seem worth it for a simple boolean assignment. Agree, will fix it. Thanks! >> Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:120 >> + return; > > Is this necessary? No, it is not. :-) >> Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:161 >> + m_ringBuffer->getCurrentFrameBounds(start, end); > > getCurrentFrameBounds always updates start and end, so I don't think they need to be initialized. Agree, will fix it.
Peng Liu
Comment 6 2020-10-20 12:26:42 PDT
Comment on attachment 411879 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=411879&action=review > Source/WebKit/GPUProcess/media/RemoteAudioDestinationManager.cpp:192 > + Lock m_isPlayingLock; Jer pointed out that the lock seems not necessary and it may block the main thread. So we discussed with Chris to confirm that. I will remove this lock.
Peng Liu
Comment 7 2020-10-20 12:35:12 PDT
Created attachment 411899 [details] Patch for landing
EWS
Comment 8 2020-10-20 13:42:12 PDT
Committed r268758: <https://trac.webkit.org/changeset/268758> All reviewed patches have been landed. Closing bug and clearing flags on attachment 411899 [details].
Note You need to log in before you can comment on or make changes to this bug.