PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : ALSA bleibt beim Booten hängen



Pegasus87
10.09.04, 21:01
Hallo,
habe gerade ALSA nach der Anleitung, die auf gentoo.org zu finden ist, auf meinem Gentoo2004.2 installiert.

Hat auch alles wunderbar geklappt, hatte sofort Sound, doch nach einem Neustart bleibt der Bootvorgang hängen, da steht dann nur noch:


...
* Loading ALSA drivers...
* Using ALSA OSS emulation
* Loading: snd-mixer-oss
* Loading: snd-pcm-oss
* Loading: snd-seq-oss


Tja und da kann ich nur warten bis ich schwarz werde, da passiert nix mehr.
Wenn ich dann mit CTRL+C abbreche und ins KDE komme, hab ich natürlich kein Sound.
Jedoch reicht ein einfaches


amixer set Master 100 unmute
amixer set PCM 100 unmute


Und ich hab klaren Sound.

Jetzt die Frage: Was läuft da schief und wie kann ich das abstellen?

Danke

m.o.o.
10.09.04, 21:32
Servus,
also Alsa wird ja geladen, nur die OSS-Emulation nicht.
Was passiert denn, wenn du die Module per Hand lädst?
Vlt. hat das Startskript (von Alsa) einen Fehler. Hast du das selber geschrieben?

Gruß, Florian

Pegasus87
10.09.04, 21:37
Hmm, wie kann ich die denn per Hand laden?

Das Startscript hab ich nich selber geschrieben, ich guck da aber trotzdem mal rein.


PS:

Hab im mom nen anderes Problem, hab mal alsasound in den rc "default" gelegt und nun lässt sich das nicht mehr mit CTRL+C abbrechen, was mach ich da?

Pegasus87
10.09.04, 22:02
Hier is der alsa start-script aus /etc/init.d/alsasound



#!/sbin/runscript
# $Header: /var/cvsroot/gentoo-x86/media-sound/alsa-utils/files/alsasound,v 1.16 2004/08/30 03:29:39 pyrania Exp $
#
# Gentoo users: add this script to 'boot' run level.
# ==================================================
#
# alsasound This shell script takes care of starting and stopping
# the ALSA sound driver.
#
# This script requires /usr/sbin/alsactl and /usr/bin/aconnect programs
# from the alsa-utils package.
#
# Copyright (c) by Jaroslav Kysela <perex@suse.cz>
#
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

# Edited to support Linux kernel 2.5 and above as well as 2.4
# John Mylchreest <johnm@gentoo.org>
# July 29, 2003

# Rewritten for better support for built-in drivers
# Jeremy Huddleston <eradicator@gentoo.org>
# 2004.06.02

alsactl=/usr/sbin/alsactl
asoundcfg=/etc/asound.state
aconnect=/usr/bin/aconnect
alsascrdir=/etc/alsa.d

depend() {
need bootmisc localmount
before modules
after isapnp
provide alsa-modules
}

load_modules() {
DRIVERS="$(modprobe -c | grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | awk '{print $3}')"

if modprobe -c | grep -q "snd.*oss$" ; then
# Test for use of OSS
einfo "Using ALSA OSS emulation"
OSS="$(modprobe -l | grep "snd.*oss" | sed -e "s:\/.*\/::" -e "s:\..*::")"
# Add oss modules to list
for i in ${OSS}
do
DRIVERS="${i} ${DRIVERS}"
done
fi

# Fall back on the automated aliases if we don't have ALSA configured properly...
if [ -z "${DRIVERS}" ]; then
ewarn "Could not detect custom ALSA settings. Loading all detected alsa drivers."
DRIVERS="$(modprobe -c | grep pci: | awk '{ print $3 }' | grep snd.* | sort | uniq)"
fi

[ -z "${DRIVERS}" ] && eerror "Unable to find any ALSA drivers. Have you compiled alsa-drivers correctly?"

for DRIVER in ${DRIVERS}
do
if [ ! "${DRIVER}" = off ] &&
[ -z `cut -d' ' -f1 /proc/modules | egrep "^${DRIVER}\$"` ] &&
[ -z `cut -d' ' -f1 /proc/modules | egrep "^${DRIVER//-/_}\$"` ]; then
einfo "Loading: ${DRIVER}"
/sbin/modprobe ${DRIVER}
fi
done

sleep 1

if [ -f /proc/asound/seq/drivers ] ; then
# We want to ensure snd-seq is loaded as it is needed for things like timidity even if
# we don't use a real sequencer.
SEQUENCERS="snd-seq $(awk -F, '$2~/^empty$/ {print $1}' /proc/asound/seq/drivers)"
for SEQUENCER in ${SEQUENCERS}
do
if [ -z `cut -d' ' -f1 /proc/modules | egrep "^${SEQUENCER}\$"` ] &&
[ -z `cut -d' ' -f1 /proc/modules | egrep "^${SEQUENCER//-/_}\$"` ]; then
einfo "Loading: ${SEQUENCER}"
[ -n "${SEQUENCER}" ] && /sbin/modprobe ${SEQUENCER}
fi
done
fi

einfo "Running card-dependent scripts"
for DRIVER in ${DRIVERS}
do
TMP=${DRIVER##snd-}
TMP=${TMP##snd_}
[ -x "${alsascrdir}/${TMP}" ] && ${alsascrdir}/${TMP}
done

[ ! -d /proc/asound ] && eerror "ERROR: Failed to load necessary drivers"
}

unload_modules() {
LOADED_MODULES="$(/sbin/lsmod | grep -E "^snd" | awk '{print $1}')"
for MODULE in ${LOADED_MODULES}
do
/sbin/rmmod ${MODULE} >& /dev/null
done
/sbin/rmmod soundcore >& /dev/null
/sbin/rmmod gameport >& /dev/null

# Return success if the modules are unloaded
test -z "$(/sbin/lsmod | grep -E "^snd" | awk '{print $1}')"
}

terminate() {
#
# Kill processes holding open sound devices
#
# DEVS=`find /dev/ -follow -type c -maxdepth 1 -print 2>/dev/null | xargs ls -dils | grep "1*1[46]," | cut -d: -f2 | cut -d" " -f2; echo /proc/asound/dev/*`
ossdevs="/dev/admmidi? /dev/adsp? /dev/amidi? /dev/audio* /dev/dmfm* \
/dev/dmmidi? /dev/dsp* /dev/dspW* /dev/midi0? /dev/mixer? /dev/music \
/dev/patmgr? /dev/sequencer* /dev/sndstat"
alsadevs="/proc/asound/dev/* /dev/sound/* /dev/snd/*"
fuser -k $ossdevs $alsadevs 2> /dev/null 1>/dev/null

#
# remove all sequencer connections if any
#
[ -f /proc/asound/seq/clients -a -x $aconnect ] && $aconnect --removeall
}

restore_mixer() {
if [ ! -r $asoundcfg ]; then
ewarn "No mixer config in $asoundcfg, you have to unmute your card!"
return 1
elif [ -x $alsactl ]; then
CARDS="$(cat /proc/asound/cards | awk '/: / { print $1 }')"
for CARDNUM in ${CARDS}
do
[ -e /dev/snd/controlC0 ] || sleep 2
[ -e /dev/snd/controlC0 ] || sleep 2
[ -e /dev/snd/controlC0 ] || sleep 2
[ -e /dev/snd/controlC0 ] || sleep 2
$alsactl -f $asoundcfg restore ${CARDNUM}
done
else
eerror -e "ERROR: Cannot find alsactl, did you forget to install media-sound/alsa-utils?"
return 1
fi

return 0
}

save_mixer() {
if [ -x $alsactl ]; then
$alsactl -f $asoundcfg store
else
eerror -e "ERROR: Cannot find alsactl, did you forget to install media-sound/alsa-utils?"
return 1
fi

return 0
}

start() {
if [ -d /proc/asound ] && [ -z "$(grep ' no soundcards ' /proc/asound/cards)" ] ; then
ebegin "ALSA Detected"
else
ebegin "Loading ALSA drivers"
load_modules
fi

einfo "Restoring Mixer Levels"
restore_mixer
eend 0
}

stop() {
if [ ! -d /proc/asound ] ; then
eerror "ALSA is not loaded"
return 0
fi

ebegin "Unloading ALSA"
terminate

if [ "${SAVE_ON_STOP}" = "yes" ]; then
einfo "Storing ALSA Mixer Levels"
if ! save_mixer; then
eend 1
fi
fi

einfo "Unloading modules"
if ! unload_modules; then
eend 1
fi

eend 0
}

Pegasus87
10.09.04, 22:14
Also ich bin einen Schritt weiter gekommen:

Beim Booten bleibt er jetzt erst hier hängen:



...
* Loading ALSA drivers...
* Using ALSA OSS emulation
* Loading: snd-mixer-oss
* Loading: snd-pcm-oss
* Loading: snd-seq-oss
* Loading: snd-ens1371


Und zwar habe ich die /etc/modules.d/alsa so abgeändert:



# ALSA portion
# OSS/Free portion

##
## IMPORTANT:
## You need to customise this section for your specific sound card(s)
## and then run `update-modules' command.
## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
##
## ALSA portion

#alias snd-card-0 snd-interwave
#alias snd-card-1 snd-ens1371
## OSS/Free portion
alias sound-slot-0 snd-card-0
alias sound-slot-1 snd-card-1
##

# OSS/Free portion - card #1

alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

## OSS/Free portion - card #2
## alias sound-service-1-0 snd-mixer-oss
## alias sound-service-1-3 snd-pcm-oss
## alias sound-service-1-12 snd-pcm-oss

alias /dev/mixer snd-mixer-oss
alias /dev/dsp snd-pcm-oss
alias /dev/midi snd-seq-oss



Also irgendwas stimmt immer noch nicht.....

m.o.o.
11.09.04, 12:59
Hmm, wie kann ich die denn per Hand laden?

Naja, modprobe <module_name>. Da gibts glaub ich aber keine Probleme

Also ich denke mal, das Script hat keinen Fehler. Vielmehr kommt mir die modprobe.conf (bzw./etc/modprobe.d/alsa) etwas seltsam vor. Welche Soundkarte/Chip hast du denn? Ens 1371?
Den habe ich, bei mir sehen die Einträge so aus


alias char-major-116 snd
alias snd-card-0 snd-ens1371
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss
.
Vlt. gehts ja so (wen du den Soundchip hast)?

Da du modprobe.d verwendest nehme ich mal an, du hast einen Kernel >= 2.6, oder?

Pegasus87
11.09.04, 16:22
Ja, ich hab den Kernel 2.6.8.1.
Das Problem hat sich aber gelöst. Es scheint einen Konflikt zwischen alsa-driver und dem Kernel 2.6.x.x zu geben. Da mein intel8x0 (IBM Thinkpad Centrino) Treiber auch direkt im Kernel zu finden ist, habe ich den als Modul eingebunden und alsa-driver "unmerged"!

Nun funktioniert die Kiste.....

trotzdem noch mal Danke für eure Hilfe!