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

Call mpr_dev_update_maps() once all signals have been updated. #44

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

malloch
Copy link
Member

@malloch malloch commented Feb 2, 2024

This change will cause libmapper to send updates to mapped peers immediately rather than waiting for the next call to mpr_dev_poll().

@aburt2
Copy link
Contributor

aburt2 commented Feb 29, 2024

tested with the esp32s3, just needs resolve conflicts with the main branch before merging

@malloch
Copy link
Member Author

malloch commented Feb 29, 2024

Would be interesting to re-run the latency & throughput benchmarks once this PR and the liblo updates merged...

@aburt2
Copy link
Contributor

aburt2 commented Feb 29, 2024

On the branch I'm working on to add support for 5G T-Sticks I have added this PR already, under good network conditions & PC connected to ethernet to router, OSC throughput is between 104-106Hz, with round-trip latency ranging from 2ms - 13ms

@aburt2
Copy link
Contributor

aburt2 commented Feb 29, 2024

under poor network conditions (ie: using my phone as an access point) the round trip latency can range from 20ms to the ESP32 doesn't respond to pings once it gets that high, libmapper does not work (ESP32 is not visible) but you can still maintain a 104-106Hz throughput via OSC just a very delayed 104Hz

@malloch
Copy link
Member Author

malloch commented Feb 29, 2024

The "ESP32 not visible to libmapper" condition is 100% due to dropped packets. I have a branch where I'm integrating TCP for administrative traffic (which should resolve visibility) but the dropped packets are still very problematic. Some of the signals generated by the T-Stick (e.g. jabs) are ballistic/event-based so a single dropped packet can have bad consequences!

Out of curiosity, are the latency/throughput tests done with both libmapper signals and non-libmapper OSC running?

@aburt2
Copy link
Contributor

aburt2 commented Feb 29, 2024

yes they are, still need to test them individually, what I don't get, is if I'm dropping packets shouldn't I also experience a drop in the OSC throughput as well

@malloch
Copy link
Member Author

malloch commented Apr 29, 2024

yes they are, still need to test them individually, what I don't get, is if I'm dropping packets shouldn't I also experience a drop in the OSC throughput as well

There would be a drop compared to transmitted packets but throughput might still increase if the drops are intermittent. It might make sense to transmit an incremented counter and check the received values.

@aburt2
Copy link
Contributor

aburt2 commented Sep 7, 2024

@malloch I've tested this before between 2 ESP32 Boards and got around 2-3% packet loss when connected to a router with no other devices on the network and 30-50% packet loss when connected to the rasberry pi 4 (T-Tree at IDMIL).

Even the best case scenario has much higher packet loss in comparison to OSC which was 0.01%-0.05% packet loss under similar conditions. I'll test with this firmware on the ESP32S3 and see the packet loss when connecting to my laptop.

@malloch
Copy link
Member Author

malloch commented Sep 7, 2024

@aburt2 thanks for testing this! I have a few questions...

  1. Which version of libmapper are you using? (there have been some recent optimizations)
  2. Was this testing done with the call to mpr_dev_update_maps() included?
  3. I notice the call to vTaskDelay() in loop() is commented out – is there another delay being called somewhere in the function or are you just running loop() as fast as possible?
  4. the OSC bundle sizes created by libmapper and plain-OSC are likely different since updates to brush/multibrush, rub/multirub, shake, jab, count, tap/dtap/ttap, and battery are gated for plain-OSC but always included in libmapper updates. Perhaps the OSC bundle created by libmapper is becoming large enough to cause problems with the ESP32 networking stack? If you have time could you add the same update gating to the mpr_sig_set_value() calls and re-test?

Thanks!

@aburt2
Copy link
Contributor

aburt2 commented Sep 15, 2024

Hello Joe to answer your questions.

  1. The ESP32 boards are using the libmapper-arduino library which is still using libmapper v2.3. I can't remember what version of libmapper I was using on my laptop it was at least libmapper v2.4.
  2. There was no delay the messages were sent as fast as possible.

For your other two questions, this initial test was done just between two esp32 boards sending a counter. I haven't gotten around to testing the mpr_dev_update_maps() call or on the T-Stick just yet. Just wanted to give an initial update. I'll do what you suggested in point 4 when testing on a 5G T-Stick.

@aburt2
Copy link
Contributor

aburt2 commented Sep 15, 2024

@malloch

@malloch
Copy link
Member Author

malloch commented Sep 17, 2024

Thanks @aburt2 for the information – could you share the esp32 firmware you used for the test? I'd love to replicate & debug this issue.

@aburt2
Copy link
Contributor

aburt2 commented Sep 20, 2024

I had this firmware running on the ESP32 boards: https://github.com/aburt2/TStick-tester/tree/main/firmware/Wifi%20Testing%20(Libmapper)

I read the data via the serial monitor and analysed it.

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

Successfully merging this pull request may close these issues.

2 participants