Skip to content

Faster tuner on v2 hardware#187

Merged
sastraxi merged 4 commits into
TreeFallSound:pistomp-v3from
sastraxi:feat/v2-tuner
Jun 23, 2026
Merged

Faster tuner on v2 hardware#187
sastraxi merged 4 commits into
TreeFallSound:pistomp-v3from
sastraxi:feat/v2-tuner

Conversation

@sastraxi

@sastraxi sastraxi commented Jun 21, 2026

Copy link
Copy Markdown
Collaborator

The tuner's DSP loop and LCD refresh were both doing unnecessary work on every frame. This PR adds back the Tuner menu item for v2 and ports optimizations from lcd/more-speed-tuner:

  • YIN detector: pre-allocates its scratch arrays once at startup instead of every frame, and works in float32 throughout. ~15% reduction in CPU usage
  • Strobe widget: batches all the partial-column LCD refresh calls for a given tick into a single SPI transfer instead of firing up to 12 separate ones. Basically, do a big blit instead of many smaller blits, because the pixel bookkeeping that reduces SPI transfers kills us in terms of CPU time. Fewer SPI round-trips = less CPU time spent waiting on the display bus
  • Reduces target frame rate from 100fps to 50fps to fit in new SPI budget (coalesced transfers mean more pixels transferred per frame)

@sastraxi sastraxi requested a review from rreichenbach June 21, 2026 18:20

@rreichenbach rreichenbach left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much better. The tuner is usable. It does still spike the CPU, especially on start. Enough to cause overruns - 10 to 20 maybe, but not hundreds like before. My main concern is crashes when used with already demanding pedalboards, but perhaps having it somewhat hidden under the system menu makes it available for those who really want it.

@sastraxi

Copy link
Copy Markdown
Collaborator Author

This is much better. The tuner is usable. It does still spike the CPU, especially on start. Enough to cause overruns - 10 to 20 maybe, but not hundreds like before. My main concern is crashes when used with already demanding pedalboards, but perhaps having it somewhat hidden under the system menu makes it available for those who really want it.

If you change def lcd_poll_divisor in modhandler to return a higher number when the tuner panel is active, you can lower CPU further. Anything up to 8 is still usable IMO, but it does hurt the immediacy somewhat of understanding if you're flat or sharp.

@sastraxi sastraxi merged commit b08e9ce into TreeFallSound:pistomp-v3 Jun 23, 2026
1 check passed
@sastraxi sastraxi deleted the feat/v2-tuner branch June 23, 2026 03:47
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