Bug 196643 - Audio stream dropping frames
Summary: Audio stream dropping frames
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Safari 12
Hardware: All macOS 10.14
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-05 04:07 PDT by Alex Wilde
Modified: 2019-07-23 02:59 PDT (History)
5 users (show)

See Also:


Attachments
Recording test on top of a backing track (201.58 KB, audio/mp3)
2019-04-05 04:07 PDT, Alex Wilde
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Wilde 2019-04-05 04:07:14 PDT
Created attachment 366806 [details]
Recording test on top of a backing track

How to reproduce the issue:
1. Open https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API/Constraints#Result with Safari 12.2.
2. Put on headphones and click on the "Start" button
3. Speak/sing a constant tone into the microphone

You'll hear that the resulting audio on the monitor is constantly dropping frames. This issue doesn't occur in Chrome or Firefox though.

Further observations:
- the same issue occurs when playing back another audio source in the background
- however, when setting the background audio source's volume to 1%, the getUserMedia audio stream seems to be (almost) fine
- also, the issue does not occur when concurrently playing back a track of silence

This makes e.g. recording audio while playing back a backing track impossible (despite using headphones).

In order to exclude any external factors, I've tested this with different mics, different computers, checked the mic's sample rate, bit rate etc. in "Audio Midi Setup" but to no avail.

I've also tested preloading the audio, as well as tested with a WebAudio API white-noise generator in order to exclude memory or buffering issues – no difference. The audio stream is constantly dropping frames while the other audio source was audible.

I've got a hunch that echo cancellation might be the culprit here. Even if turned off, like in the example above, it just seems to keep filtering the audio stream while another audio source was active.
Comment 1 Radar WebKit Bug Importer 2019-04-07 17:02:03 PDT
<rdar://problem/49682289>
Comment 2 youenn fablet 2019-07-18 17:27:59 PDT
Hi Alex,

I tried with a recent Safari Tech Preview on MacOS Jazz and it works fine.
If you have a chance to test it here, please let me know the result of your testing.
Comment 3 Alex Wilde 2019-07-23 02:59:36 PDT
Hi Youenn,

Thanks a bunch for taking the time to look into this.

I've tested again with the lastest Safari Tech Preview 13.0 Release 87 on a MacOS Mojave 10.14.5, MacBook Pro Mid-2014 and I'm still encountering the same issue. Same on a newish iPad (2018), iPhone 6 as well as iPhone 8.

However, on one of my co-workers MacBook Pro from 2017, the Mozilla demo worked fine!

So apparently, less powerful devices are causing this issue. Can you confirm this on your side?