hyperion.ng icon indicating copy to clipboard operation
hyperion.ng copied to clipboard

Device { leds } parameter should work with any device type

Open tociek opened this issue 10 years ago • 8 comments

Related to #626.

As requested, opening an issue here...

"leds" parameter in device section works only for apa102 leds. Ideally, it should work for any device type

tociek avatar Jun 28 '16 15:06 tociek

why does it make sense? the count of leds are the count of configured leds in the leds block. I think we should remove this parameter from apa102 device.

I read the code, with that param you can say that there are more leds than configured. E.g. you have 50 leds in your leds section. When "leds" param of device section is lower 50, this value has no effect. Is it higher, the device is told that more leds are available. The reason for that is, when you have more leds than configured, then switch the unconfigured leds off. This solution isn't good, because this is not general enough. Better is, configure all leds and then implement a method to say that the led you want should be black/off. (the implement thing is not implemented yet, but shouldn't be hard)

redPanther avatar Jun 28 '16 17:06 redPanther

Normally you can achieve this effect by defining these extra leds that you have, but you want them to be off - and assign special transformation to these leds with brightness=0. So currently it is possible but a bit cumbersome to do. "leds" parameter sounds like something convenient to achieve this effect.

Problem with "extra" leds being on is not only with apa102, but with ws2801 as well. I don't know what happens with ws2801 but it has been a problem with hyperion since I remember (at least for 3 years)

tociek avatar Jun 28 '16 19:06 tociek

The effects engine needs to know how many LEDs it should be using - this is why we need the concept of maximum physical LEDs bs maximum configured/usable LEDs.

I agree that doing it the led devices is the wrong place.

Maybe the transform or even just before the call to updateleds is a much better place

penfold42 avatar Jun 28 '16 23:06 penfold42

While I agree that doing this in each led device code would be "suboptimal", however from config stand point "device" section does make sense as "leds" describes physical device (and not transformation)

tociek avatar Jun 29 '16 05:06 tociek

Agreed - where it is configured doesn't have to align with where we implement it.

penfold42 avatar Jun 29 '16 05:06 penfold42

this should be done in hyperion class. today my day is a bit tight. tomorow evening I have time. I have a nice idea to solve this and other related issues. more later ....

redPanther avatar Jun 29 '16 06:06 redPanther

I just remembered that the rpi_281x driver needs to know how many physical LEDs there are at startup time.

penfold42 avatar Jun 29 '16 06:06 penfold42

this issue is solved. see pr #77 for details

redPanther avatar Jul 04 '16 14:07 redPanther