LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Linux Expert Qwestion Stumper: Garunteed to stump linux experts or your money back! (https://www.linuxquestions.org/questions/linux-general-1/linux-expert-qwestion-stumper-garunteed-to-stump-linux-experts-or-your-money-back-13559/)

psyklops 02-04-2002 10:27 PM

Linux Expert Qwestion Stumper: Garunteed to stump linux experts or your money back!
 
Installation of Alsa sound Drivers for RH v7.2. This is from my terminal. This is me trying to configure my alsa driver before moving onto to libs and utils. Dont laugh, please.

note to reader: if you dont know that the alsa drivers are sound related you should leave, as you will not get your moneys worth. You were warned.

[root@psyklopsbox alsa-driver-0.5.12a]# ./configure
loading cache ./config.cache
checking for gcc... gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking for ranlib... ranlib
checking for a BSD compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for linux/fs.h... yes
checking for working const... yes
checking for inline... inline
checking whether time.h and sys/time.h may both be included... yes
checking whether gcc needs -traditional... no
checking for directory with kernel source... /usr/src/linux
checking for kernel version... expr: syntax error
expr: syntax error
expr: syntax error
failed (probably missing /usr/src/linux/include/linux/version.h)
[root@psyklopsbox alsa-driver-0.5.12a]#

The error says that version.h is probably missing. I checked in /usr/src/linux/include/linux/ and found this snipet from the dir:

usb.h
user.h
utime.h
uts.h
utsname.h
version.h
vfs.h
video_decoder.h
videodev.h
video_encoder.h
videotext.h
vmalloc.h
vt_buffer.h
vt.h
vt_kern.h
wait.h
wanpipe.h
wanrouter.h
watchdog.h
wavefront.h
wireless.h
wrapper.h
x25.h
yam.h
zftape.h
zorro.h
zorro_ids.h

Notice the version.h file? Why in the heck would I get an error for a missing file when its right there.

And this is a picture of my /usr/src dir:

[psyklops@psyklopsbox src]$ lsalsa-driver-0.5.12a
alsa-driver-0.5.12a.tar
alsa-lib-0.5.10b
alsa-lib-0.5.10b.tar
alsa-utils-0.5.10.tar.bz2
aterm-0.4.2.tar.gz
blackbox-0.61.1-2.i386.rpm
linux-2.4
linux-2.4.7-10
[psyklops@psyklopsbox src]$

Ive put all necessary info for your viewing pleasure. Please help this :newbie: if you can?

tiamat 02-04-2002 10:33 PM

check 2 lines above "syntax error". thats most likely it :)

Seems you have to load up vi and fix that configuration script :D

psyklops 02-04-2002 11:17 PM

Wait, sorry. I dont seem to understand. Two lines above syntax is:

checking for directory with kernel source... /usr/src/linux

How will I 'fix' this? The dir /linux has the kernel source in it...
I dont seem to see what you see. Please explain it to me.

dj_relentless 02-05-2002 12:14 AM

If you are using redhat it might be one of those strange version things they do..
does your kernel version happen to look something like 2.4.17-23 (the dash is the bit I'm wondering about)

psyklops 02-05-2002 12:47 AM

Hmm we might be onto something here. Yes I am using RH v7.2 and kernel v is 2.4.7-10... Does this tell you anything?

dj_relentless 02-05-2002 12:59 AM

This is only a guess..
That script may not support the -10 part of your kernel version, and is packing a sad about it.
So the first post was kinda right, you can edit the script and add
-10 to the part that checks the kernel version..Unfortunatly I've not done it so can't tell you the exact line it'll be contained in..

Again this is only a guess so might wanna wait and see what david or trickykid has to say.

psyklops 02-05-2002 01:09 AM

Thanks Ill wait for now and see who turns up what.

isajera 02-05-2002 01:17 AM

you're more or less on the right track. it's almost certainly the -10 that's throwing things off. unfortunately, that doesn't help get a solution.

the problem is that expr is a testy prog, and it's using the output from a uname to find the kernel version, and breaking. you'll need to find where the "uname -r" is in the config script, and fix it so that it just returns the 2.4.7 instead of 2.4.7-10.

you'll need to have an editor with an easy search function - you'll be looking for either uname or expr- if you don't know how to fix it, then post the relevant lines here, and i'm sure someone will be able to help.

psyklops 02-05-2002 01:49 AM

Heh this is what another bloke told me to do bur Im stuck on the second copy command. It wont copy the files.

"Yeah, the default ALSA ./configure expects to find the kernel source under /usr/src/linux unless you tell it otherwise. You MUST NOT HAVE any sound cards built as a module or static in the kernel, but you MUST HAVE sound support by itself built-in. What I would recommend is the following to build Alsa:

# cd /usr/src/
# ln -sf linux-$KERN-VER linux
# cd linux
# cp .config config.bak
# make distclean; make mrproper
# cp config.bak .config
# make menuconfig
(check your sound config!!)
# make dep && make clean && make bzImage && make modules
# cp /lib/modules/$KERN-VER /lib/modules/$KERN-VER.bak
# make modules_install
# cp /vmlinuz /vmlinuz.bak
# cp arch/i386/boot/bzImage /vmlinuz
# cp System.map /boot/System.map-$KERN-VER
- configure LILO appropriately -
# reboot
Once the new kernel comes up, run the Alsa drivers config and make 'em.
# ./configure --prefix=/usr/local --with-cards=$YOUR-CARD-HERE
# make && make install
# depmod -a (make sure the Alsa mods work)
#./snddevices (must create the devices under /dev)
Build the libs and utils. Modprobe your cards module."

He disappeared on me like a high school football player at planned parenthood. Im between a rock and a hard place. If he doesnt return what do you suggest besides good luck. Im desperate here Jeeves!!

acid_kewpie 02-05-2002 05:36 AM

again! again! again!
 
erm.. ok then, so do we get our money back?

i lost 55p in a can machine the other day. i'll set up a paypal account if it's handy...

psyklops 02-05-2002 12:33 PM

:smash:

Duh 02-05-2002 03:09 PM

ln -s /usr/src/linux-2.4 /usr/src/linux

that will fix it

ryanstrayer 02-05-2002 03:22 PM

Okay - What version of GCC are you using? If you are using 2.9.6 - that is also another potential problem. About 50% of compiles work using 2.9.6 ... I have numerous problems running ./configure and make commands until I upgraded to 3.0.3 .. some say 2.9.5 works as good too.. and more compatible.

But.. personally I'm not sure if that will fix this problem or not. One thing will definetly tell you if you have a system problem, or if it's a program problem.. go download an older version of the Alsa package and try to compile it.. if it does the same thing.. you've got a system problem, either with your source tree as everyone has stated, or your compiler is it.

You need to also open configure with vi or whatever you use, and check how they are calling that line.. they may be using a standard system package that you didn't install or is corrupt for some reason.

To make absolutely sure your tree is correct - untar a brand new copy of the 2.4.17 kernel to /usr/src/linux-2.4.17 and create a symbolic link to it using /usr/src/linux - as stated above. This will ensure you have a correct tree, and eliminate that issue.

You have a process of elimination that must be performed and I would start here.

finegan 02-05-2002 07:34 PM

A short explanation to what dude was telling you and probably why it doinked up.

# cd /usr/src/

Duh...

# ln -sf linux-$KERN-VER linux

This creates a static link from a non-existent directory called linux to whatever RedHat calls the directory... with all of that version crap in the dirname. So now, when you try to run configure for alsa, it will actually find a dir called: /usr/src/linux

# cd linux

Duh...

# cp .config config.bak

This will make a backup of your kernel configuration file in case something doinks up.

# make distclean; make mrproper

This purges the entirety of the Linux kernel source of anything already compiled... I think this may also erase config.bak and config, which is why the following doesn't work. People that use distclean and mrpropper scare me in their fastidiousness. Copying the config file is relatively paranoid.

# cp config.bak .config
# make menuconfig

This is going to make a great big menu with nothing having to do with anything selected (mrpropper wiped out all of the settings RedHat had given you.) You can either learn how to compile a kernel from the ground up... (the kernel how-to is useful for this.) or re RPM -U the kernel source from the install CDs and just use make clean. This will leave the good old basic RH config in there so you can modify only the parts about sound instead of doing everything...

(check your sound config!!)

If you re-RPM-it, don't fiddle with the other stuff... sound is at the bottom of the menu. Make sure sound is compiled in with a[*] and leave everything else out.

# make dep && make clean && make bzImage && make modules

The first updates the entires systems dependency tree. The bzImage is the compressed kernel image, and the modules are everything you didn't want as part of the kernel, but wanted more... hotloadable...

Again, the 'make clean' in there is extra paranoia. Maybe this is a way to get a default RedHat kernel to compile... I've never had much luck with anything other than pristine kernel source from kernel.org. Or, maybe this guy is the kind who clips his nose hair.

# cp /lib/modules/$KERN-VER /lib/modules/$KERN-VER.bak

more extreme paranoia

# make modules_install

installs the modules to /lib/modules/2.4.7-10 where the kernel can find them when it needs them.

# cp /vmlinuz /vmlinuz.bak
# cp arch/i386/boot/bzImage /vmlinuz
# cp System.map /boot/System.map-$KERN-VER

Copies the old kernel to a backup, then copies the new kernel over the old, and then drops the system map where the kernel can find it.

- configure LILO appropriately -
A) Joker probably ignored the fact RH7.2 installs Grub by default. If you're using Grub, I don't know it either, but there are How-to's abound. Make sure you can boot both the new kernel (un-tested so it may go bongoroo), and the old (which works).

B) To configure Lilo add the following to /etc/lilo.conf

image = /vmlinuz.bak
root = (whatever is in the entry already there)
Label = backup_kernel
read-only (this may be different depending on ext3. Use whatever is in the entry already there.)

C) Then... re-run lilo with /sbin/lilo


# reboot

You should have 2 choices now, choose Linux.

Once the new kernel comes up, run the Alsa drivers config and make 'em.
# ./configure --prefix=/usr/local --with-cards=$YOUR-CARD-HERE

This is extra... slightly unnecessary stuff. Its telling configure to build so when everything is done it will go in /usr/local. --with-cards=$YOUR-CARD-HERE, You might just want to ditch this and let it make modules for every card as the whole mountain of modules will probably only be a few Megs... disk is cheap, but getting the wrong card is a pain.

# make && make install
# depmod -a (make sure the Alsa mods work)
#./snddevices (must create the devices under /dev)
Build the libs and utils. Modprobe your cards module."

Blah blah blah blah

He disappeared on me like a high school football player at planned parenthood. Im between a rock and a hard place. If he doesnt return what do you suggest besides good luck. Im desperate here Jeeves!!

Good one... and good luck hacking the alsa stuff.

Cheers,

Finegan

psyklops 02-06-2002 06:55 PM

Thank you!! Ive been banging around the system for a day now. Im so close I can almost smell the sounds...

I believe everything is alright. However there is one thing. This is the section of alsa instructions that Im caught on....

"4.6 Preparing the devices

There is a script in the driver-directory that will install the ALSA-sound-devices in your /dev directory. Type

./snddevices
from the driver-directory. There should be a /dev/snd subdirectory now (test if it is there. If you are not familiar with even the "ls" command, please consider reading other HOWTO's first. You should have some basic Linux knowledge to install these drivers).

Now you're ready to insert the driver, so please turn over to the next paragraph."

Well I checked the /dev dir for /snd/ and found it but it was blinking red. How do I make this a proper dir so I can turn on the sound? I believe after this all I need to do is unmute the drivers which were muted by default. Great tut Finegan thanks.


All times are GMT -5. The time now is 06:02 AM.