KX mini manual

Unofficial support for the KXStudio Linux distribution and applications.
More info at http://kxstudio.linuxaudio.org/

Moderators: khz, MattKingUSA

danboid
Established Member
Posts: 1305
Joined: Sun Aug 26, 2012 11:28 am
Location: England

Re: KX mini manual

Postby danboid » Tue Apr 30, 2013 9:50 am

I was planning to build the PDF from the wiki, yes. The problem is that, except for the last 'Useful links' chapter, I'll prob have to unembed the links for the PDF.

One of the aspects I really like about AV Linux is that it is desgned to be fully usable straight after installation. Even if you don't have an internet connection and you were new to Linux, you'd still be able to get off the starting blocks because the PDF manual is included on the DVD.

My desire to replicate this great feature for KXStudio is the reason I started the KX docs we have on the wiki now, but when they're 'finished' I think F wants to mirror and/or reformat them for inclusion on his site. I don't think that version will be publicly editable though.
Are you new to Linux Audio? This manual explains how to install KXStudio, set up and use JACK, mimimize latency, lists the best Linux AV apps and much more all in a concise and easy to understand format.

http://wiki.linuxaudio.org/wiki/kxstudio_manual

RockHopper
Established Member
Posts: 142
Joined: Thu Apr 18, 2013 3:19 pm
Contact:

Re: KX mini manual

Postby RockHopper » Tue Apr 30, 2013 12:09 pm

Sorry to be a nuisance, I just noticed on the “Cadence Introduction” page under “Jack Status” it states that “Latency is the delay in milliseconds between the audio being received by JACK and being sent to the output device.” Cadence (as well as Ardour and other apps) actually only shows the capture latency – the time taken to fill up the audio capture buffer. To get the total latency of a system:

Total latency = capture latency + playback latency + loopback latency

Capture latency = “Buffer Size” / “Sample Rate”
Playback latency = “Periods/Buffer” x “Buffer Size” / “Sample Rate”
Loopback latency = “jack_iodelay result” / “Sample Rate”

I ran jack_iodelay as per your instructions to check this:

Sample Rate: 48000
Buffer Size: 128
Periods/Buffer: 2

Capture latency = 128 / 48000 = 2.7ms
Playback latency = 2 x 128 / 48000 = 5.3ms

Output from jack_iodelay:

444.608 frames 9.263 ms total roundtrip latency
extra loopback latency: 60 frames
use 30 for the backend arguments -I and -O

Loopback latency = 60 / 48000 = 1.2ms

Total latency = 2.7 + 5.3 + 1.2 = 9.2 ms (as confirmed by jack_iodelay)
Last edited by RockHopper on Tue Apr 30, 2013 2:36 pm, edited 1 time in total.

wolftune
Established Member
Posts: 1302
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Contact:

Re: KX mini manual

Postby wolftune » Tue Apr 30, 2013 1:31 pm

danboid wrote:I was planning to build the PDF from the wiki, yes. The problem is that, except for the last 'Useful links' chapter, I'll prob have to unembed the links for the PDF.

One of the aspects I really like about AV Linux is that it is desgned to be fully usable straight after installation. Even if you don't have an internet connection and you were new to Linux, you'd still be able to get off the starting blocks because the PDF manual is included on the DVD.

My desire to replicate this great feature for KXStudio is the reason I started the KX docs we have on the wiki now, but when they're 'finished' I think F wants to mirror and/or reformat them for inclusion on his site. I don't think that version will be publicly editable though.


But Dan, there is no point in making links readable if there's no internet connection! Anyway, PDFs can include embedded links so that someone reading the PDF can still access the link and even copy the URL as long as they are reading on a computer and not on printed paper. But my point is: if they have an internet connection, they can use the wiki. Now, if they don't have connection, it certainly is nice to include an offline PDF or something, but then links are useless anyway!
Aaron Wolf
Music teacher, scholar
http://wolftune.com

Pablo
Established Member
Posts: 1269
Joined: Thu Apr 17, 2008 9:57 pm

Re: KX mini manual

Postby Pablo » Tue Apr 30, 2013 5:34 pm

RockHopper wrote:To get the total latency of a system:

Total latency = capture latency + playback latency + loopback latency

Capture latency = “Buffer Size” / “Sample Rate”
Playback latency = “Periods/Buffer” x “Buffer Size” / “Sample Rate”
Loopback latency = “jack_iodelay result” / “Sample Rate”

I ran jack_iodelay as per your instructions to check this:

Sample Rate: 48000
Buffer Size: 128
Periods/Buffer: 2

Capture latency = 128 / 48000 = 2.7ms
Playback latency = 2 x 128 / 48000 = 5.3ms

Output from jack_iodelay:

444.608 frames 9.263 ms total roundtrip latency
extra loopback latency: 60 frames
use 30 for the backend arguments -I and -O

Loopback latency = 60 / 48000 = 1.2ms

Total latency = 2.7 + 5.3 + 1.2 = 9.2 ms (as confirmed by jack_iodelay)


However, note that jack1 and jack2 behave differently.

In jack2, by default, as you noted (just summing capture + playback latency here):

Capture latency + playback latency = “Periods/Buffer + 1” x “Buffer Size” / “Sample Rate”

However, in jack1, there is one period less latency. Like this:

Capture latency + playback latency = “Periods/Buffer” x “Buffer Size” / “Sample Rate”

You can use the synchronous mode in jack2 to make it behave like jack1 and hence reduce latency. Just add --sync to the jackd command.

With the settings above + sync mode, one period counts for 2,7 ms, so total latency will result in 2.7 x 2 + 1.2 (extra in your case) = 6.6 ms

RockHopper
Established Member
Posts: 142
Joined: Thu Apr 18, 2013 3:19 pm
Contact:

Re: KX mini manual

Postby RockHopper » Tue Apr 30, 2013 9:41 pm

Pablo wrote:You can use the synchronous mode in jack2 to make it behave like jack1 and hence reduce latency. Just add --sync to the jackd command.


Ah, that’s interesting! I tried to find out more about synchronous/asynchronous mode on the JackAudio wiki. From the table it seems it has to do with multiprocessor support, but the explanation went somewhat over my head:

Jack2 can run in 2 different modes : "asynchronous" when the server does not wait for graph end for a given cycle but just write the outputs computed at the previous cycle. In this case an extra period of latency is added. Jack 2 can also be run in "synchronous" mode, when the server waits for the graph activation end in a given cycle, in which case it works like Jack 1.


I’m guessing this means that in asynchronous mode Jack2 can support multiple processors at the expense of an extra period of latency, and in synchronous mode latency is reduced at the expense of ditching multiprocessor support?

tbritton
Established Member
Posts: 33
Joined: Sun Jan 29, 2012 4:22 am

Re: KX mini manual

Postby tbritton » Tue Apr 30, 2013 10:02 pm

While discussing latency, keep in mind that you'll want to use even-numbered latency "theoretical" numbers when employing a USB interface, as explained in this article:

List of JACK Frame & Period settings ideal for USB interface

Or link to the same info at the Wiki: http://wiki.linuxmusicians.com/doku.php ... _interface

Feel free to include this table in the PDF if you like.

Terry
Last edited by tbritton on Tue Apr 30, 2013 10:07 pm, edited 2 times in total.

danboid
Established Member
Posts: 1305
Joined: Sun Aug 26, 2012 11:28 am
Location: England

Re: KX mini manual

Postby danboid » Tue Apr 30, 2013 10:05 pm

Rockhopper:

Thanks for pointing that out - it was a pretty major error so I have now fixed it with a hopefully more accurate description.

Pablo:

Thanks for pointing that out but KXStudio ships J2 and I'm not even going to discuss JACK1 vs JACK2 in this manual - its the sorta stuff only devs and advanced users need to know.

Wolftune:

I'm not so sure about embedded links within PDF files - I need to think about that more but whats for sure is the installation chapter isn't much use right now without reproducing the Ubuntu install guide. There are a number of links that are extraneous and non-critical too.
Are you new to Linux Audio? This manual explains how to install KXStudio, set up and use JACK, mimimize latency, lists the best Linux AV apps and much more all in a concise and easy to understand format.

http://wiki.linuxaudio.org/wiki/kxstudio_manual

danboid
Established Member
Posts: 1305
Joined: Sun Aug 26, 2012 11:28 am
Location: England

Re: KX mini manual

Postby danboid » Tue Apr 30, 2013 10:10 pm

Hi Terry!

I went through most of the suggested settings on that list but in the end I discovered that I got the best performance using the usual power of 2 buffer sizes 'recommended' by Cadence and 'enforced' by qjackctl (without editing config files, I think) and I've also heard of some plugins having difficulty with non power of 2 buffer sizes.

Thanks for the suggestion!
Are you new to Linux Audio? This manual explains how to install KXStudio, set up and use JACK, mimimize latency, lists the best Linux AV apps and much more all in a concise and easy to understand format.

http://wiki.linuxaudio.org/wiki/kxstudio_manual

danboid
Established Member
Posts: 1305
Joined: Sun Aug 26, 2012 11:28 am
Location: England

Re: KX mini manual

Postby danboid » Tue Apr 30, 2013 10:38 pm

Pablo:

Sorry, what I meant to say was I may mention about sync mode but I don't think we need to go into any equations or deeper detail for the purposes of this manual.

Is rockhopper correct in his assumption about async mode enabling SMP support (at the expense of latency)?
Are you new to Linux Audio? This manual explains how to install KXStudio, set up and use JACK, mimimize latency, lists the best Linux AV apps and much more all in a concise and easy to understand format.

http://wiki.linuxaudio.org/wiki/kxstudio_manual

Pablo
Established Member
Posts: 1269
Joined: Thu Apr 17, 2008 9:57 pm

Re: KX mini manual

Postby Pablo » Wed May 01, 2013 7:56 am

I use jack2 in sync mode because years ago, for my simple recording setups, I found it more robust in addition to reducing latency.
However, I am not an expert and I can't add anymore to what faltkx and the jack wiki say.

Danboid: About the kxstudio wiki, great work! I am not sure if it is worth mentioning the sync mode but I agree on keeping it simple.

Cheers! Pablo

wolftune
Established Member
Posts: 1302
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Contact:

Re: KX mini manual

Postby wolftune » Wed May 01, 2013 5:08 pm

I'd like to add: The whole recent discussion about buffer sizes, Jack1 vs Jack2, sync mode, all this is totally baffling to me.

Either:

(A) it is really not important and should be left out of the manual
OR
(B) it actually matters, in which case I hope it will be included somewhere because I am confused and want to read an easy-to-follow manual thing about this.
Aaron Wolf
Music teacher, scholar
http://wolftune.com

Pablo
Established Member
Posts: 1269
Joined: Thu Apr 17, 2008 9:57 pm

Re: KX mini manual

Postby Pablo » Wed May 01, 2013 6:04 pm

Maybe this article can shed some light:

http://apps.linuxaudio.org/wiki/jack_latency_tests

Note that this article is not very recent. For example, they refer to "jack_delay" which is the original tool for measuring latency. Jack devs merged jack_delay into jack and they even improved it by adding the recommendations for latency compensation. And they called it jack_iodelay.

Jack_iodelay is the only way to know the total round trip latency, and this includes what the article calls the "processing latency" (which only depends on jack settings, i.e, frames per period, periods per buffer, sample rate and async/sync mode) and the rest, which jack_iodelay calls "extra loopback latency". The latter can and should be compensated, as per jack_iodelay instructions, as the KXstudio wiki already explains.

But there are some caveats.

For PCI cards, at least for my m-audio card, the extra latency doesn't vary with jack settings. It is always 60 frames, more or less, so the total latency only depends on jack settings and the compensation works fine for any settings.

However, it seems that, surprisingly, for USB cards not only the processing latency changes with jack settings, but also the extra latency. Do some test to see what I mean.

danboid
Established Member
Posts: 1305
Joined: Sun Aug 26, 2012 11:28 am
Location: England

Re: KX mini manual

Postby danboid » Wed May 01, 2013 7:59 pm

New chapter 'Package Management' done

http://www.wiki.linuxmusicians.com/doku ... management

I decided against covering apt-get, aptitude, dpkg etc etc and instead I have just covered the bare essentials ie how to update, install, remove and fix packages mostly just using Muon.

We could include a link to a more detailed guide to APT and friends but I think I've covered enough to get people going.
Are you new to Linux Audio? This manual explains how to install KXStudio, set up and use JACK, mimimize latency, lists the best Linux AV apps and much more all in a concise and easy to understand format.

http://wiki.linuxaudio.org/wiki/kxstudio_manual

danboid
Established Member
Posts: 1305
Joined: Sun Aug 26, 2012 11:28 am
Location: England

Re: KX mini manual

Postby danboid » Wed May 01, 2013 8:07 pm

Just the one chapter left to do now!

:D
Are you new to Linux Audio? This manual explains how to install KXStudio, set up and use JACK, mimimize latency, lists the best Linux AV apps and much more all in a concise and easy to understand format.

http://wiki.linuxaudio.org/wiki/kxstudio_manual

wolftune
Established Member
Posts: 1302
Joined: Fri Feb 24, 2012 7:40 pm
Location: Portland, OR
Contact:

Re: KX mini manual

Postby wolftune » Wed May 01, 2013 9:08 pm

Hi Dan and all,

I added to and edited the new chapter, mostly clarifying wordings, but also section on adding PPA's and some other items. I think it's better in many ways, but it could use further edits to get to a more accessible point.

I agree overall with being minimal here and not getting into too much CLI stuff. On the other hand, I think it would be easy enough and helpful to just mention in places what the CLI version of each action is. I didn't do that at this time though.

PROBLEM: The wiki is interpreting two hyphens and turning them into an n-dash which means a non-functional command (see the last thing on the page).
Aaron Wolf
Music teacher, scholar
http://wolftune.com


Return to “KXStudio Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests