client-sdk-android
client-sdk-android copied to clipboard
Problem with calls via cellular network
There are two Android devices:
- A – connected via Wi-Fi
- B – connected via cellular network (4G)
A calls B via LiveKit. After both users enter the room, A does not see the video track from B, and B does not see the video track from A. After a while, the video from B becomes visible on side A, but with very poor quality. At the same time, messages about the status of the microphone and camera are transmitted between the devices. Next, an error occurs on the B side:
E/SignalClient: websocket failure: null java.io.EOFException at
okio.RealBufferedSource.require(RealBufferedSource.kt:199) at
okio.RealBufferedSource.readByte(RealBufferedSource.kt:209) at
okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.kt:119) at
okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.kt:102) at
okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.kt:293) at
okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:195) at
okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at
java.lang.Thread.run(Thread.java:764)
After the error occurs, there are several attempts to restore the connection, after which the web socket is closed. During all attempts, the participants do not see each other.
The same problem occurs when A and B both call from a cellular network (regardless of the mobile operator used).
The problem was discovered in an application made based on a demo “sample-app” provided in the repository. For both demo applications, the problem persists.
The problem occurred on many Android devices with API level 28 and higher from different manufacturers. On iOS devices in the same situation, the problem is not observed.
The attached files contain logs recorded when connecting devices via LiveKit.
Note: RoomEvent.ActiveSpeakersChanged, RoomEvent.ConnectionQualityChanged and ParticipantEvent.SpeakingChanged were not logged.
Logs from device A (call initiator, connected via Wi-Fi): livekit_log_full_user_a.txt - full logs livekit_log_events_user_a.txt - room and participant events and websocket errors
Logs from device B (call receiver, connected via cellular network): livekit_log_full_user_b.txt - full logs livekit_log_events_user_b.txt - room and participant events and websocket errors
client-sdk-android version: 1.1.0 (the problem was also in 1.0.1 and 1.0.2-SHAPSHOT) livekit version: 1.1.0
Room connection code:
val room = LiveKit.create(
appContext = application,
options = RoomOptions(
adaptiveStream = true,
dynacast = true,
),
)
room.connect(
Constants.Url.LIVEKIT,
token,
)
Are there any logs on the server indicating whether it closed from remote?
Hello! Yes, the logs are in this file: livekit_server_logs_issue_116.txt
Hi @davidliu , Problem with calls via cellular network and Wifi both,
sometimes no participant video displayed for the new or old joining participant
There are two Android devices:
A – connected via Wi-Fi
B – connected via Wi-Fi
A – connected via cellular network(4G)
B – connected via cellular network(4G)
A calls B via LiveKit. After both users enter the room, A does not see the video track from B, and B does not see the video track from A. After a while, the video from B becomes visible on side A, but with very poor quality. At the same time, messages about the status of the microphone and camera are transmitted between the devices. Next, an error occurs on the B side:
E/SignalClient: websocket failure: null java.io.EOFException at okio.RealBufferedSource.require(RealBufferedSource.kt:199) at okio.RealBufferedSource.readByte(RealBufferedSource.kt:209) at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.kt:119) at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.kt:102) at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.kt:293) at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:195) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)
After the error occurs, there are several attempts to restore the connection, after which the web socket is closed. During all attempts, the participants do not see each other.
I am using 1.1.1 latest one livekit as well as 0.8.1
@kamaltyagi02 this seems like a copy paste of the above post?
Fixed by #144.