monome / druid

terminal interface for crow
GNU General Public License v3.0
35 stars 16 forks source link

decrease serial timeout & increase reconnect poll #52

Closed trentgill closed 5 years ago

trentgill commented 5 years ago

Fixes the sluggishness of the interface! The issue was how we were polling the serial.read() where it would always wait for the timeout because we asked for "lots of data", and this would fail to release the asyncio thread.

Fixed by reducing the timeout to 10ms in crowlib.py (was 100ms, causing the 10fps). Feels super snappy now. Input polls are more much more snappy!

Reduced the reconnect rate so druid will auto-connect much faster in case of a pulled cable. This really relies on #49 as otherwise the console fills up fast! Tested on Linux as has no effect on CPU usage when polling for the serial port this fast. Main benefit here is it reduces the delay we have to set on crow before sending a startup message.