Skip to content

Connection Failed when upgrading to newest version (2.5.2 - 2.5.7) #1723

@padi-dev-anhntn

Description

@padi-dev-anhntn

Hi,
I use 2.5.1 and it works well, I start streaming from mobile and can see the video streaming on the website.
I want to upgrade to newer version(2.5.2 - 2.5.7) to remove the noise when streaming using rtmpStream.setTimestampMode(TimestampMode.BUFFER, TimestampMode.BUFFER);
But when I upgrade to newer version, it had errors like this, and I can't see the video streaming on the website.
'rtmps://abc-live-20-01-abcd.rtmp.livekit.cloud/x/abcdef'

/Handshake( 6589): writing C0
I/Handshake( 6589): C0 write successful
I/Handshake( 6589): writing C1
I/Handshake( 6589): writing time 1740476260 to c1
I/Handshake( 6589): writing zero to c1
I/Handshake( 6589): writing random to c1
I/Handshake( 6589): C1 write successful
I/Handshake( 6589): reading S0
I/Handshake( 6589): read S0 successful
I/Handshake( 6589): reading S1
E/RtmpClient( 6589): connection error
E/RtmpClient( 6589): kotlinx.coroutines.channels.ClosedReceiveChannelException: Unexpected EOF: expected 1434 more bytes
E/RtmpClient( 6589): 	at io.ktor.utils.io.ByteBufferChannel.readFullySuspend(ByteBufferChannel.kt:623)
E/RtmpClient( 6589): 	at io.ktor.utils.io.ByteBufferChannel.access$readFullySuspend(ByteBufferChannel.kt:23)
E/RtmpClient( 6589): 	at io.ktor.utils.io.ByteBufferChannel$readFullySuspend$3.invokeSuspend(Unknown Source:16)
E/RtmpClient( 6589): 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
E/RtmpClient( 6589): 	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
E/RtmpClient( 6589): 	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:113)
E/RtmpClient( 6589): 	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89)
E/RtmpClient( 6589): 	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586)
E/RtmpClient( 6589): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:820)
E/RtmpClient( 6589): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717)
E/RtmpClient( 6589): 	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704)
E/duc2111 ( 6589): onConnectionFailed = Error configure stream, Unexpected EOF: expected 1434 more bytes
W/VideoCapabilities( 6589): Unrecognized profile 2130706433 for video/avc
W/VideoCapabilities( 6589): Unrecognized profile 2130706434 for video/avc
W/VideoCapabilities( 6589): Unrecognized profile 2130706433 for video/avc
W/VideoCapabilities( 6589): Unrecognized profile 2130706434 for video/avc
W/VideoCapabilities( 6589): Unrecognized profile 2130706433 for video/avc
W/VideoCapabilities( 6589): Unrecognized profile 2130706434 for video/avc
W/VideoCapabilities( 6589): Unrecognized profile 2130706433 for video/avc
W/VideoCapabilities( 6589): Unrecognized profile 2130706434 for video/avc
D/FlutterWebRTCPlugin( 6589): onIceGatheringChangeGATHERING
D/FlutterWebRTCPlugin( 6589): onIceCandidate
I/chatty  ( 6589): uid=10950(app.boosty.live.boosty_live_app.stg) signaling_threa identical 4 lines
2
D/FlutterWebRTCPlugin( 6589): onIceCandidate
I/chatty  ( 6589): uid=10950(app.boosty.live.boosty_live_app.stg) signaling_threa identical 1 line
2
D/FlutterWebRTCPlugin( 6589): onIceCandidate
I/chatty  ( 6589): uid=10950(app.boosty.live.boosty_live_app.stg) signaling_threa identical 1 line
5
D/FlutterWebRTCPlugin( 6589): onIceCandidate
2
I/flutter ( 6589): isCameraOn camera - true
W/FlutterWebRTCPlugin( 6589): audioFocusChangeListener [Earpiece(name=Earpiece)] Earpiece(name=Earpiece)
W/FlutterWebRTCPlugin( 6589): audioFocusChangeListener [Speakerphone(name=Speakerphone), Earpiece(name=Earpiece)] Speakerphone(name=Speakerphone)
D/MediaConstraintsUtils( 6589): mandatory constraints are not a map
D/MediaConstraintsUtils( 6589): optional constraints are not an array
D/FlutterWebRTCPlugin( 6589): onConnectionChangeCONNECTING
D/FlutterWebRTCPlugin( 6589): onSelectedCandidatePairChanged
D/FlutterWebRTCPlugin( 6589): onIceGatheringChangeCOMPLETE
D/FlutterWebRTCPlugin( 6589): onConnectionChangeCONNECTED
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: initRecording(sampleRate=48000, channels=1)
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: byteBuffer.capacity: 960
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: AudioRecord.getMinBufferSize: 3840
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: bufferSizeInBytes: 7680
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: createAudioRecordOnMOrHigher
W/AudioRecord( 6589): dead IAudioRecord, creating a new one from obtainBuffer()
I/org.webrtc.Logging( 6589): WebRtcAudioEffectsExternal: enable(audioSession=52489)
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: AudioRecord: session ID: 52489, channels: 1, sample rate: 48000
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: AudioRecord: buffer size in frames: 3840
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: Number of active recording sessions: 0
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: startRecording
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: scheduleLogRecordingConfigurationsTask
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: AudioRecordThread@[name=AudioRecordJavaThread, id=18174]
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: doAudioRecordStateCallback: START
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: Number of active recording sessions: 2
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: AudioRecordingConfigurations: 
E/AudioRecordingConfiguration( 6589): Couldn't find device for recording, did recording end already?
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal:   client audio source=MIC, client session id=52481 (52489)
I/org.webrtc.Logging( 6589):   Device AudioFormat: channel count=1, channel index mask=0, channel mask=IN_MONO, encoding=PCM_16BIT, sample rate=48000
I/org.webrtc.Logging( 6589):   Client AudioFormat: channel count=2, channel index mask=0, channel mask=IN_STEREO, encoding=PCM_16BIT, sample rate=32000
E/AudioRecordingConfiguration( 6589): Couldn't find device for recording, did recording end already?
I/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal:   client audio source=VOICE_COMMUNICATION, client session id=52489 (52489)
I/org.webrtc.Logging( 6589):   Device AudioFormat: channel count=1, channel index mask=0, channel mask=IN_MONO, encoding=PCM_16BIT, sample rate=48000
I/org.webrtc.Logging( 6589):   Client AudioFormat: channel count=1, channel index mask=0, channel mask=IN_MONO, encoding=PCM_16BIT, sample rate=48000
2
E/AudioRecordingConfiguration( 6589): Couldn't find device for recording, did recording end already?
E/org.webrtc.Logging( 6589): WebRtcAudioRecordExternal: verifyAudioConfig: FAILED

My initialization:

rtmpStream = new RtmpStream(activity, this, videoSource, new MicrophoneSource());
rtmpStream.getGlInterface().setAutoHandleOrientation(true);
rtmpStream.getStreamClient().setBitrateExponentialFactor(0.5f);
rtmpStream.setTimestampMode(TimestampMode.BUFFER, TimestampMode.BUFFER);

rtmpStream.prepareAudio(32000, true, 128 * 1000);
rtmpStream.prepareVideo(1280, 720, 1200* 1000);

 rtmpStream.startStream('rtmps://abc-live-20-01-abcd.rtmp.livekit.cloud/x/abcdef');

 rtmpStream.getGlInterface().setIsPortrait(true);
 rtmpStream.getGlInterface().setCameraOrientation(0);
 rtmpStream.startPreview(surface, resolutionPreset.getHeight(), resolutionPreset.getWidth());

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions