tinypilot icon indicating copy to clipboard operation
tinypilot copied to clipboard

Extremely high latency when multiple client windows are open

Open WardBenjamin opened this issue 4 years ago • 2 comments

Description

If you open the frontend web interface multiple times (for the sameTinyPilot), latency increases to 5-6 seconds or worse, including sometimes totally freezing up.

What's the behavior that you expect?

If TinyPilot doesn't function with multiple streams at the same time, I expect the focused window to take over all input. Ideally the other display would still show the display output.

What's happening instead?

Latency increases massively and the software becomes unusable.

What are the steps to reproduce this behavior?

  1. Open the TinyPilot web frontend in multiple tabs or windows or browsers.

Screenshots

N/A

Logs

http://sprunge.us/ynhMsj

WardBenjamin avatar Feb 03 '21 23:02 WardBenjamin

I've had a chance to test a bit further, and I didn't see the same problem if I ran the stream on multiple computers (instead of multiple streams on the same computer).

WardBenjamin avatar Feb 04 '21 20:02 WardBenjamin

Thanks for reporting this!

I suspect that this is a consequence of MJPEG. It's an uncommon format, and it consumes a lot of bandwidth. So the latency could be because you're flooding your network links with multiple MJPEG streams. Or, given that it works fine from multiple computers, it could be that multiple streams are overwhelming the browser.

We're planning to move to H264 in the next few months, likely with WebRTC, so I think this issue will naturally disappear as a consequence, but I'll keep it open to track.

mtlynch avatar Feb 04 '21 20:02 mtlynch

This is now fixed with H.264 streaming mode.

mtlynch avatar Feb 16 '23 16:02 mtlynch