Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebRTC DataChannels Speed Issue

Tags:

webrtc

I have an Array of ArrayBuffers that I send through WebRTC from peerA to peerB. The major inconvenience that I'm experiencing is this: if peerA changes the tab to another one, then he is sending at a horribly slow rate. When peerA comes back to the app's tab, the sending speed hops back to normal levels.

Is there any way to address this particular problem?

I had a similar issue when I was slicing the files, that a change of tabs dropped the rate, and overcame this by using WebWorkers. As long as I have searched the WebRTC methods are not accessible from WebWorkers (just many people asking for this feature).

Any ideas?

like image 873
a_kats Avatar asked Jun 25 '15 04:06

a_kats


2 Answers

There's a demo page at https://webrtc.github.io/samples/src/content/datachannel/datatransfer/ that will generate and transfer data. I'm unable to see any issue like the one you describe when I put the tab in the background. If this problem persists, please file a bug at https://bugs.webrtc.org.

like image 161
kjellander Avatar answered Nov 19 '22 09:11

kjellander


I believe this may be a problem with the system timer resolution. Chrome sets this to 1 ms for certain active tabs, and sets it back to a higher value for backgrounded tabs to preserve battery life. To test this, try switching to a tab that is playing a YouTube video, and see if the send speed drops in the meantime.

like image 1
Sid G. Avatar answered Nov 19 '22 09:11

Sid G.