- UCLA M.S. Computer Science
- Android Developer
- Freelance IT
or, thoughts from a random graduate student
I took the plunge and upgraded my main machine to 11.10 from 11.04 today. Altogether not too bad since underneath the much maligned Unity lies compiz and ccsm still configures everything I actually care about. The one thing that did break on upgrade however was my sound. I happen to have a Sound Blaster X-Fi Titanium HD (etc etc), which according to Google searches, seems to be the source of quite a few people’s headaches. Specifically, the X-Fi Titanium HD is recognized by the snd_ctxfi driver, but prior to approximately 6/14/2011, it was recognized as an older model, which caused improper behavior, and if you were quick on the kernel logging, yielded messages similar to these:
[ 4881.961765] SB-XFi 0000:02:00.0: setting latency timer to 64 [ 4918.787949] SB-XFi 0000:02:00.0: PCI INT A disabled [ 4918.787955] ctxfi: Something wrong!!! [ 4918.787969] SB-XFi: probe of 0000:02:00.0 failed with error -1
Quick check on gmane.linux.alsa.devel shows that this fellow Harry Butterworth has put a lot of effort into patching up the driver to support the new card in these messages. The ALSA project’s git repositories show that these three patches are required to make things work:
Now that I have the requisite background info, it’s time to get to solving the problem. At the time of this writing (10/14/2011), the version of the Linux kernel package Oneiric uses is 3.0.0-12.20 (full package: linux-image-3.0.0-12-generic). Let’s start off by fetching the source for the kernel with:
sudo apt-get install linux-source
This places the Ubuntu kernel source at /usr/src. We need to go there and unpack it somewhere useful.
mkdir ctxfi-module cd ctxfi-module cp /usr/src/linux-source-3.0.0.tar.bz2 . tar xfj linux-source-3.0.0.tar.bz2
We now need to patch the unpacked kernel source with the proper patches from above. In this version of the source (linux-source-3.0.0-12.20), patch 1 has already been included.
patch -p1 < /path/to/patch2 patch -p1 < /path/to/patch3
We need to now build our new kernel module. I found useful directions at the Ubuntu wiki page on custom kernel builds. Before doing that however, I noticed my current linux-headers package didn’t have the PCI_ID for the X-Fi Ti HD, so I added this line:
#define PCI_SUBDEVICE_ID_CREATIVE_SB1270 0x0062to
/usr/src/linux-headers-`uname -r`/include/linux/pci_ids.h
file at line 1308, as in patch 1. Then I followed the make directions in from the Ubuntu wiki.
make -C /usr/src/linux-headers-`uname -r` M=`pwd` KBUILD_SRC=`pwd`/../../.. modules sudo make -C /usr/src/linux-headers-`uname -r` M=`pwd` KBUILD_SRC=`pwd`/../../.. modules_install sudo depmod -a sudo update-initramfs -u
This installed the snd_ctxfi.ko module to:
/lib/modules/`uname -r`/extra/snd_ctxfi.ko
From there it’s a simple matter to rmmod snd_ctxfi and insmod your newly patched one. This got sound working for me again.