Operating system(s): Ubuntu Studio 17.10
Version if official Rack release, commit hash and/or branch if from source: VCV Rack 0.6 (Official)
It would be very nice if JACK Audio could be a first-class support target for VCV Rack builds on Linux, as many pro-Audio users with Linux DAW's utilize JACK for the Audio subsystem.
It was discussed on the Facebook group that one option might be to configure the VCV Rack build server to produce VCVRack executables linked to each library independently, e.g. VCVRack-alsa, VCVRack-Jack, etc. But then wisdom prevailed and of course the idea was floated to have RtAudio built with all the appropriate audio backends.
If Andrew could push me in the right direction, per his needs with regards to build/configuration system, I'd be happy to help as I have a working Linux DAW system in front of me and am an avid JACK user with a system (based on Presonus FirePod hardware) that provides over 40 channels of JACK-based digital audio i/o to test with ..
Producing separate Rack builds is unnecessary. At the worst, all you'd have to do is replace librtaudio.so.
There are two approaches I can think of.
Any other ideas, or expansions on those two?
Other ideas:
Build librtaudio as at present, but also build a JACK-enabled one. Then either
or
So since I imagine the number of JACK users is small, why not someone just post an librtaudio.so build here and problem solved? If someone searches on the Facebook group or on here, they'll eventually find it.
I posted one on the facebook group (yes, that's me!) I'm not used to distributing binaries, though, and have basically no idea if it will work. (EDIT: for other people, I mean - it appears to work fine for me)
@ndrspcfd Not everyone is on Facebook and afaik Facebooks numbers shrink for some time now, and the trend gets even more popular, especially after recent events. Could you post an librtaudio.so build/info in some other places as well, preferably here, on https://github.com?
@freemanfromgodotengine I appreciate your unwillingness to enmire yourself in Facebook :)
I'm not sure whether my build will work for others, so posting it there is something of an experiment. So far, no-one has tried it (or at least admitted trying it) there's just a bunch of people going "oh noes, no JACK support in the build" and then successfully compiling their own.
I did try to attach it to this issue, but github is having none of it, and I don't really want to start hosting things on my own account here just at the moment, sorry. If there's some indication it works for people, I'll find a dropbox or something and leave the url here. It's really not hard to compile (just follow the instructions in the wiki
@freemanfromgodotengine Good news! Pawel Anansi from facebook has put their own librtaudio.so on dropbox and at least one user is reporting success. I've just tried it with a fresh binary download of Rack and it works on my system too..
So, for anyone who's willing to run it, the dropbox url is:
https://www.dropbox.com/s/y55ry35mholiya6/librtaudio.so-jack.zip?dl=0
That was me posting the above link. It was built with the 0.6dev about a week before official release. It works with for me and for some other people with official 0.6 build. That would be good, If someone hosts it in some more reliable place than my Dropbox 😉
I'm switching to a full static build for Linux, so unfortunately this won't give you the ability to replace the librtaudio.so file.
I'm considering adding JACK as a requirement for Rack since forcing users to install JACK on their system is easier than forcing JACK users to copy a library.
You could set it as a 'recommends' for apt packaging maybe. I don't have a ton of time to help with packaging rn but will give you some cycles asap
@AndrewBelt - Ouch! Is the suggestion of providing JACK and no-JACK binaries (static or otherwise) just too clunky for you? This seems like it is going to really hurt one way or the other (though I suppose building from source will remain an option?)
EDIT: P.S. @falkTX''s "weak-jack" style jackBridge within his carla repo looks to be compatibly licensed with Rack, if the wrapper approach becomes an option later - you can see the license in: https://github.com/falkTX/Carla/blob/master/source/jackbridge/JackBridge.hpp
and also P.S: Apart from the pain of writing it, is there anything stopping a JACK client from living in a module, like the Bridge, or core audio module (in terms of it needing special or unusual privs or access to Rack's objects, for a module, that is)?
@normn This isn't a distro packaging issue. It's a linking issue. I also don't create DEB packages for Linux, just a ZIP.
@ndrspcfd Yes, it's too clunky to provide multiple builds. It's just about user numbers at this point. I'm glad I have some opposition on the other side though, since I'm personally on the no-JACK side.
Please note that most users will have libjack.so.0 installed, even if the full JACK is not.
libjack is a dependency of quite a few things, including gstreamer, ffmpeg and mplayer.
So dynamic linking expecting a libjack.so works more often than not.
For a static build, a "weakjack" version is needed indeed.
The RtAudio version I include in my own Carla application uses this method.
@AndrewBelt I am willing to maintain a fork of RtAudio+weakjack if you use it in VCVRack.
I already do it for Carla, more or less, it's just together with the rest of the code for now instead of a separate repo.
I do not want to maintain cmake/autoconf/whatever project files though, so I'd need help on that area.
Please note that most users will have libjack.so.0 installed, even if the full JACK is not.
Yes, I think this is why adding libjack as a requirement isn't as bad as it seems. It'll link, complain about not having a server, and then all is good.
To be clear, I'm statically linking rtaudio but not libjack.so, which will be dynamically linked to a system copy.
Oh, this all seems good now, with no real downside to a dependency on libjack. I was reading "full static build" and "JACK as a requirement" to mean a dependency on the full JACK server. Sorry for the noise..
"@freemanfromgodotengine Good news! Pawel Anansi from facebook has put their own librtaudio.so on dropbox and at least one user is reporting success. I've just tried it with a fresh binary download of Rack and it works on my system too..
So, for anyone who's willing to run it, the dropbox url is:
https://www.dropbox.com/s/y55ry35mholiya6/librtaudio.so-jack.zip?dl=0"
@ndrspcfd , it works fine on Debian Stretch. Thanks.
As an alternative in the meantime, copying over librtaudio.so from my locally installed librtaudio package did the trick. I'm running Arch Linux, but it looks like Ubuntu's package is compiled for jack as well.
So, jack seems to work pretty well in the 0.6.1 release, but it bases the number of available in/out-puts on the machine-device. This should not be a software limit really. At least the default 8x8 device should work, or eventually even configurable (there is only a systems-resource limit on the number really).
In the mean time you can work around this by using multiple audio modules: https://i.imgur.com/GyTUEra.png
But this is a bit annoying.
Please just provide 8x8 for jack as there is no reason not to.
All I'm using is rtaudio/rtmidi's wrapper. Let me know what I need to do, otherwise it'll be 8-24 months before I get around to looking at JACK.
Ok, I see. Lets dive in to rtaudio then ..
Perhaps just something in https://github.com/VCVRack/Rack/blob/4e12141e3abfc9b692ea13699c8f4e80573ac14f/src/audio.cpp#L103 like (pseudo):
if ( RtAudio::UNIX_JACK ) {
return 8
}
@dromer Have you tried to start jackd with an explicit device name instead of letting it auto-select the machine device? Doing so, may be a better workaround.
Seems to me that if jackd is not configured with a specific device name to use, it will use the first one it finds in the list when asked to enumerate ports - "hw:0" - whereas with systems that have multiple audio devices, such as mine - built-in Intel-based audio card on the motherboard, and external Firewire-based FP10 devices (x2) - jackd would have to be told to use them, explicitly.
@seclorum yes I start jackd with the device/interface.
But I don't see how the number of software in/out-puts of vcvrack is related to whatever amount the device has.
@dromer No, that's the code that tells the frontend how many audio channels it has. I imagine you want to change the number of channels in the backend, on JACK's side.
@AndrewBelt I kind of assumed that rtaudio will use that number to present jack with this number of channels as well.
It doesn't make sense here for jack to tell vcvrack what to do. It will accept any number of channels.
Say I want to multitrack 20 channels in ardour, I should be able to create 20 channels in vcvrack and link them up.
edit: seems a limitation of rtaudio: https://github.com/thestk/rtaudio/issues/123
Ah I see, another workaround is to first start a program using jack that provides 8x8 channels. then create an audio module. the module can then 'select' this program as a device. and after that you can do the routing in jack: https://i.imgur.com/CvIPIbL.png
What I would suggest is that vcvrack/rtaudio doesn't depend on what other 'devices' (jack programs) there are, but just creates its own 'virtual device' based on whatever parameters.
But this is probably on the rtaudio side first.
This workaround can be useful at least :)
And maybe something like this if you want another 8x8 to jack: https://i.imgur.com/ZTpdU2N.png
Although it gets hard to track them without being able to name them.
Ideally you just have a parametric module where you can set this directly of course.
I finally got VCVRack working with Jack last night in 0.6.1 after literally weeks of fiddling - I got the audio working pretty quickly but midi was a real pain. This is not entirely VCVRack's fault, as Jack can be confusing at the best of times, but I agree with some of the above comments that VCVRack's interface to Jack appears hamstrung by its (or possibly librtmidi and librtaudio's) model of how audio and midi interfaces should work. For best results, Jack requires thinking about things a little bit differently. Given that both Jack and VCVRack use a flexible model of connecting endpoints together with virtual patch-cables, it seems to me that they should be able to play together a bit more nicely than they do currently.
"So since I imagine the number of JACK users is small,"
Overall yes, but I'd imagine among the sorts of people who run modular synth emulators and DAWs on Linux, the proportion of Jack users would be much, much higher than the background!
@SpacemanPaul I also was struggling for a sec with midi, but basically with the midi module you just select whatever midi-source in jack (use a2jmid for your alsa devices) and connect it from a jack patcher (qjackctl, patchage, claudia).
It actually works really well, just that the concept rtmidi translates to/from jack is a bit weird. It behaves like it connects to a device, but in fact it does nothing more than provide an interface that jack can then do whatever it wants to.
@dromer Yes, I think what happened is that the weirdness you described lead me to try some things that broke a2jmid, which only confused me more and it was really clearing up THAT mess that took the time.
Despite the unreasonable amount of effort I've put into getting it working with everything else I use or want to use, I'm a huge fan of Jack. I find it hard to believe that people can do even semi-pro level music production without it (or something similar).
I find it hard to believe that people can do even semi-pro level music production without it
probably because of
unreasonable amount of effort I've put into getting it working
So I understand that the latest vcv rack should work with jack by default. Is there any special setup I need to make except selecting the right audio output? I am running Ubuntu 16.04 with the latest checkout compiled but I get no sound when routing VCV rack through jack. Other software works, but not rack.
@senisioi are you routing the vcvrack outpots to anything with jack? just selecting jack as output does not connect vcvrack to your soundcard's outputs.
I selected JACK as driver and then the default output. Not sure what else there is. I also routed pulseaudio through jack so that I can get sound from my browser while running jack, I tried routing rack through the pulseaudio output but I still couldn't get any sound. Once I stop jack and route everything through ALSA it works like a charm.
You have to connect Rack outputs with your soundcard physical outs in a
Jack patchbay (qjackctl, ladish or similiar).
niedz., 5.08.2018, 13:40 użytkownik Sergiu Nisioi notifications@github.com
napisał:
I selected JACK as driver and then the default output. Not sure what else
there is. I also routed pulseaudio through jack so that I can get sound
from my browser while running jack, I tried routing rack through the
pulseaudio output but I still couldn't get any sound. Once I stop jack and
route everything through ALSA it works like a charm.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/VCVRack/Rack/issues/868#issuecomment-410514411, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AjRtIWOKcE1pL8S6kWMKlfTOQP4yIdVBks5uNtmzgaJpZM4TCIQB
.
I use and recommend Patchage as a way to get the basics routed.
Thanks folks, I thought the patching will be made automagically. I made it work now.
rtaudio and rtmidi are extremely rudimentary jack clients, so yeah it's very unintuitive how it interfaces.
rtaudio makes it seem like you are connecting to an audio device, but that's not how jack works.
All things work, but i had some big problems making it sound okay. I tried through my default laptop output and through an external soundcard (Behringer UMC204HD) and I always get extra noise and crackles. Even with different sampling rates set, still, I couldn't make Rack sound okay through jack. Alsa gives better sound if I don't try to plug a midi controller. Mybe my laptop can't handle the weight. One more thing, if I use audacity to record the output from rack, I don't hear the extra noise.
I have the same problem as senisioi when running under jack. It sounds ok when I'm on a different workspace in my window manager (i3), but when Rack is on the current workspace (ie. when I can see it) there's lots of crackling and audio dropouts. It's almost as if the graphics are competing for processing time with the audio, and it's the animations that are causing the audio dropouts.
Because it is. Rack is a GPU hog.
sob., 25.08.2018, 06:21 użytkownik diamond-lizard notifications@github.com
napisał:
I have the same problem as senisioi when running under jack. It sounds ok
when I'm on a different workspace in my window manager (i3), but when I
Rack is on the current workspace (ie. when I can see it) there's lots of
crackling and audio dropouts. It's almost as if the graphics are competing
for processing time with the audio, and it's the animations that are
causing the audio dropouts.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/VCVRack/Rack/issues/868#issuecomment-415934318, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AjRtIea8-EgXinSJDYA6UoxA6swk84siks5uUNC4gaJpZM4TCIQB
.
I downloaded the prebuilt Rack 0.6.2b for linux, and when I select Jack output, I cannot see any ports in patchage to connect to system playback. But with Rack compiled from commit fa95c3e63b30537159447d7fa3ffd1bb8474da6a I can see RtApiJack from which I can connect outputs to playback and hear sound.
When compiling, I disabled pulseaudio:
diff --git a/dep/Makefile b/dep/Makefile
index 5fe02ea..463997f 100755
--- a/dep/Makefile
+++ b/dep/Makefile
@@ -153,7 +153,7 @@ ifeq ($(ARCH),mac)
RTAUDIO_FLAGS += -DAUDIO_UNIX_JACK=ON
endif
ifeq ($(ARCH),lin)
-RTAUDIO_FLAGS += -DAUDIO_LINUX_PULSE=ON -DAUDIO_UNIX_JACK=ON
+RTAUDIO_FLAGS += -DAUDIO_UNIX_JACK=ON
endif
endif
Then I compiled like this:
make -j4 dep RTAUDIO_ALL_APIS=1
make -j4
How can I enjoy an official build and get jack output working?
I have also another issue about jack: it keeps losing the connection. "RtApiJack: the Jack server is shutting down this client ... stream stopped and closed!!" followed by "[debug] Audio Interface underflow". @AndrewBelt do you prefer a dedicated ticket for this?
Oh, and in case there is need for genuine user stories telling why jack support is important: I was just able to record vcv rack output to a DAW (tracktion t7) simply by connecting its jack output to the jack input of the DAW. No "vcv bridge", no "vcv host", just plain simple jack connecting apps :)
So since I imagine the number of JACK users is small
I wouldn't be so sure. Ardour and Non DAW are based entirely around it, and have a non-trivial amount of mind share. Qtractor uses it for MIDI. There is also some black magic that allows you to bridge a JACK server to Wine-ASIO.
and also P.S: Apart from the pain of writing it, is there anything stopping a JACK client from living in a module, like the Bridge, or core audio module (in terms of it needing special or unusual privs or access to Rack's objects, for a module, that is)?
Probably not. Manually compiling everything and turning on RtAudio’s JACK support results in something that almost works; the UI is completely wrong (it asks you to select an output device, but what actually happens is it just creates the ports in the background you have to manually connect in the jack patchbay.)
The UI just needs to edge case the “JACK” device. Worst case it disables the source/destination selector and relies on the user hooking it up in the patch bay, best case it gets fixed up to actually connect to the ports you select.
Oh, and in case there is need for genuine user stories telling why jack support is important: I was just able to record vcv rack output to a DAW (tracktion t7) simply by connecting its jack output to the jack input of the DAW. No "vcv bridge", no "vcv host", just plain simple jack connecting apps :)
I’m not sure anyone who uses things with first class jack support is ever the same afterwards :)
I have audio output working as a dedicated module, derived from AudioInterface but ripped apart and running through the JACK APIs instead of RtAudio.
Using an engine sampling rate differen't from Jack's seems to just make everything sound lower pitched, which I'm not sure if that's supposed to be happening. It uses the same code as AudioInterface though, so who knows? Old bug, was fixed.
Just wanted to add my voice to the chorus. Rack on Linux sort of works with ALSA but nothing else. Tried what @wipu suggested above when building, tried the .zip prebuilt from the main site, built Rack several times on both Ubuntu 18.10 and Manjaro 18, can't get any sound out of it using Jack, and manually patching up doesn't make a difference. Meanwhile, other Jack clients are working as expected. Luckily I have a Windows machine Rack runs nicely on, it would just be fantastic having it working on the laptop too.
@Skrylar oh that sounds great. Can we find your module anywhere?
@dromer Stable builds are now in the plugin manager; pre-releases at https://github.com/Skrylar/skjack-vcv
Closing, since Rack supports JACK audio and MIDI through RtAudio and RtMidi.
Confirmed working and no longer an issue. Thanks Andrew! :)
Audio-8 and 16 objects still expect to connect to a "device" which is not appropriate behavior for a jack client.
With audio-16 client the only workaround for me to access all 16 in and outputs is to (for instance) create a track in qtractor with 16 in/out put channels, then tell the the audio-16 module to pick this "device". After this the audio-16 module subsequently presents the 16 in/out ports to jack, which I can then connect to another program (possibly not even qtractor).
This is completely backwards.
@dromer The "appropriate" behavior that you're describing cannot be done with the Driver/Device model of VCV Audio-*. Check out the third-party SkJack plugin for more advanced functionality.
Most helpful comment
Please note that most users will have libjack.so.0 installed, even if the full JACK is not.
libjack is a dependency of quite a few things, including gstreamer, ffmpeg and mplayer.
So dynamic linking expecting a libjack.so works more often than not.
For a static build, a "weakjack" version is needed indeed.
The RtAudio version I include in my own Carla application uses this method.
@AndrewBelt I am willing to maintain a fork of RtAudio+weakjack if you use it in VCVRack.
I already do it for Carla, more or less, it's just together with the rest of the code for now instead of a separate repo.
I do not want to maintain cmake/autoconf/whatever project files though, so I'd need help on that area.