Bug 230902

Summary: REGRESSION(Safari 15 - iOS15): [WebRTC] MediaStreamTack audio volume too low
Product: WebKit Reporter: Les <lragsdale>
Component: WebRTCAssignee: youenn fablet <youennf>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Major CC: 913007768zyw, abarnes, alex, alex.wayfer, al.nagar.mahmoud, andrei.rebegea, avasilko, ayp465, bernardo, brendandelrosario, cdumez, chrisguttandin, clubmx7771, csantos, cxdevteam, daginge, daniel.ororke, davy.de.durpel, dchand3, dima.kucher, drkrieger.dev, eliel.cohen, eric.carlson, eumansky, gabor, GARYnJAYE, glefebvr, heycam, hrickardsaw, israel20, jameshoward, jean-yves.avenard, jer.noble, jerry, j.graseec, jgrealy, jonathan, josh.sauder, junk, kat, katya, kevin_neal, koivisto, Kongpheng.Nanthavongsa, lee.ellam, lhphong09t2, luca.simonetti, makarand, marcus-gilson, marymhart, matiasirland, mattkiazyk, mattwindwer, mb, melvin.colaco, michael.kork, mina.koltaa, mjs, molson, neo.jung, pablofuenteperez, petez, plotbreeze, rychouwei, sean.oshea, shikher.prasad, silviapfeiffer1, simon.fraser, ssim, steve.mieskoski+webkit, streambot, sunlimet, tavucapinto, teodor.atroshenko, varundabke, webkit-bug-importer, wenson_hsieh, yazan.tec, yekime1436, youennf, zach
Priority: P1 Keywords: InRadar
Version: Other   
Hardware: iPhone / iPad   
OS: Other   
See Also: https://bugs.webkit.org/show_bug.cgi?id=233316
https://bugs.webkit.org/show_bug.cgi?id=232941
https://bugs.webkit.org/show_bug.cgi?id=237375
Attachments:
Description Flags
feedback noises none

Description Les 2021-09-28 11:01:22 PDT
The audio in our web application’s WebRTC sessions is barely audible for users using Safari 15.This is not the case for previous Safari/iOS versions. Adjusting the volume in the web application and on the physical device has no effect. 

While searching for a solution, we found that the same issue exists for iOS15 users that join FaceTime calls via facetime.apple.com with Safari. We encountered this issue with the following steps (Users A and B are both using iOS15 ): 

- User A chooses “Create Link” from the FaceTime app
- User A shares the link with User B via SMS
- User B copies the facetime.apple.com link into Safari and ignores any prompt to use the FaceTime app
- User B should be able to hear User A clearly but the audio is very low

We’ve tried a number of workarounds with no luck:
- Establish a new audio connection after the initial to reset the volume
- Enabling autoGainControl
- Manually setting the volume constraint
- Triggering the audio by playing a sound prior to the WebRTC session
Comment 1 Matt 2021-09-28 11:53:57 PDT
Using the above test from Les in my case:


User B was NO sound, until they turned on the video, then User B had low sound. User A (on app) could hear User B fine.
Comment 2 rychouwei 2021-09-29 03:27:22 PDT
I have same issue.

remote stream volume on iOS 15 Safari is obviously lower than iOS 14.
Comment 3 Kevin Neal 2021-09-29 09:17:11 PDT
Thank you for filing. The appropriate engineers have been notified.
Comment 4 Radar WebKit Bug Importer 2021-09-29 09:17:21 PDT
<rdar://problem/83673859>
Comment 5 Phong Le 2021-09-29 09:26:39 PDT
Although, audio stream is played on bottom speaker, but the volume is very low
Comment 6 Mike Olson 2021-10-01 16:18:11 PDT
Hi Kevin,

Thanks for the Radar issue.

I'm not sure whether this is possible, but Les and I (we both work for the same company) would love to see this issue imported into OpenRadar or some other community-visible tool if that's convenient. I'm happy to authorize disclose of any details of the original report, in case that's necessary.
Comment 7 Eliel Cohen 2021-10-03 06:18:15 PDT
Hi Everyone,

Where I work we also suffer from this, therefore I have been investigating on my side this issue, by the way it's not that the audio volume is low, but that the audio output is the earpiece and not the speaker anymore to my opinion.

Now I have got some interesting finding that could guide Apple engineers in solving this, basically I've found out that if I open a new tab (with some audio tag inside, but it could be not mandatory), as long as the new tab is on a different domain, then it will put back the audio back to the speaker at normal volume, and going back to the tab where the Webrtc call happens will not reproduce the low volume/earpiece output issue.

Please note, that using an iframe, won't solve it, and using a same domain url for the new tab, won't also solve it.

Other finding, using Chrome application (which relies of course on WKWebView) will reproduce the issue, but there, simply going to the tab view will solve the audio issue, and we can then go back to the tab where the Webrtc call takes place.

At last, please note that sometime, these two solutions can deliver a mix solution, meaning that some rare time, it did create a state where the audio will go through the earpiece (low volume) for half a second, then through the speaker for half a sec, and so on continuously...

Hope my findings will help someone :)

Thanks,

Eliel
Comment 8 Steve Mieskoski 2021-10-05 12:12:45 PDT
Hi everyone,

I am also seeing this issue with iOS15. Our QA people went through the various audio settings to see if any of them would have an effect, but none did.
Comment 9 Sherwin Sim 2021-10-06 07:45:56 PDT
Just want to add that Bluejeans/Verizon is also seeing this issue

We've tried a couple different workarounds as suggested in other threads and we cannot seem to get it to work
Comment 10 Anna Vasilko 2021-10-08 16:42:46 PDT
We @Twilio received multiple reports of this iOS15 issue as well and are able to reproduce internally. Most of the end users perceive this as a "low volume issue" , when in reality it seems that in iOS15 audio is routed into earpiece audio output by default instead of speaker.
Comment 11 Mina 2021-10-11 23:56:20 PDT
We are having the same issue too, in iOS15 the audio seems to be routed to the earpiece audio instead of the speaker, on the other hand iOS14 works properly
Comment 12 Krieger 2021-10-12 01:58:11 PDT
*** Bug 231421 has been marked as a duplicate of this bug. ***
Comment 13 youenn fablet 2021-10-12 10:53:33 PDT
Have any of you tried the latest iOS 15 beta?
Comment 14 Mike Olson 2021-10-12 11:19:29 PDT
We tried 15.1 beta 3 and 15.0.2, the problem wasn't fixed in either.
Comment 15 neo 2021-10-13 03:11:09 PDT
do not use media element (audio or video)
for play remote audio stream use audio context destination. 
this work for me.
Comment 16 Phong Le 2021-10-13 05:04:51 PDT
Could you guide about how to use AudioContext to play this remote stream? I researched and when using AudioContext to play, we must attach with an audio element. Thanks
Comment 17 Phong Le 2021-10-13 05:06:17 PDT
(In reply to neo from comment #15)
> do not use media element (audio or video)
> for play remote audio stream use audio context destination. 
> this work for me.

Could you guide about how to use AudioContext to play this remote stream? I researched and when using AudioContext to play, we must attach with an audio element. Thanks
Comment 18 neo 2021-10-13 18:42:36 PDT
(In reply to Phong Le from comment #16)
> Could you guide about how to use AudioContext to play this remote stream? I
> researched and when using AudioContext to play, we must attach with an audio
> element. Thanks

i tested iOS 15. (wkWebview)

// audio stream example
 function connectToSpeaker(remoteAudioStream: MediaStream, gain: number) {
    const context: AudioContext = window.AudioContext || window.webkitAudioContext;
    const audioNode = context.createMediaStreamSource(remoteAudioStream);
    const gainNode: GainNode = context.createGain();
    // some device volume too low ex) iPad
    gainNode.gain.value = gain;
    audioNode.connect(gainNode);
    gainNode.connect(context.destination);
  } 

and i'm not append video(with audio) element to document body. 
i use canvas.
Comment 19 Brendan Del Rosario 2021-10-15 13:56:59 PDT
(In reply to neo from comment #18)
> (In reply to Phong Le from comment #16)
> > Could you guide about how to use AudioContext to play this remote stream? I
> > researched and when using AudioContext to play, we must attach with an audio
> > element. Thanks
> 
> i tested iOS 15. (wkWebview)
> 
> // audio stream example
>  function connectToSpeaker(remoteAudioStream: MediaStream, gain: number) {
>     const context: AudioContext = window.AudioContext ||
> window.webkitAudioContext;
>     const audioNode = context.createMediaStreamSource(remoteAudioStream);
>     const gainNode: GainNode = context.createGain();
>     // some device volume too low ex) iPad
>     gainNode.gain.value = gain;
>     audioNode.connect(gainNode);
>     gainNode.connect(context.destination);
>   } 
> 
> and i'm not append video(with audio) element to document body. 
> i use canvas.

This workaround allowed us(OP/Les, Mike & Brendan) to be able to hear the remote audio at an appropriate level. We set our gain value to 10 for now and will tweak as needed (increasing too much can cause clipping). The quality of audio is slightly lower than that of iOS 14 but for the time being it is a workaround that gets us closer to previous functionality. Thank you very much for posting this!
Comment 20 Phong Le 2021-10-15 16:37:28 PDT
(In reply to neo from comment #18)
> (In reply to Phong Le from comment #16)
> > Could you guide about how to use AudioContext to play this remote stream? I
> > researched and when using AudioContext to play, we must attach with an audio
> > element. Thanks
> 
> i tested iOS 15. (wkWebview)
> 
> // audio stream example
>  function connectToSpeaker(remoteAudioStream: MediaStream, gain: number) {
>     const context: AudioContext = window.AudioContext ||
> window.webkitAudioContext;
>     const audioNode = context.createMediaStreamSource(remoteAudioStream);
>     const gainNode: GainNode = context.createGain();
>     // some device volume too low ex) iPad
>     gainNode.gain.value = gain;
>     audioNode.connect(gainNode);
>     gainNode.connect(context.destination);
>   } 
> 
> and i'm not append video(with audio) element to document body. 
> i use canvas.

Wow, it works :) Thanks for sharing. Before, I tested this one on MacOS Safari but not work. Only work on iOS device :). I set gain 4 to iPhone and 2 to iPad.  The <audio> and <video> tag (play file by url not remote stream) is still very low volume
Comment 21 neo 2021-10-17 19:59:34 PDT
(In reply to Phong Le from comment #20)
> (In reply to neo from comment #18)
> > (In reply to Phong Le from comment #16)
> > > Could you guide about how to use AudioContext to play this remote stream? I
> > > researched and when using AudioContext to play, we must attach with an audio
> > > element. Thanks
> > 
> > i tested iOS 15. (wkWebview)
> > 
> > // audio stream example
> >  function connectToSpeaker(remoteAudioStream: MediaStream, gain: number) {
> >     const context: AudioContext = window.AudioContext ||
> > window.webkitAudioContext;
> >     const audioNode = context.createMediaStreamSource(remoteAudioStream);
> >     const gainNode: GainNode = context.createGain();
> >     // some device volume too low ex) iPad
> >     gainNode.gain.value = gain;
> >     audioNode.connect(gainNode);
> >     gainNode.connect(context.destination);
> >   } 
> > 
> > and i'm not append video(with audio) element to document body. 
> > i use canvas.
> 
> Wow, it works :) Thanks for sharing. Before, I tested this one on MacOS
> Safari but not work. Only work on iOS device :). I set gain 4 to iPhone and
> 2 to iPad.  The <audio> and <video> tag (play file by url not remote stream)
> is still very low volume

still very low volume <== it'll be ok if use audio context for playing audio file.
Comment 22 neo 2021-10-17 20:07:59 PDT
does anyone knsow about this issue.
https://bugs.webkit.org/show_bug.cgi?id=231733
Comment 23 Phong Le 2021-10-19 23:25:53 PDT
(In reply to neo from comment #21)
> (In reply to Phong Le from comment #20)
> > (In reply to neo from comment #18)
> > > (In reply to Phong Le from comment #16)
> > > > Could you guide about how to use AudioContext to play this remote stream? I
> > > > researched and when using AudioContext to play, we must attach with an audio
> > > > element. Thanks
> > > 
> > > i tested iOS 15. (wkWebview)
> > > 
> > > // audio stream example
> > >  function connectToSpeaker(remoteAudioStream: MediaStream, gain: number) {
> > >     const context: AudioContext = window.AudioContext ||
> > > window.webkitAudioContext;
> > >     const audioNode = context.createMediaStreamSource(remoteAudioStream);
> > >     const gainNode: GainNode = context.createGain();
> > >     // some device volume too low ex) iPad
> > >     gainNode.gain.value = gain;
> > >     audioNode.connect(gainNode);
> > >     gainNode.connect(context.destination);
> > >   } 
> > > 
> > > and i'm not append video(with audio) element to document body. 
> > > i use canvas.
> > 
> > Wow, it works :) Thanks for sharing. Before, I tested this one on MacOS
> > Safari but not work. Only work on iOS device :). I set gain 4 to iPhone and
> > 2 to iPad.  The <audio> and <video> tag (play file by url not remote stream)
> > is still very low volume
> 
> still very low volume <== it'll be ok if use audio context for playing audio
> file.

No. (In reply to neo from comment #21)
> (In reply to Phong Le from comment #20)
> > (In reply to neo from comment #18)
> > > (In reply to Phong Le from comment #16)
> > > > Could you guide about how to use AudioContext to play this remote stream? I
> > > > researched and when using AudioContext to play, we must attach with an audio
> > > > element. Thanks
> > > 
> > > i tested iOS 15. (wkWebview)
> > > 
> > > // audio stream example
> > >  function connectToSpeaker(remoteAudioStream: MediaStream, gain: number) {
> > >     const context: AudioContext = window.AudioContext ||
> > > window.webkitAudioContext;
> > >     const audioNode = context.createMediaStreamSource(remoteAudioStream);
> > >     const gainNode: GainNode = context.createGain();
> > >     // some device volume too low ex) iPad
> > >     gainNode.gain.value = gain;
> > >     audioNode.connect(gainNode);
> > >     gainNode.connect(context.destination);
> > >   } 
> > > 
> > > and i'm not append video(with audio) element to document body. 
> > > i use canvas.
> > 
> > Wow, it works :) Thanks for sharing. Before, I tested this one on MacOS
> > Safari but not work. Only work on iOS device :). I set gain 4 to iPhone and
> > 2 to iPad.  The <audio> and <video> tag (play file by url not remote stream)
> > is still very low volume
> 
> still very low volume <== it'll be ok if use audio context for playing audio
> file.

Yup. But I need to use media element tag to play. However, createMediaElementSource on ios safari hadn't worked for long time
Comment 24 neo 2021-10-19 23:55:36 PDT
> 
> Yup. But I need to use media element tag to play. However,
> createMediaElementSource on ios safari hadn't worked for long time

hi
we no need to use createMediaElementSource for playing audio file.
how about use decodeAudioData.


window.onload = function(){
    var context = new AudioContext() || new webkitAudioContext(),
        request = new XMLHttpRequest();
    
    request.open("GET", "audio_file.mp3", true);
    request.responseType = "arraybuffer";
    request.onload = function(){
        context.decodeAudioData(request.response, onDecoded);
    }
    
    function onDecoded(buffer){
        var bufferSource = context.createBufferSource();
        bufferSource.buffer = buffer;
        bufferSource.connect(context.destination);
        bufferSource.start();
    }
    
    request.send();
};
Comment 25 Paul 2021-10-21 12:06:21 PDT
We are running into this same issue - our website has been working for 3 years on all major browsers except IE. We do need to play audio at the same time as recording. We are beginning to get complaints.
Comment 26 Paul 2021-10-23 07:54:41 PDT
The hack of adding the gain node works for us - sort of. Safari 15 on MacOS doesn't have the problem so I look at the User Agent and only apply the hack if the client is Safari 15 and mobile. That keeps from breaking browsers that don't have this bug.

However, I can't figure out how to distinguish between iPad and MacbookPro, so iPad is still broken. That's better than nothing, though, since iphones outnumber ipads in our user base.

BTW, we only have a few test devices but adding a gain of 10 seems to be approximately right.

The other thing we're worried about is that if this gets fixed then all of the sudden we'll be blasting iphone users out.
Comment 27 Phong Le 2021-10-23 19:11:13 PDT
(In reply to Paul from comment #26)
> The hack of adding the gain node works for us - sort of. Safari 15 on MacOS
> doesn't have the problem so I look at the User Agent and only apply the hack
> if the client is Safari 15 and mobile. That keeps from breaking browsers
> that don't have this bug.
> 
> However, I can't figure out how to distinguish between iPad and MacbookPro,
> so iPad is still broken. That's better than nothing, though, since iphones
> outnumber ipads in our user base.
> 
> BTW, we only have a few test devices but adding a gain of 10 seems to be
> approximately right.
> 
> The other thing we're worried about is that if this gets fixed then all of
> the sudden we'll be blasting iphone users out.

More, if the user plug a headset and we still keep gain 10. Then, it would be very very high volume :(. We cannot do anything here because we cannot detect when users plug their headset. We must wait for fixing this issue
Comment 28 Varun D 2021-10-24 22:03:28 PDT
(In reply to Brendan Del Rosario from comment #19)
> (In reply to neo from comment #18)
> > (In reply to Phong Le from comment #16)
> > > Could you guide about how to use AudioContext to play this remote stream? I
> > > researched and when using AudioContext to play, we must attach with an audio
> > > element. Thanks
> > 
> > i tested iOS 15. (wkWebview)
> > 
> > // audio stream example
> >  function connectToSpeaker(remoteAudioStream: MediaStream, gain: number) {
> >     const context: AudioContext = window.AudioContext ||
> > window.webkitAudioContext;
> >     const audioNode = context.createMediaStreamSource(remoteAudioStream);
> >     const gainNode: GainNode = context.createGain();
> >     // some device volume too low ex) iPad
> >     gainNode.gain.value = gain;
> >     audioNode.connect(gainNode);
> >     gainNode.connect(context.destination);
> >   } 
> > 
> > and i'm not append video(with audio) element to document body. 
> > i use canvas.
> 
> This workaround allowed us(OP/Les, Mike & Brendan) to be able to hear the
> remote audio at an appropriate level. We set our gain value to 10 for now
> and will tweak as needed (increasing too much can cause clipping). The
> quality of audio is slightly lower than that of iOS 14 but for the time
> being it is a workaround that gets us closer to previous functionality.
> Thank you very much for posting this!

Can this work if we have many peer's audio stream coming in?
Also, should the first line of this function be
const context = new (window.AudioContext || window.webkitAudioContext)();
Otherwise, createMediaStreamsource fails.
Comment 29 Pablo Fuente 2021-10-26 03:53:41 PDT
Hi,

We at @openvidu are also experiencing this problem. From iOS 15, when using Safari audio is coming out through both the earpiece and the main speaker, but the total output volume is reduced about 1/2 to 2/3, comparing it to Safari in iOS 14.
I can provide some more information: if the user stops the camera clicking on the navigation bar "Stop Using Camera" button, then the receiving audio gets automatically back to a normal level.
Comment 30 Phong Le 2021-10-27 20:47:00 PDT
@@ A month from reported day and nobody is assigned to investigate to fix. Why? How an super big company as Apple has lack of developers to resolve this one
Comment 31 Luca Simonetti 2021-10-28 06:59:16 PDT
we're experiencing the same issue with a cordova app. Exactly same behavior. I sure hope this is being taken care of.
Comment 32 youenn fablet 2021-10-28 07:00:43 PDT
This is being worked on but it is not clear yet whether changes in WebKit will be needed.
Comment 33 Phong Le 2021-10-28 22:40:40 PDT
Cool. I hope that it's fixed asap :(. Many people are influenced seriously. We don't have anyway to make it workound now(In reply to youenn fablet from comment #32)
> This is being worked on but it is not clear yet whether changes in WebKit
> will be needed.

Cool. I hope that it's fixed asap :(. Many people are influenced seriously. We don't have anyway to make it workound now. Using AudioContext is bad solution. If the user plug a headset and we still keep gain 10. Then, it would be very very high volume :(. We cannot do anything here because we cannot detect when users plug their headset. We must wait for fixing this issue
Comment 34 hrickardsaw 2021-11-05 08:18:52 PDT
Any update here? This has a *very* noticeable user impact and, like Phong mentioned, there is no viable workaround as increasing gain causes the opposite problem for users with headsets. Given the impact, updates on this ticket, rather than just on the internal Radar issue, would be very much appreciated.
Comment 35 Mina 2021-11-05 08:31:14 PDT
I completely agree with you, the issue is causing a noticeable bad impact on our end users too.
I really appreciate any updates here.
Comment 36 bdesai 2021-11-05 08:33:26 PDT
We are facing the same problem as well. we are highly relied on webRTC for our workflow. Would be great to have some progress on this one.
Comment 37 Luca Simonetti 2021-11-05 08:33:41 PDT
Same here, we are currently suggesting users to use our app with headphones. 
And obviously it's not a solution nor a workaround but a real limitation.
Comment 38 seanoshea 2021-11-05 08:41:42 PDT
Pinging on this here too to see if this can get prioritized. We're running into this on a daily basis.
Comment 39 ivalencia 2021-11-05 08:56:36 PDT
We are being hit by this bug as well, a quick turnaround will be highly appreciated. Thanks.
Comment 40 Natch 2021-11-05 11:58:23 PDT
Completely agree with Luca - switching to headphones is not a plausible solution.
Would really appreciate to see this one get resolved soon.
Comment 41 Octavio Pinto 2021-11-05 12:01:54 PDT
Any updates, yet? Really impacting user experience.
Comment 42 JoshSauder 2021-11-05 13:50:25 PDT
We're also frequently experiencing this same issue. Would also appreciate an update on this issue.
Comment 43 melvin bos 2021-11-05 18:27:41 PDT
This is greatly impacting end user experience and please patch this soon. thanks in advance.
Comment 44 Freet30 2021-11-05 20:21:34 PDT
This need to be patch.  Anyone tried new beta?
Comment 45 Dana Chandler 2021-11-06 03:19:03 PDT
I agree with previous comments.  The is seriously affecting user experience and would be nice if this was prioritized.  Any updates you could provide would be greatly appreciated.
Comment 46 Andrei Rebegea 2021-11-08 01:42:00 PST
Please fix this regression. It impacts our users.
Comment 47 neo 2021-11-08 08:49:44 PST
iOS 15.1 low sound issue.

this works for me 
1. create new audio context (before getUserMedia. important!)
2. getUserMedia
3. use audio context to play remote audio and sound
hope this helps
Comment 48 Mina 2021-11-08 13:17:05 PST
I think the issue is related to webkit not safari, I've tested the same on Firefox on iOS which is webkit based and the issue occurred too.
Comment 49 Freet30 2021-11-09 00:56:55 PST
Sometimes plug in headphones and unplug them the audio goes to normal.
Comment 50 Phong Le 2021-11-09 05:00:56 PST
This is a critical issue. Please fix asap
Comment 51 Phong Le 2021-11-10 04:18:00 PST
At https://bugs.webkit.org/show_bug.cgi?id=232873, youenn fablet updated WebRTC lib. Does anyone know how to check this issue work on this patch?
Comment 52 Yazz 2021-11-14 09:26:40 PST
Wondering if there is any progress in this issue, we are recommending users to not use IPAD/IPHONE currently, which is not so good :(
Comment 53 Phong Le 2021-11-14 10:13:58 PST
(In reply to Yazz from comment #52)
> Wondering if there is any progress in this issue, we are recommending users
> to not use IPAD/IPHONE currently, which is not so good :(

Yeap, they move to use Android and Chrome on Windows becauase this one
Comment 54 Matthew Windwer 2021-11-14 10:15:42 PST
Waiting to hear as well. Hoping this will be fixed for iOS 15.2. Does anybody know?
Comment 55 Zach Rattner 2021-11-14 11:39:25 PST
If anyone on this thread is able to reliably reproduce this bug on iOS 15.1, you could try out the iOS 15.2 beta and see if the issue resolved: 

https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-15_2-release-notes

I know I, for one, would appreciate it if anyone could do this and report back here. Probably others would too.

My team's attempts at reproducing on iOS 15.1 were intermittent and I haven't had a chance to chase down exactly why yet. Will share if we figure anything out.
Comment 56 Zach Rattner 2021-11-14 11:39:50 PST
If anyone on this thread is able to reliably reproduce this bug on iOS 15.1, you could try out the iOS 15.2 beta and see if the issue resolved: 

https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-15_2-release-notes

I know I, for one, would appreciate it if anyone could do this and report back here. Probably others would too.

My team's attempts at reproducing on iOS 15.1 were intermittent and I haven't had a chance to chase down exactly why yet. Will share if we figure anything out.
Comment 57 Marcus G 2021-11-15 14:47:46 PST
(In reply to Zach Rattner from comment #56)
> If anyone on this thread is able to reliably reproduce this bug on iOS 15.1,
> you could try out the iOS 15.2 beta and see if the issue resolved: 
> 
> https://developer.apple.com/documentation/ios-ipados-release-notes/ios-
> ipados-15_2-release-notes
> 
> I know I, for one, would appreciate it if anyone could do this and report
> back here. Probably others would too.
> 
> My team's attempts at reproducing on iOS 15.1 were intermittent and I
> haven't had a chance to chase down exactly why yet. Will share if we figure
> anything out.

I have tried it on an iPhone 10XS with 5.2 beta 2 and it has not been fixed.
The audio is still low with our web app.
Comment 58 Marcus G 2021-11-15 14:49:00 PST
(In reply to Marcus G from comment #57)
> (In reply to Zach Rattner from comment #56)
> > If anyone on this thread is able to reliably reproduce this bug on iOS 15.1,
> > you could try out the iOS 15.2 beta and see if the issue resolved: 
> > 
> > https://developer.apple.com/documentation/ios-ipados-release-notes/ios-
> > ipados-15_2-release-notes
> > 
> > I know I, for one, would appreciate it if anyone could do this and report
> > back here. Probably others would too.
> > 
> > My team's attempts at reproducing on iOS 15.1 were intermittent and I
> > haven't had a chance to chase down exactly why yet. Will share if we figure
> > anything out.
> 
> I have tried it on an iPhone 10XS with 5.2 beta 2 and it has not been fixed.
> The audio is still low with our web app.

Sorry 15.2 beta 2.
Comment 59 cxdevteam@outlook.com 2021-11-16 00:19:24 PST
the issue is not fixed on 15.2 beta and 15.2beta2 on devices below,
iphone 12 pro
iphone 12 
iphone 7
ipad gen 8
Comment 60 Phong Le 2021-11-16 20:07:53 PST
(In reply to cxdevteam@outlook.com from comment #59)
> the issue is not fixed on 15.2 beta and 15.2beta2 on devices below,
> iphone 12 pro
> iphone 12 
> iphone 7
> ipad gen 8

Thank for this announcement. This is actually critical issue for web based call applications. Hope that Apple will fix it asap :(
Comment 61 Marcus G 2021-11-17 09:49:31 PST
Bug still in iOS 15.2 public beta 3

Just checked the new released 15.2 public beta 3 on an iPhone XS and the issue has not been fixed.  Audio is still low on connection to our audio web app. Opening an additional browser window while the audio is running in the original window brings the audio back to a normal level. User can then go back to the original browser window, but most users are not going to figure this out.
Comment 62 Paul 2021-11-18 06:56:02 PST
(In reply to Zach Rattner from comment #56)
> My team's attempts at reproducing on iOS 15.1 were intermittent and I
> haven't had a chance to chase down exactly why yet. Will share if we figure
> anything out.

Zach, it happens every time in our website. If you'd like to see it contact me and we can give you an account.
Comment 63 Johnny V 2021-11-20 10:22:15 PST
To reproduce the issue all you have to do is go here on an iPhone/Pad https://webrtc.github.io/samples/src/content/devices/input-output/

When speaking into the microphone of an iPhone it is clear the sound is coming out of the headset instead of the speaker.
Comment 64 Mina 2021-11-21 08:29:32 PST
Hi Guys,

My colleges did something like 

mediaStream.getAudioTracks()[0].enabled = false;
setTimeout(() => {						        mediaStream.getAudioTracks()[0].enabled = true;
}, 1500);

they reported hearing echo sound which was never happening before, can anybody help verifying it on your end too?

We tested iOS 15.1 and 15.0
Comment 65 Teodor 2021-11-24 06:57:44 PST
We tried overriding audio route (kAudioSessionOverrideAudioRoute_Speaker) while WebRTC audio was being played through earpiece – we are seeing this issue in WKWebView as well as Safari – and the result is that the entire WebRTC call crashes.

If anybody has any stable (reproducible) workarounds, even if they rely on executing native code, please share. It seems we won't see a fix in 15.3, and we are looking at one more month and a half with this bug, and that's if we are lucky.
Comment 66 Marcus G 2021-11-24 07:28:50 PST
(In reply to Johnny V from comment #63)
> To reproduce the issue all you have to do is go here on an iPhone/Pad
> https://webrtc.github.io/samples/src/content/devices/input-output/
> 
> When speaking into the microphone of an iPhone it is clear the sound is
> coming out of the headset instead of the speaker.

We have the same low audio issue using airPods and other bluetooth devices (car audio) as well. So it seems to go beyond a headset/speaker routing issue.
Comment 67 Phong Le 2021-11-24 19:37:07 PST
(In reply to Marcus G from comment #66)
> (In reply to Johnny V from comment #63)
> > To reproduce the issue all you have to do is go here on an iPhone/Pad
> > https://webrtc.github.io/samples/src/content/devices/input-output/
> > 
> > When speaking into the microphone of an iPhone it is clear the sound is
> > coming out of the headset instead of the speaker.
> 
> We have the same low audio issue using airPods and other bluetooth devices
> (car audio) as well. So it seems to go beyond a headset/speaker routing
> issue.

@@ Super critical issue. :(. Apple should be aware of fixing this one asap
Comment 68 Teodor 2021-11-26 19:42:18 PST
Can anybody confirm that this issue is NOT reproducible on iPhone 8 (model number MQ6W2LL/A) with iOS 15.1?

I could join a call with it 10+ times in a row and sound was coming out of the speaker every time. Comment 59 mentions iPhone 7, so iPhone 8 may be the only exception.

If this is the case, then gain workaround must not be applied on iPhone 8. Media query to detect it is "only screen and (device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)".
Comment 69 Varun D 2021-11-28 08:57:04 PST
I tried a solution mentioned the last comment by David on this thread 
https://bugs.webkit.org/show_bug.cgi?id=218012
It partially improved the volume.

However, as soon as Mic permission was granted - peer volume dropped to very poor.
Comment 70 Varun D 2021-11-28 08:57:18 PST
I tried a solution mentioned the last comment by David on this thread 
https://bugs.webkit.org/show_bug.cgi?id=218012
It partially improved the volume.

However, as soon as Mic permission was granted - peer volume dropped to very poor.
Comment 71 Jacob 2021-11-29 12:54:55 PST
We are experiencing this on our video chat app on ios 15.1.1 but not ios 15.0.1
Comment 72 Johnny V 2021-11-30 10:56:51 PST
I wanted to let everyone know that new evidence suggests that WebRTC sessions in iOS15.1 with Stereo Opus Audio come in at full volume whereas Mono Opus Audio does not.

https://meeting.anycompany.xyz/ can be used to test the Mono Audio
https://demo.millicast.com/ can be used to test the Stereo Audio

It is possible that some other factor is in play here.  Just wanted to update everyone so get more eyes on this.
Comment 73 Varun D 2021-12-02 01:12:17 PST
(In reply to Johnny V from comment #72)
> I wanted to let everyone know that new evidence suggests that WebRTC
> sessions in iOS15.1 with Stereo Opus Audio come in at full volume whereas
> Mono Opus Audio does not.
> 
> https://meeting.anycompany.xyz/ can be used to test the Mono Audio
> https://demo.millicast.com/ can be used to test the Stereo Audio
> 
> It is possible that some other factor is in play here.  Just wanted to
> update everyone so get more eyes on this.

When viewing millicast video, was mic permission asked & granted? 
when mic permission is granted - that is when volume drops on iphone.
Comment 74 Johnny V 2021-12-02 05:43:30 PST
(In reply to Varun D from comment #73)
> (In reply to Johnny V from comment #72)
> > I wanted to let everyone know that new evidence suggests that WebRTC
> > sessions in iOS15.1 with Stereo Opus Audio come in at full volume whereas
> > Mono Opus Audio does not.
> > 
> > https://meeting.anycompany.xyz/ can be used to test the Mono Audio
> > https://demo.millicast.com/ can be used to test the Stereo Audio
> > 
> > It is possible that some other factor is in play here.  Just wanted to
> > update everyone so get more eyes on this.
> 
> When viewing millicast video, was mic permission asked & granted? 
> when mic permission is granted - that is when volume drops on iphone.

Do you have a test URL where I can try this?  The https://meeting.anycompany.xyz/ will not let me in the room without enabling Camera and Microphone on iOS 15.1
Comment 75 Varun D 2021-12-02 09:26:16 PST
(In reply to Varun D from comment #73)
> (In reply to Johnny V from comment #72)
> > I wanted to let everyone know that new evidence suggests that WebRTC
> > sessions in iOS15.1 with Stereo Opus Audio come in at full volume whereas
> > Mono Opus Audio does not.
> > 
> > https://meeting.anycompany.xyz/ can be used to test the Mono Audio
> > https://demo.millicast.com/ can be used to test the Stereo Audio
> > 
> > It is possible that some other factor is in play here.  Just wanted to
> > update everyone so get more eyes on this.
> 
> When viewing millicast video, was mic permission asked & granted? 
> when mic permission is granted - that is when volume drops on iphone.

I have tried this working on a WebRTC solution for client - cant share the URL.
More details here https://bugs.webkit.org/show_bug.cgi?id=218012'

As I understand, for viewing milicast video - mic permission is not needed - and that is making the difference.
Comment 76 Matthew Windwer 2021-12-03 10:39:28 PST
Twilio has indicated that this bug is resolved in iOS 15.2 beta 4:
https://github.com/twilio/twilio-video.js/issues/1586#issuecomment-985094190

Has anybody else confirmed?
Comment 77 Marcus G 2021-12-03 17:39:19 PST
(In reply to mattwindwer from comment #76)
> Twilio has indicated that this bug is resolved in iOS 15.2 beta 4:
> https://github.com/twilio/twilio-video.js/issues/1586#issuecomment-985094190
> 
> Has anybody else confirmed?

On an iPhone XS this is NOT resolved for the speakers with iOS 15.2 beta 4. There is some progress though.

My initial testing with an iPhone XS and iOS 15.2 beta 4 is that volume is still very LOW (unusable) with the SPEAKERS, but... with bluetooth airPods or bluetooth car audio or wired apple earphones the audio is at a normal level again and sounds good.

To get normal level with the speakers, if you open another browser window to some other web site after you have opened the audio site, then the speaker level reverts to normal volume for the duration of the session.

So, definitely progress with the 1 phone I have tested with but not resolved. I have an iPhone 7 that I will update and test with as well.

All testing was done with Safari.
Comment 78 Lee 2021-12-09 05:47:51 PST
We are seeing this, although our use case is slightly different, we have (intermittently) very low audio on non-WebRTC video playback while microphone access is granted.
Comment 79 Johnny V 2021-12-09 05:50:35 PST
(In reply to Lee from comment #78)
> We are seeing this, although our use case is slightly different, we have
> (intermittently) very low audio on non-WebRTC video playback while
> microphone access is granted.

Check https://bugs.webkit.org/show_bug.cgi?id=218012
Comment 80 Marcus G 2021-12-09 08:42:42 PST
(In reply to Marcus G from comment #77)
> (In reply to mattwindwer from comment #76)
> > Twilio has indicated that this bug is resolved in iOS 15.2 beta 4:
> > https://github.com/twilio/twilio-video.js/issues/1586#issuecomment-985094190
> > 
> > Has anybody else confirmed?
> 
> On an iPhone XS this is NOT resolved for the speakers with iOS 15.2 beta 4.
> There is some progress though.
> 
> My initial testing with an iPhone XS and iOS 15.2 beta 4 is that volume is
> still very LOW (unusable) with the SPEAKERS, but... with bluetooth airPods
> or bluetooth car audio or wired apple earphones the audio is at a normal
> level again and sounds good.
> 
> To get normal level with the speakers, if you open another browser window to
> some other web site after you have opened the audio site, then the speaker
> level reverts to normal volume for the duration of the session.
> 
> So, definitely progress with the 1 phone I have tested with but not
> resolved. I have an iPhone 7 that I will update and test with as well.
> 
> All testing was done with Safari.

FOLLOW UP - 15.2 RC (19C56) released Dec 7, 2021:

As far as I can tell the progress that was made in 15.2 public beta 4 did not make it into 15.2 RC (19C56). The 15.2 RC has all audio levels low again regardless of it being the speakers, bluetooth, or wired headphones on a iPhone XS. This is with a WebRTC audio streaming web app.
Comment 81 Peter 2021-12-09 14:48:51 PST
Is there an ETA on fixing this? This is a major bug and I'm really shocked that has gone on this long.
Comment 82 Mahmoud 2021-12-10 04:50:22 PST
Can someone take a look on this bug ?
We are running a peer to peer streaming service based on WebRTC and this bug decrease the value of our product drastically. At least tell us an ETA on what we can expect so we can act upon it towards our clients. 

How could Apple afford this kind of major flow to be in the system for so long ? This makes iPhone useless.
Comment 83 Mahmoud 2021-12-10 05:00:10 PST
Is there any reference ticket created about the issue on Apple side which can be accessed publicly?
Comment 84 youenn fablet 2021-12-10 05:18:32 PST
A first fix should have landed in iOS 15.2 beta.
If the issue still reproduces in the latest iOS 15.2 beta, please provide repro steps.
Thanks.
Comment 85 Marcus G 2021-12-10 07:40:19 PST
(In reply to youenn fablet from comment #84)
> A first fix should have landed in iOS 15.2 beta.
> If the issue still reproduces in the latest iOS 15.2 beta, please provide
> repro steps.
> Thanks.

Hello,

It seems 15.2 RC (19C56) has lost some of the progress made with 15.2 beta 4.

It seems there was a partial fix with 15.2 beta 4. The volume level was normal again with bluetooth devices and directly plugged apple headphones, but NOT with speakers. Speakers were at about 50% volume which makes it difficult to use the app.

But with 15.2 RC (19C56) we are experiencing the same issue as before.  Low audio in all devices unchanged from the original problem.

On an iPhone XS, if you first connect to the site that has audio and then open another browser window to some other web site, the audio jumps up to a normal level. This work around may not work, though, on an iPhone 13.

I will PM you a link you can use to reproduce the issue.

Thanks
Comment 86 youenn fablet 2021-12-10 08:13:32 PST
That is not expected, I'll look at that.
Btw, the fix I am talking about is only for MediaStreamTrack audio rendering at the moment.

(In reply to Marcus G from comment #85)
> (In reply to youenn fablet from comment #84)
> > A first fix should have landed in iOS 15.2 beta.
> > If the issue still reproduces in the latest iOS 15.2 beta, please provide
> > repro steps.
> > Thanks.
> 
> Hello,
> 
> It seems 15.2 RC (19C56) has lost some of the progress made with 15.2 beta 4.
> 
> It seems there was a partial fix with 15.2 beta 4. The volume level was
> normal again with bluetooth devices and directly plugged apple headphones,
> but NOT with speakers. Speakers were at about 50% volume which makes it
> difficult to use the app.
> 
> But with 15.2 RC (19C56) we are experiencing the same issue as before.  Low
> audio in all devices unchanged from the original problem.
> 
> On an iPhone XS, if you first connect to the site that has audio and then
> open another browser window to some other web site, the audio jumps up to a
> normal level. This work around may not work, though, on an iPhone 13.
> 
> I will PM you a link you can use to reproduce the issue.
> 
> Thanks
Comment 87 seanoshea 2021-12-13 10:38:16 PST
I see 15.2 is out now. Is this fix considered closed for all iPhone models now (I did see some chatter in this bug report about iPhone XS still having this issue)
Comment 88 Marcus G 2021-12-13 10:46:53 PST
(In reply to seanoshea from comment #87)
> I see 15.2 is out now. Is this fix considered closed for all iPhone models
> now (I did see some chatter in this bug report about iPhone XS still having
> this issue)

15.2 RC (19C56) on an iPhone XS does not resolve the low audio issue as far as I can tell. We still have the original issue with no change.
Comment 89 Mahmoud 2021-12-13 11:12:42 PST
Hey everyone.
I tried it on our WEBRtc based site with the new 15.2 on an iPhone 11 pro max device and it seems to be resolved.

You can test it here: https://airtalk.live
Comment 90 Peter 2021-12-13 11:23:30 PST
I have tested with 15.2 RC in my own WebRTC app and I would say it’s improved but is definitely not “fixed”. On an iPhone 13 Pro which has perhaps the loudest and clearest speakers of any iPhone, turning the volume up to 100% makes it just barely loud enough to be usable. This can’t possibly be considered acceptable, as any other audio played at this volume would be blaring and heard from a long distance. By comparison, the WebRTC audio is just barely loud enough to be used when held 10 inches away from your face.
Comment 91 Kat 2021-12-13 12:55:18 PST
Tested with IOS 15.2 and it definitely is not fixed.
Comment 92 Ed Umansky 2021-12-13 14:42:14 PST
I tested this with the newly released 15.2, and the issue is slightly improved but not fixed. It looks like now the audio comes out of both the earpiece speaker at the top of the phone and the main speaker at the bottom, whereas before it only came out of the earpiece. However, the audio volume is still very low, so it's a bit louder than before and semi-usable at maximum volume, but far from fixed.
Comment 93 Peter 2021-12-13 14:43:41 PST
^ My results are exactly the same as Ed. I have no idea how this can be marked as fixed.
Comment 94 Mahmoud 2021-12-14 03:31:41 PST
+1 

My obervation was too fast yesterday. It seems volume level is increased but not to a satisfying level unfortunately.
Comment 95 Jacob 2021-12-14 08:57:05 PST
We are also seeing that it is improved but not fixed, still low unless at full volume.
Comment 96 Michael Korkaris 2021-12-15 01:11:22 PST
Any workarounds on this? Still waiting for a fix
Comment 97 Varun D 2021-12-15 02:22:41 PST
(In reply to Michael Korkaris from comment #96)
> Any workarounds on this? Still waiting for a fix

I have one working - please check my previous comments.
Comment 98 Yuwei Zhang 2021-12-22 00:53:24 PST
15.3(19D5026g) still has not fixed this problem, I hope Apple engineers can tell the cause of this problem and ways to avoid it.
Comment 99 Phong Le 2021-12-22 01:03:04 PST
(In reply to Yuwei Zhang from comment #98)
> 15.3(19D5026g) still has not fixed this problem, I hope Apple engineers can
> tell the cause of this problem and ways to avoid it.

Sad. My customers now are very disappointed with the issue. Hope Apple can spend time to investigate and resolve it in 15.4 version :(
Comment 100 GARY 2022-01-07 10:23:11 PST
(In reply to neo from comment #18)
> (In reply to Phong Le from comment #16)
> > Could you guide about how to use AudioContext to play this remote stream? I
> > researched and when using AudioContext to play, we must attach with an audio
> > element. Thanks
> 
> i tested iOS 15. (wkWebview)
> 
> // audio stream example
>  function connectToSpeaker(remoteAudioStream: MediaStream, gain: number) {
>     const context: AudioContext = window.AudioContext ||
> window.webkitAudioContext;
>     const audioNode = context.createMediaStreamSource(remoteAudioStream);
>     const gainNode: GainNode = context.createGain();
>     // some device volume too low ex) iPad
>     gainNode.gain.value = gain;
>     audioNode.connect(gainNode);
>     gainNode.connect(context.destination);
>   } 
> 
> and i'm not append video(with audio) element to document body. 
> i use canvas.

I have embedded a YouTube live stream into my iOS app, and I am getting very low volume, even with the device volume and YouTube volume at MAX, so I assume I am experiencing the bug reported here.  I would like to try your solution; however, my app is coded entirely in Objective C, and I have no Swift coding knowledge.

Normally, I can convert simple Swift code to Objective C, but I tried for several hours with your code, and got nowhere.  I even tried adding a Swift module to my app, but the compiler complained about not finding the MediaStream, AudioContext, and GainNode types.  Importing every framework I could think of had no effect.

Any chance you could provide an Objective C version of your solution?
Comment 101 GARY 2022-01-07 11:18:14 PST
(In reply to neo from comment #18)
> (In reply to Phong Le from comment #16)
> > Could you guide about how to use AudioContext to play this remote stream? I
> > researched and when using AudioContext to play, we must attach with an audio
> > element. Thanks
> 
> i tested iOS 15. (wkWebview)
> 
> // audio stream example
>  function connectToSpeaker(remoteAudioStream: MediaStream, gain: number) {
>     const context: AudioContext = window.AudioContext ||
> window.webkitAudioContext;
>     const audioNode = context.createMediaStreamSource(remoteAudioStream);
>     const gainNode: GainNode = context.createGain();
>     // some device volume too low ex) iPad
>     gainNode.gain.value = gain;
>     audioNode.connect(gainNode);
>     gainNode.connect(context.destination);
>   } 
> 
> and i'm not append video(with audio) element to document body. 
> i use canvas.

Upon further investigation, I see now that WebRTC is a framework in and of itself, and I realize that your code may not actually be Swift.  I was wondering why I had to change the ‘const’ keywords to ‘let’ and the ‘function’ keyword to ‘func’.  :-)

Now I am not even sure that my request for an Objective C version of your code makes any sense?
Comment 102 rychouwei 2022-01-09 18:17:23 PST
(In reply to GARY from comment #101)
> (In reply to neo from comment #18)
> > (In reply to Phong Le from comment #16)
> > > Could you guide about how to use AudioContext to play this remote stream? I
> > > researched and when using AudioContext to play, we must attach with an audio
> > > element. Thanks
> > 
> > i tested iOS 15. (wkWebview)
> > 
> > // audio stream example
> >  function connectToSpeaker(remoteAudioStream: MediaStream, gain: number) {
> >     const context: AudioContext = window.AudioContext ||
> > window.webkitAudioContext;
> >     const audioNode = context.createMediaStreamSource(remoteAudioStream);
> >     const gainNode: GainNode = context.createGain();
> >     // some device volume too low ex) iPad
> >     gainNode.gain.value = gain;
> >     audioNode.connect(gainNode);
> >     gainNode.connect(context.destination);
> >   } 
> > 
> > and i'm not append video(with audio) element to document body. 
> > i use canvas.
> 
> Upon further investigation, I see now that WebRTC is a framework in and of
> itself, and I realize that your code may not actually be Swift.  I was
> wondering why I had to change the ‘const’ keywords to ‘let’ and the
> ‘function’ keyword to ‘func’.  :-)
> 
> Now I am not even sure that my request for an Objective C version of your
> code makes any sense?

The code on comment #18 is Javascript code. not Objective c or Swift
Comment 103 GARY 2022-01-09 21:17:49 PST
(In reply to rychouwei from comment #102)
> (In reply to GARY from comment #101)
> > (In reply to neo from comment #18)
> > > (In reply to Phong Le from comment #16)
> > > > Could you guide about how to use AudioContext to play this remote stream? I
> > > > researched and when using AudioContext to play, we must attach with an audio
> > > > element. Thanks
> > > 
> > > i tested iOS 15. (wkWebview)
> > > 
> > > // audio stream example
> > >  function connectToSpeaker(remoteAudioStream: MediaStream, gain: number) {
> > >     const context: AudioContext = window.AudioContext ||
> > > window.webkitAudioContext;
> > >     const audioNode = context.createMediaStreamSource(remoteAudioStream);
> > >     const gainNode: GainNode = context.createGain();
> > >     // some device volume too low ex) iPad
> > >     gainNode.gain.value = gain;
> > >     audioNode.connect(gainNode);
> > >     gainNode.connect(context.destination);
> > >   } 
> > > 
> > > and i'm not append video(with audio) element to document body. 
> > > i use canvas.
> > 
> > Upon further investigation, I see now that WebRTC is a framework in and of
> > itself, and I realize that your code may not actually be Swift.  I was
> > wondering why I had to change the ‘const’ keywords to ‘let’ and the
> > ‘function’ keyword to ‘func’.  :-)
> > 
> > Now I am not even sure that my request for an Objective C version of your
> > code makes any sense?
> 
> The code on comment #18 is Javascript code. not Objective c or Swift

Thanks for the info.  I guess I should have figured that, since the WebKit engine is JavaScript; however, my only exposure to WebKit has been via the use of its WKWebView, which I access from Objective C.  (In reply to rychouwei from comment #102)
> (In reply to GARY from comment #101)
> > (In reply to neo from comment #18)
> > > (In reply to Phong Le from comment #16)
> > > > Could you guide about how to use AudioContext to play this remote stream? I
> > > > researched and when using AudioContext to play, we must attach with an audio
> > > > element. Thanks
> > > 
> > > i tested iOS 15. (wkWebview)
> > > 
> > > // audio stream example
> > >  function connectToSpeaker(remoteAudioStream: MediaStream, gain: number) {
> > >     const context: AudioContext = window.AudioContext ||
> > > window.webkitAudioContext;
> > >     const audioNode = context.createMediaStreamSource(remoteAudioStream);
> > >     const gainNode: GainNode = context.createGain();
> > >     // some device volume too low ex) iPad
> > >     gainNode.gain.value = gain;
> > >     audioNode.connect(gainNode);
> > >     gainNode.connect(context.destination);
> > >   } 
> > > 
> > > and i'm not append video(with audio) element to document body. 
> > > i use canvas.
> > 
> > Upon further investigation, I see now that WebRTC is a framework in and of
> > itself, and I realize that your code may not actually be Swift.  I was
> > wondering why I had to change the ‘const’ keywords to ‘let’ and the
> > ‘function’ keyword to ‘func’.  :-)
> > 
> > Now I am not even sure that my request for an Objective C version of your
> > code makes any sense?
> 
> The code on comment #18 is Javascript code. not Objective c or Swift

Thanks for the info.  Since WebKit’s engine is JavaScript, I probably should have figured that.  My total exposure to WebKit has been limited to the WKWebView object, which I have been able to access in Xcode via Objective C, but I guess I will need to start looking into Xcode’s JavaScriptCore framework ... if I want to solve this low volume problem.
Comment 104 Silvia Pfeiffer 2022-01-13 15:43:22 PST
Hi all,

Is there any indication that this will be worked on?

We have extensive problems with our video telehealth platform.
All patients that use iOS (iPhone or iPad) and don't use headphones are exposed to this bug.
We have over 70,000 clinicians using our platform and thousands of patients each day that cannot hold a consultation.

We've had to implement a volume slider in our web app for patients to increase the volume and even then they cannot properly hear the clinician, ending up moving the call to phones instead of webrtc.

It's starting to become a reputational issue for us with people not trusting our platform any longer.

Can I please please get an indication that this is going to get fixed. Thousands of patients and clinicians will be grateful.
Comment 105 Silvia Pfeiffer 2022-01-13 15:46:14 PST
I'm told the actual problem is under WebRTC, so @othermaciej and @youenn
Comment 106 Simon Fraser (smfr) 2022-01-20 19:43:18 PST
The "See also" bugs above relate to additional fixes in this area.
Comment 107 Silvia Pfeiffer 2022-01-22 13:41:39 PST
(In reply to Simon Fraser (smfr) from comment #106)
> The "See also" bugs above relate to additional fixes in this area.

Those fixes were applied in November and released with 15.2 and neither 15.2 nor 15.3 has this issue fixed.

We now have to use the AudioContext approach to by default increase iOS volume for our video calls by 800% to allow hearing the audio as the majority of our customers don't use headsets and wouldn't know how to turn up the volume via a slider in the app as compared to the volume button on the device. We just hope that for those that do use a headset, they are fast at turning down the volume before destroying their hearing.

This is not a tenable solution. Please prioritise working on this issue - 4 months has been a long time!
Comment 108 Peter 2022-01-22 14:37:13 PST
It’s incomprehensible that this bug has gone on so long. It’s akin to abandoning WebRTC on iOS.
Comment 109 youenn fablet 2022-01-24 11:18:40 PST
(In reply to Silvia Pfeiffer from comment #107)
> (In reply to Simon Fraser (smfr) from comment #106)
> > The "See also" bugs above relate to additional fixes in this area.
> 
> Those fixes were applied in November and released with 15.2 and neither 15.2
> nor 15.3 has this issue fixed.

One fix has shipped, not the others.

> We now have to use the AudioContext approach to by default increase iOS
> volume for our video calls by 800% to allow hearing the audio as the
> majority of our customers don't use headsets and wouldn't know how to turn
> up the volume via a slider in the app as compared to the volume button on
> the device. We just hope that for those that do use a headset, they are fast
> at turning down the volume before destroying their hearing.

I am surprised x8 is needed on latest iOS, https://bugs.webkit.org/show_bug.cgi?id=232941 is doing x5.

> This is not a tenable solution. Please prioritise working on this issue - 4
> months has been a long time!

https://bugs.webkit.org/show_bug.cgi?id=233316 should fully fix the audio level issue.
I'll let know this thread when this gets testable.
Comment 110 Sun 2022-01-27 04:48:33 PST
Here at a french agency, we first noticed the issue in September 2021 (https://discussions.apple.com/thread/253190228?answerId=255976213022&cid=em-com-apple_watches_email_thread_owner-view_the_full_discussion-en-us-11192020#255976213022). We are in contact with Apple since October 2021 for this issue that severely affects one of our projet. Despite many exchanges, a very nice lady on the phone, and the fact that I had to share my iPhone logs, nothing useful from "the tech team" behind. Looks like "they don't reproduce"...

Just uploaded to OS 15.3 ---> STILL NOT FIXED

Seriously, Apple, are you working on it, what is going on? Has someone has any news?
Comment 111 Bernardo Gontijo 2022-01-27 06:36:20 PST
It is so sad that a company like Apple left this open for so long.
We have lost a lot of clients because of this issue.
We are thinking of creating an app to stop using safari.
Comment 112 youenn fablet 2022-01-27 10:34:56 PST
Could anybody try out iOS 15.4 latest beta?
Comment 113 Marcus G 2022-01-27 12:41:59 PST
(In reply to youenn fablet from comment #112)
> Could anybody try out iOS 15.4 latest beta?

Has this been released for public beta or is it developer? My iPhone XS (public beta) is not finding it (currently at 15.3-19D49). I will test it if I can get it installed.
Comment 114 daginge 2022-01-27 22:03:28 PST
Reports on Twitter that the issue has been resolved in 15.4 on iPhone XS. https://twitter.com/christer_a_j/status/1486828979168464897?s=21 I’ll get around to testing my devices tomorrow.
Comment 115 Yuwei Zhang 2022-01-27 23:14:56 PST
I just updated the latest 15.4 beta on my iphone 12 and it seems to have fixed the issue, I will continue to test more.
Comment 116 youenn fablet 2022-01-28 00:55:34 PST
Thanks for the testing, please ping me or file any bug you may encounter during that testing.

To summarise:
- In iOS 15 and 15.1, web apps might need a workaround with a big volume gain
- In iOS 15.2 and iOS 15.3, web apps may or may not need the gain workaround. If needed, it should be smaller than previous iOS 14 versions.
- In iOS 15.4 beta, no workaround should be needed.
Comment 117 Misha 2022-02-02 02:14:31 PST
(In reply to youenn fablet from comment #116)
> Thanks for the testing, please ping me or file any bug you may encounter
> during that testing.
> 
> To summarise:
> - In iOS 15 and 15.1, web apps might need a workaround with a big volume gain
> - In iOS 15.2 and iOS 15.3, web apps may or may not need the gain
> workaround. If needed, it should be smaller than previous iOS 14 versions.
> - In iOS 15.4 beta, no workaround should be needed.

Hello, thanks for pointing to this summary.
Do you know what could cause this issue? webkit bug/safari bug/ios bug?
Comment 118 Daniel ORorke - Vonage 2022-02-18 15:17:52 PST
Hi Youenn,
The problem with with the proposed workaround is that the issue is not present on all devices - iPhone 8 for example will not exhibit this behavior. Using the big audio volume gain will damage someone's device or hearing. We need more information to be able to use this workaround effectively.

Which devices do and which versions do not need this? How can we detect when the workaround is needed or may result in a very unpleasant (deafening) experience for the user? "sometimes" for iOS 15 - 15.3.x is not specific enough to safely implement.

Glad this appears to be resolved in iOS 15.4.



(In reply to youenn fablet from comment #116)
> Thanks for the testing, please ping me or file any bug you may encounter
> during that testing.
> 
> To summarise:
> - In iOS 15 and 15.1, web apps might need a workaround with a big volume gain
> - In iOS 15.2 and iOS 15.3, web apps may or may not need the gain
> workaround. If needed, it should be smaller than previous iOS 14 versions.
> - In iOS 15.4 beta, no workaround should be needed.
Comment 119 Krieger 2022-02-21 05:00:17 PST
(In reply to youenn fablet from comment #116)
> Thanks for the testing, please ping me or file any bug you may encounter
> during that testing.
> 
> To summarise:
> - In iOS 15 and 15.1, web apps might need a workaround with a big volume gain
> - In iOS 15.2 and iOS 15.3, web apps may or may not need the gain
> workaround. If needed, it should be smaller than previous iOS 14 versions.
> - In iOS 15.4 beta, no workaround should be needed.

Hi youenn,

I tested the fix with iPhone xs Max, 15.4 beta, and found the following:

- with iOS 15.4 (19E5209h) everything works fine, no low audio issue present

and today I upgraded to the latest 15.4 beta:

- with iOS 15.4 (19E5225g) it works fine, until I turn off the microphone. While the microphone is enabled, the audio is at the correct volume level,  but the audio is low again when the mic is turned off.

Seems like the new beta added a similar issue what was present before. Can you check it please?
Comment 120 Austin 2022-03-02 08:57:33 PST
I have tested on a iPhone 7 Plus running 15.4 Beta (19E5241a) and the issue is still happening. 

Steps to reproduce:
1. Open 2 tabs in Safari and navigate to an application that uses WebRTC in both tabs.
2. Start and complete 1 call in first tab.
3. Switch to Tab 2 and repeat step 2. 
4. Repeat steps 2 & 3 at least 2-3 times to see issue occur.

It appears that after certain amount of back to back calls Safari starts routing the audio to the headpiece instead of the external speakers.
Comment 121 Austin 2022-03-02 08:57:56 PST
I have tested on a iPhone 7 Plus running 15.4 Beta (19E5241a) and the issue is still happening. 

Steps to reproduce:
1. Open 2 tabs in Safari and navigate to an application that uses WebRTC in both tabs.
2. Start and complete 1 call in first tab.
3. Switch to Tab 2 and repeat step 2. 
4. Repeat steps 2 & 3 at least 2-3 times to see issue occur.

It appears that after certain amount of back to back calls Safari starts routing the audio to the headpiece instead of the external speakers.
Comment 122 Simon Fraser (smfr) 2022-03-02 09:29:50 PST
(In reply to Austin from comment #121)
> I have tested on a iPhone 7 Plus running 15.4 Beta (19E5241a) and the issue
> is still happening. 
> 
> Steps to reproduce:
> 1. Open 2 tabs in Safari and navigate to an application that uses WebRTC in
> both tabs.
> 2. Start and complete 1 call in first tab.
> 3. Switch to Tab 2 and repeat step 2. 
> 4. Repeat steps 2 & 3 at least 2-3 times to see issue occur.
> 
> It appears that after certain amount of back to back calls Safari starts
> routing the audio to the headpiece instead of the external speakers.

This seems to be a routing issue, rather than a volume issue. I filed it as bug 237375.
Comment 123 mh 2022-03-10 10:31:00 PST
(In reply to youenn fablet from comment #116)
> Thanks for the testing, please ping me or file any bug you may encounter
> during that testing.
> 
> To summarise:
> - In iOS 15 and 15.1, web apps might need a workaround with a big volume gain
> - In iOS 15.2 and iOS 15.3, web apps may or may not need the gain
> workaround. If needed, it should be smaller than previous iOS 14 versions.
> - In iOS 15.4 beta, no workaround should be needed.

We added this workaround & it has been working until recently it was reported that the audio no longer plays when the browser or tab is backgrounded. It seems like this could be due to another webkit bug that is still present on 15.4 https://bugs.webkit.org/show_bug.cgi?id=231105 but I'm curious if anyone has encountered this issue & has a solution.
Comment 124 youenn fablet 2022-03-11 05:29:46 PST
> We added this workaround & it has been working until recently it was
> reported that the audio no longer plays when the browser or tab is
> backgrounded. It seems like this could be due to another webkit bug that is
> still present on 15.4 https://bugs.webkit.org/show_bug.cgi?id=231105 but I'm
> curious if anyone has encountered this issue & has a solution.

This is probably the right bug.
I wonder whether you can call audioContext.resume() once the page is backgrounded to restart the audio context.
Comment 125 Lee 2022-03-29 07:23:02 PDT
I'm still seeing this issue on 15.4 (19E241) - Media is still imperceptibly quiet while a microphone stream is active.
Comment 126 Matthew Windwer 2022-04-27 12:09:39 PDT
Created attachment 458458 [details]
feedback noises
Comment 127 Matthew Windwer 2022-04-27 12:10:23 PDT
We identified a new issue that is causing echo and feedback noises during WebRTC calls on older iPad models as soon as they are updated to 15.4

We have identified (based on dozens of customer reports over the last few weeks as the iOS 15.4 update propagates) that this issue occurs when a participant in the group is on an iPad 6th generation, and have also gotten reports that the 10.5" iPad Pro causes this issue as well. We are not able to reproduce the issue on newer iPads.

We finally got our hands on an iPad 6th generation last night, updated it to 15.4.1, and were able to reproduce this issue on our own site as well as https://talky.io/.  I am not affiliated with Talky but they use WebRTC and the issue is reproducible there.

About 60+ seconds into the call (this varies), the other participants will start to hear feedback coming from the iPad 6th generation microphone.  As soon as the iPad 6 leaves the call, the feedback stops. Counterintuitively, the player on the iPad 6 doesn't hear the echo. A successful workaround that we have verified with many of our customers is to have the player on the offending device use a headset, such as AirPods.

Attached is an example of feedback noises reported by one of our customers.

I'm looking forward to hearing any responses from Apple and the WebRTC community about this new issue.
Comment 128 Gavin Lefebvre 2022-04-27 12:14:24 PDT
Hi Matt- can confirm that iPad 7th Generation is impacted also. I have submitted FB9975516 via feedbackassistant.apple.com so Apple is aware. However, it might be worth creating a separate issue on bugzilla here?
Comment 129 Matthew Windwer 2022-04-27 12:22:07 PDT
(In reply to Gavin Lefebvre from comment #128)
> Hi Matt- can confirm that iPad 7th Generation is impacted also. I have
> submitted FB9975516 via feedbackassistant.apple.com so Apple is aware.
> However, it might be worth creating a separate issue on bugzilla here?

We have also gotten some reports from iPad 7th generation. All 3 devices affected (iPad 6th generation, iPad 7th generation, and iPad Pro 10.5") have the A10 chip.

I will file a new bug if that is the best path forward. I haven't heard this issue acknowledged publicly (yet) so I wanted to announce here first to see what the best path forward is.
Comment 130 Matthew Windwer 2022-04-28 11:22:41 PDT
(In reply to Gavin Lefebvre from comment #128)
> Hi Matt- can confirm that iPad 7th Generation is impacted also. I have
> submitted FB9975516 via feedbackassistant.apple.com so Apple is aware.
> However, it might be worth creating a separate issue on bugzilla here?

Hi Gavin,

I filed a new bug for the Echo/Feedback issue on iOS 15.4: https://bugs.webkit.org/show_bug.cgi?id=239860


Thanks for any additional information that you can provide.
Comment 131 Shikher 2022-07-26 05:39:00 PDT
The issue is still there in 15.5
Comment 132 HALA CHAT 2023-03-01 23:54:47 PST
Hi everyone,

I am also seeing this issue with iOS15 <a href="https://hala.chat/en">Voice Chat With Random</a>