iOS 14 crash after calling play() for each streaming source

andrew.n

New Member
The video call feature worked well on iOS 13.x.x.
After I made the update to iOS 14 and start testing again the video call, in some cases, after I call the play() function for each streaming source the app crashes.
It looks like it's an issue with the UI setup that is not performed on the main thread.

This crash is not happening every time. Sometimes the video call setup works the same as on iOS 13.
On iOS 13.x.x I didn't have this issue.

Screenshot 2020-09-22 at 12.23.42.png


Debug logs:
[2263:467636] Metal GPU Frame Capture Enabled
[2263:467636] Metal API Validation Enabled
[2263:467636] Failed to bind EAGLDrawable: <CAEAGLLayer: 0x13b9485e0> to GL_RENDERBUFFER 1
[2263:467636] Failed to make complete framebuffer object 8cd6
[2263:467636] Failed to bind EAGLDrawable: <CAEAGLLayer: 0x13b96c490> to GL_RENDERBUFFER 1
[2263:467636] Failed to make complete framebuffer object 8cd6
[2263:467636] Video mandatory constraints:{
minHeight = 1792;
minWidth = 828;
}
[2263:468165] *** Assertion failure in -[FBSSerialQueue assertBarrierOnQueue], FBSSerialQueue.m:127
[2263:467636] Source is running 0
[2263:468165] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'threading violation: expected the main thread'
*** First throw call stack:
(0x19e5b65ac 0x1b263042c 0x19e4bf1b4 0x19f81d7bc 0x1ad5b97f8 0x1ad566260 0x1ad5664e0 0x1ad5663e0 0x1a09c3f7c 0x1a0acd1a4 0x1a0acdf20 0x100aaa6d4 0x105733b68 0x1057355f0 0x10573cfa8 0x10573dcb4 0x105749e38 0x1e5b08908 0x1e5b0f77c)
libc++abi.dylib: terminating with uncaught exception of type NSException
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'threading violation: expected the main thread'
terminating with uncaught exception of type NSException
 
Last edited:

andrew.n

New Member
I build the two-way streaming demo app on an iPhone with iOS 14.0 and I used the demo web page to set up the connection.
On the device, I couldn't see the streaming source video (from mac) and also in the debugger I saw some issues regarding the UI changes that were done on a background thread:

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 4068, TID: 1041665, Thread name: (none), Queue name: EncoderQueue, QoS: 0


The first time when I run the demo app on my device having iOS 13, everything was fine, I could see both local streaming video and remote streaming video.

full debugging logs:
 

Max

Administrator
Staff member
On the device, I couldn't see the streaming source video (from mac)
Recently, we found some regression in latest build that was installed to demo server demo.flashphoner.com. For example, stream publishing from latest Chrome on MacOS did not work (and player see no video in this case). We just rolled back demo server to last working build.
Also, some customers use demp server as production, so it may be under high load in some hours. We solving this problem now.
also in the debugger I saw some issues regarding the UI changes that were done on a background thread:
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 4068, TID: 1041665, Thread name: (none), Queue name: EncoderQueue, QoS: 0
There is the ticket WCS-2641 to fix it, but this issue does not affect stream publishing or playing in application. We'll let yuo know when fix it.
 

andrew.n

New Member
@Max I found something during the debugging sessions that is related to this thread.
As you can see the exception is caused by SocketRocket (com.squareup.SocketRocket.NetworkThread)

Also, I found out that this issue can also happen for ios 13: https://github.com/facebookarchive/SocketRocket/issues/616

The ugly part on this is that SocketRocket is no longer maintained for a while: https://github.com/facebookarchive/SocketRocket/issues/576

I want to know, is there any estimated date for an update of this framework, including iOS 14 updates? (such as updating to the "New Build System", and demo projects updated for iOS 14?)
 

Attachments

Max

Administrator
Staff member
I want to know, is there any estimated date for an update of this framework, including iOS 14 updates? (such as updating to the "New Build System", and demo projects updated for iOS 14?)
Unfortunately, we cannot provide any ETA for simple licence support tickets.
Currently, we have the following roadmap:
1. Ticket WCS-2794: update WebRTC library and switch from RTCEAGLVideoView to RTCMTLVideoView to resolve scaling issues. This will be a new minor iOS SDK release. Please note we do not work with SocketRocket directly, but WebRTC library code does. Probably, new WebRTC library versions have a workaround for this issue.
2. Ticket WCS-2878: allow to connect to custom image capturer implementation (GPUImage library support)
3. Ticket WCS-2641: fix background UI thread issue
4. Ticket WCS-2853: migrate from Objective C to Swift. This will be a new major iOS SDK release. At this stage, we'll update to new build system.
 

andrew.n

New Member
Any updates regarding points 1 and 3, @Max? We have to release the app but one of the core features of the app is not working properly.
 

Max

Administrator
Staff member
Good day.
Both tickets WCS-2794 and WCS-2878 are on testing stage now. Please be patient.
 

Max

Administrator
Staff member
Good day.
We released iOS SDK build 2.6.1 as mentioned earlier. SocketRocket is also updated to latest build from CocoaPods, and example apps are not crashing in our tests.
The tickets WCS-2641 and WCS-2853 still in progress.
 
Top