Ableton / link

Ableton Link
Other
1.09k stars 149 forks source link

3.0.5 Causing watchdog errors in my ESP32 #116

Closed vizzie closed 1 year ago

vizzie commented 2 years ago

I noticed that you updated the way the network is polled for the ESP32 platform in the latest release. I am using some of the hardware timers in my code as well, but luckily not the one you are using, so it didn't cause a problem there. But I am now seeing watchdog error messages due to Link's poll being called so often amongst the other high priority things happening in my application.

This new method seems a bit demanding on the system as it fires every 100 uS. The previous method, while also demanding, was easier to load-balance with task priority settings.

I modified the timer to fire every 1000 uS and the system seems to be doing fine. Obviously the network state isn't updated as often. Would it be possible to have a config setting to allow for throttling back the polling timer to make room for more demanding applications? Or would you consider a longer period between polls?

fgo-ableton commented 2 years ago

The changes were introduced by @mathiasbredholt in https://github.com/Ableton/link/pull/106. It would be possible to add a preprocessor flag that allows setting the timer_divider. Would that work for you? Anyways, when setting the update frequency into the milliseconds range you will likely get inaccurate ping-pong measurements and this will cause an offset between the different peers. So you should be careful there.

vizzie commented 2 years ago

That would work, but I don't want to knock Link out of alignment, if it requires 100uS polling to keep things tight. @mathiasbredholt, do you pin Link to a single core? It does seem to be happier using both cores.

mathiasbredholt commented 2 years ago

@vizzie I'm running Link on both cores yes. It usually solves the issue with the watch dog for me as it gives the scheduler more freedom. Also, the Link task runs on a low priority so it shouldn't interfere with higher priority tasks in RTOS.

vizzie commented 2 years ago

OK. Good to know. It just seems so luxurious letting Link have both cores :-)

vizzie commented 1 year ago

Noticed this was still open. Probably can close this now.