Bug 243982 - REGRESSION (iOS 16 Beta 5) Video is broken for WebRTC call if User navigates to Youtube and back
Summary: REGRESSION (iOS 16 Beta 5) Video is broken for WebRTC call if User navigates ...
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: Other
Hardware: iPhone / iPad Other
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-08-16 02:05 PDT by Madara Freimane
Modified: 2023-08-08 14:56 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Madara Freimane 2022-08-16 02:05:26 PDT
Created attachment 461666 [details]
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 "Ask" 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)
Comment 1 Madara Freimane 2022-08-16 04:01:26 PDT
Created attachment 461668 [details]
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 => also audio becomes broken.

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

Let me know if there is a need to add additional information or log file.
Comment 2 youenn fablet 2022-08-16 06:51:39 PDT
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?
Comment 3 youenn fablet 2022-08-16 09:19:53 PDT
See also https://bugs.webkit.org/show_bug.cgi?id=243993
Comment 5 Radar WebKit Bug Importer 2022-08-16 14:31:24 PDT
<rdar://problem/98748804>
Comment 6 Alexey Proskuryakov 2022-08-16 14:34:31 PDT
Removed sysdiagnoses, as they prevented importing to Radar, and sharing them isn't good for privacy. Will re-attach to radar directly.
Comment 7 Madara Freimane 2022-08-17 06:30:06 PDT
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
Comment 8 Madara Freimane 2022-08-17 06:33:32 PDT
(In reply to Madara Freimane from comment #7)
> 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

Shared Google drive with Youenn, Alexey and webkit-bug-importer@group.apple.com
Comment 9 Madara Freimane 2022-08-18 02:43:15 PDT
Hi!

Added additional sysdiagnose file 
(use case: AirPods connected => 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
Comment 10 youenn fablet 2022-08-22 01:14:04 PDT
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.
Comment 11 Madara Freimane 2022-08-22 02:43:24 PDT
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.
Comment 12 Madara Freimane 2022-11-15 08:25:30 PST
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
Comment 13 Madara Freimane 2022-12-16 02:56:27 PST
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!