<?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>243982</bug_id>
          
          <creation_ts>2022-08-16 02:05:26 -0700</creation_ts>
          <short_desc>REGRESSION (iOS 16 Beta 5) Video is broken for WebRTC call if User navigates to Youtube and back</short_desc>
          <delta_ts>2023-08-08 14:56:58 -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>Other</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=244505</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=259924</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Madara Freimane">madara.freimane</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ddp.bkdn</cc>
    
    <cc>madara.freimane</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>youennf</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1891615</commentid>
    <comment_count>0</comment_count>
      <attachid>461666</attachid>
    <who name="Madara Freimane">madara.freimane</who>
    <bug_when>2022-08-16 02:05:26 -0700</bug_when>
    <thetext>Created attachment 461666
sysdiagnose_2022.08.16_11-45-16+0300_iPhone-OS_iPhone_20A5339d.tar.gz

Summary:
REGRESSION (iOS 16 Beta 5) Video is broken for WebRTC call if User navigates to Youtube and back

Tested devices:
Bug is reproducible on:
- iPhone 13 | iOS 16 Beta 5 (20A5339d)
- iPhone 11 Pro Max | iOS 16 Beta 5 (20A5339d)

Bug is no reproducible on:
- iPhone 11 | iOS 15.6 (19G71)

Use case:
Precondition:
User is in active WebRTC call
Permissions for camera and microphone are set to &quot;Ask&quot; in browser settings

Steps:
1. iOS 16 User navigates to Youtube and listens music for ~3min
2. iOS 16 User navigates back to the Safari browser
3. iOS 16 User accepts permissions 

Actual result:
The outgoing video is broken, and other User sees the black video from iOS 16 User

Expected result:
The outgoing video is available, and other User sees the good incoming video from iOS 16 User

Reproducibility:
100%

Additional information:
-Log file added in attachments (defect reproduced on 16.08.22 at 11:45 EET)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891629</commentid>
    <comment_count>1</comment_count>
      <attachid>461668</attachid>
    <who name="Madara Freimane">madara.freimane</who>
    <bug_when>2022-08-16 04:01:26 -0700</bug_when>
    <thetext>Created attachment 461668
sysdiagnose_2022.08.16_13-53-25+0300_iPhone-OS_iPhone_20A5339d.tar.gz

Added additional sysdiagnose file: 
sysdiagnose_2022.08.16_13-53-25+0300_iPhone-OS_iPhone_20A5339d.tar.gz


Seems that we have bigger reproducibility if AirPods connected with device =&gt; also audio becomes broken.

And if we disconnect AirPods and rejoin WebRTC join, we don&apos;t have outgoing video and audio and Safari freezes.

Let me know if there is a need to add additional information or log file.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891648</commentid>
    <comment_count>2</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-08-16 06:51:39 -0700</bug_when>
    <thetext>From the logs, I can see some errors like:
2022-08-16 11:42:10.311782+0300 0x55A9     Error     0x0                  541    com.apple.WebKit.GPU: (WebCore) [com.apple.WebKit:WebRTC] LocalSampleBufferDisplayLayer::layerErrorDidChange (9958DCCA7039740)

2022-08-16 11:42:10.589290+0300 0x55A9     Error     0x0                  541    com.apple.WebKit.GPU: (WebCore) [com.apple.WebKit:WebRTC] AudioMediaStreamTrackRendererInternalUnit::createAudioUnit AudioUnitInitialize() failed, error = 560557684

We fixed related errors in the latest iOS 16 beta 6.
@Madara, could you have a try?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891682</commentid>
    <comment_count>3</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-08-16 09:19:53 -0700</bug_when>
    <thetext>See also https://bugs.webkit.org/show_bug.cgi?id=243993</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891761</commentid>
    <comment_count>5</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-08-16 14:31:24 -0700</bug_when>
    <thetext>&lt;rdar://problem/98748804&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891764</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2022-08-16 14:34:31 -0700</bug_when>
    <thetext>Removed sysdiagnoses, as they prevented importing to Radar, and sharing them isn&apos;t good for privacy. Will re-attach to radar directly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891935</commentid>
    <comment_count>7</comment_count>
    <who name="Madara Freimane">madara.freimane</who>
    <bug_when>2022-08-17 06:30:06 -0700</bug_when>
    <thetext>Hi
unfortunately, I am still able reproduce defects with latest available iOS Beta version: iOS 16 beta 6 (20A5349b), device: iPhone 11 Pro Max

I created folder in Google drive and shared it with and there a new sysdiagnose file:

https://drive.google.com/file/d/1wvzEYrbKWsZv1zujNIDRNRtEvs9tfBBV/view?usp=sharing

sysdiagnose_2022.08.17_14-54-30+0300_iPhone-OS_iPhone_20A5349b.tar.gz</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1891936</commentid>
    <comment_count>8</comment_count>
    <who name="Madara Freimane">madara.freimane</who>
    <bug_when>2022-08-17 06:33:32 -0700</bug_when>
    <thetext>(In reply to Madara Freimane from comment #7)
&gt; Hi
&gt; unfortunately, I am still able reproduce defects with latest available iOS
&gt; Beta version: iOS 16 beta 6 (20A5349b), device: iPhone 11 Pro Max
&gt; 
&gt; I created folder in Google drive and shared it with and there a new
&gt; sysdiagnose file:
&gt; 
&gt; https://drive.google.com/file/d/1wvzEYrbKWsZv1zujNIDRNRtEvs9tfBBV/
&gt; view?usp=sharing
&gt; 
&gt; sysdiagnose_2022.08.17_14-54-30+0300_iPhone-OS_iPhone_20A5349b.tar.gz

Shared Google drive with Youenn, Alexey and webkit-bug-importer@group.apple.com</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1892177</commentid>
    <comment_count>9</comment_count>
    <who name="Madara Freimane">madara.freimane</who>
    <bug_when>2022-08-18 02:43:15 -0700</bug_when>
    <thetext>Hi!

Added additional sysdiagnose file 
(use case: AirPods connected =&gt; navigate to Youtube and back):
https://drive.google.com/file/d/1ubW5LCOkLYull6oozHQB3hH1WD52ykPF/view?usp=sharing
sysdiagnose_2022.08.18_12-34-27+0300_iPhone-OS_iPhone_20A5349b.tar.gz</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1892900</commentid>
    <comment_count>10</comment_count>
    <who name="youenn fablet">youennf</who>
    <bug_when>2022-08-22 01:14:04 -0700</bug_when>
    <thetext>From the last sysdiagnose, I can see:
2022-08-18 12:30:25.760241+0300 0x1276     Error     0x0                  319    com.apple.WebKit.GPU: (WebCore) [com.apple.WebKit:WebRTC] AudioMediaStreamTrackRendererInternalUnit::createAudioUnit AudioUnitInitialize() failed, error = 560557684

This should be fixed by bug 243249.

I also see that we are stopping past captures since a new camera or microphone is selected, (for instance switching from front to back camera):
2022-08-18 12:32:40.462696+0300 0x1276     Error     0x0                  319    com.apple.WebKit.GPU: (WebKit) [com.apple.WebKit:WebRTC] Ending microphone source as new source is using a different device.

2022-08-18 12:32:55.025852+0300 0x1276     Error     0x0                  319    com.apple.WebKit.GPU: (WebKit) [com.apple.WebKit:WebRTC] Ending camera source as new source is using a different device.

@madara, can you detail which WebRTC website you were using and which actions you did on this website.
I can see YouTube being used between 12:30 until 12:32.
At 12:32, I can see the website is asking for microphone/camera access and is switching from AirPods to iPhone microphone, so we end the AirPods microphone track.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1892920</commentid>
    <comment_count>11</comment_count>
    <who name="Madara Freimane">madara.freimane</who>
    <bug_when>2022-08-22 02:43:24 -0700</bug_when>
    <thetext>Respecting the confidentiality, an email was sent with additional information to Youenn.
Let me know if there is a need to make additional tests / we need to give more information about our issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1912618</commentid>
    <comment_count>12</comment_count>
    <who name="Madara Freimane">madara.freimane</who>
    <bug_when>2022-11-15 08:25:30 -0800</bug_when>
    <thetext>I’m not able to reproduce described issue in ticket with iOS 16.2 Beta 2, build: 20C5043e, iPhone 11 Pro Max. 
@Youenn, should we see the fix with this version?

Bug linked with https://bugs.webkit.org/show_bug.cgi?id=244505</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1919871</commentid>
    <comment_count>13</comment_count>
    <who name="Madara Freimane">madara.freimane</who>
    <bug_when>2022-12-16 02:56:27 -0800</bug_when>
    <thetext>Bug is not reproducible anymore.

Tested OK on:
* iPhone 11 Pro Max | iOS 16.2, build: 20C65
* iPhone 12 Pro Max | iOS 16.2, build: 20C65
* iPhone 14 | iOS 16.2, build: 20C65

Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>