New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LV: Clarify input plugin data upload semantics and define requirements #54
Comments
@kaixiong I am aware of these three buckets regarding input API's behavior:
I believe we need to support all of these some way to not exclude some input API by design, and I conclude that:
To summarize, my current impression is that libvisual needs to move input upload calls to a dedicated thread and out of the render thread. Happy to discuss more here or elsewhere. |
@hartwork Nicely summarized. I agree with having a separate input upload thread. It would be a nice and relatively simple introduction of threading into libvisual that dovetails with long-term plans of using multiple cores for rendering. |
@kaixiong PS: For case (c) with asynchronous callbacks it would be great to have permanent (or global) access to the current |
@hartwork, can you explain why having a permanent/global VisAudio instance would be great? I default to skepticism about shared mutable objects (which languages like Rust ban in safe code for good reasons). |
@kaixiong the problem I am trying to solve is this: The If instead What do you think? |
@hartwork Ah I see what you mean. It is a classic producer-consumer problem. I don't have concrete ideas yet but here are quick thoughts:
|
The upload() implementation of the various input plugins have subtly different and inconsistent characteristics that can cause synchronisation problems.
The current rendering logic (in LV::Bin) behaves best when:
Please note that the above are not recommended as requirements. I discuss my reasons after the next section.
Below is an overview of how individual input plugins actually behave:
The biggest challenge for the input system is to handle situations where the upload() call rate is either too low or too high. Both can happen due to the variability of frame rendering times that depend very much on specific actors and rendering dimensions.
(1) and (2) shouldn't be defined as requirements. The biggest reason is that duplicated or dropped samples can screw up beat detection and spectral analysis. It is best to keep the input as faithful as possible (up to a certain length of time to conserve memory).
The text was updated successfully, but these errors were encountered: