Forums » Linux

Sound problems

Jul 31, 2006 Antz link
Today my sound randomly decided to stop working. When the client quits it prints "/dev/dsp: Device or resource busy".
It is trying to use OSS driver. If I try using the ALSA driver the client just exits as soon as I click apply without any errors.

Any ideas?
Jul 31, 2006 mr_spuck link
I thought they fixed that. hmm...
Your audio device was probably blocked and the game decided to try oss and got stuck on that.

the selector in the preferences doesn'T work you have to manually change the AudioDriver line in ~/.vendetta/config.ini to:
AudioDriver=ALSA driver
while the game isn't running.

try to avoid running oss apps when starting the game
Jul 31, 2006 avirulence link
Yeah, I have an idea :)

Just open ~/.vendetta/config.ini and change AudioDriver=Open Sound System driver to AudioDriver=ALSA driver. If you want to change to another device, add the section:
[alsa]
device=headset --> where headset would be the preferred audio device. I'm not sure why this hasn't been implemented yet and why that stupid probably segfaulting bug still exists. No way to change it besides manually editing config.ini.

Good luck.

EDIT: okay, seems you have enough help..
Aug 01, 2006 Antz link
Splendid! That worked perfectly, thank you.
Feb 26, 2007 Finster link
I have been happily using the OSS driver until now I would like to switch to ALSA so I can use Teamspeak at the same time. I edited the config.ini as suggested but here is what I got in the terminal:

ALSA lib confmisc.c:1105:(snd_func_refer) Unable to find definition 'defaults.pcm.ipc_key'
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:3947:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2146:(snd_pcm_open_noupdate) Unknown PCM dmix:ICH5

Apparently after these errors the sound drops back to OSS. This is with Ubuntu 6.10 upgraded from 6.06LTS. lspci gives the following info about my soundcard:
00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)

Any ideas, suggestions?
Feb 26, 2007 mr_spuck link
check if you have an /etc/asound.conf and/or ~/.asoundrc and posterate the contents
Feb 26, 2007 Finster link
Thanks Spuck for the quick reply. I have both files.
Here is the contents to /etc/asound.conf file:
# Set default sound card
# Useful so that all settings can be changed to a different card here.
pcm.snd_card {
type hw
card 0
}
# Allow mixing of multiple output streams to this device
pcm.dmixer {
type dmix
ipc_key 1024
slave.pcm "snd_card"
slave {
# This stuff provides some fixes for latency issues.
# buffer_size should be set for your audio chipset.
period_time 0
period_size 1024
buffer_size 4096
# rate 44100
}
bindings {
0 0
1 1
}
}
# Allow reading from the default device.
# Also known as record or capture.
pcm.dsnooper {
type dsnoop
ipc_key 2048
slave.pcm "snd_card"
}

The ~/.asoundrc points to the file .asoundrc.asoundconf which contains:
# ALSA library configuration file managed by asoundconf(1).
#
# MANUAL CHANGES TO THIS FILE WILL BE OVERWRITTEN!
#
# Manual changes to the ALSA library configuration should be implemented
# by editing the ~/.asoundrc file, not by editing this file.
!defaults.pcm.card ICH5
defaults.ctl.card ICH5
defaults.pcm.device 0
defaults.pcm.subdevice -1

Thanks for helping...
Feb 26, 2007 mr_spuck link
That stuff in ~/.asoundrc looks kinda odd. Maybe changing the ICH5 to ICH4 would work. Because the description of the config file /usr/share/alsa/cards/ICH4.conf refers to both ICH4 and ICH5.

If that doesn't work, rename .asoundrc and add pcm.!default "snd_pcm" to /etc/asound.conf. That's how I have it here.

EDIT: oups err ... I meant pcm.!default "dmixer"

and that dsnoop device is needed if you want to record with dmix, cause dmix itself can only handle playback. I think you'd have to make make the dmixer device a slave of dsnoop and set dsnoop as default. but I'm not totally sure.

Feb 26, 2007 Finster link
Hmm ok. First i tried renaming ICH5 to ICH4 as you suggested and got:
ALSA lib confmisc.c:670:(snd_func_card_driver) cannot find card 'ICH4'
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
ALSA lib confmisc.c:391:(snd_func_concat) error evaluating strings
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_concat returned error: No such device
ALSA lib confmisc.c:1070:(snd_func_refer) error evaluating name
ALSA lib conf.c:3479:(_snd_config_evaluate) function snd_func_refer returned error: No such device
ALSA lib conf.c:3947:(snd_config_expand) Evaluate error: No such device
ALSA lib pcm.c:2146:(snd_pcm_open_noupdate) Unknown PCM default

So it seems 5 is correct for me.
Then I renamed ~/.asoundrc and added pcm.!default "snd_pcm" to /etc/asound.conf on the very last line of the file. (Not sure if that is were it should go) When I start VO with this setting I get:
ALSA lib pcm.c:2017:(snd_pcm_open_conf) Invalid type for PCM default definition (id: default, value: snd_pcm)
And the sound driver reverts back to OSS.
Feb 26, 2007 mr_spuck link
see above

although snd_pcm should have worked too. that points directly to the hardware device

EDIT gawd damn ... snd_card not snd_pcm
Feb 27, 2007 Finster link
Success! Thanks Spuck I added the "dmixer" line and VO uses the ALSA driver now. Now if you don't mind I still can't seem to get Teamspeak to behave as well. Teamspeak only uses OSS so from what I've read I need to use a util called "aoss" to "route" the sound through the ALSA system. Unfortuntely, when I run Teamspeak with VO I am muted in Teamspeak and cannot umute. I believe they are fighting over /dev/dsp. I read the aoss man page but I really don't understand these sound settings. So I think I need to add something to /etc/asound.conf or ~/.asoundrc. Any ideas?
Thanks again for all your help.
Feb 27, 2007 mr_spuck link
pcm.!default "duplex"

pcm.dmixer {
type dmix
ipc_key 1026
ipc_key_add_uid false
slave {
pcm "hw:0"
period_time 0
period_size 1024
buffer_size 4096
}
}

pcm.dsnooper {
ipc_key 1025
type dsnoop
ipc_key_add_uid false
slave.pcm "hw:0"
}


pcm.duplex {
type asym
playback.pcm "dmixer"
capture.pcm "dsnooper"
}

pcm.dsp0 "duplex"

For some reason I can't get recording to work at all on my card. but above is how it should theoretically work...

have you tried putting aoss into the teamspeak startup script directly, like aoss <path/to/Teamspeak.bin>?

here's a very thorough guide btw:
http://www.linux-gamers.net/modules/wiwimod/index.php?page=HOWTO+Sound
Feb 27, 2007 Finster link
I should have mentioned that yes I did add "aoss" to the TeamSpeak startup script, but alas it did not work. That's why I thought I needed some more configuration. Thanks for the guide link. I will read it and see how it goes. Again, thanks for all the help.
Mar 11, 2007 Finster link
Sorry I forgot that you asked me to post the config file. Honestly I don't really understand the settings, but I have VO using ALSA and Teamspeak works and they work together. Hurray! I just copy and pasted the stuff from that guide page link you posted. Anyways here is my /etc/asound.conf

# Set default sound card
# Useful so that all settings can be changed to a different card here.
pcm.snd_card {
type hw
card 0
}

# Allow mixing of multiple output streams to this device
pcm.dmixer {
type dmix
ipc_key 1024
slave.pcm "snd_card"
slave {
# This stuff provides some fixes for latency issues.
# buffer_size should be set for your audio chipset.
period_time 0
period_size 1024
buffer_size 4096
# rate 44100
}

bindings {
0 0
1 1
}
}

# Allow reading from the default device.
# Also known as record or capture.
pcm.dsnooper {
type dsnoop
ipc_key 2048
slave.pcm "snd_card"
}
pcm.!default "dmixer"
pcm.card0 {
type hw
card 0
mmap_emulation true
}

pcm.!playback {
type dmix # dmix plugin for mixing the output
ipc_key 1234 # an uniqe number
slave {
pcm "card0"
period_time 0
period_size 1024
buffer_size 8192
rate 44100
}
bindings {
0 0
1 1
}
}

pcm.!capture {
type dsnoop # dsnoop plugin for input
ipc_key 5678 # another uniqe number
slave {
pcm "card0"
period_time 0
period_size 1024
rate 44100
}
}

#
# combined playback/capture device
#
pcm.!duplex {
type asym playback.pcm "playback"
capture.pcm "capture"
}

#
# making the playback/capture device default
#
pcm.!default {
type plug
slave.pcm "duplex"
}
#
# for oss compatibility (maybe)
#
pcm.!dsp {
type plug
slave.pcm "duplex"
}

ctl.!mixer0 {
type hw
card 0
}
Mar 11, 2007 mr_spuck link
looks like how I did it ... maybe the drivers for my chip are just broken *shrug*