PDA

View Full Version : alsa parallel stereo output



stevodude
19th June 2008, 11:58 PM
Hi people,

I have F9 on 2 machines (one is a test box, the other a production box)

the test box has 2 yamaha ymf724, the production box has 3 Audigy 2 zs's

now on both of these I have an fm tuner feeding line in on all cards, and can turn radio on all cards just by unmuting line in on all cards in one box through web interface = same radio on all line outputs. and MPD on seperate ports (1 for each card), and access via seperate jinzora configs via web interface

We'll stick with the test box with 2 yamaha cards for the moment.

What I want to do is:

create a asound.rc or asound.conf file that has some sort of software mixer that I can add into another MPD server and when this runs will output the save audio to all Line-out's on audio cards.

I think this can be done with some sort of matrix dmix configuration or something...
I did have 'all outputs' working with pulse, but I don't want pulse, and all MPD/radio software control is currently using alsa.

I currently don't have any .asound file, but there is a /etc/alsa/alsa.conf?

any help appreciated. cheers, stevo.

stevodude
22nd June 2008, 11:23 AM
OK, no one biting?...

here is my current asound.conf for my home pc:



# the sound card
pcm.snd_emu10k1 {
type hw
card 0
device 0
}

pcm.snd_emu10k1_1 {
type hw
card 1
device 0
}

pcm.snd_emu10k1_2 {
type hw
card 2
device 0
}

# the ipc stuff is needed for permissions, etc.
pcm.dmixer {
type dmix
ipc_key 1024
ipc_perm 0666
slave.pcm "snd_emu10k1"
slave {
period_time 0
period_size 1024
buffer_size 8192
rate 44100
}
bindings {
0 0
1 1
}
}

pcm.dmixer_1 {
type dmix
ipc_key 1024
ipc_perm 0666
slave.pcm "snd_emu10k1_1"
slave {
period_time 0
period_size 1024
buffer_size 8192
rate 44100
}
bindings {
0 0
1 1
}
}

pcm.dmixer_2 {
type dmix
ipc_key 1024
ipc_perm 0666
slave.pcm "snd_emu10k1_2"
slave {
period_time 0
period_size 1024
buffer_size 8192
rate 44100
}
bindings {
0 0
1 1
}
}


ctl.dmixer {
type hw
card 0
}

ctl.dmixer_1 {
type hw
card 1
}

ctl.dmixer_2 {
type hw
card 2
}


# software volume
pcm.softvol {
type softvol
slave.pcm "dmixer"
control {
name "Software"
card 0
}
}

pcm.softvol_1 {
type softvol
slave.pcm "dmixer_1"
control {
name "Software"
card 1
}
}

pcm.softvol_2 {
type softvol
slave.pcm "dmixer_2"
control {
name "Software"
card 2
}
}

# mpd volume control
pcm.mpdvol {
type softvol
slave.pcm "dmixer"
control {
name "MPD"
card 0
}
}

pcm.mpdvol_1 {
type softvol
slave.pcm "dmixer_1"
control {
name "MPD_1"
card 1
}
}

pcm.mpdvol_2 {
type softvol
slave.pcm "dmixer_2"
control {
name "MPD_2"
card 2
}
}


# ctrl for mpd volume
ctl.mpdvol {
type hw
card 0
}

ctl.mpdvol_1 {
type hw
card 1
}

ctl.mpdvol_2 {
type hw
card 2
}


# input
pcm.input {
type dsnoop
ipc_key 3129398
ipc_key_add_uid false
ipc_perm 0660
slave.pcm "810"
}

# duplex device
pcm.duplex {
type asym
playback.pcm "softvol"
capture.pcm "input"
}

# default devices
pcm.!default {
type plug
slave.pcm "duplex"
}

# for oss devices
pcm.dsp0 {
type plug
slave.pcm "duplex"
}



Here is a link to someone who has two sound cards as one: http://alsa.opensrc.org/index.php/TwoCardsAsOne

now I can probably work this out, and probably will, but if anyone has any ideas on how I can format my asound.conf file to make a 'virtual' 3 card stereo control.

I'll post more when I work it out I spose, cheers for looking.

stevodude
22nd June 2008, 11:54 AM
OK, might try this (for 3 card system)
pcm.multi {
type multi;
slaves.a.pcm "hw:0,0"
slaves.a.channels 2;
slaves.a.pcm "hw:1,0"
slaves.a.channels 2;
slaves.a.pcm "hw:2,0"
slaves.a.channels 2;
bindings.0.slave a;
bindings.0.channel 0;
bindings.1.slave a;
bindings.1.channel 1;
bindings.2.slave b;
bindings.2.channel 0;
bindings.3.slave b;
bindings.3.channel 1;
bindings.4.slave c;
bindings.4.channel 0;
bindings.5.slave c;
bindings.5.channel 1;
}

ctl.multi {
type hw;
card 0;
}

but not now, as children are asleep, and would want ACDC going flat out on all stereo's hehehe