Skip to content
This repository was archived by the owner on Dec 8, 2023. It is now read-only.

Parallelization, FPS limiting, fixed memory leak#24

Open
tuffnerdstuff wants to merge 4 commits intobauersimon:masterfrom
tuffnerdstuff:parallel
Open

Parallelization, FPS limiting, fixed memory leak#24
tuffnerdstuff wants to merge 4 commits intobauersimon:masterfrom
tuffnerdstuff:parallel

Conversation

@tuffnerdstuff
Copy link
Copy Markdown

Hi all!

First of all: Thank you @bauersimon for sharing this awesome project with the world! As I had some stage lights lying around collecting dust and I wanted to put them to good use again. After some fiddling-around with the config I was able to introduce ScreenToArtnet to my Raspberry Pi OLA ArtNet Node. The latency was pretty good, but the 13 FPS I got was causing some noticeable flickering during fades (I use the ambilight mostly for gaming). I checked your open issues and noticed that parallelization was still something you wanted to try out. After some experiments I made the following improvements:

  • limited capture region to union of areas instead of whole screen
  • introduced a configurable worker pool for color computation and universe update
  • made target FPS configurable with 40 FPS as default in order to prevent getting limited by ArtNet (44 Hz Limit)

That bumped my FPS from 13 to over 60, so now the ambilight is buttery smooth (even though I'm driving my Raspberry Pi 1 over WiFi).

I also tweaked something here and there:

  • added command line argument validation
  • refactored some stuff

I also figured out during testing that the particular snapshot of the screenshot library used here had a memory leak issue. I upgraded to the latest "version" (sadly it is not tagged) and now the issue is gone.

I went over your issues and these changes should address #20 , #18 and #13 (kept lock-stepping color computation and networking in order to prevent out-of-order updates).

Have fun
tuffnerdstuff

* implemented worker pool
* running color computation in parallel
* running universe update in parallel
* limiting frame generation (default 40 fps)
@bauersimon
Copy link
Copy Markdown
Owner

Woooow - thanks for taking a look at my project and even adding some improvements. Super glad to hear that you found it useful.

As I stated in #20 (comment) I don't have an ArtNet interface anymore 🙈 so sadly I didn't get around to take care of the open issues. I really want to review and incorporate your changes at some point - thanks so much for contributing! Will probably resort to some virtual Artnet visualizer?

Cannot promise to take of this immediately but it's definitely on my plate 👼.

@tuffnerdstuff
Copy link
Copy Markdown
Author

No problem, take your time 😂 In the meantime I will just continue playing around on my fork 😁

@bauersimon
Copy link
Copy Markdown
Owner

@tuffnerdstuff I fear I cannot give this project the necessary focus for the forseable future. I'm planning on archiving it and forwarding to your fork, if that's alright with you?

@tuffnerdstuff
Copy link
Copy Markdown
Author

@bauersimon sure no problem, I'll see what I can do 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants