Increasing scroll speed (and refresh rate?)

I’d like to achieve a text scroll speed in SmartMatrix that is extremely fast.

I’m running a simplified version of the Arduino IDE example “MultipleTextLayersGfx” on an ESP32 Rover module with Hub75 panels. It’s a 64x64 config.

I am finding that the fastest scroll speed I can achieve for the continuously scrolling text “Layer00” using FreeMono12pt7b (with “speed” = 100 and “setSpeed(255)”) is about 3 seconds per loop. Is there a way to achieve a faster speed? I’ve tried tinkering with some constants in the library’s MatrixEsp32Hub75xxxx files, with items such as maxCalcCpuPercentage, but not seeing faster speeds. When I try to alter the Refresh Rate from the sketch using matrix.setRefreshRate(), I typically get a Refresh Rate indicated in Serial Monitor of one-half the value I try to set. (e.g. set it to 240, see it set to 120.) It looks like the library MatrixESP32Hub75Calc_Impl.h is increasing a CPU divider based on it seeing too much CPU time used with the higher attempted Refresh Rate.

Since it looks like I’m probably going down a dead end with that idea, can you recommend any other ideas for speeding up the actually observed scroll speed? Ideally I’d like a max scroll speed (when selecting setSpeed(255)) that’s so fast it’s barely readable, and then I’d just throttle down from that with adjustable settings to allow for very fast options.

Thanks
Rick

Scroll speed is limited to one pixel shift per frame. If you want to change it to move multiple pixels, here’s a starting point for where to look:

Instead of framesperscroll you probably need to add a scrollsperframe variable, and change this function to run multiple passes at a time if scrollsperframe is > 1:

I don’t have time to comment on your refresh rate issue at the moment, LMK if that’s still important

Hey, a quick thanks. I’ve got high speed scrolling working on a demo, thanks to your assistance.

Rick

I’m running some experiments with the scrolling at normal fairly slow speeds as well as super-fast ones, and in both cases I’m seeing that wild swings in setting the refresh rate using matrix.setRefreshRate() (selecting 10 vs 500) seem to have no impact at all on the observed scrolling text. This makes me think I have an incorrect idea of refresh rate, or at least its influence on scrolling text.

In what kinds of situations would my changing of the refresh rate have any observable impact on a scrolling text or a playing GIF? Maybe if there were multiple layers scrolling at once…and then you might see some sort of flicker? (In my use case, I only will be using one scrolling layer at a time.)

Thanks
Rick

void SMLayerGFXMono<RGB_API, RGB_STORAGE, optionFlags>::setSpeed(unsigned char pixels_per_second) {
    pixelsPerSecond = pixels_per_second;
    framesperscroll = (this->refreshRate * 1.0) / pixelsPerSecond;
}

The code to set the scroll speed is in pixels per second, so it corrects for the current refresh rate when you set the scroll speed. Run FeatureDemo and look at the section that changes the refresh rate, I believe the scrolling text there slows down and speeds up as the refresh rate changes