PDA

View Full Version : ALSA issues



Linuxshark
06-01-2004, 09:01 AM
I did a search on this board but couldn't find anything to solve my problem:

I run a Knoppix 3.4 (2.6.5 kernel) HDD install on a PC with a SB Live soundcard.

When I got into IP-phones on Linux I ran into the problem that VoIP doesn't run properly with OSS (using kphone and Linphone). When I did set the sound-system manually to ALSA, all I got was an error message:

Sound server informational message:
Error while initializing the sound driver:
device: default can't be opened for playback (No such device)
The sound server will continue, using the null output device.

I then fingured that maybe I do not have a proper ALSA installed so I apt-cache searched for ALSA packages and apt-get installed knx-alsa. This, however, did not work properly due to some dependency issues. I then tried to solve the dependencies by installing the missing packages. Installing the missing packages didn't work either.

Since then, I always get the same error message when using apt-get install, even if the package to install has zero to do with ALSA (sorry this is in German):

root@DKHost:~# apt-get install mencoder-586
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut... Fertig
Sie möchten wahrscheinlich ,,apt-get -f install" aufrufen, um dies zu korrigieren:
Die folgenden Pakete haben nichterfüllte Abhängigkeiten:
alsa-base: Hängt ab: alsa-utils (>= 1.0.2-2) soll aber nicht installiert werden
E: Nichterfüllte Abhängigkeiten. Versuchen Sie ,,apt-get -f install" ohne jeglich Pakete (oder geben Sie eine Lösung an).
root@DKHost:~#


So, apparently there is a dependency conflict between alsa-base and alsa-utils. Doing "apt-get -f install" results in the following:

root@DKHost:~/stuff/alsa/alsa-driver-1.0.5# apt-get -f install
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut... Fertig
Abhängigkeit werden korrigiert... Fertig
Die folgenden zusätzlichen Pakete werden installiert:
alsa-utils
Vorgeschlagene Pakete:
alsadriver
Die folgenden NEUEN Pakete werden installiert:
alsa-utils
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 10 nicht aktualisiert.
2 nicht vollständig installiert oder entfernt.
Es müssen noch 0B von 129kB Archiven geholt werden.
Nach dem Auspacken werden 381kB Plattenplatz zusätzlich benutzt.
Möchten Sie fortfahren? [J/n] j
(Lese Datenbank ... 117554 Dateien und Verzeichnisse sind derzeit installiert.)
Entpacke alsa-utils (aus .../alsa-utils_1.0.4-1_i386.deb) ...
dpkg: Fehler beim Bearbeiten von /var/cache/apt/archives/alsa-utils_1.0.4-1_i386.deb (--unpack):
versuche »/usr/bin/alsamixer« zu überschreiben, welches auch in Paket knx-alsa ist
dpkg-deb: Unterprozess paste getötet mit Signal (Datenübergabe unterbrochen (broken pipe))
Fehler traten auf beim Bearbeiten von:
/var/cache/apt/archives/alsa-utils_1.0.4-1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Briefly, apt-get -f install tries to install alsa-utils, but dpkg fails because the package tries to install/overwrite alsamixer which is also a part of knx-alsa. As it is also part of knx-alsa, dpkg cannot overwrite /usr/bin/alsamixer.

I then tried to remove knx-alsa, which ended up like this:

root@DKHost:~# apt-get -f remove knx-alsa
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut... Fertig
Sie möchten wahrscheinlich ,,apt-get -f install" aufrufen, um dies zu korrigieren:
Die folgenden Pakete haben nichterfüllte Abhängigkeiten:
alsa-base: Hängt ab: alsa-utils (>= 1.0.2-2) soll aber nicht installiert werden
E: Nichterfüllte Abhängigkeiten. Versuchen Sie ,,apt-get -f install" ohne jeglich Pakete (oder geben Sie eine Lösung an).
root@DKHost:~#

Once again, apt-get couldn't get to work because of the alsa-bas/alsa-utils dependency. I got a final hint from a Linux/Knoppix-experienced friend (removing knx-alsa while installing alsa-utils at the same time), so I did the following:

root@DKHost:~# apt-get -f remove knx-alsa alsa-utils+
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut... Fertig
Vorgeschlagene Pakete:
alsadriver
Die folgenden Pakete werden ENTFERNT:
knx-alsa
Die folgenden NEUEN Pakete werden installiert:
alsa-utils
0 aktualisiert, 1 neu installiert, 1 zu entfernen und 10 nicht aktualisiert.
2 nicht vollständig installiert oder entfernt.
Es müssen noch 0B von 129kB Archiven geholt werden.
Nach dem Auspacken werden 2945kB Plattenplatz freigegeben sein.
Möchten Sie fortfahren? [J/n] j
(Lese Datenbank ... 117554 Dateien und Verzeichnisse sind derzeit installiert.)
Entpacke alsa-utils (aus .../alsa-utils_1.0.4-1_i386.deb) ...
dpkg: Fehler beim Bearbeiten von /var/cache/apt/archives/alsa-utils_1.0.4-1_i386.deb (--unpack):
versuche »/usr/bin/alsamixer« zu überschreiben, welches auch in Paket knx-alsa ist
dpkg-deb: Unterprozess paste getötet mit Signal (Datenübergabe unterbrochen (broken pipe))
Fehler traten auf beim Bearbeiten von:
/var/cache/apt/archives/alsa-utils_1.0.4-1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Yet again the same problem, alsamixer could not be written by dpkg because it is part of the (still not removed) knx-alsa.


In a nutshell, I am really stuck here. I have learned from my friend that many Knoppix-ALSA issues result from the fact that Knoppix uses a stripped down ALSA. The only way out is to (re-)install a freash and complete ALSA. I'd love to do it, but apparently I can neither remove the old ALSA, nor install a new one. Even when apt-get installing packages that have nothing to do with alsa, it won't work because of the alsa-base/alsa-utils error message coming up.

Can anyone help me with this? I thought about manually removing everything alsa from both, HD and installed package list. But then again, I have no clue how to do it properly.

Thanks for reading this long message and any help is appreciated!

David

Cuddles
06-01-2004, 12:53 PM
Linuxshark,

Even though I can't understand any German, I know what you are going through, I went through the exact same issues with v3.3, and like you, was stuck in exactly the same place. Apt-get was broke all over the place, ALSA was broke and didn't work, and even OSS was damaged to the point that I had no sound at all...

Not sure if this will help, or that this is the way you can resolve this, but, it is how I got ALSA resolved on my Knoppix v3.3, and probably what I am going to do when I "exchange" v3.3 with v3.4, shortly...

I had to completely cfdisk my installation, start with a completely gutted system, boot the Live CD with the ALSA cheatcode on the boot prompt, and then hard drive install from the CD with the cheatcode. It appeared that in v3.3, installing from the CD with "certain" boot cheatcodes, would be inherited from the CD boot, to the hard drive install... (ALSA being one of these "certain" cheatcodes)

I guess, I plan to do the same thing when I re-install v3.4 - using the ALSA boot cheatcode on the CD, and then using that boot to hard drive install with. (hopefully, it will work again, with this new version, and that they didn't change that on this new version ( ? ))

I hope that this isn't the way, and that someone else has gotten ALSA to work the "right" way, as I have come to know it should be done: apt-get the packages, set them up, compile the source to the kernel, etc... I tried that way in v3.3, and got pretty much where you are now, with the previous version... So, I will be watching to see if anyone else can help you out, and probably be using that, if it gets you working...

I am not sure if this, has helped, other than the fact, you weren't alone with this. That someone else has been where you are, if not in the current version, but from the previous version,
Ms. Cuddles

Linuxshark
06-01-2004, 01:04 PM
Thank you very much Cuddles for your support.

I even managed to get apt-get back on track. I used kpackage to uninstall anything ALSA-related, and this worked fine. My apt-get back to work I installed all ALSA packages from scratch. And still ALSA would not work. I downloaded the newest source codes from ALSA's website, compiled, installed and still nada. The driver itself could not be installed as it is alreday part of my 2.6.5 kernel.

I booted with the old 2.4 kernel and same dilio.

I inserted my 3.4 (first official release) CD and started it with the "knoppix26 alsa noscsi" command (note: I needed "noscsi" with this version because otherwise the boot frooze). As you imagine, ALSA worked perfectly.

As I havs some other minor issues with my current HD-install (see noscsi-command, solved on newer 3.4s), I am right now downloading the 3.4 04-05-17 and will do a re-install in an hour, with the "knoppix26 alsa" command for sure.

David

Cuddles
06-01-2004, 01:17 PM
Bummer Linuxshark,

I was hoping that there was another way, really I was. I know this idea works, but it shouldn't have to be done this way. It should work the way you described, and I did it the same way, and yet, it didn't work for me either. Shame.

Its a shame that someone wasn't able to provide the working behind this, without having to use the boot cheatcode method, but, that was the only way "I" could get it to work, and no one else could get it to work the "proper" way of doing this.

I am quite sure that if "we" didn't decide on Knoppix, and went with Debian, or Red Hat, or any one of the "other" distributions, it would only work if we did it the way you were doing it, but it appears that isn't the case in the Knoppix World...

Good luck on your re-install, and again, sorry it appears that is the way it is going to work,
Ms. Cuddles

kelmo
06-01-2004, 01:22 PM
I hacked up a script made by the excellent Kano. This has been certified to work with the 2.4 series kernel on knoppix 3.4, so long as alsa-* is version 1.0.4 +. Also you must stop the OSS module from loading at startup by removing it from /etc/modules-2.4.26. Hope it helps.

install-alsa.bash :-



#!/bin/bash
if [ $(id -u) != 0 ]; then
echo Error: You must be root to run this script!
exit 1
fi
if [ $(uname -r) != 2.4.26 ]; then
echo Error: You must be running kernel-2.4.26 to run this script!
exit 1
fi
# disable knx-alsa hack
if [ -f /etc/modutils/1alsa ]; then
echo knx-alsa hack... removed
mv /lib/modules/extra/alsa /lib/modules/$(uname -r)/
rm -f /etc/modutils/1alsa
update-modules
exit
fi
# disable old sndconfig
SNDCONFIG=""
if [ -f /etc/modutils/sndconfig ]; then
SNDCONFIG=$(awk '/sound-slot/{print $3}' /etc/modutils/sndconfig)
mkdir -p /etc/modutils.1st/
mv -f /etc/modutils/sndconfig /etc/modutils.1st/
fi
# disable libranet soundconfig
LIBRANET=""
if [ -f /etc/modutils/libranet-sound ]; then
LIBRANET=$(awk '/alias/{print $3}' /etc/modutils/libranet-sound)
mkdir -p /etc/modutils.1st/
mv -f /etc/modutils/sndconfig /etc/modutils.1st/
fi
# disable sounddriver(s)
killall artsd 2>/dev/null
[ -x /etc/init.d/alsa ] && /etc/init.d/alsa stop >/dev/null
fuser -k /dev/dsp* 2>/dev/null
fuser -k /dev/mixer* 2>/dev/null
MODULE=$(lsmod|perl -pe '($_)=/soundcore.*\d+\s+\d+\s+\[?(\w+)\]?/')
[ "$MODULE" ] && echo $MODULE|xargs rmmod
if [ -e /etc/modules ]; then
# make backup
[ ! -e /etc/modules.1st ] && cp /etc/modules /etc/modules.1st
perl -pi -e 's/\n?$/\n/' /etc/modules
# remove modules
for m in $MODULE $SNDCONFIG $LIBRANET libranet-sound; do
perl -pi -e "s/^.*$m.*\n//" /etc/modules
done
fi
# remove old config
rm -f /etc/modutils/*alsa*
# remove old alsa drivers
#apt-get -y remove --purge alsa-modules-$(uname -r) 2>/dev/null
#rm -rf /lib/modules/$(uname -r)/alsa
update-modules
# install new alsa modules
rm -rf /etc/alsa
#apt-get -y remove --purge knx-alsa
dpkg --purge knx-alsa 2>/dev/null
apt-get -y -t unstable install alsa-source alsamixergui alsa-base alsa-utils
rm -rf /etc/alsa
mkdir -p /etc/alsa/modutils/
rm -f /etc/alsa/modutils/1.0
touch /etc/alsa/modutils/1.0
ln -sf /etc/alsa/modutils/1.0 /etc/modprobe.d/alsa
#touch /etc/alsa/modutils/0.9
ln -sf /etc/alsa/modutils/1.0 /etc/modutils/alsa
echo '### DEBCONF MAGIC' > /etc/alsa/modutils/1.0
cd /usr/src
rm -rf modules/alsa-driver/
tar jxf alsa-driver.tar.bz2
cd modules/alsa-driver/
CC=gcc-$(perl -pe '($_)=/gcc.[Vv]ersion\s(3\.\d|2\.\d+)/;' /proc/version)
if [ -e /usr/bin/$CC ]; then
CC=/usr/bin/$CC
else
CC=$(which gcc)
fi
if ! [ -f /lib/modules/$(uname -r)/alsa/snd.o -o \
-f /lib/modules/$(uname -r)/kernel/sound/acore/snd.o -o \
-f /lib/modules/$(uname -r)/kernel/sound/core/snd.ko ]; then
./configure --with-kernel=/usr/src/linux CC=$CC
make
make install
#depmod -a
update-modules
fi
#ln -s /usr/bin/lspci /sbin/lspci 2>/dev/null
#cd utils
alsaconf
grep -q "alias snd-card" /etc/modutils/alsa
if [ $? -gt 0 ]; then
echo Error: ALSA configuration generator did not find your soundcard!
echo Select it manually using: dpkg-reconfigure alsa-base
echo To start ALSA use: /etc/init.d/alsa start
echo Note: volume is 0 by default, so run: aumix or alsamixergui
else
aumix -m 0 -v 60 -w 60 # set pcm & master to 60, micro to 0
[ -e /usr/share/sounds/startup.ogg ] && play /usr/share/sounds/startup.ogg
fi

Cuddles
06-01-2004, 01:54 PM
Nice Kelmo,

You have any plans to hack this into the newer kernel version? (or, if I am wrong, does the new kernel use the same areas as the older kernel?)

Anyway, I looked it over, and the funny thing is, I can actually "read" and "understand" what it is doing ! Amazing, I "am" getting to know more about Linux, I can actually understand the coding now... Some commands are foreign to me still, but I can "fake" my way through them now...

Thanks for the assistance on this, I felt really bad I wasn't able to have a better answer, than what a lot of "Windows" support people always say: Re-Install -=- always seemed to me as a "cop-out", and Windows CSR's always used it to blatantly, IMHO.

Thanks,
Ms. Cuddles

Durand Hicks
06-01-2004, 07:47 PM
FWIW,

I was able to strip out the knx-alsa and compile my own alsa drivers twice. Alas, I didn't document the exact steps I took since I pretty much played it by intuition. But I can tell it has been done and it does work. The only gotcha I had with alsa was that every time I suspended my laptop with arts with the irda module loaded at the same time, it made my soundcard screech like a scared monkey when it resumed or rebooted to kde. I couldn't hear it without my hearing aid, but my daughter and parents were really bothered by it, so I ended up ripping out alsa and going back to oss which works fine as long as I turned up the volume. Sorry I couldn't be more help.

Durand

Linuxshark
06-01-2004, 08:57 PM
Holy s*** :evil:

I just finished the HD-install of Knoppix 3.4 04-05-17 with boot command (before installation) knoppix26 alsa. After booting from CDROM, ALSA worked fine.

Now that the HD-install is done, the shit hit the fan again... when switching the sound-system to ALSA I once again get:

"Sound server informational message:
Error while initializing the sound driver:
device: default can't be opened for playback (No such file or directory)
The sound server will continue, using the null output device.

I'm really getting tired of this.

David

Linuxshark
06-01-2004, 09:29 PM
Hum, things are strange at times. I found a way to make it work. I got apt-get to fetch the unstable version of ALSA and now everything works fine. Here is what I did:

apt-get -t unstable install alsa-base alsa-utils alsa-source alsa-oss alsa-headers

Thanks to all for suffering my gross language and for all the help.

David

bob58
06-02-2004, 07:51 PM
I got similar error message too....my 'test sound" button works, and my cd audio is ok.....just the sound server does not work for some reason. Its no big deal, but it should work anyway. I tried the apt-get in the above post but it didnt work. got an error. bob

roger_girardin
07-04-2004, 08:05 AM
thanks

i've got alsa mixer working now knoppix hd install 3.4 kernel 2.66

root@vaio:/home/rog# apt-get -t unstable remove alsa-base alsa-utils alsa-source alsa-oss alsa-headers libasound2-dev libarts1-dev kdelibs4-dev

i have just add 3 libs

but the sound is very weak