dkrivoruchko / ScreenStream

ScreenStream Android App
https://screenstream.io
MIT License
1.56k stars 319 forks source link

Stream Lagging #242

Closed SMDIndomitable closed 4 months ago

SMDIndomitable commented 5 months ago

Hi, this issue has nothing to do with the application, but if possible, can you give me some insights to solve this problem? Basically, I am streaming through Hotspot. I proceed to connect the stream using 3 different ubuntu devices. Previously, the stream had no issue on the ubuntu devices. I also tested both the latest update and the update before. 2 of the ubuntu devices are fine, 1 is running extremely smooth, and 1 is slightly choppy. However, the device that I am most concerned with, has freezes in the stream every now and then. Do you know why this is happening?

Thank you very much for the application, very much appreciated

dkrivoruchko commented 5 months ago

Hi. What stream mode you use? MJPEG or WebRTC?

SMDIndomitable commented 5 months ago

Hi. What stream mode you use? MJPEG or WebRTC?

Hi, I am using MJPEG

dkrivoruchko commented 5 months ago

Ok. Go to "Stream settings" and enable "Notify for slow connections" checkbox. Try to stream and check if there are any slow connections reported. Also check "Connected clients" list for slow connections.

SMDIndomitable commented 5 months ago

Yep, I have done that. Under the 'Connected client' list, all of them showed slow connection, however 2 of the devices, the stream are still considered smooth. Only 1 of the device have freeze occuring every few seconds.

dkrivoruchko commented 5 months ago

Ok. For this one freezing device - will it freeze if only it is connected? I'm trying to understand if this is a network bandwidth issue when all three clients connected or it's just one slow-connected client.

SMDIndomitable commented 5 months ago

Yes, it does freeze as well even if is only one connection.

dkrivoruchko commented 5 months ago

Well, then this is a network issue - it's too slow for this particular client.

SMDIndomitable commented 5 months ago

But it used to be working fine, is there anything I can do about it?

dkrivoruchko commented 5 months ago

Try to open browser dev mode for slow stream. Maybe there are some useful logs.

SMDIndomitable commented 5 months ago

Understood, thank you for the help. Also, when you meant network, it includes local (LAN) right? because I am using without 4G or Wifi.

dkrivoruchko commented 5 months ago

Yes. Any type of network. You can even run stream via Network-over-USB.

SMDIndomitable commented 5 months ago

Hey, I managed it get it working smooth again, but it is rather inconsistent. So I was wondering if you could lend me your expertise on networking because I am rather clueless on it.

Is the local streaming using TCP or UDP? will this actually work if is TCP? https://www.fosslinux.com/135535/how-to-enhance-network-speed-and-reliability-in-ubuntu.htm

dkrivoruchko commented 5 months ago

MJPEG mode works over HTTP that works over TCP that works over IPv4 or IPv6. In general, there is no need for any additional configuration on client network. In your particular case, to give any reasonable advice, I require some additional information: How client reaches device with streaming application it terms of network connectivity. How it's connected, topology, technology ...

SMDIndomitable commented 5 months ago

I have a smartphone that's acts as the mobile hotspot with 4G enabled. All the client devices are connected using that mobile hotspot. However, all the client seems to be working fine except that ubuntu device. Hence I am trying the additional configuration.

dkrivoruchko commented 5 months ago

Well, it's really hard to say in general. Maybe firs check that Ubuntu client connects via fast WiFi. 802.11a and b decently too slow even for one client. It's better to have at least 802.11n with 40MHz channels to got 144MBit wifi link. It should be ok for one client if WiFi environment is not too noisy and not full of other devices talking. To have WiFi5 (ac) or WiFi6 (ax) is preferable, but it has to be in 5 or 6 GHz

SMDIndomitable commented 5 months ago

I have check the hotspot connection in that Ubuntu device, it was roughly around 5.7GHz

dkrivoruchko commented 5 months ago

This is good, what about connection speed?

SMDIndomitable commented 5 months ago

Download: 58.57 Mbit/s Upload: 18.24 Mbit/s

I got this from running speedtest-cli on the ubuntu device

dkrivoruchko commented 5 months ago

This is wrong. This shows internet speed, but we need WiFI connection speed on Ubuntu

SMDIndomitable commented 5 months ago

Uhm, how can I check for that? Sorry for the trouble

SMDIndomitable commented 5 months ago
      Bit Rate:867 Mb/s   Sensitivity:0/0  

Is it this?

dkrivoruchko commented 5 months ago

Yes. Bit Rate:867 Mb/s. Speed is fine. There must be something else. Hard to say.

SMDIndomitable commented 5 months ago

Try to open browser dev mode for slow stream. Maybe there are some useful logs.

Also how can I see the log, sorry I am not experience with browser

dkrivoruchko commented 5 months ago

Press F12 in browser

SMDIndomitable commented 5 months ago

Thank you! I have pressed F12 and the network tab, but I have no idea what I should look for. When I click analyse, it does not have any error in the log. Also, you mentioned Network-over-USB, does that mean is possible to use the application with wired connection?