What's new

problems configuring alsa for linux

mesman00

What's that...?
hi. i am having some troulbe setting up alsa. first of all, when my computer loads i get the following error message:

Code:
error while initializing the sound driver:
device dev/dsp cannot be opened (no such file or directory)

i have merged alsa and configured the config files for my sound card (AMD Audio Codec '97 1980). however, when i get to the part where i have to type amixer (i am following the gentoo install guide for alsa, found in the docs section on the gentoo home page) i get the following error:

Code:
amixer: mixer attatch default error: No such device

it appears that linux isn't even recognizing that my sound card is there. does anyone have any help?
 

Malcolm

Not a Moderator
i assume that you did the old
Code:
/etc/init.d/alsasound start
stuff...

now try
Code:
update-modules

then try to modprobe sound, snd-mixer-oss and snd-pcm-oss

if that doesnt work then
Code:
emerge alsa-oss

Beyond that I got no idea for you :p
 
OP
mesman00

mesman00

What's that...?
Malcolm said:
i assume that you did the old
Code:
/etc/init.d/alsasound start
stuff...

now try
Code:
update-modules

then try to modprobe sound, snd-mixer-oss and snd-pcm-oss

if that doesnt work then
Code:
emerge alsa-oss

Beyond that I got no idea for you :p

sigh, i did that! alright, hopefully someone else has some advice, i posted this on gentoo forums already too, but to really no avail
 

Malcolm

Not a Moderator
what's your mobo, my asus a7v8x-x said it was running a ADI 1980 6-channel CODEC but its was really on a via 8233 sound chipset
 

blight

New member
do you have anything in /dev/sound?
which kernel are you using?
which alsa version?
modules or builtin?
do you use devfs? (i guess so ;))
do you have the OSS emulation of alsa enabled/loaded? whates the output of lsmod?
does lspci list your card?
 
OP
mesman00

mesman00

What's that...?
Malcolm said:
what's your mobo, my asus a7v8x-x said it was running a ADI 1980 6-channel CODEC but its was really on a via 8233 sound chipset

i have the same mobo as you do. hmm, interesting, i just ran grep audio /proc/pci and see that i am running a VT8233 AC 97 sound controller. any suggestion on what i should do?

do you have anything in /dev/sound?
which kernel are you using?
which alsa version?
modules or builtin?
do you use devfs? (i guess so )
do you have the OSS emulation of alsa enabled/loaded? whates the output of lsmod?
does lspci list your card?

i am using gentoo-sources, v. 2.4.20 R7. i assume i am using the newest version of alsa, as i just merged it last night and installed gentoo 2 days ago (so i have updated portage). In the alsa intruction guide it told me to compile sound card support using modules. devfs is enabled in the kernel. what exactly is the oss emulation of alsa? how do i check if it is enabled/loaded? the output of lsmod is:

Code:
snd-pcm-oss
snd-pcm
snd-page-alloc
snd-timer
snd-mixer-oss
snd

apparently all the right modules are loaded. how do i use lspci? thanks
 

blight

New member
if you see your sound chip in /proc/pci it should be ok (no need to check with lspci)
the OSS emulation is what it says - OSS is a different sound api/drivers - most apps nowaday support both, OSS and alsa
as you can see there are the -oss modules which are for the emulation ;)
seems like you truncated the output of lsmod, is something like snd-via8233 loaded?
check kernel messages with `dmesg | less` - maybe there is some problem which the driver tells you
 
OP
mesman00

mesman00

What's that...?
ok, how do i check to see if OSS is either enabled or installed? and the output of lsmod isn't truncated, thats what it says. the last thing just says snd. i changed my driver from AC '97 1980 to via8233 and reinstalled the modules. however, i still get the message when gentoo loads the /dev/dsp doesn't exit. if i try to cd there in a bash prompt it tells me it doesn't exist as well. i am still unable to run amixer, and it gives me the same error. this is what my /etc/modules.d/alsa file looks like.

Code:
/etc/modules.d/alsa# Alsa 0.9.X kernel modules' configuration file.
# $Header: /home/cvsroot/gentoo-x86/media-sound/alsa-driver/files/alsa-modules.conf-rc,v 1.1 2002/12/21 06:31:52 agenkin Exp $

# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore

##
## 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-via8233
## 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

# Set this to the correct number of cards.
options snd cards_limit=1
 

blight

New member
the config file looks ok (except for the alias lines maybe?)
you have the OSS emulation loaded
you cannot cd to /dev/dsp because it's supposed to be a file
Code:
lr-xr-xr-x    1 root     root            9 Sep 23 13:47 /dev/dsp -> sound/dsp
this is my /dev/dsp - as you can see it is /dev/sound/dsp really.
do you have any files in /dev/sound/?
do you see any error messages when running `dmesg`?
 
OP
mesman00

mesman00

What's that...?
blight said:
the config file looks ok (except for the alias lines maybe?)
you have the OSS emulation loaded
you cannot cd to /dev/dsp because it's supposed to be a file
Code:
lr-xr-xr-x    1 root     root            9 Sep 23 13:47 /dev/dsp -> sound/dsp
this is my /dev/dsp - as you can see it is /dev/sound/dsp really.
do you have any files in /dev/sound/?
do you see any error messages when running `dmesg`?

i don't know what to say about the alias lines. following the gentoo install guide it told me to uncomment that ones that are uncommented, and leave the rest alone. there are no files located in /dev/sound. however it is a direction, unlike /dev/dsp. here are the errors i get when running dmesg.

Code:
ttached scsi removable disk sda at scsi1, channel 0, id 0, lun 0
sda : READ CAPACITY failed.
sda : status = 1, message = 00, host = 0, driver = 08
Current sd00:00: sense key Not Ready
Additional sense indicates Medium not present
sda : block size assumed to be 512 bytes, disk size 1GB.
 /dev/scsi/host1/bus0/target0/lun0: I/O error: dev 08:00, sector 0
 I/O error: dev 08:00, sector 0
 unable to read partition table
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 2
Device not ready.  Make sure there is a disc in the drive.
VFS: Disk change detected on device 08:00
sda : READ CAPACITY failed.
sda : status = 1, message = 00, host = 0, driver = 08
Current sd00:00: sense key Not Ready
Additional sense indicates Medium not present
sda : block size assumed to be 512 bytes, disk size 1GB.
 /dev/scsi/host1/bus0/target0/lun0: I/O error: dev 08:00, sector 0
 I/O error: dev 08:00, sector 0
Adding Swap: 995988k swap-space (priority -1)
EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
EXT3 FS 2.4-0.9.19, 19 August 2002 on ide0(3,8), internal journal
Device not ready.  Make sure there is a disc in the drive.
VFS: Disk change detected on device 08:00
sda : READ CAPACITY failed.
sda : status = 1, message = 00, host = 0, driver = 08
Current sd00:00: sense key Not Ready
Additional sense indicates Medium not present
sda : block size assumed to be 512 bytes, disk size 1GB.
 /dev/scsi/host1/bus0/target0/lun0: I/O error: dev 08:00, sector 0
 I/O error: dev 08:00, sector 0
Device not ready.  Make sure there is a disc in the drive.
VFS: Disk change detected on device 08:00
sda : READ CAPACITY failed.
sda : status = 1, message = 00, host = 0, driver = 08
Current sd00:00: sense key Not Ready
Additional sense indicates Medium not present
sda : block size assumed to be 512 bytes, disk size 1GB.
 /dev/scsi/host1/bus0/target0/lun0: I/O error: dev 08:00, sector 0
 I/O error: dev 08:00, sector 0

*note this isn't full output of dmesg

i don't know what they have to do with, the output before this point seems fine, as it reports no errors
 

blight

New member
you have to insert the modules (this might be done automatically by a startup script) and if there are any errors the modules will log the error messages which dmesg will show you (in case there are any) so you gotta check the dmesg output for messages containing "alsa" or "via8233"
 
OP
mesman00

mesman00

What's that...?
blight said:
you have to insert the modules (this might be done automatically by a startup script) and if there are any errors the modules will log the error messages which dmesg will show you (in case there are any) so you gotta check the dmesg output for messages containing "alsa" or "via8233"

what do you mean "insert" the modules? like modprobe "module name here". if so, what would be the modules, the snd ones? how do i check if they are done by a startup script? when i looked through dmesg i saw nothing relating to alsa or "via8233." further, are there any other sound drivers i can try?
 

blight

New member
yes, the snd- modules need to be inserted... you can list loaded modules with /sbin/lsmod and load modules with /sbin/modprobe - seems like its done by a startup script, but you need to make sure that the snd-via8233 module is loaded which is the actual driver for your card, else you will not get any useful device files
 
OP
mesman00

mesman00

What's that...?
hm, now wheni run lsmod there are no modules loaded? this is a problem, how can i make it so the modules are automotically loaded at boot.

this is what the alsa section of my modules.conf file looks like

Code:
# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore

##
## 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-via8233
## 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

# Set this to the correct number of cards.
options snd cards_limit=1

### modules-update: end processing /etc/modules.d/alsa

### modules-update: start processing /etc/modules.d/alsa.save
/etc/modules.d/alsa# Alsa 0.9.X kernel modules' configuration file.
# $Header: /home/cvsroot/gentoo-x86/media-sound/alsa-driver/files/alsa-modules.conf-rc,v 1.1 2002/12/21$

# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore
##
## 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-via8233
## 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

# Set this to the correct number of cards.
options snd cards_limit=1

to me it seems like everythign should be loaded when i boot.

edit* when i watch gentoo boot i notice that there are a bunch of modprobe errors relationg to alsa. alsa, when i reboot gentoo and it goes to bring down alsa, it just says "alsa driver not loaded." i would really like to see the modprobe errors. however, gentoo auto boots into kde. even when i comment out the display manager in rc.conf, and will auto boot into x window manager. how do i make it so it just boots a prompt.
 
Last edited:

blight

New member
for a boot prompt you need to remove the graphical login manager - use rc-update del kdm or whatever
but you can also run the alsa startup script yourself:
/etc/init.d/alsasound start
 
OP
mesman00

mesman00

What's that...?
this should be so difficult! why does it no longer find any of the snd- modules when its booting linux, when it did before?
 
OP
mesman00

mesman00

What's that...?
ok i think i almost got this thing working. i reinstaleld alsa for my sound driver (via82xx). then i merged alsa-utils. then opened my /etc/modules.d/alsa file and everything was already configured like it said it should be in the install guide. then did modules-autoload. then, when i ran amixer i got the following error:

Code:
amixer: Mixer attach default error: No such file or directory

this is good as it is different from my original error which said:


Code:
amixer: Mixer attach default error: Device not found

so i follow the instructions and try to:

Code:
# modprobe snd-mixer-oss
# modprobe snd-pcm-oss[code]

when doing this it gives me the following error:

[code]modprobe: Invalid line 101 in /etc/modules.conf
        /etc/modules.d/alsa

also, when booting linux it gives me the same error when trying to load all of the modules associated with alsa (except the error for each module is on a different line). this is my modules.conf file:

Code:
## This file is automatically generated by modules-update
#
# Please do not edit this file directly. If you want to change or add
# anything please take a look at the files in /etc/modules.d and read
# the manpage for modules-update.
#
### modules-update: start processing /etc/modules.d/aliases
# Aliases to tell insmod/modprobe which modules to use

# Uncomment the network protocols you don't want loaded:
# alias net-pf-1 off            # Unix
# alias net-pf-2 off            # IPv4
# alias net-pf-3 off            # Amateur Radio AX.25
# alias net-pf-4 off            # IPX
# alias net-pf-5 off            # DDP / appletalk
# alias net-pf-6 off            # Amateur Radio NET/ROM
# alias net-pf-9 off            # X.25
# alias net-pf-10 off           # IPv6
# alias net-pf-11 off           # ROSE / Amateur Radio X.25 PLP
# alias net-pf-19 off           # Acorn Econet

alias char-major-10-175 agpgart
alias char-major-10-200 tun
alias char-major-81     bttv
alias char-major-108    ppp_generic
alias /dev/ppp          ppp_generic
alias tty-ldisc-3       ppp_async
alias tty-ldisc-14      ppp_synctty
alias ppp-compress-21   bsd_comp
alias ppp-compress-24   ppp_deflate
alias ppp-compress-26   ppp_deflate

# Crypto modules (see [url]http://www.kerneli.org/[/url])
alias loop-xfer-gen-0   loop_gen
alias loop-xfer-3       loop_fish2
alias loop-xfer-gen-10  loop_gen
alias cipher-2          des
alias cipher-3          fish2
alias cipher-4          blowfish
alias cipher-6          idea
alias cipher-7          serp6f
alias cipher-8          mars6
alias cipher-11         rc62
alias cipher-15         dfc2
alias cipher-16         rijndael
alias cipher-17         rc5

# Support for i2c and lm_sensors
alias char-major-89    i2c-dev

# Old nvidia support ...
alias char-major-195 NVdriver
alias /dev/nvidiactl char-major-195

### modules-update: end processing /etc/modules.d/aliases

### modules-update: start processing /etc/modules.d/alsa
# Alsa 0.9.X kernel modules' configuration file.
# $Header: /home/cvsroot/gentoo-x86/media-sound/alsa-driver/files/alsa-modules.conf-rc,v 1.1 2002/12/21 06:31:52 agenkin Exp $

# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore

##
## 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-via82xx
## 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

# Set this to the correct number of cards.
options snd cards_limit=1

### modules-update: end processing /etc/modules.d/alsa

### modules-update: start processing /etc/modules.d/alsa.save
/etc/modules.d/alsa# Alsa 0.9.X kernel modules' configuration file.
# $Header: /home/cvsroot/gentoo-x86/media-sound/alsa-driver/files/alsa-modules.conf-rc,v 1.1 2002/12/21 06:31:52 agenkin Exp $

# ALSA portion
alias char-major-116 snd
# OSS/Free portion
alias char-major-14 soundcore

##
## 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-via8233
## 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

# Set this to the correct number of cards.
options snd cards_limit=1

### modules-update: end processing /etc/modules.d/alsa.save

### modules-update: start processing /etc/modules.d/i386
alias parport_lowlevel parport_pc
alias char-major-10-144 nvram
alias binfmt-0064 binfmt_aout
alias char-major-10-135 rtc

### modules-update: end processing /etc/modules.d/i386

i'm guessing there is a problem somewhere int he modules.conf file. can you help? i'm almost there, i can taste it!
 
Last edited:

blight

New member
yes i guess i can help a bit :p
/etc/modules.conf is created from the files in /etc/modules.d when you run update-modules - this is to make it easy for packages/ebuilds to add something to modules.conf
the error seems to come from /etc/modules.d/alsa.save - remove it or rename it to .alsa.save (the . in front makes it a "hidden" file - you can see them with "ls -a" or by turning it on in your file manager :D)

edit: don't forget to run "update-modules" after you remove/rename the file
i do not know if update-modules includes hidden files (ones starting with a dot) but i don't think so - you can check by opening /etc/modules.conf and look for something like
### start processing /etc/modules.d/.alsa.save
...
 
Last edited:
OP
mesman00

mesman00

What's that...?
ok, so now all the modprobe errors are gone, alsa is brought up perfectly, and i get no sound errors when loading linux. also, i can run amixer fine. i even set the master volumes and all that stuff. however,i still get no sound. when i use aplay command to play a sound it tells me this:

Code:
Playing WAVE 'ktalkd.wav' : Unsigned 8 bit, Rate 11025 Hz, Mono

obviously it is playing the sound. and before you ask, yes my speakers are turned on and plugged in! help again? thanks

the here is what my alsamixer looks like:
 
OP
mesman00

mesman00

What's that...?
IT WORKS! hey hey, thanks for all of your help blight and malcom. i had center and surround still muted, thats why sound still wasn't coming through.

*edit* ok, for some reason the sound is very very staticky, is there a reason for this? something i can do to fix it? i know there is a way to fix this, i KNOW IT!
 
Last edited:

Top