<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>218012</bug_id>
          
          <creation_ts>2020-10-21 02:31:56 -0700</creation_ts>
          <short_desc>Audio Volume reduces considerably on accepting the mic permissions.</short_desc>
          <delta_ts>2026-03-16 01:47:43 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Audio</component>
          <version>Safari 14</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=233316</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Critical</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>asanand</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>541657414</cc>
    
    <cc>a</cc>
    
    <cc>andres.traumann.01</cc>
    
    <cc>aqlykamarudin</cc>
    
    <cc>bfulgham</cc>
    
    <cc>bryce.aebi</cc>
    
    <cc>cdumez</cc>
    
    <cc>ch.chiang</cc>
    
    <cc>david.goelzhaeuser</cc>
    
    <cc>eric.carlson</cc>
    
    <cc>glefebvr</cc>
    
    <cc>homerlex</cc>
    
    <cc>jameshoward</cc>
    
    <cc>jer.noble</cc>
    
    <cc>juberti</cc>
    
    <cc>justinhiggy</cc>
    
    <cc>ngode</cc>
    
    <cc>peng.liu6</cc>
    
    <cc>philipp.hancke</cc>
    
    <cc>smoley</cc>
    
    <cc>stuart.todd</cc>
    
    <cc>taimoor</cc>
    
    <cc>tobias.bley</cc>
    
    <cc>varundabke</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
    
    <cc>zale</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1700116</commentid>
    <comment_count>0</comment_count>
    <who name="">asanand</who>
    <bug_when>2020-10-21 02:31:56 -0700</bug_when>
    <thetext>Source code - https://github.com/ashishanand26cs/ashishanand26cs.github.io/blob/master/index.html 

Steps to reproduce:-

In &quot;Website Settings&quot; of Safari, set the microphone&apos;s permission to &quot;Ask&quot;. Open page &quot;https://ashishanand26cs.github.io&quot; on safari(ios version 14.0.1)&quot;
Clicking on the webpage generates Gunshots. Observe the volume of the gunshot for below two cases.

Case 1:-
On opening the webpage the popup generates &quot;Would Like To Access the Microphone&quot;
Press &quot;Allow&quot;. Now press click on the white page. It will generate the Gunshots on every click.
Observer the audio volume.

Case 2:-
Again refresh the page. It will again generate &quot;Would Like To Access the Microphone&quot;
Press &quot;Cancel&quot;. Now press click on the white page. It will generate the Gunshots on every click.
Observer the audio volume.


Audio Volume generated in &quot;Case 1&quot; is significantly lower than &quot;Case 2&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1700223</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2020-10-21 09:26:18 -0700</bug_when>
    <thetext>Does not reproduce on macOS but I can reproduce on iOS 14.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1700821</commentid>
    <comment_count>2</comment_count>
    <who name="Smoley">smoley</who>
    <bug_when>2020-10-22 13:57:21 -0700</bug_when>
    <thetext>Also reproduces on iOS 13.5.1 using the provided link.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1700822</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-10-22 13:57:44 -0700</bug_when>
    <thetext>&lt;rdar://problem/70588151&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1703441</commentid>
    <comment_count>4</comment_count>
    <who name="">asanand</who>
    <bug_when>2020-11-01 21:45:38 -0800</bug_when>
    <thetext>Hi
Do we have any update on this issue? 
Is the root cause identified? When can we expect the fix for this issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1703466</commentid>
    <comment_count>5</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2020-11-02 01:57:42 -0800</bug_when>
    <thetext>When starting capturing, we are changing of audio category which might explain the issue.The following fiddle helps: https://jsfiddle.net/af147yqz/

If you start capturing, then create the audio context, you will get the audio volume as high.

If you create the audio context, audio volume will be low and will stay like this, even after starting capture.
If during capture, you will suspend/resume the audio context, audio volume will be high.

Hopefully, that can help you find a temporary workaround.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1705261</commentid>
    <comment_count>6</comment_count>
    <who name="">ngode</who>
    <bug_when>2020-11-06 08:55:49 -0800</bug_when>
    <thetext>We tried the WAR, however, unfortunately, it seems to be working just on a few devices - for several devices, the WAR does not have any effect

Few further isolations which we observed:
- Volume is also reset for pre-existing audio contexts, even just if a new audio context is created when recording starts
- On devices which WAR doesn&apos;t work, suspending/Resuming audio stream/track makes no difference

Devices on which WAR works: iPad Pro 12.9-in (Second Generation), iPhone 7, iPhone X
Devices on which WAR doesn&apos;t work: iPad Pro 11-in (Third Generation), iPhone XR</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1709264</commentid>
    <comment_count>7</comment_count>
    <who name=":fippo">philipp.hancke</who>
    <bug_when>2020-11-19 13:40:24 -0800</bug_when>
    <thetext>I can reproduce quite reliably after finding out they key is rotating the device somehow.
I can reproduce on an iphone SE (2020) and both in iOS 14.1 and 14.2. Upgrading to 14.2 caused a (hopefullly) unrelated webaudio issue which makes the audio stutter for several seconds.

The minimal sample is at https://fippo.github.io/htmlthings/aadz4a.html
It plays a constant tone using webaudio and visualizes the audio level webrtc sees.

Steps to reproduce low audio volume:
1/ open Safari, put into portrait mode
2/ put phone on the desk, do not hold it
3/ open https://fippo.github.io/htmlthings/aadz4a.html
4/ click &quot;play noise&quot; button. This emits a constant tone.
5/ click &quot;request getusermedia&quot; button. Audio volume usually increases. Note that the graph which shows the audio level webrtc computes stays at 1.0
6/ reload, pick up phone, rotate to portrait mode, put phone on the desk
7/ click &quot;play noise&quot; button. This emits a constant tone roughly the same volume as in step 4.
8/ click &quot;request getusermedia&quot; button&quot;. Audio volume drops considerably. Note that the graph which shows the audio level webrtc computes stays at 1.0

For extra fun, continue testing:
9/ pick up phone, put in portrait mode, put down phone
10/ reload
11/ click &quot;play noise&quot; button followed by getUserMedia button
12/ Observe low volume

For even more fun, kill safari, then repeat but starting from landscape mode and switch to portrait mode.

https://bugs.webkit.org/show_bug.cgi?id=198545#c29 suggests rotation fixes *some* issue.
This sounds like some kind of &quot;audio ducking&quot; issue.
This is not detectable from what I can see.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1709865</commentid>
    <comment_count>8</comment_count>
    <who name="">ngode</who>
    <bug_when>2020-11-23 00:01:57 -0800</bug_when>
    <thetext>Hi, I wonder if there were any updates on this issue?

This seems to be reproing without device rotation too for us</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1717842</commentid>
    <comment_count>9</comment_count>
    <who name="">asanand</who>
    <bug_when>2021-01-06 20:25:58 -0800</bug_when>
    <thetext>We are still seeing this issue on 14.3. The workaround mentioned is not working.

Do we have any updates on this issue? 
When can we expect the fix for this issue?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1726524</commentid>
    <comment_count>10</comment_count>
    <who name="">asanand</who>
    <bug_when>2021-02-07 17:57:03 -0800</bug_when>
    <thetext>We are still seeing this issue on 14.4. 

If we play the audio element again(WAR) it increases the volume but only until 50 percent.

Is there a plan for a fix in some upcoming version?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1737518</commentid>
    <comment_count>11</comment_count>
    <who name="Andres Traumann">andres.traumann.01</who>
    <bug_when>2021-03-09 02:55:33 -0800</bug_when>
    <thetext>We still have the bug on 14.5 beta.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1741786</commentid>
    <comment_count>12</comment_count>
    <who name="James Howard">jameshoward</who>
    <bug_when>2021-03-19 10:54:59 -0700</bug_when>
    <thetext>It looks like Safari uses the following options when setting the audio category to play and record:

auto options = AVAudioSessionCategoryOptionAllowBluetooth | AVAudioSessionCategoryOptionMixWithOthers;

https://git.webkit.org/?p=WebKit-https.git;a=blob;f=Source/WebCore/platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm;hb=29d45f52c2db831d9b6a7d9e96dfd44624984c24#l110

I think this means when the mic turns on that the receiver speaker becomes the only one active (the little earpiece one on a phone). This is probably a reasonable set of options for when you&apos;re holding the phone like a phone, but it&apos;s maybe not great for video chat or music apps. Using AVAudioSessionCategoryOptionDefaultToSpeaker would be better for our use case, but I&apos;m not sure what the fallout would be by changing it across the board. I kind of think maybe AVAudioSessionCategoryOptionDefaultToSpeaker better fits what most web apps want to do; most web apps aren&apos;t trying to just make phone calls.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1741791</commentid>
    <comment_count>13</comment_count>
    <who name=":fippo">philipp.hancke</who>
    <bug_when>2021-03-19 11:03:13 -0700</bug_when>
    <thetext>Would it be possible to use AVAudioSessionCategoryOptionDefaultToSpeaker when there is a stereo track playing?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1755639</commentid>
    <comment_count>14</comment_count>
    <who name="Andres Traumann">andres.traumann.01</who>
    <bug_when>2021-04-30 02:50:05 -0700</bug_when>
    <thetext>The issue seems to have disappeared in 14.5. However, it seems there is now an opposite issue, on at least one device the volume seemed to slightly increase after asking for microphone permissions. Of course this new issue is a much smaller problem, at least in my use case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1799194</commentid>
    <comment_count>15</comment_count>
    <who name="David Gölzhäuser">david.goelzhaeuser</who>
    <bug_when>2021-10-01 00:37:02 -0700</bug_when>
    <thetext>I still see this issue on iOS 15 and iOS 15.1 Beta 2.

All workarounds do not work for me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1800087</commentid>
    <comment_count>16</comment_count>
    <who name="">asanand</who>
    <bug_when>2021-10-04 09:28:41 -0700</bug_when>
    <thetext>This issue still seems to be happening on iOS 15.
The audio is switching to receiver speakers on enabling mic</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1800401</commentid>
    <comment_count>17</comment_count>
    <who name="David Gölzhäuser">david.goelzhaeuser</who>
    <bug_when>2021-10-04 23:18:34 -0700</bug_when>
    <thetext>I am currently working on a workaround, I made some progress.


Here is our use case.

Web based WebRTC Application that initially receives a Video Stream, then when calling the remote peer the local and remote audio will be enabled

The current implementation acquired the devices local microphone stream and added its track to the RTCPeerConnection, this triggered a renegotiate and eventually in receiving the remote peers audio stream. =&gt; Remote Audio was emitted through the earpiece

I restructured this behavior because I noticed the correct speaker is used when first receiving the remote peers audio stream and then acquiring the local devices microphone stream. =&gt; Remote Audio was emitted through the speaker

However, this only works once per app livecycle (Cordova based App). So I am still working on it, but its an improvement.


FYI:
I simply add the empty Track `audioContext.createMediaStreamDestination().stream.getAudioTracks()[0]` to the RTCPeerConnection, then when the mic stream is acquired I simply replace the former added track with the local microphone track of the resulting RTCSender (from the RTCPeerConnections function `addTrack`)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1818075</commentid>
    <comment_count>18</comment_count>
    <who name="Varun D">varundabke</who>
    <bug_when>2021-11-28 08:55:03 -0800</bug_when>
    <thetext>Thanks for the trick.
I tried this solution. This improved audio level - but only till the code acquired MIC stream.
If I deny the Mic permission when it is asked later - the volume still continued to be good. But as soon as I say &apos;yes&apos; to mic permissions - volume goes to very low.
I am using iPhone XR with 15.1 iOS.
May I know what is your setup where it stayed High even after giving mic permissions? @David

(In reply to David Gölzhäuser from comment #17)
&gt; I am currently working on a workaround, I made some progress.
&gt; 
&gt; 
&gt; Here is our use case.
&gt; 
&gt; Web based WebRTC Application that initially receives a Video Stream, then
&gt; when calling the remote peer the local and remote audio will be enabled
&gt; 
&gt; The current implementation acquired the devices local microphone stream and
&gt; added its track to the RTCPeerConnection, this triggered a renegotiate and
&gt; eventually in receiving the remote peers audio stream. =&gt; Remote Audio was
&gt; emitted through the earpiece
&gt; 
&gt; I restructured this behavior because I noticed the correct speaker is used
&gt; when first receiving the remote peers audio stream and then acquiring the
&gt; local devices microphone stream. =&gt; Remote Audio was emitted through the
&gt; speaker
&gt; 
&gt; However, this only works once per app livecycle (Cordova based App). So I am
&gt; still working on it, but its an improvement.
&gt; 
&gt; 
&gt; FYI:
&gt; I simply add the empty Track
&gt; `audioContext.createMediaStreamDestination().stream.getAudioTracks()[0]` to
&gt; the RTCPeerConnection, then when the mic stream is acquired I simply replace
&gt; the former added track with the local microphone track of the resulting
&gt; RTCSender (from the RTCPeerConnections function `addTrack`)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1818078</commentid>
    <comment_count>19</comment_count>
    <who name="Varun D">varundabke</who>
    <bug_when>2021-11-28 09:10:15 -0800</bug_when>
    <thetext>Update: the above trick did work for me in iOS chrome *once, but not always* - but never in Safari. 
(In reply to Varun D from comment #18)
&gt; Thanks for the trick.
&gt; I tried this solution. This improved audio level - but only till the code
&gt; acquired MIC stream.
&gt; If I deny the Mic permission when it is asked later - the volume still
&gt; continued to be good. But as soon as I say &apos;yes&apos; to mic permissions - volume
&gt; goes to very low.
&gt; I am using iPhone XR with 15.1 iOS.
&gt; May I know what is your setup where it stayed High even after giving mic
&gt; permissions? @David
&gt; 
&gt; (In reply to David Gölzhäuser from comment #17)
&gt; &gt; I am currently working on a workaround, I made some progress.
&gt; &gt; 
&gt; &gt; 
&gt; &gt; Here is our use case.
&gt; &gt; 
&gt; &gt; Web based WebRTC Application that initially receives a Video Stream, then
&gt; &gt; when calling the remote peer the local and remote audio will be enabled
&gt; &gt; 
&gt; &gt; The current implementation acquired the devices local microphone stream and
&gt; &gt; added its track to the RTCPeerConnection, this triggered a renegotiate and
&gt; &gt; eventually in receiving the remote peers audio stream. =&gt; Remote Audio was
&gt; &gt; emitted through the earpiece
&gt; &gt; 
&gt; &gt; I restructured this behavior because I noticed the correct speaker is used
&gt; &gt; when first receiving the remote peers audio stream and then acquiring the
&gt; &gt; local devices microphone stream. =&gt; Remote Audio was emitted through the
&gt; &gt; speaker
&gt; &gt; 
&gt; &gt; However, this only works once per app livecycle (Cordova based App). So I am
&gt; &gt; still working on it, but its an improvement.
&gt; &gt; 
&gt; &gt; 
&gt; &gt; FYI:
&gt; &gt; I simply add the empty Track
&gt; &gt; `audioContext.createMediaStreamDestination().stream.getAudioTracks()[0]` to
&gt; &gt; the RTCPeerConnection, then when the mic stream is acquired I simply replace
&gt; &gt; the former added track with the local microphone track of the resulting
&gt; &gt; RTCSender (from the RTCPeerConnections function `addTrack`)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1818143</commentid>
    <comment_count>20</comment_count>
    <who name="David Gölzhäuser">david.goelzhaeuser</who>
    <bug_when>2021-11-29 00:23:25 -0800</bug_when>
    <thetext>Hi Varun,

This trick only works once per app session on WKWebView (which is also used by Chrome). I did not try this in the Safari Browser yet.

Try to close Chrome and reopen it after it worked once to see that it only works once per app session.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1819625</commentid>
    <comment_count>21</comment_count>
    <who name="Varun D">varundabke</who>
    <bug_when>2021-12-02 01:46:13 -0800</bug_when>
    <thetext>(In reply to David Gölzhäuser from comment #20)
&gt; Hi Varun,
&gt; 
&gt; This trick only works once per app session on WKWebView (which is also used
&gt; by Chrome). I did not try this in the Safari Browser yet.
&gt; 
&gt; Try to close Chrome and reopen it after it worked once to see that it only
&gt; works once per app session.

Thanks!
Did work on Safari as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1828513</commentid>
    <comment_count>22</comment_count>
    <who name="Aqly">aqlykamarudin</who>
    <bug_when>2022-01-06 00:04:37 -0800</bug_when>
    <thetext>(In reply to David Gölzhäuser from comment #17)
&gt; I am currently working on a workaround, I made some progress.
&gt; 
&gt; 
&gt; Here is our use case.
&gt; 
&gt; Web based WebRTC Application that initially receives a Video Stream, then
&gt; when calling the remote peer the local and remote audio will be enabled
&gt; 
&gt; The current implementation acquired the devices local microphone stream and
&gt; added its track to the RTCPeerConnection, this triggered a renegotiate and
&gt; eventually in receiving the remote peers audio stream. =&gt; Remote Audio was
&gt; emitted through the earpiece
&gt; 
&gt; I restructured this behavior because I noticed the correct speaker is used
&gt; when first receiving the remote peers audio stream and then acquiring the
&gt; local devices microphone stream. =&gt; Remote Audio was emitted through the
&gt; speaker
&gt; 
&gt; However, this only works once per app livecycle (Cordova based App). So I am
&gt; still working on it, but its an improvement.
&gt; 
&gt; 
&gt; FYI:
&gt; I simply add the empty Track
&gt; `audioContext.createMediaStreamDestination().stream.getAudioTracks()[0]` to
&gt; the RTCPeerConnection, then when the mic stream is acquired I simply replace
&gt; the former added track with the local microphone track of the resulting
&gt; RTCSender (from the RTCPeerConnections function `addTrack`)

Hi,

Do you mind sharing sample codes on how you did it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1828680</commentid>
    <comment_count>23</comment_count>
    <who name="ztb">zale</who>
    <bug_when>2022-01-06 11:17:28 -0800</bug_when>
    <thetext>Is a patch being proposed to address this issue as it is very serious?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1829400</commentid>
    <comment_count>24</comment_count>
    <who name="David Gölzhäuser">david.goelzhaeuser</who>
    <bug_when>2022-01-10 02:38:35 -0800</bug_when>
    <thetext>To shed a bit more light on this issue.

I created a issue using the Feedback-Assistent App on August the 3rd linking multiple WebKit bugs describing the same or similar issues (including this one).

After every Beta or Public release of iOS I check the behaviour and update the issue with the current state -&gt; No Feedback whatsoever from Apple.

As our application relies on that WebRTC Audio Calls it is a critical issue. I also created an TSI (Technical Support Incident) as our Application is available in the AppStore. The response was like &quot;You already created an issue, please use the issue to track it, we won&apos;t help you here.&quot; -&gt; TSI wasted


Now we are in 2022 with no response from Apple whatsoever. 

This is a very serious bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1829402</commentid>
    <comment_count>25</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-01-10 02:45:10 -0800</bug_when>
    <thetext>This is probably addressed by https://bugs.webkit.org/show_bug.cgi?id=233316.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1829412</commentid>
    <comment_count>26</comment_count>
    <who name="David Gölzhäuser">david.goelzhaeuser</who>
    <bug_when>2022-01-10 04:40:11 -0800</bug_when>
    <thetext>Hey Youenn,

Thanks for taking care of https://bugs.webkit.org/show_bug.cgi?id=233752 and for checking out this issue.

I just revisited the issue after the new year break and indeed, it appears to be fixed in iOS 15.3 Beta 1. I just tested it myself in the office and not via remote. (I don&apos;t know why I did suspect it not to work when I tested it in Homeoffice.)

Thanks for taking care of this 👍</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1829427</commentid>
    <comment_count>27</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-01-10 05:24:06 -0800</bug_when>
    <thetext>(In reply to David Gölzhäuser from comment #26)
&gt; Hey Youenn,
&gt; 
&gt; Thanks for taking care of https://bugs.webkit.org/show_bug.cgi?id=233752 and
&gt; for checking out this issue.
&gt; 
&gt; I just revisited the issue after the new year break and indeed, it appears
&gt; to be fixed in iOS 15.3 Beta 1. I just tested it myself in the office and
&gt; not via remote. (I don&apos;t know why I did suspect it not to work when I tested
&gt; it in Homeoffice.)
&gt; 
&gt; Thanks for taking care of this 👍

I am not sure the fix is in iOS 15.3 beta.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1829439</commentid>
    <comment_count>28</comment_count>
    <who name="David Gölzhäuser">david.goelzhaeuser</who>
    <bug_when>2022-01-10 06:20:35 -0800</bug_when>
    <thetext>I will take a close look on any upcoming iOS Beta. At least our issue is fixed on that iOS version. It&apos;s &quot;Case 2&quot; of the initial post.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1829518</commentid>
    <comment_count>29</comment_count>
    <who name="ztb">zale</who>
    <bug_when>2022-01-10 10:01:45 -0800</bug_when>
    <thetext>Hi Youenn,

Appreciate you being responsive to the community.

2 questions....

1st question....

Does this patch also address https://bugs.webkit.org/show_bug.cgi?id=230902 as I understood the core issue to be the same and should bot be fixed now in your opinion?

Second question.....

Is there any way to track when fixes get into iOS?

There are several critical bugs that are closed (https://bugs.webkit.org/show_bug.cgi?id=232822 for example) or have submitted patches but aren&apos;t in any version of iOS and once they are closed no more updates happen.

Am I missing where the released iOS version is being documented?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1830472</commentid>
    <comment_count>30</comment_count>
    <who name="David Gölzhäuser">david.goelzhaeuser</who>
    <bug_when>2022-01-13 00:01:24 -0800</bug_when>
    <thetext>After updating to iOS 15.3 Beta 2 I am able to reproduce this issue again</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1838022</commentid>
    <comment_count>31</comment_count>
    <who name="StillTravelling">stuart.todd</who>
    <bug_when>2022-02-07 00:25:40 -0800</bug_when>
    <thetext>This is definitely happening to me on iPad Pro 2019 on 15.4 beta 1. Creating the context before the capturing does not resolve the issue. Stopping the mic track does not return the volume to normal.

Testing on iPhone XS on 15.4 beta 1 results in some differences. Stopping the mic track does not return the volume to normal, however if I restart the mic capture again after originally getting permissions, the volume is normal.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1838024</commentid>
    <comment_count>32</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-02-07 01:16:35 -0800</bug_when>
    <thetext>(In reply to StillTravelling from comment #31)
&gt; This is definitely happening to me on iPad Pro 2019 on 15.4 beta 1. Creating
&gt; the context before the capturing does not resolve the issue. Stopping the
&gt; mic track does not return the volume to normal.

The fix is only affecting audio rendering of MediaStreamTrack, not WebAudio (potentially other non-MediaStreamTrack media elements as well).
The current workaround for getting regular volume for web audio is to render WebAudio through a MediaStreamAudioDestinationNode. 

&gt; Testing on iPhone XS on 15.4 beta 1 results in some differences. Stopping
&gt; the mic track does not return the volume to normal, however if I restart the
&gt; mic capture again after originally getting permissions, the volume is normal.

Thanks for the testing.
I filed https://bugs.webkit.org/show_bug.cgi?id=236219, let&apos;s continue the discussion there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1839013</commentid>
    <comment_count>33</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-02-08 21:40:17 -0800</bug_when>
    <thetext>Please continue the investigation of remaining issues in Bug 236219.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1938053</commentid>
    <comment_count>34</comment_count>
    <who name="Bryce Aebi">bryce.aebi</who>
    <bug_when>2023-03-01 22:59:06 -0800</bug_when>
    <thetext>Issue persists on iOS 16.2

Our entire web app is rendered unusable on iPhone due to this bug. I am happy to assist in any way to get this bug resolved. Thank you</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1938054</commentid>
    <comment_count>35</comment_count>
    <who name="Bryce Aebi">bryce.aebi</who>
    <bug_when>2023-03-01 22:59:23 -0800</bug_when>
    <thetext>Issue persists on iOS 16.2

Our entire web app is rendered unusable on iPhone due to this bug. I am happy to assist in any way to get this bug resolved. Thank you</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1938192</commentid>
    <comment_count>36</comment_count>
    <who name="Bryce Aebi">bryce.aebi</who>
    <bug_when>2023-03-02 09:36:37 -0800</bug_when>
    <thetext>I&apos;ve mentioned this on the related bug, but will repeat here as it&apos;s relevant to this one as well. 

I have tried both WebAudio and routing the WebAudio through a MediaStreamAudioDestinationNode. This was on both iOS 16.2 and iOS 16.4. The volume issue persists regardless of the audio routing or iOS version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1938253</commentid>
    <comment_count>37</comment_count>
    <who name="Bryce Aebi">bryce.aebi</who>
    <bug_when>2023-03-02 12:42:44 -0800</bug_when>
    <thetext>SOLUTION FOR POSTERITY:

The solution to this issue is to manually set the following BEFORE mic capture:

navigator.audioSession.type = &apos;play-and-record&apos;;

And then running the following AFTER mic capture

navigator.audioSession.type = &apos;playback&apos;;

I have confirmed that this resolves the issue in iOS 16.4 beta 2. More details about this setting can be viewed here: https://github.com/w3c/audio-session/blob/main/explainer.md</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1941042</commentid>
    <comment_count>38</comment_count>
    <who name="Justin Higgins">justinhiggy</who>
    <bug_when>2023-03-13 16:42:37 -0700</bug_when>
    <thetext>Hey Bryce, is the navigator.audioSession.type API only available on iOS 16.4 beta 2? Not seeing it on iOS 16.2</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1941103</commentid>
    <comment_count>39</comment_count>
    <who name="Bryce Aebi">bryce.aebi</who>
    <bug_when>2023-03-13 19:34:27 -0700</bug_when>
    <thetext>Justin, I am not sure. I updated my phone to 16.4 beta 2 and haven&apos;t had a chance to test on lower versions yet. What do you mean when you say you are &quot;not seeing it on iOS 16.2&quot;? Are you seeing an error in the console when you try to access it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1941104</commentid>
    <comment_count>40</comment_count>
    <who name="Justin Higgins">justinhiggy</who>
    <bug_when>2023-03-13 19:57:27 -0700</bug_when>
    <thetext>&gt; Are you seeing an error in the console when you try to access it
Hey Bryce, yep, when in the js console for iOS safari 16.2, i get `undefined` for navigator.audioSession</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1941105</commentid>
    <comment_count>41</comment_count>
    <who name="Bryce Aebi">bryce.aebi</who>
    <bug_when>2023-03-13 20:17:54 -0700</bug_when>
    <thetext>Thanks for the response Justin, that&apos;s good to know. Do you mind testing if 16.3 works?

I&apos;m guessing on 16.2 and below there isn&apos;t really any recourse then.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1941246</commentid>
    <comment_count>42</comment_count>
    <who name="Justin Higgins">justinhiggy</who>
    <bug_when>2023-03-14 09:37:09 -0700</bug_when>
    <thetext>&gt; Thanks for the response Justin, that&apos;s good to know. Do you mind testing if 16.3 works?

Same issue on 16.3, I get `undefined` for navigator.audioSession in the js console</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1962398</commentid>
    <comment_count>43</comment_count>
    <who name="Tobi (onexip.com)">tobias.bley</who>
    <bug_when>2023-06-19 01:42:49 -0700</bug_when>
    <thetext>setting the audioSession type back to &quot;playback&quot; after the microphone track is stopped (or WebSpeech is stopped) only helps sometimes, sometimes not. It seams that setting the type doesn&apos;t always works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1962653</commentid>
    <comment_count>44</comment_count>
    <who name="Tobi (onexip.com)">tobias.bley</who>
    <bug_when>2023-06-20 14:35:57 -0700</bug_when>
    <thetext>any news here fixing the bug? Currently it&apos;s not possible to use recording and playback simultaniously on iOS :( On Android and native iOS it works.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2014290</commentid>
    <comment_count>45</comment_count>
    <who name="Taimoor">taimoor</who>
    <bug_when>2024-02-15 20:29:47 -0800</bug_when>
    <thetext>None of the solutions work for me. I still see this issue in iOS 17.3.1. Please suggest any work arounds, our business rely on this and we are losing customers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2020096</commentid>
    <comment_count>46</comment_count>
    <who name="Tobi (onexip.com)">tobias.bley</who>
    <bug_when>2024-03-11 07:23:04 -0700</bug_when>
    <thetext>Additionally to this bug, we have an &quot;audio ducking problem&quot;. So If you play back audio using WebAudio and open the microphone stream in parallel, the audio volume decreased if the user talks to the microphone. Its like a &quot;talk over&quot; or &quot;audio ducking&quot; feature which can&apos;t be disabled.

Event disabling the mic track does not help.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2030823</commentid>
    <comment_count>47</comment_count>
    <who name="Tobi (onexip.com)">tobias.bley</who>
    <bug_when>2024-04-24 01:06:55 -0700</bug_when>
    <thetext>no news here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2086320</commentid>
    <comment_count>48</comment_count>
    <who name="Aliaksandr Dunin">a</who>
    <bug_when>2025-01-10 04:32:25 -0800</bug_when>
    <thetext>I&apos;ve solved the issue with the audio volume decreases on iPad (iOS 17) passing additional constraints calling getUserMedia method:

navigator.mediaDevices.getUserMedia({
  audio: {
    autoGainControl: false,
    echoCancellation: false,
    noiseSuppression: false,
  }
}).then(...)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2190500</commentid>
    <comment_count>49</comment_count>
    <who name="">ch.chiang</who>
    <bug_when>2026-03-16 01:47:43 -0700</bug_when>
    <thetext># Bug Description

I am still encountering this issue on iOS 18.6 (Safari 18.6).

Calling getUserMedia() causes audio output routing to change in ways that lead to inconsistent and undesirable user experiences.

Disabling the following audio processing options does not resolve the issue:
```
{
  autoGainControl: false,
  echoCancellation: false,
  noiseSuppression: false,
}
```

When microphone capture is involved, the audio output is routed inconsistently:
- In a playback audio session, audio output is sometimes routed to the phone receiver.
- In a play-and-record audio session, audio output behavior changes depending on whether microphone capture has started.

This creates a jarring and inconsistent volume and routing experience for web applications that alternate between playback and microphone input.

------

# Expected Behavior

Two behaviors would be acceptable and consistent for web applications.

(1) When the audio session type is auto

Audio output should remain routed to the original output device (sinkId).

This would allow web applications to toggle between playback and recording (playback &lt;--&gt; play-and-record) without unexpected changes in audio routing or volume.

------

(2) When the audio session type is play-and-record

Audio output should be routed to the default speaker.

This would allow web applications to explicitly configure the session at launch, even before microphone capture begins.

------

# Current Behavior

Currently:
- Setting navigator.audioSession.type = &quot;play-and-record&quot; routes audio playback to the phone receiver.
- Audio playback is not routed to the default speaker until microphone capture actually begins via getUserMedia().

This makes it difficult for web applications to maintain a consistent audio experience when switching between playback and microphone usage.

------

# Impact

This behavior affects web applications that implement voice interaction workflows, such as:
- voice chat
- speech assistants
- voice input + TTS playback

These applications often need to alternate between recording and playback, and unexpected routing changes significantly degrade the user experience.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>