Skip to content
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

WIP: Upgrade to julia 1.0 #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

garrison
Copy link

@garrison garrison commented May 1, 2020

I would be very interested to see this package work on modern versions of julia, so I attempted updating it myself. I did not see the discussion in #6 before I started this. Right now on my system it gets as far as complaining that it cannot find libjack, which is much further than it got previously.

@garrison garrison marked this pull request as ready for review May 1, 2020 21:37
@garrison
Copy link
Author

garrison commented May 1, 2020

BTW, it is only now that I see (via SampledSignals.jl) that there is also PortAudio.jl. If that is indeed the recommended way now it would be nice to link that from the README. In particular, I am left wondering: is it able to achieve as low latency as JACKAudio.jl?

@ssfrr
Copy link
Contributor

ssfrr commented May 2, 2020

I unfortunately don't have time to maintain this package any more, so I just added a note saying as much to the README. Sorry to waste your time - thanks for looking into this!

I think the best path forward is to add JACK support to PortAudio.jl. Please see this issue.

PortAudio.jl is also in a bit of an in-between state right now but at least it's pretty close to working. The master branch works for most folks, but there are a few issues I need to work out before doing a release.

PortAudio.jl uses a read/write interface exposed by the underlying libportaudio library. This necessarily introduces an extra block of latency relative to implementing the JACK callback directly. The problem is that implementing the callback directly in Julia is a problem because you can't call into the Julia runtime from a different thread. You end up needing to be super careful about how the callback is written (which is what I tried with JACKAudio.jl). Then changes in the Julia compiler can end up causing segfaults because something that didn't allocate memory before starts needing to allocate.

Another approach is to implement the callback in C and then pass data to Julia via a ringbuffer. This is what PortAudio.jl used to do, using RingBuffers.jl. This ends up adding the extra block of latency, so at that point you might as well just use libportaudio's built-in blocking read/write API, which is what the new master branch of PortAudio.jl does.

So long story short, if you're interested in getting JACK working in Julia, the best way would be to help get libportaudio compiling with the right flags to support JACK. Latency won't be quite as good or reliable as a static C program using JACK directly, but this thread reported being able to get down to around 10ms round-trip latency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants