Git Product home page Git Product logo

Comments (3)

fgo-ableton avatar fgo-ableton commented on August 23, 2024

I just did a test changing lines 160 and 207 of AudioEngine.m of the example App to use the App versions of capture... and commit... and could not see any issue.

Is it possible you are committing a timeline from another thread that overwrites your intended change?
If you commit a change on the app thread it will not immediately propagate to the audio thread. So changing the timeline from multiple threads can lead to race conditions.

What is self.quantum set to? Maybe having it set to 0 will not give you the desired result. But if that is the same for both versions that is probably not the cause of the problem.

Let me know if that helps. If not, do you have more information that might help me to reproduce the problem?

from linkkit.

edsharp avatar edsharp commented on August 23, 2024

I found that I was not committing to the timeline from a different thread, but I was using ABLLinkCaptureAudioTimeline in a method that was sometimes called on the main thread and sometimes in my own thread.

My app is related to timing rather than producing audio. At first I used the audio thread, but eventually I I created a THREAD_TIME_CONSTRAINT_POLICY (real-time constraint) thread that's scheduled every 50ms to be independent of the audio thread buffer size.

I'm therefore sometimes calling link-related methods from the main thread and sometimes from my independent thread.

On the basis that the audio thread is realtime and so my independent thread, I guessed at generally using ABLLinkCaptureAudioTimeline in my thread and ABLLinkCaptureAppTimeline from the main thread. However because of the way I'd structured the app, some methods were written as plain C but could be called from either my thread or the main thread. In those cases I'd gone with ABLLinkCaptureAudioTimeline on the basis they're perhaps better behaved with regards to locks.

I'd love a clearer understanding of the difference between ABLLinkCaptureAudioTimeline and ABLLinkCaptureAppTimeline particularly when it comes to their use in a thread other than main or audio.

With a better understanding, I can rearchitect my app :)

Thanks for the speedy response.

from linkkit.

edsharp avatar edsharp commented on August 23, 2024

I have tracked down my problem and my mistake and it indeed was that I was sometimes using the wrong capture/commit from the wrong thread.

from linkkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.