Mixxx real time fix

Da My-Lab.

It's notorious that, while scratching, real time is fundamental. But how to get it on linux? How to reach for very low latencies with your box? The first step is to configure jack properly. Jack is a pro audio server for linux which enables you to reach very low latencies; all you have to do is to fire up an

sudo apt-get jackd

next, launch qjackctl, select the right card, set up frames and periods, and start; you'll probably have to try for different values in order to get something useful out of it. Next come mixxx. Just go on htp://www.mixxx.org and download the latest release. It's good! You'll probably end up with a setup which is good but not so fast. Here comes optimization.

Indice

Step 1: Real Time

Download latest low latency kernel (preempt) and restart your computer. Now you'll be able to use jack with real time mode

Step 2: Fix that damn ntfs external disc

If you store your songs on an external hard drive (very probable, since you'll need flac files, not mp3, in order to achieve good scratchings) it's probable that it's formatted under ntfs. That's a problem. Yes it works, but it's a userspace driver, and it's not that fast. My suggestion is to switch to fat32, which is windows compatible, or even better, to ext4 which is faster and safer (but not windows compatible). If you still want to use ntfs what you should do, when using mixxx, is to disable ntfs-3g.

I know it's quite a pain: without ntfs-3g, you'll not be able anymore to write on your external disc, you'll be able only to read data from it. But, there comes the threadoff, you'll get a kernel space driver. Which goes faster and is real-time ready. I kindly suggest you to try, it's just as easy as a:

sudo umount /media/YOURDISCNAME
sudo mkdir /media/windows
sudo mount /dev/hdNUMBER /media/windows -t ntfs -o umask=0222,utf8

Step 3: Fix that nvidia driver

Nvidia's powermizer feature is a great one as long as power saving is concerned. But it's problematic in a real time context: imagine you have to run at a costant speed, and someone in a moment, and without telling you anything, changes gear down. Will you be able to keep on running at a costant speed? Probably not, so for our purpouse is better to disable this feature. We'll leave thing untouched for battery mode, since power saving is important while on battery, but when we're in AC mode, real time is more important.

Fire up a:

sudo gedit /etc/X11/xorg.conf

and add this line:

 Option     "RegistryDwords"    "PowerMizerEnable=0x1; PerfLevelSrc=0x2222; PowerMizerDefault=0x3;
PowerMizerDefaultAC=0x1"

(all in a line)

inside the Device section. As a side effect you'll notice a faster graphical system in general.

Debugging Real Time Errors

It's an hard, but not an impossible, task. First of all, you'll need a lot of time to do this. Run your system long and verify: do real time error trigger when you fire up a specific action? If yes, who are the component involved responding to your request?

Do your errors verify with no cause-effect schema? Than it should be something that runs on background. Monitor your processes with top, change priorities and watch on.

With some patient, you'll get a perfect, fast, economic system.