rjrouquette / rgb_matrix_udp

udp based rgb panel driver using raspberry pi
The Unlicense
10 stars 3 forks source link

Change colour depth (pwm bits) #8

Closed arahasya closed 4 years ago

arahasya commented 4 years ago

I don't know the relation between colour depth and pwm bits but from results I know from rpi-rgb-led-matrix using --led-pwm-bits=1 gives the best refresh rate I want to display text only without any shade so it is suitable me it. Is it possible to do the sane using this library?

Thanks

rjrouquette commented 4 years ago

Color depth and PWM bits are independent. The color depth is fixed at 24-bit RGB. The PWM bits control the fidelity of the color rendering.

For your case, you'll need to set the PWM bits to 1, and reconfigure the DPI with 1 PWM bit plane. If your panels have less than 16 physical scan lines, you might need to increase the number of bit planes to make the DPI configuration valid. I don't recall the minimum supported dimensions offhand.

You'll still need to use 24-bit RGB with setPixel(), but the actual output will be binary.

rjrouquette commented 4 years ago

Also of note, is that if you reduce the number of PWM bits, you'll also limit the usefulness on the brightness setting. The brightness control relies on the PWM resolution.

arahasya commented 4 years ago

Really don't understand this formula for Pwm bit planes

22 = 7+(1+2+4+8)

Can you please explain this again?

rjrouquette commented 4 years ago

22 = 7 + (1 + 2 + 4 + 8)

7 = number of PWM bits (1 + 2 + 4 + 8) = BCM bits

There are 7 PWM bits and 4 BCM bits which yields the 11-bit overall depth.

This is why for 1-bit overall depth you get 1 bit plane, and no brightness control:

arahasya commented 4 years ago

So the framebuffer_height = 1 + 1
Only 2? That will give me a very high refresh rate don't think driver IC supports that high

rjrouquette commented 4 years ago

No. The frame buffer height is derived as follows:

So with a 3-bit row address it would be 9:

I suspect that might be too small for the DPI driver, so you may need to add more bit planes and color depth. With 3-bit row select and 2-bit depth it would be:

arahasya commented 4 years ago

Oh yes sorry forgot to add 8 I'll run the tests tomorrow and get back with results

arahasya commented 4 years ago

Working. Had to reduce avr clock