HARDWARE Creative Labs X-Fi

From Gentoo Linux Wiki

Jump to: navigation, search

Image:logo.gif


The X-Fi series of sound cards from Creative Labs is one of the best consumer oriented pieces of audio hardware today. It features:

  • Full Hardware Processing
  • CMSS-3D for virtual headphone surround sound
  • Crystalizer for enhancing compressed audio
  • THX Certified
  • Hardware DTS and Dolby EX

Unfortunately, for years after the Windows release of the card, there existed no Linux driver. Creative has released two drivers now, 1.14, and latest, 1.18. Both have significant reliability problems and do not even compile on most systems.

This HOWTO will demonstrate how to use the 1.18 driver on Gentoo with ALSA built into the kernel. It is a complete and very BAD hack. I will repeat this: THIS IS A COMPLETE HACK!

Warning: You will most likely screw up some part of your system using these drivers and configuring them the way this guide suggests. The drivers are still unstable, there have been reports of crashing X, ALSA, and locking up the whole computer. Using these drivers is like waving a red flag at a bull.....

Contents

[edit] Downloading

First of all, download the driver tarball.

[edit] First build try

FIXME: section yet to be written

[edit] Modifying and Patching

The following listed errors show up in /var/log/creative-installer.log when the installer fails with a Make error 2.

Begin by decompressing the bz2 archive, then recompressing it once all modifications are done.

[edit] Drivers

Error:

LinuxSys.c:648: error: ‘SA_SHIRQ’ undeclared (first use in this function)

This error occurs when using kernel version 2.6.24 or higher. You'll need to change the variable SA_SHIRQ in

drivers/src/ossrc/LinuxSys.c

to

IRQF_SHARED

[edit] ctsound

The drivers/ctsound init script loads all the necessary modules into the kernel and alerts ALSA as to the card's presence. The modules, however, are called in wrong order. In the original version it looks like this:

drivers="ctossrv ctsfman emupia ct20xut ctexfifx cthwiut haxfi ctalsa"

It must be:

drivers="ctossrv emupia ctsfman haxfi ctalsa ct20xut ctexfifx cthwiut", 
[edit] Baselayout 2 and OpenRC Users

An alternate ctsound file must be used. Download and unpack it. Then, replace drivers/ctsound with this file.

FIXME: How?

Thanks to the_root on the Gentoo Forums!

[edit] Kernel Source

If you choose to compile without Creative's ./installer you can skip this step.

Error:

make -C /lib/modules/2.6.24-16-generic/build SUBDIRS=/tmp/xfisrc/src/ossrv modules
make[3]: Entering directory `/usr/src/linux-headers-2.6.24-16-generic' scripts/Makefile.build:46: *** CFLAGS was changed in "/tmp/xfisrc/src/ossrv/Makefile". Fix it to use EXTRA_CFLAGS.  Stop.
make[3]: *** [_module_/tmp/xfisrc/src/ossrv] Error 2
make[3]: Leaving directory `/usr/src/linux-headers-2.6.24-16-generic'
make[2]: *** [module] Error 2
make[2]: Leaving directory `/opt/Creative/XFiDrv_Linux_US-1.18/drivers/src/ossrv'
make[1]: *** [ctossrv] Error 2
make[1]: Leaving directory `/opt/Creative/XFiDrv_Linux_US-1.18/drivers'

Extremely hack fix: Edit

/usr/src/linux/scripts/Makefile.build 

around line 46 and comment out the following lines:

#ifeq ($(KBUILD_NOPEDANTIC),)
       #ifneq ("$(save-cflags)","$(CFLAGS)")
               #$(error CFLAGS was changed in "$(kbuild-file)". Fix it to use EXTRA_CFLAGS)
       #endif
#endif

I'm assuming that you'll want to either unfix this or re-emerge gentoo-sources before you recompile your kernel again.

[edit] Kernel 2.6.25


Please format this article according to the guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article


Verify that the following kernel options are set:

Kernel hacking -> Enable unused/obsolete exported symbols[*]
General setup -> Choose SLAB allocator (SLAB)

Verify that the entire ALSA sound system is build as modules

Device Drivers -> Sound -> Sound card support <M>

Download this modified driver from here

[edit] Installing

[edit] Without Creative's ./installer

Remove all previous installation attempts by deleting:

/etc/init.d/ctsound
/etc/creative
tmp/xfisrc
/lib/modules/'kernel version'/kernel/drivers/ssound/"

Reboot the machine or clear your environment with

env-update

Unpack the installation archive, "cd" to drivers directory, then execute the following:

./configure && make KBUILD_NOPEDANTIC=1 && make install

[edit] With Creative's ./installer

Simply run:

./installer

Be sure the "drivers" directory is repacked. This script automatically unpacks it.

[edit] Running

Unless you're willing to do a multi-card ALSA configuration, do the following:

rc-update add ctsound default (this doesn't seem to work, will investigate)

Reboot, disable your onboard sound you've been using until now :)

The next time Linux loads up, ALSA will start with errors because it's trying to load modules for your now disabled on-board sound.

In the event ctsound didn't load itself:

/etc/init.d/ctsound start

And enjoy!

[edit] Compatible X-Fi Models (add yours)

  • X-Fi XtremeGamer
  • X-Fi XtremeMusic

[edit] Troubleshooting

[edit] Kernel Oops with Reiser FS

If you are using reiserfs you can expect kernel opps, it can be fixed, just open:

/usr/src/linux/fs/reiserfs/file.c , go to "const struct file_operations reiserfs_file_operations = {"

and add this line:

.llseek = generic_file_llseek,

it should look like this:

const struct file_operations reiserfs_file_operations = {
.llseek = generic_file_llseek,
.read = do_sync_read,

Source: Gentoo forums

[edit] External links

Personal tools