ant-media / Ant-Media-Server

Ant Media Server is a live streaming engine software that provides adaptive, ultra low latency streaming by using WebRTC technology with ~0.5 seconds latency. Ant Media Server is auto-scalable and it can run on-premise or on-cloud.
https://antmedia.io
Other
4.25k stars 623 forks source link

Android Sample App #2678

Open Stewioie opened 3 years ago

Stewioie commented 3 years ago

E/WSChannelRTCClient: sent websocket message:{"command":"publish","streamId":"564203582944055160666315","token":"","video":true,"audio":true}

After I pressed the Start streaming button

D/de.tavendo.autobahn.WebSocketReader: run() : SocketException (java.net.SocketException: Connection reset) I/chatty: uid=10083(u0_a83) WebSocketReader identical 91 lines D/de.tavendo.autobahn.WebSocketReader: run() : SocketException (java.net.SocketException: Connection reset) D/de.tavendo.autobahn.WebSocketConnection: fail connection [code = CONNECTION_LOST, reason = WebSockets connection lost D/de.tavendo.autobahn.WebSocketReader: quit D/de.tavendo.autobahn.WebSocketReader: WebSocket reader ended. D/de.tavendo.autobahn.WebSocketWriter: WebSocket writer ended. D/WSChannelRTCClient: WebSocket connection closed. Ping Pong timer stop called D/de.tavendo.autobahn.WebSocketConnection: worker threads stopped D/de.tavendo.autobahn.WebSocketConnection: fail connection [code = CONNECTION_LOST, reason = WebSockets connection lost D/de.tavendo.autobahn.WebSocketReader: quit D/de.tavendo.autobahn.WebSocketConnection: SocketThread exited. W/MessageQueue: Handler (de.tavendo.autobahn.WebSocketWriter$ThreadHandler) {cba4469} sending message to a Handler on a dead thread java.lang.IllegalStateException: Handler (de.tavendo.autobahn.WebSocketWriter$ThreadHandler) {cba4469} sending message to a Handler on a dead thread at android.os.MessageQueue.enqueueMessage(MessageQueue.java:545) at android.os.Handler.enqueueMessage(Handler.java:661) at android.os.Handler.sendMessageAtTime(Handler.java:630) at android.os.Handler.sendMessageDelayed(Handler.java:600) at android.os.Handler.sendMessage(Handler.java:537) at de.tavendo.autobahn.WebSocketWriter.forward(WebSocketWriter.java:95) at de.tavendo.autobahn.WebSocketConnection.failConnection(WebSocketConnection.java:109) at de.tavendo.autobahn.WebSocketConnection.handleMessage(WebSocketConnection.java:410) at de.tavendo.autobahn.WebSocketConnection.access$1(WebSocketConnection.java:344) at de.tavendo.autobahn.WebSocketConnection$ThreadHandler.handleMessage(WebSocketConnection.java:536) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767) W/MessageQueue: Handler (android.os.Handler) {838a21c} sending message to a Handler on a dead thread java.lang.IllegalStateException: Handler (android.os.Handler) {838a21c} sending message to a Handler on a dead thread at android.os.MessageQueue.enqueueMessage(MessageQueue.java:545) at android.os.Handler.enqueueMessage(Handler.java:661) at android.os.Handler.sendMessageAtTime(Handler.java:630) at android.os.Handler.sendMessageDelayed(Handler.java:600) at android.os.Handler.post(Handler.java:356) at de.tavendo.autobahn.WebSocketConnection.failConnection(WebSocketConnection.java:121) at de.tavendo.autobahn.WebSocketConnection.handleMessage(WebSocketConnection.java:410) at de.tavendo.autobahn.WebSocketConnection.access$1(WebSocketConnection.java:344) at de.tavendo.autobahn.WebSocketConnection$ThreadHandler.handleMessage(WebSocketConnection.java:536) at android.os.Handler.dispatchMessage(Handler.java:105) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6541) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

mekya commented 3 years ago

Hi @Stewioie ,

Thank you for the report. It's helpful for us to reproduce the problem on our hand. Do you have a step by step reproduce scenario in the following template? It will help us a lot to understand and fix the problem.

Secondly, I think there may be some kind of firewall or device problem.

Short description

Brief description of what happened

Environment

Steps to reproduce

Expected behavior

Put as much detail here as possible

Actual behavior

Put as much detail here as possible

thinkgopal commented 3 years ago

Hi,

Is it solved? I am also facing the same issue in Android Sample App.

Downloaded the sample from below link. https://antmedia.io/free-webrtc-android-ios-sdk/

Any help will be much appreciated. Thank you.

mekya commented 3 years ago

Please let us have the reproduce scenario. Because it's working for lots of guys.

santhoshdayala commented 3 years ago

Hi ,

We are also facing the same issue , Once the streaming is initiated the web-socket connection is closing and below are the logs .

2021-08-10 15:26:50.977 1733-1733/com.wesupport.android E/WSChannelRTCClient: sent websocket message:{"streamId":"9116368053796_4913_ACE-L9Y","definition":"joined","command":"notification"}
2021-08-10 15:26:51.026 1733-7748/com.wesupport.android I/org.webrtc.Logging: EglRenderer: Dropping frame - No surface
2021-08-10 15:26:51.386 1733-7759/com.wesupport.android W/de.tavendo.autobahn.WebSocketReader: Status: 101 ()
2021-08-10 15:26:51.387 1733-1733/com.wesupport.android D/de.tavendo.autobahn.WebSocketConnection: opening handshake received
2021-08-10 15:26:51.831 1733-1733/com.wesupport.android E/WSChannelRTCClient: onTextMessage: {"streamId":"9116368053796_4913_ACE-L9Y","definition":"joined","command":"notification"}
2021-08-10 15:26:51.831 1733-1733/com.wesupport.android D/WSChannelRTCClient: notification:   joined
2021-08-10 15:26:51.832 1733-1733/com.wesupport.android I/Tue Aug 10 15:26:51 GMT+05:30 2021 : RemoteConnectionService: onJoinedTheRoom
2021-08-10 15:26:51.833 1733-7759/com.wesupport.android D/de.tavendo.autobahn.WebSocketReader: run() : ConnectionLost
2021-08-10 15:26:51.833 1733-7759/com.wesupport.android D/de.tavendo.autobahn.WebSocketReader: WebSocket reader ended.
2021-08-10 15:26:51.890 1733-6666/com.wesupport.android D/OpenGLRenderer: textureCacheSize 58720256
2021-08-10 15:26:51.899 1733-1733/com.wesupport.android D/de.tavendo.autobahn.WebSocketConnection: WebSockets Close received (1002 - **An unrecoverable IOException occurred so the connection was closed)**
2021-08-10 15:26:51.899 1733-1733/com.wesupport.android D/de.tavendo.autobahn.WebSocketConnection: fail connection [code = CONNECTION_LOST, reason = WebSockets connection lost
2021-08-10 15:26:51.899 1733-1733/com.wesupport.android D/de.tavendo.autobahn.WebSocketReader: quit
2021-08-10 15:26:51.900 1733-7760/com.wesupport.android D/de.tavendo.autobahn.WebSocketWriter: WebSocket writer ended.
2021-08-10 15:26:51.901 1733-1733/com.wesupport.android D/WSChannelRTCClient: WebSocket connection closed.
2021-08-10 15:26:51.901 1733-1733/com.wesupport.android D/WSChannelRTCClient: Ping Pong timer stop called
2021-08-10 15:26:51.901 1733-1733/com.wesupport.android D/de.tavendo.autobahn.WebSocketConnection: worker threads stopped

Environment Operating system and version: Android OS 10 Ant Media Server version: 2.3+ Browser name and version: Google Chrome ,Version 92.0.4515.131 Device : T12ey

mekya commented 3 years ago

Hi @santhoshdayala,

It may be a problem in firewall or something.

Do you check that you can publish the server via your web browser on the same network and different network? It would be also good if you can share your server url to let us make a quick test.

Regards, A. Oguz

santhoshdayala commented 3 years ago

Hi @mekya , We tried with different networks and still facing the same issue

Thanks, Santhosh.

mekya commented 3 years ago

Hi @santhoshdayala ,

Do you have any working scenario?

I mean if you have a working scenario in the same network, it means it's a device issue. If you don't have any working scenario, maybe there is a kind of issue in your configuration.

Because we're using the SDK in different devices and different networks.

Regards, A. Oguz

santhoshdayala commented 3 years ago

@mekya yes , it's working on other devices in same network except on the device mentioned above ? What could be the reason for not working on this device ?

Thanks, Santhosh

mekya commented 3 years ago

Hi @santhoshdayala ,

It seems that it's a device specific error.

What's this device look like? I could not even find it on https://www.gsmarena.com/res.php3?sSearch=T12ey

It seems no exception in the logs either.

santhoshdayala commented 3 years ago

@mekya Its a custom manufacturer device and what could be the possible solution you can provide in order to fix this issue ?

From the logs i can see the error below

15:26:51.899 1733-1733/com.wesupport.android D/de.tavendo.autobahn.WebSocketConnection: WebSockets Close received (1002 - An unrecoverable IOException occurred so the connection was closed) 2021-08-10 15:26:51.899 1733-1733/com.wesupport.android D/de.tavendo.autobahn.WebSocketConnection: fail connection [code = CONNECTION_LOST, reason = WebSockets connection lost 2021-08-10 15:26:51.899 1733-1733/com.wesupport.android D/de.tavendo.autobahn.WebSocketReader: quit

in which scenarios the SDK will throw An unrecoverable IOException occurred so the connection was closed) this error ?

Thanks Santhosh.

mekya commented 3 years ago

Hi @santhoshdayala ,

If you are sure that you give all the permissions for internet connection, microphone, camera, etc. That device may not support websocket connection or something.

Just try to make websocket connection maybe with another app and confirm whether websocket connections can be established in your device.

Alternatively, you may prefer to ask device manifacturer for that. Maybe there are some security restrictions on your device.

meet-zimozi commented 3 years ago

@mekya

streaming is not working on android device which is >=10 os version. I have EE of webrtc but when we start streaming it automatically stops after 3 to 5 seconds.

the ports are open

Screenshot 2021-08-27 at 12 06 49 PM

but still we have issue below android 10 streaming working perfectly fine.

Please check this issue asap I have client deadline which reaches soon.

mekya commented 3 years ago

Hi @meet-zimozi ,

You're sending messages in different channels. Please don't do that. You're making us over stress and it's not helpful for anyone.

Please continue here https://github.com/ant-media/Ant-Media-Server/issues/3576

meet-zimozi commented 3 years ago

Okay sorry for that


From: Ahmet Oğuz Mermerkaya @.> Sent: Friday, August 27, 2021 3:30 PM To: ant-media/Ant-Media-Server @.> Cc: Meet Chandra @.>; Mention @.> Subject: Re: [ant-media/Ant-Media-Server] Android Sample App (#2678)

Hi @meet-zimozihttps://github.com/meet-zimozi ,

You're sending messages in different channels. Please don't do that. You're making us over stress and it's not helpful for anyone.

Please continue here

3576https://github.com/ant-media/Ant-Media-Server/issues/3576

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/ant-media/Ant-Media-Server/issues/2678#issuecomment-907082600, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AURQPOVPQ24DINMJ7BOJTHLT65O3NANCNFSM4TPUK5IA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

mekya commented 3 years ago

Thank you so much for your understanding.