Skip to content
This repository has been archived by the owner on Oct 14, 2022. It is now read-only.

Stuttering audio in iOS14.2 only NG version #108

Open
yokurin opened this issue Nov 17, 2020 · 5 comments
Open

Stuttering audio in iOS14.2 only NG version #108

yokurin opened this issue Nov 17, 2020 · 5 comments

Comments

@yokurin
Copy link

yokurin commented Nov 17, 2020

Describe the bug

I only use voice call.
I created 1to1 voice call system in web page with the sdk agora-rtc-sdk-ng (v4.1.1). This based on a code in a tutorial page of it.

If the caller or callee is iOS 14.2, the audio is interrupted and cannot be heard well.
In order to isolate the problem, I tested it with 3.x and 4.x in iOS14.2
This audio bug occurred only in 4.x.

I used a simple demo.
3.x demo:https://webdemo.agora.io/agora-web-showcase/examples/Agora-Web-Tutorial-1to1-Web/
4.x demo:https://agoraio-community.github.io/AgoraWebSDK-NG/demo/basicVideoCall/index.html

SDK Logs

Platform and Browser: iOS14.2 Safari

SDK Version: 4.1.1

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://agoraio-community.github.io/AgoraWebSDK-NG/demo/basicVideoCall/index.html in iOS14.2.
  2. Call
@HAHAHA44
Copy link
Collaborator

It maybe a bug of WebAudio and WebRTC API using together in the latest iOS Safari. We are trying to find out the reason.

@porterde
Copy link

I have what I think is the same issue but I had a very simple way to demonstrate it.

<!DOCTYPE html>
<html lang="en">
<body>
  <audio id="audio-test">
    <source src="https://www.learningcontainer.com/wp-content/uploads/2020/02/Kalimba.mp3" />
  </audio>
  <button onclick="navigator.mediaDevices.getUserMedia({ audio: true });">Capture microphone</button>
  <button onclick="document.getElementById('audio-test').play();">Play sound</button>
  <button onClick="import('https://download.agora.io/sdk/web/AgoraRTC_N.js')">Load Agora NG SDK</button>
  <button onClick="import('https://cdn.agora.io/sdk/release/AgoraRTCSDK-3.2.3.js')">Load Agora 3 SDK</button>
</body>
</html>

1, Load that page in Safari on iOS 14.2.
2. Click "Capture microphone" button then Allow
3. Click "Play sound" button. Sound plays fine.
4. Click "Load Agora NG SDK" button. Sound begins stuttering.

With Agora NG SDK loaded the sound plays fine unless the microphone is also captured. Apparently something Agora SDK does on load together with microphone capture breaks sound playback.

Clicking "Load Agora 3 SDK" button momentarily pauses the sound, but then it resumes fine.

This appears to confirm something different that NG SDK does on initialisation compared to v3 that is breaking audio playback.

(btw if you play the sound first, then capture the microphone, the sound quality changes. I believe this is related to https://bugs.webkit.org/show_bug.cgi?id=211959)

@aandrewww
Copy link

I have the same issue.
Fix it, please!

@aandrewww
Copy link

aandrewww commented Dec 28, 2020

Screenshot 2020-12-28 at 21 27 13

It's log from safari. multiple logs about "rebuild web audio" - every 4 seconds. And then I tried to play a track... and multiple resume success logs in onetime

@aandrewww
Copy link

aandrewww commented Dec 28, 2020

It's a very interesting part of code. But it could be a root of the problem.

Recursive call via autoclick (it's part of code from AgoraWebSDK_N-v4.2.1-0-gf505b57):

Screenshot 2020-12-28 at 22 21 15

Screenshot 2020-12-28 at 22 24 05

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants