Kernel Compile and Restricted Modules Issue

Asked by Sertan

Hi there,

I'm using Ubuntu Feisty 7.04 i386 architecture. I also enabled Ubuntu Studio repositories to benefit from music apps.

My computer has a hardware issue to randomly recognize my mainboard soundcard and Creative soundcard. I want my Creative soundcard to be recognized.

My hardware components are:
AMD Athlon 64 3000+ Processor
Creative SB Audigy 2 ZS
Asus A8V Mainboard

I have previously dealt with the problem by compiling my own kernel and removing all the modules except Creative's.

But after compilation I have to install Nvidia restricted modules and now newer kernels need SATA modules manually enabled, which I ,frankly, need some guidance.

I want to compile latest of two kernels: generic and lowlatency (from Ubuntu Studio). I believe 2.6.20.16.28.1's are in the latest in the Ubuntu official repositories. I'm using 2.6.20.15.14-generic (which has the soundcard recognition problem) and the same version of the lowlatency kernel (which is not booting due to Nvidia restricted modules are not manually installed but should have the sound problem if it were to boot)

I would also appreciate help on compilation (a ubuntu patch maybe), a link to a good how-to to remember kernel compilation or any friendly advice on the process.

Thanks in advance,
Sertan

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Cesare Tirabassi
Solved:
Last query:
Last reply:
Revision history for this message
Thomas Templin (coastgnu) said :
#1

On Mon, 28. May 2007 12:13:33 Sertan wrote:
> Question #7302 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/7302
>
> Description changed to:
> Hi there,
>
> I'm using Ubuntu Feisty 7.04 i386 architecture. I also enabled Ubuntu
> Studio repositories to benefit from music apps.
>
> My computer has a hardware issue to randomly recognize my mainboard
> soundcard and Creative soundcard. I want my Creative soundcard to be
> recognized.
>
> My hardware components are:
> AMD Athlon 64 3000+ Processor
> Creative SB Audigy 2 ZS
> Asus A8V Mainboard
>
> I have previously dealt with the problem by compiling my own kernel and
> removing all the modules except Creative's.
>
> But after compilation I have to install Nvidia restricted modules and
> now newer kernels need SATA modules manually enabled, which I ,frankly,
> need some guidance.
>
> I want to compile latest of two kernels: generic and lowlatency (from
> Ubuntu Studio). I believe 2.6.20.16.28.1's are in the latest in the
> Ubuntu official repositories. I'm using 2.6.20.15.14-generic (which has
> the soundcard recognition problem) and the same version of the
> lowlatency kernel (which is not booting due to Nvidia restricted
> modules are not manually installed but should have the sound problem if
> it were to boot)
>
> I would also appreciate help on compilation (a ubuntu patch maybe), a
> link to a good how-to to remember kernel compilation or any friendly
> advice on the process.

You just have to disable the onboard sound in your mainboards BIOS.
Have a look into the mainboard vendors dokumentation shipped with your
mainboard for this.
So the Audigy will be the one and only sound device to discover.
No need for building a new kernel.

regards,
thomas

Revision history for this message
Sertan (sertansenturk) said :
#2

Thanks for such a fast answer.

In forums I have read that disabling from BIOS may not work sometimes, kernel may somehow grab the unwanted hardware. I do not know the reason but I have the same issue.

The mainboard's audio controller (OnBoard AC'97 Audio) have always been disabled in my BIOS configuration, yet I randomly have the two soundcards work.

Revision history for this message
Alan Pope 🍺🐧🐱 🦄 (popey) said :
#3

Could you blacklist the kernel module for the device that doesn't work?

Edit /etc/modprobe.d/blacklist

Revision history for this message
Sertan (sertansenturk) said :
#4

Yes, I have put the module "snd-via82xx" into /etc/modprobe.d/blacklist and still it can pick the mainboard's soundcard.

I am also sure that if I were to remove the corresponding module and if the kernel tries to pick it (and cannot find), it won't bother to pick emu10k1 (Creative's module) afterwards.

Above solutions didn't worked for me in my previous compilation (Edgy) and they didn't worked for Feisty either. Sorry.

Revision history for this message
Cesare Tirabassi (norsetto) said :
#5

This is interesting, we have the same hardware yet I do not suffer from any sound problem.
Actually, I'm using both cards without any problems.

In any case, no need to recompile the whole kernel, just the modules should do.
Grab the alsa-source module and follow the instructions in /usr/share/doc/alsa-source/README.Debian
Make sure to run dpkg-reconfigure alsa-source as root and select only the emu10k1 module.

Revision history for this message
Thomas Templin (coastgnu) said :
#6

On Tue, 29. May 2007 15:23:58 Sertan wrote:
> Question #7302 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/7302
>
> Status: Needs information => Open
>
> Sertan gave more information on the question:
> Yes, I have put the module "snd-via82xx" into /etc/modprobe.d/blacklist
> and still it can pick the mainboard's soundcard.
>
> I am also sure that if I were to remove the corresponding module and if
> the kernel tries to pick it (and cannot find), it won't bother to pick
> emu10k1 (Creative's module) afterwards.
>
> Above solutions didn't worked for me in my previous compilation (Edgy)
> and they didn't worked for Feisty either. Sorry.

As a last fallback to solve your problem there is a *dirty*hack* which will
help.

If you move the kernel module of your onboard audio chipset to another place
it can't be found during boot. And by this the one and only audio device
recognized will be your audigy card. (So you also can avoid compiling a new
kernel)

For this search for the kernel module first. Open a terminal and start:
 sudo find /lib/modules/$(uname -r) -iname snd-via82xx*

Note: In the above command line the part $(uname -r) tells bash to insert the
      putput of the command 'uname -r' at this point. The correct term for
      this is command substitution and is one of the core principles of Linux
      and UNIX shells as there are bash, c-shell and others.
      You my test this by typing:
        echo $(uname -r)
      or just:
        uname -r
      in a terminal.

This will give the location of the snd-via82xx kernel modules.
For my system it shows:
 /lib/modules/2.6.20-16-lowlatency/kernel/sound/pci/snd-via82xx-modem.ko
 /lib/modules/2.6.20-16-lowlatency/kernel/sound/pci/snd-via82xx.ko
For your system it will show another location, so this is only an example.

Now you can move them to a place where they are not seen during the startup
(But not to /tmp because /tmp is cleaned during every startup!)
In this example I will use the directory /root/modules.
So first we need the directory /root/modules to be created. For this start in
a terminal:
 sudo mkdir /root/modules

Now we can move the modules to this place. Start in a terminal:
 sudo find /lib/modules/$(uname -r) -iname snd-via82xx* -exec mv \
 {} /root/modules/ \;

Note: The '\' at the end of the first line is a linebrak, if you put both
      lines in a single line you have to remove the '\'!

But let me say again, this is not a common way to solve your problem and it's
not what is known as 'Art of System Administration'. But it works...

regards,
thomas

Revision history for this message
Sertan (sertansenturk) said :
#7

First of all, I am receiving the fastest replies I have ever seen; I would like to thank all of you. This is the reason why I love this community.

And sorry for the such long dialoge, although I have common hardware, it has some difficulties like this.

To return to the matter I have tried hacking way when I was on Edgy. It didn't worked on me. Instead the kernel wasn't able to find the module and stopped trying to load any other alternative module. I am not eager to try it once. It is not comfortable but at least I can hear music by plugging to the working soundcard. It will be worse to restart the machine for a couple of times and praying for the kernel to grab emu10k1.

HoweverI haven't tried never to compile alsa-source. I am now trying it.

I hope to give good news soon.

Revision history for this message
Sertan (sertansenturk) said :
#8

Unfortunately no good news,

I followed the instructions on the read me:

dpkg-reconfigure alsa-source

 -Selected emu10k1, emu10k1x

cd /usr/src
rm -rf modules/alsa-driver
tar jxf alsa-driver.tar.bz2

cp -rpL '/usr/src/linux-headers-2.6.20-16-generic' /tmp
cd /tmp/linux-headers-2.6.20-16-generic/
make-kpkg --rootcmd=fakeroot modules-image

make[7]: *** [/usr/src/modules/alsa-driver/acore/hwdep.o] Error 1
make[6]: *** [/usr/src/modules/alsa-driver/acore] Error 2
make[5]: *** [_module_/usr/src/modules/alsa-driver] Error 2
make[4]: *** [modules] Error 2
make[4]: Leaving directory `/usr/src/linux-headers-2.6.20-16-generic'
make[3]: *** [compile] Error 2
make[3]: Leaving directory `/usr/src/modules/alsa-driver'
make[2]: *** [build-stamp] Error 2
make[2]: Leaving directory `/usr/src/modules/alsa-driver'
make[1]: *** [kdist_image] Error 2
make[1]: Leaving directory `/usr/src/modules/alsa-driver'
Module /usr/src/modules/alsa-driver failed.
Perhaps /usr/src/modules/alsa-driver does not understand --rootcmd?
If you see messages that indicate that it is not
in fact being built as root, please file a bug
against /usr/src/modules/alsa-driver.

cd
rm -rf /tmp/linux-headers-2.6.12-1-686

I tried to attempt other proposed method but the alsa-driver failed error was always present.

Revision history for this message
Cesare Tirabassi (norsetto) said :
#9

Thats because you need to be root to run make-kpkg (or just prefix it with sudo).

By the way, you don't need the emu10k1x module (IIRC its for embedded Dell).

Revision history for this message
Sertan (sertansenturk) said :
#10

I made all these processes on the root terminal

To double check I did it again, and in normal terminal with sudo.

Always the same response.

Am I doing something wrong?

Revision history for this message
Cesare Tirabassi (norsetto) said :
#11

You did exaclty what I did few days ago, and it worked for me (ok, I did it with another kernel).
Perhaps you forgot to install the fakeroot package?

Revision history for this message
Sertan (sertansenturk) said :
#12

No, it is installed.

I tried with other kernel headers but it was unsuccessful like 2.6.20-16-generic.

Maybe I should stick with kernel compilation again

Revision history for this message
Best Cesare Tirabassi (norsetto) said :
#13

You can also try this way, if you want (my current drivers are compiled this way).

Download latest alsa source packages in ~/downloads (or whatever).

http://www.alsa-project.org/alsa/ftp/driver/alsa-driver-1.0.14rc4.tar.bz2
http://www.alsa-project.org/alsa/ftp/lib/alsa-lib-1.0.14rc4.tar.bz2
http://www.alsa-project.org/alsa/ftp/utils/alsa-utils-1.0.14rc4.tar.bz2

Setup installation directories:

sudo mkdir -p /usr/src/alsa
cd /usr/src/alsa
sudo cp ~/downloads/alsa* .
sudo tar xjf alsa-driver-1.0.14rc4.tar.bz2
sudo tar xjf alsa-lib-1.0.14rc4.tar.bz2
sudo tar xjf alsa-utils-1.0.14rc4.tar.bz2

Compile and install alsa-driver:
cd alsa-driver-1.0.14rc4
sudo ./configure --with-cards=emu10k1
sudo make
sudo make install

Compile and install alsa-lib:
cd ../alsa-lib-1.0.14rc4
sudo ./configure
sudo make
sudo make install

Compile and install alsa-utils:
cd ../alsa-utils-1.0.14rc4
sudo ./configure
sudo make
sudo make install

Reboot

Revision history for this message
Sertan (sertansenturk) said :
#14

Thanks Cesare Tirabassi, that solved my question.