Monday, April 21, 2008

Creative XFi driver on Linux 2.6.25

There is still a problem with beta2 version of Creative Sound Blaster XFi driver on Linux kernel 2.6.25. If we do what is said by the driver installation instruction, it ends up with some errors. Here's a trick how to manually compile and install it:



  1. Download the driver from http://us.creative.com/support/downloads/download.asp?searchString=XFiDrv_Linux. or directly from shell: wget http://ccftp.creative.com/manualdn/Drivers/AVP/10530/0xE84AB36F/XFiDrv_Linux_US-1.18.tar.gz
    The latest is version 1.18

  2. Extract the tar.gz file from your build folder:

    tar zxvf XFiDrv_Linux_US-1.18.tar.gz

    This will extract all files to XFiDrv_Linux_US-1.18
  3. cd to the XFiDrv_Linux_US-1.18/drivers
  4. Try to do make (gotta be a root). It will cause some errors (the errors don't appear on the screen. They are logged in /var/log/creative-installer.log and need root access to see it). We can open another window/shell and just type: sudo tail -f /var/log/creative-installer.log to see what's going on.
  5. OK, now we're about to fix these problems. First, just typ: ./configure
  6. Don't do make yet. We need to modify some files.
  7. edit file LinuxSys.c: vi src/ossrv/LinuxSys.c
  8. Goto line 648 and replace SA_SHIRQ with IRQF_SHARED (Kernel 2.6.22 has told us that it was going to deprecate it although still defines it, but in kernel 2.6.25 this SA_SHIRQ is now gone!)
  9. Add the following line after line 33:


  10. #include <linux/fs.h> // for definitions of filp_*
  11. Add the following lines after line 37:

    #include <asm-generic/fcntl.h> // otherwise, some MACROS are undefined


  12. Compile with the following command: sudo make KBUILD_NOPEDANTIC=1 or modify (temporarily!) file /usr/src/linux/scripts/Makefile.build and comment out statements around line 46 as below:

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

  14. Edit file in drivers/ctsound and change the order to:

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

    #endif
  15. Install it: sudo make install

18 comments:

  1. I get an "make: *** [install] Error 2"
    when running sudo make install.

    ReplyDelete
  2. What was reported in /var/log/creative-lab.log ??

    ReplyDelete
  3. This is the last part of the file...



    Building modules, stage 2.
    MODPOST 1 modules
    WARNING: "InterlockedDecrement" [/tmp/xfisrc/src/plugins/cthwiut/cthwiut.ko] undefined!
    WARNING: "register_plugin" [/tmp/xfisrc/src/plugins/cthwiut/cthwiut.ko] undefined!
    WARNING: "heap_free" [/tmp/xfisrc/src/plugins/cthwiut/cthwiut.ko] undefined!
    WARNING: "unregister_plugin" [/tmp/xfisrc/src/plugins/cthwiut/cthwiut.ko] undefined!
    WARNING: "heap_alloc" [/tmp/xfisrc/src/plugins/cthwiut/cthwiut.ko] undefined!
    WARNING: "InterlockedIncrement" [/tmp/xfisrc/src/plugins/cthwiut/cthwiut.ko] undefined!
    CC /tmp/xfisrc/src/plugins/cthwiut/cthwiut.mod.o
    LD [M] /tmp/xfisrc/src/plugins/cthwiut/cthwiut.ko
    make[3]: Leaving directory `/usr/src/linux-2.6.24.4-server-1mnb'
    make[2]: Leaving directory `/home/fredrik/Download/XFiDrv_Linux_US-1.18/drivers/src/plugins/cthwiut'
    cp -f /tmp/xfisrc/src/plugins/cthwiut/cthwiut.ko .
    make[1]: Leaving directory `/home/fredrik/Download/XFiDrv_Linux_US-1.18/drivers'

    make -f /tmp/xfisrc/Makefile.build install
    make[1]: Entering directory `/home/fredrik/Download/XFiDrv_Linux_US-1.18/drivers'
    Copy module files...
    Update module dependency relationships...
    /bin/sh: -c: line 2: syntax error near unexpected token `;'
    /bin/sh: -c: line 2: ` cat .tmp | grep -x -v -e "# Prevent system from loading ctalsa prematurely" -e "" > ; \'
    make[1]: *** [clear_blacklist] Error 2
    make[1]: Leaving directory `/home/fredrik/Download/XFiDrv_Linux_US-1.18/drivers'

    ReplyDelete
  4. I could compile with 'make', but
    I get the same error than the previous post with 'make install':

    make -f /tmp/xfisrc/Makefile.build install
    make[1]: Entering directory `/home/fredrik/Download/XFiDrv_Linux_US-1.18/drivers'
    Copy module files...
    Update module dependency relationships...
    /bin/sh: -c: line 2: syntax error near unexpected token `;'
    /bin/sh: -c: line 2: ` cat .tmp | grep -x -v -e "# Prevent system from loading ctalsa prematurely" -e "" > ; \'
    make[1]: *** [clear_blacklist] Error 2
    make[1]: Leaving directory `/home/fredrik/Download/XFiDrv_Linux_US-1.18/drivers'

    Commenting the lines in the Makefile.build does not work. As I could see, the problem is the variable 'blacklist' (or similar) is empty at the time of executing the command:

    cat .tmp | grep -x -v -e "# Prevent system from loading ctalsa prematurely" -e "" > ; \

    so it fails.
    Any ideas please?

    Anyway, thanks for your help.

    ReplyDelete
  5. Sorry for all the failures. Seems the driver is still not ready for Kernel 2.6.25 just yet. Wait till they release the new one in a few months.

    ReplyDelete
  6. Seems the order of loading modules are wrong.
    As I found somewhere else, the order should be:

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

    This order is specified in drivers/ctsound init script.

    Anyway, please follow the instructions in

    http://www.gentoo-wiki.com/X-Fi#Compatible_X-Fi_Models_.28add_yours.29

    Good luck!

    ReplyDelete
  7. Nice work man!

    I've tryed several guides to compile this driver without success, but this works!!
    Congratulations and nice work!!

    PS: I've installed XFiDrv_Linux_US-1.18 version of the driver in a Gentoo workstation with kernel
    2.6.23-gentoo-r3 ( x86_64 ).

    ReplyDelete
  8. Thanks!!!!!!

    ReplyDelete
  9. Really thx man, works great.

    ReplyDelete
  10. I love you.

    ReplyDelete
  11. Linux novice here in need of help. I've got to 7. on the list, but how do I find line 648? I'm using Ubuntu 8.10. my email is amm12087 at hotmail dot com. I really appreciate any help. Thanks.

    Alex

    ReplyDelete
  12. Hello MLS, first i want to say thanks for the post, its helpful. I did all the steps (including change drivers order and not changing it) several times and when try make install it says [error] 2 or kernel panic and gives me some info about with memory positions :p

    I have Fedora 10 with kernel 2.6.27.5-117.fc10.x86_64
    and XFI fatality pro.

    Have some ideas why?
    Sorry for my english i am from Argentina.
    thanks again in advance.

    Paio.

    ps: I hate creative drivers, they have too much bugs, including windows drivers too.

    ReplyDelete
  13. Thanks a lot man!

    ReplyDelete
  14. To whomever failed to install the driver, please follow the instruction on the Creative website. Creative has had the official driver available (currently only version 1.0). It works with no issues (I am using it on my Linux kernel 2.6.29.2).

    ReplyDelete
  15. Dear MLS,
    Please help! I just got the public release of the XFi Driver, i redownloaded it and it got further than the one i'd already used successfully on Ubuntu but i got a Kernel Panic error pop up (I'm now on Fedora Core 11 due to it supporting my RAID controller out the box) so what can i do?

    Email me on: chaoshusky.removethis@gmail.delete.com

    ReplyDelete
  16. http://wiki.debian.org/X-Fi
    Be wary- if you get a very long list of modules to be removed from
    "aptitude remove alsa-modules-$(uname -r)"
    do not execute it!
    Just skip. Otherwise you will remove stuff you need.

    ReplyDelete
  17. Finally, the driver is now officially supported in kernel 2.6.35.y

    ReplyDelete
  18. I wanted to download this driver for my linux. Thank you.

    ReplyDelete