hzeller / rpi-rgb-led-matrix

Controlling up to three chains of 64x64, 32x32, 16x32 or similar RGB LED displays using Raspberry Pi GPIO
GNU General Public License v2.0
3.64k stars 1.16k forks source link

--led-show-refresh shows values 33% slower with HEAD compared to c2076d4444ba70a93a55a627b63155ccf54277 (2020/03) #1180

Open marcmerlin opened 3 years ago

marcmerlin commented 3 years ago

Older code: root@rPi4:~/rpi-rgb-led-matrix# ~/rpi-rgb-led-matrix.sav-faster/examples-api-use/demo --led-gpio-mapping=regular --led-rows=64 --led-cols=128 --led-row-addr-type=0 --led-show-refresh --led-slowdown-gpio=2 --led-pwm-bits=9 --led-panel-type=FM6126A --led-parallel=3 --led-pwm-dither-bits=2 --led-pwm-lsb-nanoseconds=100 -D0 279.1Hz up to 331.0Hz (mostly 330Hz)

Current code: root@rPi4:~/rpi-rgb-led-matrix# ~/rpi-rgb-led-matrix/examples-api-use/demo --led-gpio-mapping=regular --led-rows=64 --led-cols=128 --led-row-addr-type=0 --led-show-refresh --led-slowdown-gpio=2 --led-pwm-bits=9 --led-panel-type=FM6126A --led-parallel=3 --led-pwm-dither-bits=2 --led-pwm-lsb-nanoseconds=100 -D0 283.2Hz down to 221.9Hz

Both codebases show a start speed to 280Hz but then goes up to 330Hz on the old code but down to 220Hz on the new code.

old code is c2076d4444ba70a93a55a627b63155ccf54277 (HEAD -> master) Author: Henner Zeller h.zeller@acm.org Date: Mon Mar 16 18:38:21 2020 -0700

Before I start with a git bisect, did the speed computation get changed/fixed (I see the ouptut now adds "(lowest: 219.9Hz)" )?

hzeller commented 3 years ago

Haven't looked at that recently, but I am not aware that the speed calculation would've changed too much. The 'lowest' values is now emitted to have a better starting value to be used for --led-limit-refresh.

So bisect might help finding the culprit.

marcmerlin commented 3 years ago

will do

marcmerlin commented 3 years ago

Ok, this makes no sense, git bisect sent me to https://github.com/hzeller/rpi-rgb-led-matrix/commit/1362da5a2991a53f567c68c17f161731a66cdf8e which seems clearly innocent.

Still

root@rPi4:~/rpi-rgb-led-matrix# git log
commit 1362da5a2991a53f567c68c17f161731a66cdf8e (HEAD, refs/bisect/bad)
Author: Henner Zeller <h.zeller@acm.org>
Date:   Sat Aug 15 19:31:19 2020 -0700

    Simplify exit message (there is no timeout anymore).
root@rPi4:~/rpi-rgb-led-matrix# make; ./examples-api-use/demo --led-gpio-mapping=regular --led-rows=64 --led-cols=128  --led-row-addr-type=0  --led-show-refresh --led-slowdown-gpio=2   --led-pwm-bits=7 --led-panel-type=FM6126A  --led-parallel=3 --led-pwm-dither-bits=2 --led-pwm-lsb-nanoseconds=100 -D0 
make -C ./lib
make[1]: Entering directory '/root/rpi-rgb-led-matrix/lib'
make[1]: Leaving directory '/root/rpi-rgb-led-matrix/lib'
make -C examples-api-use
make[1]: Entering directory '/root/rpi-rgb-led-matrix/examples-api-use'
make -C ../lib
make[2]: Entering directory '/root/rpi-rgb-led-matrix/lib'
make[2]: Leaving directory '/root/rpi-rgb-led-matrix/lib'
make[1]: Leaving directory '/root/rpi-rgb-led-matrix/examples-api-use'
Size: 128x192. Hardware gpio mapping: regular
Press <CTRL-C> to exit and reset LEDs                                                             2 286.2HzReceived CTRL-C. Exiting.)z)z)

I get 280 to 320Hz. Then I go back one step and get back to 410Hz:

root@rPi4:~/rpi-rgb-led-matrix# git reset --hard HEAD^
HEAD is now at 54c63bf Update options of demo in README and help output.
root@rPi4:~/rpi-rgb-led-matrix# make; ./examples-api-use/demo --led-gpio-mapping=regular --led-rows=64 --led-cols=128  --led-row-addr-type=0  --led-show-refresh --led-slowdown-gpio=2   --led-pwm-bits=7 --led-panel-type=FM6126A  --led-parallel=3 --led-pwm-dither-bits=2 --led-pwm-lsb-nanoseconds=100 -D0 
make -C ./lib
make[1]: Entering directory '/root/rpi-rgb-led-matrix/lib'
make[1]: Leaving directory '/root/rpi-rgb-led-matrix/lib'
make -C examples-api-use
make[1]: Entering directory '/root/rpi-rgb-led-matrix/examples-api-use'
g++ -I../include -Wall -O3 -g -Wextra -Wno-unused-parameter -c -o demo-main.o demo-main.cc
make -C ../lib
make[2]: Entering directory '/root/rpi-rgb-led-matrix/lib'
make[2]: Leaving directory '/root/rpi-rgb-led-matrix/lib'
g++ demo-main.o -o demo -L../lib -lrgbmatrix -lrt -lm -lpthread
make[1]: Leaving directory '/root/rpi-rgb-led-matrix/examples-api-use'                                          354.2HzSize: 128x192. Hardware gpio mapping: regular                                                                   373.7HzPress <CTRL-C> to exit and reset LEDs                                                             4 410.2HzReceived CTRL-C. Exiting.)z)z)
marcmerlin commented 3 years ago

I've done a dist-upgrade on raspbian, gone from 4.19 to 5.4, gotten new compilers, rebooted, done make clean, and make, and I'm still seeing this. I can't make any sense of it though.

Can anyone else reproduce?