Jump to content

Problems playing multiple sounds


MrMorden
 Share

Recommended Posts

Hey, everyone:

 

My computer won't play multiple sounds at the same time. I have diaganosed this problem by attempting to open different programs that access the sound at the same time, namely AlsaPlayer and Kaffeine. If AlsaPlayer is open when I try to open Kaffeine, Kaffeine will say that "all audio drivers failed to initialize" and crash. If I attempt to open an instance of AlsaPlayer while Kaffeine is open, AlsaPlayer will not load until I stop the media clip. In addition, when attempting to run Vegastrike (http://vegastrike.sourceforge.net) I can consistently get music but no sound (by loading esd) or sound but no music (by not loading esd.) The devs at the vegastrike message board say that both sound and music should be working properly if esd is running.

 

In my attempts to solve the problem, I have googled the following:

 

multiple sounds at once NForce2

"multiple sounds" at once NForce2

multiple sounds NForce2

 

As well as search the Vegastrike message boards and these boards. I did find someone with the same problem, but he solved it by putting in a dedicated sound card. Here is my system info:

 

Mandrake 10.1 Offiical

kernel 2.6.8.1-12mdkcustom

Giga-byte 7NNXP (NForce2 chipset) with dirver intel8x0

Athalon XP 3200+

 

Thank you,

MrMorden

Link to comment
Share on other sites

Your soundcard (in this case onboard sound) doesn't do hardware mixing. That means only one application at the time can use the card.

 

Solution: use a software mixer like esd (the gnome soundmixer) (or arts (kde soundmixer) or dmix (alsamixer)). The easiest solution is if the app you want to use has different audio output options. Just changing the audio out to esd will solve the problem. If not you have to run the app trough a soundwrapper. Start it from a console by typing: soundwrapper <name of app> (or esddsp, artsdsp <name of app>)

 

The dmix way is more difficult. If the other solutions don't work try it.

Link to comment
Share on other sites

Well, I tried using esddsp, and as soon as I did something that called for a sound effect (sc, fireing my ship's guns) the performance immediately went to crap. The sound became choppy and my framerate took a dive from ~150 fps to ~10 fps.

 

Does this mean I need to use dmix, or is there some other trick for making the sound wrapper work properly? If I do need to use dmix, where/how do I get the plug-in, or tell if I already have it? Digging around the wiki (http://wiki.arslinux.com/Dmix) isn't helpful.

Link to comment
Share on other sites

Yes esd is crap :)

 

Ok for dmix: open your favorite text editor and create a file called .asoundrc (don't forget the '.') in your home directory. Copy and paste this:

 

 pcm.nforce-hw {
type hw
card 0
}

pcm.!default {
type plug
slave.pcm "nforce"
}

pcm.nforce {
type dmix
ipc_key 1234
slave {
pcm "hw:0,2"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}

ctl.nforce-hw {
type hw
card 0
}

 

and save the file.

 

Disclaimer: I got this from google (i don't have nforce2) http://www.mythtv.info/moin.cgi/DigitalSoundHowTo so I don't know this will work for sure. This is a howto: http://alsa.opensrc.org/index.php?page=DmixPlugin

 

Good luck

Link to comment
Share on other sites

Output of lsmod:

 

snd-seq-oss            32704  0
snd-seq-midi-event      6464  1 snd-seq-oss
snd-seq                50576  4 snd-seq-oss,snd-seq-midi-event
snd-pcm-oss            50856  0
snd-mixer-oss          18112  1 snd-pcm-oss
snd-intel8x0           29772  0
snd-ac97-codec         68496  1 snd-intel8x0
snd-pcm                84552  2 snd-pcm-oss,snd-intel8x0
snd-timer              22148  2 snd-seq,snd-pcm
snd-page-alloc          7496  2 snd-intel8x0,snd-pcm
gameport                3456  1 snd-intel8x0
snd-mpu401-uart         6208  1 snd-intel8x0
snd-rawmidi            20836  1 snd-mpu401-uart
snd-seq-device          6472  3 snd-seq-oss,snd-seq,snd-rawmidi
snd                    45412  11 snd-seq-oss, snd-seq, snd-pcm-oss, snd-mixer-oss, snd-intel8x0, snd-ac97-codec, snd-pcm, snd-timer, snd-mpu401-uart, snd-rawmidi, snd-seq-device
floppy                 54096  0
md5                     3648  1
ipv6                  244612  8
ipt_TOS                 1920  12
ipt_REJECT              5568  4
ipt_pkttype             1344  4
ipt_LOG                 5824  8
ipt_state               1472  9
ipt_multiport           1664  0
ipt_conntrack           2112  0
iptable_mangle          2176  1
ip_nat_irc              3568  0
ip_nat_tftp             2928  0
ip_nat_ftp              4272  0
iptable_nat            22124  3 ip_nat_irc,ip_nat_tftp,ip_nat_ftp
ip_conntrack_irc       70512  1 ip_nat_irc
ip_conntrack_tftp       2992  0
ip_conntrack_ftp       71344  1 ip_nat_ftp
ip_conntrack           29736  9 ipt_state, ipt_conntrack, ip_nat_irc, ip_nat_tftp, ip_nat_ftp, iptable_nat, ip_conntrack_irc, ip_conntrack_tftp,ip_conntrack_ftp
iptable_filter          2176  1
ip_tables              16064  10 ipt_TOS, ipt_REJECT, ipt_pkttype, ipt_LOG, ipt_state, ipt_multiport, ipt_conntrack, iptable_mangle,iptable_nat,iptable_filter
nls_iso8859-1           3776  1
af_packet              17352  4
nvidia               3468316  12
nvnet                  69348  0
genrtc                  8244  0

Link to comment
Share on other sites

try this one:

# 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.dmix {
    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 8192
    }

    bindings {
         0 0
         1 1
    }
}

# Allow reading from the default device.
# Also known as record or capture.
pcm.dsnoop {
    type dsnoop
    ipc_key 2048
    slave.pcm "snd_card"

## Possible artsd full duplex fix:
#     slave {
#          period_time 0
#          period_size 1024
#          buffer_size 8192
#     }

    bindings {
         0 0
         1 1
    }
}

# This is what we want as our default device
# a fully duplex (read/write) audio device.
pcm.duplex {
    type asym
    playback.pcm "dmix"
    capture.pcm "dsnoop"
}

###################
# CONVERSION PLUG #
###################
# Setting the default pcm device allows the conversion
# rate to be selected on the fly.
# duplex mode allows any alsa enabled app to read/write
# to the dmix plug (Fixes a problem with wine).
pcm.!default {
    type plug
    slave.pcm "duplex"
}

# Apparently this is wrong (breaks mplayer for me opening the device)
#ctl.!default {
#     type plug
#     slave.pcm "snd_card"
#}

########
# AOSS #
########
# OSS dsp0 device (OSS needs only output support, duplex will break some stuff)
pcm.dsp0 {
    type plug
    slave.pcm "dmix"
}

# OSS control for dsp0 (needed?...this might not be useful)
ctl.dsp0 {
    type plug
    slave.pcm "snd_card"
}

# OSS control for dsp0 (default old OSS is mixer0)
ctl.mixer0 {
    type plug
    slave.pcm "snd_card"
}

Link to comment
Share on other sites

All right, that one worked! Can you tell me how you got that file? I'd like to see an example of your probelm-solving in action.

 

However, the combined sound and music for Vegastrike STILL isn't working...I think I'll try talking to the vegastrike devs some more...

 

Thanks for your help!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...