You are not logged in.

#1 2010-02-21 17:02:07

eldalion
Member
From: Chapel Hill, NC
Registered: 2008-03-11
Posts: 35

Can't play sound from multiple programs

So I have this new shiny box running Arch64 with a ASRock N68-S motherboard. I installed alsa and I am able to play music just fine using amarok or mpd. However, when I try playing two sounds at once, there is a short pause and the first program becomes silent, and then the second kicks in.

According to the wiki, dmix should work automatically with this version of alsa. I tried seting up dmix "the old way" using /etc/asound.conf (hey, you never know) but no luck either.

Lspci lists my card as
00:05.0 Audio device: nVidia Corporation MCP61 High Definition Audio (rev a2)

I figured this was a bit vague and went to the manufacturer's site and found out the actual name is
5.1 CH Windows® Vista™ Premium Level HD Audio (Realtek ALC662 / VIA® VT1708S / VT1705 Audio Codec)

The Alsa wiki suggests to test dmix using these instructions but this simple test fails miserably, alsaplayer windows show up and complain "no stream found". So it seems and one of the unlucky few for which dmix doesn't just work.

However, OSS4 works with hardly no setup. But I just don't want to use it since most applications aren't OSS-aware, there is no KDE integration and so on.

What sould I do? I'd happy to report a bug upstream if necessary but I realised audio in Linux is way more complicated than previously thought and I'd rather make sure I haven't over looked something. I'm so confused I can't tell what my actual soundcard vendor is: nVidia, Realtek or Via?

edit: oh and of course, nothing of interest in /var/log/everything.log

Thanks! smile

Last edited by eldalion (2010-02-21 17:28:53)

Offline

#2 2010-02-21 22:25:29

MAroco
Member
From: Germany
Registered: 2010-01-20
Posts: 72

Re: Can't play sound from multiple programs

Just to make sure you don't miss the obvious... The wiki page you linked gives the instruction:

alsaplayer -o alsa -d plug:dmix some.mp3 &

You certainly have to replace "some.mp3" with one you actually have on your system, including the complete path smile

I'm not a sound expert at all but you could also look at esound, pulseaudio, jack (or since you seem to use KDE perhaps arts) ie soundservers that kind of "mask" your card, so all applications giving out sound will send to one of those programs and they will do the mixing and give output to the card itself.
Well it may be that they need dmix to work at all though - as I said, me no expert...
Good luck.

[Edit:
P.S. I assume you already found http://wiki.archlinux.org/index.php/All … Play_Sound
And I just found arts is the "old" KDE-Soundserver from KDE3.x the new one would be Phonon, but I have no KDE here so no experience....]

Last edited by MAroco (2010-02-21 23:08:01)

Offline

#3 2010-02-22 18:13:19

eldalion
Member
From: Chapel Hill, NC
Registered: 2008-03-11
Posts: 35

Re: Can't play sound from multiple programs

Hehe no, I specified a valid path. tongue
Anyway I just gave up and bought a cheap pci 7.1 soundcard.

Offline

#4 2010-02-23 07:47:30

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Can't play sound from multiple programs

eldalion wrote:

I tried seting up dmix "the old way" using /etc/asound.conf (hey, you never know) but no luck either.

Not necessary. ALSA supports dmix by default. Don't edit that file.

Let me explain what's happening. mpd has a stupid default config, of using OSS rather than ALSA. And OSS screws up dmix.

For example, my ~/.mpdconf is:

music_directory         "~/gnutella/downloads/Cool"
playlist_directory      "~/.mpd/playlists"
db_file                 "~/.mpd/mpd.db"
log_file                "~/.mpd/mpd.log"
error_file              "~/.mpd/mpd.error"

audio_output {
        type                    "alsa"
        name                    "Sound Card"
        options                 "dev=dmixer"
        device                  "plug:dmix"
}

Try that, to prove to yourself that I'm right wink  Also use this good debugging command, from the same ALSA wiki entry (because I put it there):

fuser -v /dev/snd/* /dev/dsp*

eldalion wrote:

What should I do?

Step 1: File a bug with your distro, for the app (mpd) to default to ALSA instead of OSS. Defaulting to OSS these days is ridiculous - ALSA is the standard sound system in Linux, and that's not gonna change.
Please do this. I'm not doing this, because I don't use Arch or mpd any more.

Step 2: File a bug upstream, to default to ALSA instead of OSS.


Edit: I notice that Ubuntu has the right idea:

* Update mpd.conf from upstream
    - Configure an ALSA output by default

Last edited by brebs (2010-02-23 07:56:16)

Offline

#5 2010-05-01 06:22:14

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,217
Website

Re: Can't play sound from multiple programs

brebs wrote:
audio_output {
        type                    "alsa"
        name                    "Sound Card"
        options                 "dev=dmixer"
        device                  "plug:dmix"
}

Legend!! big_smile
That solved my multiple-programs-play-audio-at-once problem, thank-you big_smile

Offline

Board footer

Powered by FluxBB