You are not logged in.

#1 2010-08-11 23:06:09

k2000
Member
Registered: 2009-12-02
Posts: 33

Using 2 soundcards with ALSA and MPD [Resolved]

Hi everyone,

I wonder if it is possible to use two soundcards at the same time with ALSA.

What I want to do is using the inboard sound card, wich is connected to my pc speakers, for every sounds, like listening a video on youtube or someting. The other one (PCI soundcard) is connected to the living room speakers, and I want it to be used only by mpd.

Someone know if it is possible? And if not with ALSA, maybe with pulseaudio?

Thanks you all !

Last edited by k2000 (2010-08-12 22:09:44)

Offline

#2 2010-08-12 04:17:42

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

Re: Using 2 soundcards with ALSA and MPD [Resolved]

Yes, ALSA can do that.

Flash, and all apps by default, use the obviously-named stereo "default" PCM.

So, set up a PCM for MPD to use, which outputs to the 2nd soundcard.

Offline

#3 2010-08-12 11:17:52

Themaister
Member
From: Trondheim, Norway
Registered: 2008-07-21
Posts: 652
Website

Re: Using 2 soundcards with ALSA and MPD [Resolved]

To set up a dedicated PCM for MPD, use something like this:

pcm.mpd {
  type hw
  card 1 # Obviously, this number can be anything. Check with aplay -l to see what number your card has.
}

Offline

#4 2010-08-12 16:41:15

k2000
Member
Registered: 2009-12-02
Posts: 33

Re: Using 2 soundcards with ALSA and MPD [Resolved]

Thanks!
but...

Themaister wrote:

To set up a dedicated PCM for MPD, use something like this:

pcm.mpd {
  type hw
  card 1 # Obviously, this number can be anything. Check with aplay -l to see what number your card has.
}

wich file must I edit? Something like alsa.conf... but I don't know where Alsa configuration is located.

Offline

#5 2010-08-12 16:52:14

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,543

Re: Using 2 soundcards with ALSA and MPD [Resolved]

~/.asoundrc

Offline

#6 2010-08-12 22:00:41

k2000
Member
Registered: 2009-12-02
Posts: 33

Re: Using 2 soundcards with ALSA and MPD [Resolved]

ok, thanks for your help.

doesnt work yet...

first I want it system-wide, so I put the lines in /usr/share/alsa/alsa.con
aplay -l says this:

**** List of PLAYBACK Hardware Devices ****
card 0: SI7012 [SiS SI7012], device 0: Intel ICH [SiS SI7012]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: CA0106 [CA0106], device 0: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: CA0106 [CA0106], device 1: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: CA0106 [CA0106], device 2: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: CA0106 [CA0106], device 3: ca0106 [CA0106]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

card 0 is the onboard default soundcard, nice. All sounds currently play through this one.
So I want mpd to use card 2. I put this in alsa.conf:

pcm.mpd {
  type hw
  card 2 
}

just after the "pcm.hw" part. Alsa still works correctly, so I guess there is no errors...

Now to configure mpd. I tried this, and a few other combinaison, but it doesnt work. In fact I absolutely don't know where to put the "pcm.mpd" to specify which card to use.

audio_output {
    type        "alsa"
    name        "My ALSA Device"
    device        "mpd:0,0"    # optional
#    format        "44100:16:2"    # optional
#    mixer_device    "default"    # optional
#    mixer_control    "pcm.mpd"    # optional
#    mixer_index    "0"        # optional
#}

Any help?

Offline

#7 2010-08-12 22:09:23

k2000
Member
Registered: 2009-12-02
Posts: 33

Re: Using 2 soundcards with ALSA and MPD [Resolved]

Oh I got it!
what it takes was that:

audio_output {
    type        "alsa"
    name        "My ALSA Device"
    device        "hw:2,0"    # optional
    mixer_control    "mpd"    # optional
}

And everyting seems to be all right! Thanks!!!

Offline

#8 2010-09-02 22:20:08

k2000
Member
Registered: 2009-12-02
Posts: 33

Re: Using 2 soundcards with ALSA and MPD [Resolved]

Hey, I'm back...
It still works correctly most of the time, but I have a related problem that I posted here:
https://bbs.archlinux.org/viewtopic.php … 59#p820259

Offline

Board footer

Powered by FluxBB