Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebRTC stacks up messages when receiving data 30x per second in Firefox #43

Open
myusernameiscewl opened this issue Feb 15, 2014 · 7 comments

Comments

@myusernameiscewl
Copy link

Steps to reproduce:

In firefox the listener doesn't work well, when receiving messages 30x per second. The listener is called at inconsistent times. This can be checked with Date now().

To reproduce it:

  1. Make a connection between two peer in two different tabs.
  2. Let one or both send data at 30x per second rate.
  3. 'on('data') -> console.log(Date.now());'
    In Chrome everything works as aspected.

I tested it using PeerJS. The bug has nothing to do with PeerJS itself. It's when using DTLS in firefox.

Actual results:

You will see something like this in firebug (millisecond times):

1392036772332
CLIENT.html (line 870)

1392036772334
CLIENT.html (line 870)

1392036772337
CLIENT.html (line 870)

1392036772340
CLIENT.html (line 870)

1392036772342
CLIENT.html (line 870)

1392036772345
CLIENT.html (line 870)

1392036772546
CLIENT.html (line 870)

1392036772548
CLIENT.html (line 870)

There are 200 millisecond skips every ~4 messages. Sending does work and is called 30x per second.

Expected results:

Receive messages at consistent times. How would a multiplayer game like banana bread be possible if not?

In chrome this works but Firefox to chrome or chrome to Firefox or Firefox to Firefox it doesn't work either. Not even in the canary/nightly versions!

Did I do something wrong?

@kripken
Copy link
Owner

kripken commented Feb 16, 2014

cc @modeswitch who wrote this

@myusernameiscewl
Copy link
Author

I also tried it following this guide:
https://developer.mozilla.org/en-US/docs/Web/Guide/API/WebRTC/WebRTC_basics

And changing this demo, so it would send data at 30x per second:
http://louisstow.github.io/WebRTC/datachannels.html (demo linked to from above WebRTC basics URL)

I also posted the issue on bugzilla here, but I didn't get a single reaction:
https://bugzilla.mozilla.org/show_bug.cgi?id=970610

And it seems to happen in both reliable and unreliable connections. I tested unreliable by setting maxRetransmitnum = 0, reliable = false and ordered = false.

So is this issue confirmed now?

Any idea when this is going to be resolved?

@modeswitch
Copy link
Collaborator

BananaBread performs well even at higher latency.

It's unclear from your report above whether this is causing a bug in BananaBread. If not, the correct place to track this is in bugzilla.

@myusernameiscewl
Copy link
Author

Yes but Banana Bread still uses the fake audio/video stream (which doesn't interoperate) and not DTLS dataChannel which does interoperate with Chrome. So this might be a problem for Banana Bread in the future.

Also the new WebRTC version of WebRTC on Firefox seems to use far less CPU (if it's not a problem caused by my laptop) than the one with the fake media stream.

I also posted it on bugzilla but nobody seems to either see it or do something about it. And that makes me sad, because I'm so excited and interested about the things you and Mozilla are doing. And then this single bug stops me, from showing and convincing other people in a beautiful and interopable way how great these web technologies you and Mozilla work on are.

I hope maybe one of you could contact someone who is working on the implementation of WebRTC on Firefox.

@kripken
Copy link
Owner

kripken commented Feb 16, 2014

Link to bugzilla bug report?

@myusernameiscewl
Copy link
Author

https://bugzilla.mozilla.org/show_bug.cgi?id=970610

The bug report stated here on GitHub is more complete.

@kripken
Copy link
Owner

kripken commented Feb 16, 2014

Thanks, let's continue discussion there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants