LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   which source tree to choose for module compilation ? (https://www.linuxquestions.org/questions/linux-hardware-18/which-source-tree-to-choose-for-module-compilation-307706/)

roemisch 03-30-2005 04:54 AM

which source tree to choose for module compilation ?
 
The actual task is to get a SB Audigy2 Value soundcard running on Debian Sarge 2.6.8-2 on my new machine. It won't work unless upgrading the kernel an using most recent ALSA source code. Up to this moment everything has been simple: Kernel image, tree, headers, source, compiler were the same version, but now I'll end up having new source, kernel tree and headers (2.6.11), on which my new kernel image will be based upon, and the old ones, the gcc compiler itself was originally compiled against. What follows is essential for all software or module sources, but ALSA is especially interesting while being so close to the kernel and asking for a lot of symlinks pointing not only at the kernel tree, but also at the sources (i.e. build and sources).
My first thought, of course, is to symlink the new ones, but I remember having read in an article from Linus himself (gcc.gnu.org/ml/gcc/2004-12/msg00112.html), that my compiler won't like compiling against headers and sources, which it was not compiled against itself (many unresolved symbols), if I got it right. On the other hand: When I choose the old headers and sources, how will ALSA be able to produce appropriate modules for my new kernel. And even worse: I have no idea, what's gonna happen to my old malfunctioning 2.6.8 modules. Will they be overwritten, deleted or coexist as zombies without reference in modules.conf ?
I don't dare think about the future, when I have to consider about a compiler upgrade and the environment is completely heterogenuous. For the time being, I would be very happy, if someone could give me reliable advice or a link to some tutorials covering this subject.

PS: After 20 years DOS/Windows/XP, which did almost everything alright for me and my company I decided to leave the monopoly 3 months ago mainly for ideological reasons and started with the pc of my kids, when it took me almost a week from my Xmas vacations to get a wireless USB Prism card going after firmware/kernel/udev replacement. It was an investment, which could have bought a few dozen Windows PC, but as I said: I've been driven by a bit of ideology, and I do like Linux, esp. Debian, once it is up and running. So please, don't let me hang or recommend to pull my SBLive! out of the Ebay box. For this is a question of honor and I also feel, that it touches the very basic problem, that scares most Windows users, whose fun won't start before the installation has been finished.

Yours Michael

J.W. 03-30-2005 10:20 AM

If you need the source, just go to kernel.org for the version you want, copy it to /usr/src then unpack it. I assume that you will already have a symbolic link of /usr/src/linux that is currently pointing to the old/current kernel source (eg, /usr/src/linux --> /usr/src/linux-2.4.x) which you need to delete, and then recreate it to point to the new kernel source (eg, /usr/src/linux --> /usr/src/linux-2.6x)

Once that's done, you would be ready to begin a standard kernel recompile. As you know there are several options available for handling the config but in order to preserve your current choices you should be able to go with "make oldconfig". There are a number of tutorials here at LQ that go into more detail on recompiling; I won't try to replicate them in this post.

In any event, if your system is working OK but the only issue is that you can't get sound to work, then a recompile may be unnecessary. You might want to try running
Code:

alsaconf
which should detect your sound card and play a test sound. If it works, that may be all you need. If not, then next confirm that the volume settings are not muted by running
Code:

alsamixer
There are a bunch of different settings, use the arrow keys to make sure you move through the whole set. Good luck with it and Welcome to LQ -- J.W.

roemisch 03-30-2005 11:40 PM

Thanks, J.W. for your quick response.
alsaconfig doesnot recognize the card. I've been running Debian Kernel 2.6.8-2 but since my SB Audigy2 Value was puchased only 3 months ago first kernel to recogize the card correctly is 2.6.11 which includes ALSA 1.08. A patch for this card was implemented mid of March, so I have to compile the ALSA source 1.0.9 against my kernel tree and that's the issue: Against tree 2.6.11 or against 2.6.8-2, which my compiler is based on ? By the way: Compiling modules in my system looks for the tree in /lib/modules/ver-xxx/"build" or ../"source" resp.
Yours Michael

J.W. 03-31-2005 10:08 AM

You need to compile against the source that corresponds to the kernel you are running, but it's ambiguous as to which kernel you are now using - you refer to 2.6.8-2, but since you also say that the first kernel to recognize the card was 2.6.11 it also appears that you've installed that as well. In any case, just run the command "uname -r" (no quotes) from a terminal session to determine the kernel version you are running. That's what you'd need to compile against.

In any case, and at the risk of telling you a bunch of stuff you already know (apologies in advance if so) while recompiling is a useful educational exercise, it isn't always necessary just to get sound working. As long as you've eliminated all the obvious issues (speakers are turned on, speakers are plugged into the right jack on the soundcard, volume knob is turned up, etc) then the next order of business is to confirm the the appropriate kernel modules are being loaded.

According to this reference article you need the following modules:

snd-emu10k1
snd-pcm-oss
snd-mixer-oss
snd-seq-oss

As root, run this command
Code:

lsmod
which will display the kernel modules that are currently loaded. If any of the above 4 are missing then you can manually load them via "modprobe" To illustrate
Code:

modprobe <module name>
where <module name> is the exact module you wish to load. In any case, if the hardware is installed correctly, and all the necessary modules are being loaded, then you card should be recognized correctly. (You should run "lspci" to confirm, which lists the PCI devices your system sees.) Once the card is recognized, then it would need to be configured. Good luck with it -- J.W.

roemisch 03-31-2005 04:03 PM

Thanks again,
compiling against 2.6.11 did the job finally, but anyway, what is it with the kernel version, the compiler itself was compiled against ? I don't get the meaning of Linus statement referred to in my first posting. If you can spare the time, I'd appreciate your comment, but if not, you have my understanding, of course.
Michael


All times are GMT -5. The time now is 12:28 AM.