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

screen glitching and redraw prioritization #97

Closed
tehn opened this issue Sep 13, 2017 · 8 comments
Closed

screen glitching and redraw prioritization #97

tehn opened this issue Sep 13, 2017 · 8 comments

Comments

@tehn
Copy link
Member

tehn commented Sep 13, 2017

screen redraw needs optimization

partial redraws moving between edit and tracker, for example

@samdoshi
Copy link
Collaborator

@scanner-darkly has a fix for this in libavr32, it was done for Earthsea (maybe?). The Teletype code just needs updating to use it.

Maybe @scanner-darkly and @burnsauce can coordinate to get the changes in?

@samdoshi
Copy link
Collaborator

@scanner-darkly
Copy link
Member

there were changes made both in libavr32 and teletype.

the libavr32 changes were merged into the master already: monome/libavr32@7170c9a

these changes include:

  • changing trigger priority from 3 to 1. the most important part here is to leave i2c as the only thing with priority of 3 so that trigger and timer interrupts do not interfere with it. i2c implementation is brittle and doesn't recover well. also imo timers should have higher priority than triggers (but we could set them both to 2 or 1 too - up for debate).
  • reducing i2c speed - don't remember why i did it, possibly it showed improvement in stability without affecting the i2c speed too much.
  • timers_pause / timers_resume replaced with irqs_pause / irqs_resume. previous implementation assumed both trigger and timer IRQ levels would be disabled at the same time which is not necessarily true.
  • SPI writes protected with irqs_pause / irqs_resume including screen.c. this is important for removing screen glitching. but perhaps a better way to go is for SPI updates to use their own queue...

teletype changes are here: scanner-darkly@c47eaaf

they include:

  • libavr32 updates - i believe these are the same updates as above (i used my dev branch in libavr32 for experimentation, and then i cherry picked commits into the stability branch which was merged into master)
  • SPI writes protected with irqs_pause / irqs_resume
  • keyboard, front button and screen refresh handlers are called from the check_events loop instead of relying on timers. this was the main improvement for responsiveness.

testing: with @samdoshi official 2.0 i still managed to lock it reliably and quickly with extreme scenario (10ms metro, audio rate triggers, lots of i2c reading and writing in metro). with the above changes i wasn't able to get it to crash (i ran it for over 40 hours).

@scanner-darkly
Copy link
Member

for screen/keyboard responsiveness we just need to update teletype, for i2c stability both teletype and trilogy/ansible will need to be updated.

@scanner-darkly
Copy link
Member

forgot to add, my change was essentially a super simple implementation of having a higher priority queue for screen/keyboard updates. i think @burnsauce had some ideas on how to do this as well.

@burnsauce
Copy link
Contributor

Yeah, I'd like to create a proper scheduler to handle as many of the teletype's jobs as possible with predictable performance and timing for critical functions.

@tehn
Copy link
Member Author

tehn commented Sep 19, 2017 via email

@burnsauce
Copy link
Contributor

2.0.1 did indeed solve this problem, so the issue can be closed.

@tehn tehn closed this as completed Oct 12, 2017
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

4 participants