On 2/19/24 05:09 Daniel Harding wrote:
> Spinning off from some of the discussion in this previous thread:
>
https://groups.google.com/g/fltkgeneral/c/xUEnuZs-THA
>
> I have a real-time audio application that ideally needs a frame rate
> of at least 45 frames per second or higher.
>
>
https://github.com/dannye/crystal-tracker
>
https://www.youtube.com/watch?v=BPsvsHj3eLM
>
> I have no problem achieving a frame rate higher than this on Linux and
> Windows, but the frame rate struggles a little bit on Mac -- at least
> on my somewhat old 2013 MacBook Pro.
>
> I'm interested in investigating what might be causing this lower frame
> rate and if there's anything that can be done to improve it.
@Daniel, thanks for opening this thread. It's interesting, but
unfortunately not essential to investigate this before the release of
FLTK 1.4.0. Therefore, I can't spend time on investigating this issue.
However, this should not be forgotten. There is an independent
investigation going on, regarding "DataReadyThread" which could also
influence the performance on macOS (not only drawing speed as you assumed).
This issue should be investigated at some time...
> As I have time, I may add more in depth explanations here, screen
> recordings to demonstrate the performance that I'm seeing, or may even
> try to create a simpler demo program that illustrates the same idea
> but without all of the dependencies of the full program, but no
> guarantees on that.
The simpler example would IMHO be the way to go. Seeing performance in
screen recordings would be "nice" but building one's own test program
that can be tested on all platforms to see the difference would be
preferable. So if you are willing to invest more time, then the small
demo program would IMHO be the better choice. Thanks in advance.
Some ideas and suggestions: draw a lot of objects like your keyboard and
the "notes" at arbitrary (maybe random) locations with different sizes.
Are you using widgets like Fl_Box in your original program, or do you
use "draw" methods like fl_rectf() etc.? Do the same in the demo
program. Make the window contents "scroll" as in your example program
(use the same Fl::awake() mechanism like your audio thread). Add a
slider where you can change the "speed" interactively. Try to add an
"fps" counter that may show a result that's comparable between systems.
Make the main window resizable so we can test with different sizes. Etc...
The smaller the demo code that shows the effect (some kind of saturation
on macOS) the better it is.
> Thanks in advance to anyone for your input.
Sorry that I can't help with "real" input because I'm concentrating on
finishing the 1.4.0 release.