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.67k stars 1.17k forks source link

InitFM6127 does not initialize more than one chain but InitFM6126 does. #1181

Open marcmerlin opened 3 years ago

marcmerlin commented 3 years ago

I have FM6127 panels. They actually seem to work fine with --led-panel-type=FM6126A When I send --led-panel-type=FM6127, only the first chain is initialized

marcmerlin commented 3 years ago

FM6127 panels are connected as 3 channels

     ,  ch1 - p1 - p4
rpi -   ch2 - p2 - p5
      ` ch3 - p3 - p6

./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: PXL_20201022_204625730

.//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=FM6127 --led-parallel=3 --led-pwm-dither-bits=2 --led-pwm-lsb-nanoseconds=100 -D0: PXL_20201022_204733955

The 2nd panels in both pictures is chained off the first one and meant to receive a mostly mirrored image (modulo some timing issues since it's receiving planes shifted off the first panel)

marcmerlin commented 3 years ago

@gohlhausen I see you contributed FM6127 support in https://github.com/hzeller/rpi-rgb-led-matrix/issues/964 Can you comment on what you think is going on with the 6127A init sequence and why it would only be going to one channel and not all 3? Reading the code, I don't really see how the init is sent on all channels for FM6126A, but it is: https://github.com/hzeller/rpi-rgb-led-matrix/blob/b8c7cc42e7f5a852ba93c3cc70e4b31e576632c5/lib/framebuffer.cc#L471

marcmerlin commented 3 years ago

@gohlhausen I'm also not too clear on what the FM6127 init does compared to FM6126A. I've been using my FM6127 panels with an FM6126A init so far, and they've seemed fine. I even managed to put an FM6127 panel in the middle of a string of 4 FM6126A panels, and it worked fine too.

IGR2014 commented 1 month ago

Guys, maybe the problem is here ?

static void InitFM6126(GPIO *io, const struct HardwareMapping &h, int columns) {
  const gpio_bits_t bits_on
    = h.p0_r1 | h.p0_g1 | h.p0_b1 | h.p0_r2 | h.p0_g2 | h.p0_b2
    | h.p1_r1 | h.p1_g1 | h.p1_b1 | h.p1_r2 | h.p1_g2 | h.p1_b2
    | h.p2_r1 | h.p2_g1 | h.p2_b1 | h.p2_r2 | h.p2_g2 | h.p2_b2
    | h.p3_r1 | h.p3_g1 | h.p3_b1 | h.p3_r2 | h.p3_g2 | h.p3_b2
    | h.p4_r1 | h.p4_g1 | h.p4_b1 | h.p4_r2 | h.p4_g2 | h.p4_b2
    | h.p5_r1 | h.p5_g1 | h.p5_b1 | h.p5_r2 | h.p5_g2 | h.p5_b2
    | h.a;  // Address bit 'A' is always on.

vs:

static void InitFM6127(GPIO *io, const struct HardwareMapping &h, int columns) {
  const gpio_bits_t bits_r_on= h.p0_r1 | h.p0_r2;
  const gpio_bits_t bits_g_on= h.p0_g1 | h.p0_g2;
  const gpio_bits_t bits_b_on= h.p0_b1 | h.p0_b2;
  const gpio_bits_t bits_on= bits_r_on | bits_g_on | bits_b_on;

As you can see, FM6127 only has p0, while FM6126 has p0 .. p5 bits