I am trying to consume an audio stream from a mobile app (written in flutter).
I have connected to the mediasoup demo and got an incoming audio stream.
When I check the track statistics I see that no packets are sent.
My guess is that there is a problem with the SDP manipulations during the “consume” call.
I would appreciate any pointers of where to look for the problem.
mediasoup (server) is an ICE Lite server so no gathering is required from client. No ICE candidates are signalled from mediasoup-client to mediasoup server.
I followed your advice and verified the SDP and ICE which seems ok.
I see an issue in the DTLS connection:
mediasoup:ERROR:Channel [pid:51152 RTC::DtlsTransport::CheckStatus() | OpenSSL error [desc:‘SSL status: SSL_ERROR_SSL’, error:‘error:141A10F4:SSL routines:ossl_statem_client_read_transition:unexpected message’]
Any idea what I can do differently to work around this?
Probably you are not respecting the DTLS role and are acting as DTLS client while you tell mediasoup server (via signalling) that you are DTLS server. However hard to figure out.
BTW is yours a public project? is the code somewhere?
I verified its working on ios and android with the proper permissions.
I tried to follow the code structure of the JS mediasoup client. The one major change is that I don’t use the concept of handlers since this code is flutter only so I merged the handler functionality into the Device and Transport objects.
It is not yet organised since I am in the initial stages.
I believe this can greatly increase the native usage of mediasoup since it provides a unified codebase.
Flutter supports ios/android and even web (still not widely spread)
Thanks. Definitely I have no idea of Dart language so I cannot provide good feedback. Just a few comments:
I see a Request class, which AFAIU is about network signalling, and should not be part of the lib itself.
I see you subscribe to PeerConnection events such as pc.onAddTrack and things like that. In mediasoup-client we completely avoid that since we do know which remote tracks we are producing in advance so we do not listen for “hey you got a new track that you already knew because you gave it to me via a remote SDP re-offer”.
I see pc.addStream(). No idea about current status of libwebrtc for Dart (does it even exist?) but definitely pc.addStream() is API from 8 years ago.
Honestly I do not like this point. We may have done the same in libmediasoupclient which is a C++ version of mediasoup-client that uses libwebrtc internally so we also only have a “handler” and still keep the design of mediasoup-client into it by splitting Transport and Handler.
The only advice I can give right now is: follow mediasoup-client “v3” branch (which has been updated recently BTW) step by step. If things are different any future change will be super hard to sync and figuring out why things don’t work won’t be easy.
I completely agree with all your points, and I accept the change regarding the transport/handler split
The code is mainly a POC so it is a bit of a mess, I will clean it up to follow the mediasoup client structure.
Your advice regarding the dtls role was point on, I am able to receive audio now!!
I tried to build apk with your example and it’s crush immediately… I googled it and common result is that use old flutter~~~ And there updates with flutter_webrtc package and it doesn’t work with mediasoup in current stage… For example, there is no more classes:
‘package:flutter_webrtc/rtc_rtp_sender.dart’
‘package:flutter_webrtc/rtc_rtp_receiver.dart’
‘package:flutter_webrtc/rtc_rtp_sender.dart’
I’m inexperienced programmer and these code is huge for me haha.
I would love to try bring flutter_mediasoup up to date.
I used the example that was in the repository above as a basis. The audio streams are working correctly, but for some reason I can’t get the video streams. Even though everything comes from the server. It is also not clear why the audio stream is not coming from me. For example, what information do I need to provide for you to understand?
I’m afraid things do not work that way. It’s not me the one who has to ask you for specific details but you the one who has to expose his problem clearly.
mediasoup (server side) exposed tons of ways to diagnose what’s going on in each transport, producer and consumer. Use them to diagnose what your problem is.