 Hey, it's ANFA and you're watching ANFA vlog today. I'm gonna talk about Jack audio connection kit and important things that surround it So if you're new to Linux audio you've probably heard the name Jack and it's all over the place, but what is it? What is Jack? Jack is a sound system that allows Independent programs to process audio together if you're used to work with a digital audio workstation You know that it has a mixer. It has a sequencer. It has effect slots, etc With Jack your whole system is like a one big DAW where everything can work together That's a very useful tool and I can't imagine not being able to pull those cables and put them where I want Using Jack you can also turn your Linux machine into a live music performance workstation with various software synthesizers, MIDI processors, effect racks, looping machines, Samplers and all that great stuff. Not everything can be achieved with a plugin Sometimes what you need is a standalone program and because of Jack, this is not a limitation anymore A bit of technical stuff So Jack is a sound system that runs a server that keeps everybody in sync The programs that connect to the server are called Jack clients The server passes around the data and makes sure everybody gets what he needs to get the sound done Jack itself can be extremely fast and reliable as the phenomenon of modduo shows where an embedded Linux system is Running a very versatile and highly configurable Stompbox or multi-fx processor that can be used live on stage or in a studio if you're interested check out moddevices.com A basic jack configuration Let's take a look at the basic jack server configuration One tool to do this is QJack CTL, which I'm running right here I'll use it to show you around the jack server settings. So here we access the settings Just click on setup and the first thing to do is select the audio interface. It's conveniently on the first page that opens and Here we have a list Devices that only feature MIDI interface are shown here also, but well using them won't give you any audio capabilities I'm right now using this one But I'm running it from cadence So like this doesn't really matter if you're using an on-board PCI or externally USB audio interface You're gonna go with also driver But if you have a firewire interface, you might need a different driver There's also a couple of different ones like the net and net one that can be used to arrange and network of Computers processing audio together through LAN, but that's an entirely different topic The buffer once we've got the driver and the device selected we need to take care about the buffer The buffer determines the amount of audio data that the jack server and clients are processing at once The bigger the buffer the more time there is between each buffer So there is left over head of just passing over the buffers and more time can be spent on just processing the sound Which is good if you're low on CPU power on the other hand the bigger the buffer they hire the latency Which means a delay the time that you need to wait before the sound actually is ready So if you're having too much of a buffer You won't really enjoy playing a guitar with live effects or playing a synthesizer because you will hear that the sound is lagging behind what you play and that's not really good But if you set your buffer too low your DSP load will go up to 100% and you will hear X runs X runs The X run is a situation when your CPU didn't manage to process the audio buffer on time The sound will pop click stutter break Glitch out and generally be very broken jack server measures the amount of X runs and Also measures how close you are to having an X run By overloading your system here We have the DSP load which is at 8% And what is right now happening with the DSP is that my voice is processed Using a bunch of plugins if the DSP load is near 100% You're in the danger zone and the sound might glitch out However, you might have your DSP load meter way down low and still get a crap ton of X runs If you set your buffer to a ridiculously low value like 32 samples or lower X runs. What can you do? Well, try making the jack buffer bigger Here it is frames per period. This is the basic number. I usually use between 256 and 124 and Periods per buffer. This is like a multiplier for the higher if you have four of them The buffer will be twice as big I usually go with just two if using a bigger buffer is not an option because of the latency You might try removing some of the processing for example Maybe you could get out with just two stacked compressors instead of eight Finally, you might consider upgrading your hardware to give yourself more CPU power to crunch the numbers But there's one thing to try before doing that and I'll talk about it in a minute By the way, the higher the sampling rate the shorter the latency for the same buffer settings Why because you have more samples in a single second So the buffers need to be shorter in time while having the same amount of samples in them I usually go with 48 kilohertz sampling rate, but that's just personal preference I know that a lot of people like using 44.1 kilohertz Here's the setting for the sampling rate. Yay There's a ton of stuff that can affect your jack performance But if you're having really bad performance, it might be because your system is not tuned properly life systems to benchmark your hardware So a quick thing is to try out live CDs of various Linux audio related distributions like AV Linux or cake studio live DVD These are complete glue and Linux systems that are tuned to have great performance with Jack And you can install them on a thumb drive and run them on your machine and see how it performs with that You might want to pick out the UV05 episode where I talk about cake studio and among other things about installing it on the USB stick The real-time mode Jack has a setting called real-time scheduling And this is indicated here by the RT Jack server mode Yeah, it's an easy and real-time scheduling and the settings. There's a checkbox titled real-time and what it does it makes Jack server use the Higher priority in the system so that it can meet the deadline meaning it can process the audio without dropouts However, for this to work You need a special kernel and most distributions like Ubuntu and Linux Mint ship with a generic kernel that doesn't support this So what we need is a low latency kernel you can search for Linux dash low latency and You'll find this complete low latency Linux kernel if you install this your system is going to boot up using that kernel next time But be warned that swapping kernels might cause your system not to boot So make sure you know what to do when you are welcomed with a black screen after reboot However, most of the time it's safe Jack transport Jack transport is a feature that allows different programs to play in sync I use that for example to record githers and vocals in our door while Programming drum patterns in a hydrogen or when I work on an animation in Blender or video editing in Blender And I want to edit audio at the same time in our door I can also use Jack transport to sync the timelines and play heads and make these programs play together like they were one Which is very helpful and makes it all feel much more integrated QJack CTL controls. Let's take a look at the main QJack CTL controls Right here. We have the Jack transport controls. I can start a transport. You can see it's rolling and the current Transport position is rolling I can pause this you can get it to the start or Skip one second ahead one second back So about the transport controls we have the main display and we can see that the jack server is active. It's running It's using the a real-time scheduling the DSP load is about 10% We're running 48 kilohertz sampling rate. We haven't had any extra runs The transport is stopped and it's at zero. It's stopped jack transport also conveys the information about beats per minute So if I have Ardor and hydrogen synced together if I change the tempo in Ardor Hydrogen will follow the connect and patch bay are places to do connections Connect is a manual thing And you can see some connections that are right now active in my system Here are the different effects That are hosted in Carla right there behind you can see my voice being processed right here and there's also the OBS jack input. This is what is recorded. We have also midi For jack midi and also for awesome midi because there are two midi standards the patch bay does a similar thing But you can create presets Define the names and Save them and the jack patch bay is going to restore them automatically when the clients with certain names appear so this is something useful if you have for example a Hardware setup and you want a software setup and you want this to be connected automatically in a certain way you can set it up and Make it go. Also in the setup you can go Start and MISC start jack audio server on application startup So that the jack server will be started when you start QJack CTL and you can use your system Auto-run even cron. No not cron tab. You can use your system auto-run to make QJack CTL and run automatically However, I used these kind of hacks in the past But since I use KX Studio, I don't need it because it gives configuration to do this automatically Finally the start and stop buttons are used to run and kill the jack server You're going to need this when you're changing something big about the jack server configuration For example, if you want to change the device, you need to stop the server go to setup Change the use audio interface Click okay, and then start it again and see if it runs If it doesn't try changing the buffer size Click okay, and start it again Troubleshooting many times I couldn't get jack server to run and here's two things to check for if you're having that problem First make sure that no other audio related program is running and that includes web browsers and full-saudio sound server and anything else that could play or record any sound because it might Block your sound card and jack is unable to access it in the past. I used to use a command pseudo alsa force Reload And what it does it reloads all the also related kernel modules a whole also driver And it forces to quit every programs that are using that so if it's something was blocking your sound card It's gonna be dead. However for some time this didn't solve the problems for me So something changed essentially and I'm not gonna run this because it would blow up my system the second thing to check is if your sound card supports the Sampling rate or the buffer size because I seen Jack refused to start with certain sound cards Not accepting a very low or very high buffer sizes That's it for now if you want to know more about Jack head over to its website and You can also find there a very fine list of interesting programs to try out once you get it running Thanks for watching if you have any questions or suggestions of what I should talk about in the future episodes Please leave them in the comments and I will see you in the next video. Bye. Oh By the way, there's a little bonus check it out The buffer determines the amount of audio data that