Low framerate when using a second channel with blinkstick pro


#1

Normally when running 64 leds from channel 0 i have about 52-62 refreshes on the leds per second, however when I connect a second line of 64 leds the refreshes drop to about 16-19/second. Note that the amount of information processed is the same in both cases, I’m simply discarding the extra rgb codes when not running the second strip.

the snippets of code that are changed to get the result are:

main = Main(r_led_count=len(positions))

to:

main = Main(r_led_count=len(positions), g_led_count=len(positions))

and:

counter = 0
for led in data:
    if counter > 63:
        pass
    else:
        self.set_color(0, counter, int(led[0]), int(led[1]), int(led[2]))
    counter += 1
self.send_data_all()

to:

counter = 0
    for led in data:
        if counter > 63:
            self.set_color(1, counter%64, int(led[0]), int(led[1]), int(led[2]))
        else:
            self.set_color(0, counter, int(led[0]), int(led[1]), int(led[2]))
        counter += 1
    self.send_data_all()

Given that these are the only changes in the code, I can only assume that the blinkstick pro itself is taking significantly more time to set the led colors. I have checked the source code for send_data_all() function and it seems that it sends everything sequentially to each channel, as opposed to in parallel, but since the drop in fps is greater than 2x when the led count is doubled - I’m wondering if i’m maybe using the channels somehow wrong? :confused:

I’d gladly provide the entire code if anyone wants to try to figure this out with me. The problem seems very weird to me and so far the only solution that i see is simply only connecting one blinkstick pro per 64 leds, which seems very wasteful.

EDIT: changed send_data_all to specific send_data commands for each channel, no noticeable result. Setting data_transmission_delay to 0 also didn’t change things. Sitting at 11fps now ironically. cpu usage is below 7% and I really doubt the pro can’t handle setting 128leds faster than 11 times a second. :confused:

Also the cable connecting the second strip is around 1.5m longer. (first one is 3m). I don’t believe that should make a difference though.

Edit 2:

It seems that the second cable on its own only runs at around 30fps, so it indeed may be the cable length hindering it. This surprises me though, doesn’t the blinkstick just blindly send out pulses of data and hope they’re received, so distance of a few meters shouldn’t actually affect the rate at which signals are sent?

Edit 3:

The following actually results in around 44fps(which is my data processing rate, so higher refresh is useless) across both strips:

main = Main(r_led_count=64, g_led_count=64, delay=0.003)

setting delay of 0.003 results in around 44fps. 0.002 already drops down to 17-ish and anything lower than that drops fps to around 10. Increasing the delay above 0.003 also reduces fps. I’m not sure why 0.003 is the number that gives the best frame rate, but the problem is kind of fixed for now. I’d still like to know if anyone has any idea why this gave me much better results, in particular why lower delays results in lower fps.