<?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>243897</bug_id>
          
          <creation_ts>2022-08-12 13:25:38 -0700</creation_ts>
          <short_desc>Volume of playing video increases when capturing microphone with getUserMedia()</short_desc>
          <delta_ts>2022-08-17 02:15:56 -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>WebRTC</component>
          <version>Safari 15</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 15</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=236219</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="David Mannion">dmannion</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1890980</commentid>
    <comment_count>0</comment_count>
    <who name="David Mannion">dmannion</who>
    <bug_when>2022-08-12 13:25:38 -0700</bug_when>
    <thetext>iPad (8th Generation)
iOS 15.6

Using https://webrtc.github.io/samples/src/content/devices/multi/


1) Select Allow to the prompt to Access the Microphone and Camera
2) Click the red video camera in the address bar to disable the Microphone and Camera.
3) Play the audio track on the right hand side under local media files.  Adjust volume on device to a medium level.  Audio track should repeat in a loop.
4) Click the red video camera in the address bar to re-enable the Microphone and Camera.
5) The volume of the playing audio track increases significantly.

Expected behavior: the volume should remain relatively the same when enabling or disabling the microphone &amp; camera.


Our actual use case is slightly different, but exhibits the same problem:
1) User clicks to move to the next page/section
2) Video starts auto playing in one element, while the prompt to Access the Microphone and Camera displays so we can display the camera stream in a second video element (which is muted)
3) User clicks Allow and the volume jumps up considerably. 
4) User lowers the volume.
All subsequent videos play at too low a volume.  If the user doesn&apos;t lower the volume in step 4, the volume will return to its normal level when a new video source is loaded into the video element.  Replaying the existing video without changing the source causes the audio to fluctuate/distort, like its interacting with the microphone or something.  Again, changing the source on the video element seems to fix the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1890981</commentid>
    <comment_count>1</comment_count>
    <who name="David Mannion">dmannion</who>
    <bug_when>2022-08-12 13:26:56 -0700</bug_when>
    <thetext>Not sure if this is related to https://bugs.webkit.org/show_bug.cgi?id=236219</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891314</commentid>
    <comment_count>2</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2022-08-15 05:29:25 -0700</bug_when>
    <thetext>Probably a duplicate, but I&apos;m not quite sure enough to close it as such.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891904</commentid>
    <comment_count>3</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-08-17 02:14:08 -0700</bug_when>
    <thetext>When capturing microphone, we change the audio session category to PlayAndRecord.
This in turns changes the system level.
While this behaves as expected, we might want applications to be able to proactively state they are capturing apps so that the audio level does not change when starting to capture.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891905</commentid>
    <comment_count>4</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-08-17 02:15:13 -0700</bug_when>
    <thetext>(In reply to David Mannion from comment #1)
&gt; Not sure if this is related to https://bugs.webkit.org/show_bug.cgi?id=236219

This is somehow different.
bug 236129 is about microphone capture ducking other audio sources.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891907</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-08-17 02:15:56 -0700</bug_when>
    <thetext>&lt;rdar://problem/98772368&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>