You are not logged in.

#1 2010-02-24 19:00:03

eyescream
Member
Registered: 2009-08-24
Posts: 49

[Solved] Multiple sounds at the same time

Hello!

I've just received my new Creative X-Fi Titanium since I was in need of an optical in socket and have spent a while trying to get it to work to my liking.
I read through the ALSA wiki, read countless posts on the forums such as this one http://bbs.archlinux.org/viewtopic.php?pid=702994, tried several .asoundrc files and of course read the related arch wiki pages without much success.
Everything is upmixed properly to 5.1 output but I still can't play two sounds at once - with one odd exception:
When I have mpd playing and start a youtube video, sound will play but it will only output through the 2 front speakers and I can pause and unpause mpd normally, sound will return.
When I pause mpd and play a youtube video, it gets upmixed properly but mpd returns "error: problems opening sound device".

Mplayer returns [AO_ALSA] alsa-lib: pcm_hw.c:1291:(snd_pcm_hw_open) open /dev/snd/pcmC0D0p failed: Invalid argument and [AO_ALSA] alsa-lib: pcm_dmix.c:1060:(snd_pcm_dmix_open) unable to open slave.
Heroes of Newerth returns the same: ALSA lib pcm_dmix.c:1060:(snd_pcm_dmix_open) unable to open slave.

fuser -v /dev/snd/*

/dev/snd/controlC0:  eyescream  27612 F.... Steam.exe
/dev/snd/pcmC0D0p:   eyescream  27612 F...m Steam.exe

fuser -v /dev/dsp*

zsh: no matches found: /dev/dsp*

cat .asoundrc

pcm.snd_card {
       type hw
            card 0 # change to your cards number or name
}

# 6 channel dmix:
pcm.dmix6 {
     type dmix
        ipc_key 1024
        ipc_key_add_uid false
        ipc_perm 0666
        slave {
                pcm "hw:0,0"
                rate 48000
                format "S32_LE"
        channels 6
                period_time 0
                period_size 1024
                buffer_time 0
                buffer_size 8192
        }
     }

# upmixing: 
pcm.ch51dup {
        type route
        slave.pcm dmix6
        slave.channels 6
        ttable.0.0 1
        ttable.1.1 1
        ttable.0.2 0.6
        ttable.1.3 0.6
        ttable.0.4 0.5
        ttable.1.4 0.5
        ttable.0.5 0.5
        ttable.1.5 0.5
   }

pcm.duplex {
     type asym
     playback.pcm "ch51dup" # upmix first
     capture.pcm "hw:0"
}

# change default device:
pcm.!default {
     type plug 
     slave {
    pcm "duplex"
    }
}

# for aoss
#pcm.dsp "duplex"

#pcm.dsp1 "duplex"

If anyone could hint me in the right direction as to how I could get it to work properly or provide me with a working .asoundrc, I'd appreciate it!

Last edited by eyescream (2010-02-25 19:30:30)

Offline

#2 2010-02-24 21:30:43

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

Re: [Solved] Multiple sounds at the same time

Not mpd again - see thread, and for God's sake someone (who uses Arch, which is not me) file a damned bug report to get the default mpd config changed, because it seems to catch every Arch user out. Grrrrr.

Don't rename "default" in your ~/.asoundrc - ALSA uses dmix automatically. It's mpd using OSS which is screwing up dmix.

Last edited by brebs (2010-02-24 21:31:14)

Offline

#3 2010-02-24 22:45:32

eyescream
Member
Registered: 2009-08-24
Posts: 49

Re: [Solved] Multiple sounds at the same time

Thank you for your reply!
I read through that thread earlier and tried your suggestion but only tested it with a youtube video.
This time I also tried it with mplayer and I can have sound in mpd and mplayer at the same time now but flash completely blocks sound off for other things.
The problem now is that mpd only outputs through my front speakers, so it isn't being upmixed anymore.

What do you mean by not renaming "default" exactly?

I've also tried your config from http://forums.gentoo.org/viewtopic-p-45 … ml#4528619 but encountered the same as described in this thread http://bbs.archlinux.org/viewtopic.php?id=90421

Playing around with various configs now, I've encountered two things:
Either dmix works but upmixing does not or everything works, just not at the same time.

Sadly, I have neither any experience nor any clue what I am doing hmm

Offline

#4 2010-02-25 02:00:59

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

Re: [Solved] Multiple sounds at the same time

eyescream wrote:

I can have sound in mpd and mplayer at the same time now

Good. So file the damned bug report against mpd. Right now would be a good time.

eyescream wrote:

but flash completely blocks sound off for other things.

See thread. Prove to me that flash/firefox is blocking:

fuser -v /dev/snd/* /dev/dsp*
eyescream wrote:

The problem now is that mpd only outputs through my front speakers, so it isn't being upmixed anymore.

Forget about upmixing for the moment, until you've got the ALSA/OSS conflict solved.

Edit: Use e.g.:

audio_output {
        type                    "alsa"
        name                    "Sound Card"
        options                 "dev=dmixer"
        device                  "headphones"
}

In /etc/mpd.conf or ~/.mpdconf, where the device string matches an ALSA pcm entry.

eyescream wrote:

What do you mean by not renaming "default" exactly?

This, of course, from your own ~/.asoundrc

# change default device:
pcm.!default {
     type plug
     slave {
    pcm "duplex"
    }
}

Comment that section out, for the time being.

Last edited by brebs (2010-02-25 02:43:54)

Offline

#5 2010-02-25 08:25:47

eyescream
Member
Registered: 2009-08-24
Posts: 49

Re: [Solved] Multiple sounds at the same time

I did everything you said and I managed to get sound simultaneously in mplayer, mpd and flash.
I've also filed a bug report here http://musicpd.org/mantis/view.php?id=2830
I hope it's fine that way.

fuser -v /dev/snd/*

/dev/snd/pcmC0D0p:   eyescream   3023 F...m firefox
                     eyescream   5327 F...m mplayer
/dev/snd/timer:      eyescream   3023 F.... firefox

In my mpd.conf I changed it to this

audio_output {
  type      "alsa"
  name      "My ALSA Device"
  options     "dev=dmixer"
  device      "default"  # optional
#  format      "44100:16:2"  # optional
}

Got everything working simultaneously this way. Must have done something wrong last time.

Now the only problem left is proper upmixing for everything. Flash is being upmixed properly but mpd and mplayer aren't.

Offline

#6 2010-02-25 19:30:17

eyescream
Member
Registered: 2009-08-24
Posts: 49

Re: [Solved] Multiple sounds at the same time

Ah well, after playing around with different setups for a while I found something that worked for me.
Thanks again for your help!

Offline

Board footer

Powered by FluxBB