Repository navigation
Spectrum: run on CPython, and move every frame on a desktop window - #39
Merged
Merged
Conversation
pump_levels took ticks_ms from time, which only MicroPython has, so the MP3 player's spectrum failed to start on a computer. It now uses multimer, as the rest of the apps do.
An app that leaves presenting to LVGL (touchkit's quiet_app_timers) stops appdev's refresh, so on a desktop window the bars reached the screen only when LVGL next drew something, about once a second. A display that needs presenting and has no row refresh is now shown after each frame.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two fixes that keep the MP3 player's spectrum from working on CPython.
lib/spectrum/pump_levels.pyimportedticks_diffandticks_msfromtime, which only MicroPython has, so the spectrum failed to start with anImportError. They now come frommultimer, as inspectrum/analyzer.pyand the apps.touchkit.shell.quiet_app_timers) has stopped appdev's refresh, so the bars appeared only when LVGL next drew something, about once a second. A display that needs presenting and has no row refresh is now shown after each frame. The P4's row refresh is unchanged.The spectrum also needs
audiometer.Meter.attach()on CPython, which audiodsp adds separately.Tested on a Raspberry Pi 4 (CPython 3.13, SDL on Wayland, 800x480 DSI panel), MP3 player with a pump-fed spectrum. Sixteen screenshots about 80 ms apart all differ in the spectrum's area; before the second change, two of sixteen did. The analyzer's report reads 16-19 fps. Not run on a board after this change; the board path (
present_rows) is untouched.