Axel wrote: "try using the a realtime kernel, it's more responsive and the apps "seems to hang less"".
How to do this?
10.10kernelrealtime
Axel wrote: "try using the a realtime kernel, it's more responsive and the apps "seems to hang less"".
How to do this?
Jackd does not normally replace ALSA. Jackd usually uses ALSA to provide it's output. What Jackd provides is a low-latency audio patching/routing network that other software can use. Only software designed to use Jackd will use JackD. Jackd only needs to be run when you are running software that uses it (e.g. Ardour, Rosegarden, Jack-rack). When you are not running a program that uses jackd, you don't have to run jackd.
The best program I have found for controlling jackd is qjackctl, which can be installed through the Ubuntu Software Center as Jack Control. It allows starting/stopping jackd, configuring how it is run, and setting up connections.
In order to get the lowest latency possible, jackd really would like to use real-time priority threads. Enabling real-time processing for jackd is good thing to do and should not hurt your system. (The machine I am typing on right now has had it enabled for 4 years under 2 different Linux distros and 2 different hardware incarnations without any lock-ups.)
BTW, once you start using some of the features of jackd, it gets pretty addictive. By starting up different effects racks (jack-rack instances), and setting up the connections, I can take take a stereo recording and create a real-time 4.2 output where I have different delays reverb/delay for the rear speakers, a custom center channel mix, and a sub-woofer output. (I am still trying to find a good octave doubler for that.)
The patch in this question is for kernel 3.4, and so is the one below; a realtime-patched kernel 3.4 is required.
The new nvidia 302 driver requires the video ABI that xorg-server 1.12 provides, and unfortunately Precise comes with xorg-server 1.11. The following instructions involve adding the xorg-edgers PPA as a software source to provide xorg-server 1.12, and this poses a certain risk of breakage. The uninstallation instructions are at the bottom, but read them through for possible hiccups there.
Create a temporary directory and change into it with:
mkdir -p ~/tmp/nvidia_302_fixrt && cd ~/tmp/nvidia_302_fixrt
Download the nvidia-current_302*.deb from the xorg-edgers PPA by browsing the packages for Precise under nvidia-graphics-driver_302* here. At the moment of this writing, a direct download can be performed with:
wget https://launchpad.net/~xorg-edgers/+archive/ppa/+files/nvidia-current_302.17-0ubuntu1~xedgers~precise1_amd64.deb
Extract the .deb with:
dpkg-deb -x nvidia-current_*.deb deb_contents && dpkg-deb --control nvidia-current_*.deb deb_contents/DEBIAN
Add the patch to the deb_contents/usr/src/nvidia-current*/patches
directory by pasting the following in a terminal:
d=$(echo deb_contents/usr/src/nvidia-current*/patches) ; cat > $d/buildfix_kernel_rt_3.4.patch <<'EOF'
diff -u a/conftest.sh b/conftest.sh
--- a/conftest.sh 2012-05-03 09:49:19.582854050 +0100
+++ b/conftest.sh 2012-05-03 09:52:58.524101586 +0100
@@ -95,7 +95,7 @@
fi
fi
- CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"
+ CFLAGS="$CFLAGS $OUTPUT_CFLAGS -I$HEADERS -I$OUTPUT/arch/x86/include/generated $AUTOCONF_CFLAGS"
test_xen
@@ -965,11 +965,12 @@
#
echo "$CONFTEST_PREAMBLE
#include <linux/acpi.h>
+ #include <acpi/acpixf.h>
void conftest_acpi_walk_namespace(void) {
acpi_walk_namespace();
}" > conftest$$.c
- $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
+ #CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
rm -f conftest$$.c
if [ -f conftest$$.o ]; then
@@ -980,6 +981,7 @@
echo "$CONFTEST_PREAMBLE
#include <linux/acpi.h>
+ #include <acpi/acpixf.h>
void conftest_acpi_walk_namespace(void) {
acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL, NULL);
}" > conftest$$.c
@@ -1604,6 +1606,9 @@
fi
fi
+ RET=0
+ SELECTED_MAKEFILE=Makefile.kbuild
+
if [ "$RET" = "0" ]; then
ln -s $SELECTED_MAKEFILE Makefile
exit 0
diff -u a/nv-linux.h b/nv-linux.h
--- a/nv-linux.h 2012-05-03 09:49:19.622853547 +0100
+++ b/nv-linux.h 2012-05-03 09:56:12.045668690 +0100
@@ -291,7 +291,18 @@
#endif
#endif
-#if defined(CONFIG_PREEMPT_RT)
+#if defined(CONFIG_PREEMPT_RT_FULL)
+typedef raw_spinlock_t nv_spinlock_t;
+#define NV_SPIN_LOCK_INIT(lock) raw_spin_lock_init(lock)
+#define NV_SPIN_LOCK_IRQ(lock) raw_spin_lock_irq(lock)
+#define NV_SPIN_UNLOCK_IRQ(lock) raw_spin_unlock_irq(lock)
+#define NV_SPIN_LOCK_IRQSAVE(lock,flags) raw_spin_lock_irqsave(lock,flags)
+#define NV_SPIN_UNLOCK_IRQRESTORE(lock,flags) \
+ raw_spin_unlock_irqrestore(lock,flags)
+#define NV_SPIN_LOCK(lock) raw_spin_lock(lock)
+#define NV_SPIN_UNLOCK(lock) raw_spin_unlock(lock)
+#define NV_SPIN_UNLOCK_WAIT(lock) raw_spin_unlock_wait(lock)
+#elif defined(CONFIG_PREEMPT_RT)
typedef atomic_spinlock_t nv_spinlock_t;
#define NV_SPIN_LOCK_INIT(lock) atomic_spin_lock_init(lock)
#define NV_SPIN_LOCK_IRQ(lock) atomic_spin_lock_irq(lock)
@@ -954,7 +965,9 @@
return ret;
}
-#if defined(CONFIG_PREEMPT_RT)
+#if defined(CONFIG_PREEMPT_RT_FULL)
+#define NV_INIT_MUTEX(mutex) sema_init(mutex,1)
+#elif defined(CONFIG_PREEMPT_RT)
#define NV_INIT_MUTEX(mutex) semaphore_init(mutex)
#else
#if !defined(__SEMAPHORE_INITIALIZER) && defined(__COMPAT_SEMAPHORE_INITIALIZER)
EOF
Add the patch to dkms.conf by pasting this in a terminal:
d=$(echo deb_contents/usr/src/nvidia-current*) ; cat >> $d/dkms.conf <<'EOF'
PATCH_MATCH[1]="^3\.4.*(rt|realtime)"
PATCH[1]="buildfix_kernel_rt_3.4.patch"
EOF
Modify the version number in deb_contents/DEBIAN/control by issuing:
sed -i 's/^\(Version: .*\)$/\1+rtfix/' deb_contents/DEBIAN/control
Repackage the driver with:
dpkg -b deb_contents nvidia-current_$(sed -n 's/^\(Version: *\)//p' deb_contents/DEBIAN/control)_amd64.deb
Add the xorg-edgers PPA:
sudo add-apt-repository ppa:xorg-edgers/ppa && sudo apt-get update && sudo apt-get dist-upgrade
Install the locally-modified .deb with:
sudo dpkg -i nvidia-current_*+rtfix_*.deb
The xorg-edgers PPA will update with newer versions of the nvidia driver as they come out; you will need to repeat the re-packaging instructions above with each new release.
You should be able to revert to the nouveau
driver with the following:
sudo apt-get remove nvidia-current
sudo apt-get install ppa-purge
sudo ppa-purge ppa:xorg-edgers/ppa
In my case, this process involved uninstalling wine
along with some i386 packages (which should have been downgraded instead). Be wary of ppa-purge
if you are on amd64 since it does not get along well with multiarch (as indicated in the PPA warnings); in my case the outcome was a non-issue (I simply reinstalled wine
), but other people might end up with badly broken dependencies depending on what they have installed.
Best Answer
It seems like rt (and preemp and lowlatency) still haven't landed in the repositories. Maverick is still beta... are you sure you want to try such special kernels in this stage?
I've found a message which covers the issue of which low latency kernels you want to try and, perhaps, a PPA to get it: https://lists.ubuntu.com/archives/kernel-team/2010-March/009323.html
Be cautious, though... There be dragons!