Talk:Dmix
From the ALSA wiki
| Line 125: | Line 125: | ||
[[User:Ingomueller.net|Ingomueller.net]] 02:06, 24 May 2007 (EST): I think, that dmix only supports hw devices as slaves, but I'm not 100% sure... BTW, if you need help with ALSA, the best place to ask is the [[ALSA_resources#Mailing_lists | alsa-user mailing list]]. Greets, Ingo | [[User:Ingomueller.net|Ingomueller.net]] 02:06, 24 May 2007 (EST): I think, that dmix only supports hw devices as slaves, but I'm not 100% sure... BTW, if you need help with ALSA, the best place to ask is the [[ALSA_resources#Mailing_lists | alsa-user mailing list]]. Greets, Ingo | ||
| + | |||
| + | [[User:Emmef|Emmef]] 09:54, 16 September 2009 (EST) Dmix does ''not'' support other than hw slaves. I remember to have read somewhere that this was done "for simplicity reasons". When I try to use a non-hw slave, I get | ||
| + | ALSA lib pcm_dmix.c:1013:(snd_pcm_dmix_open) dmix plugin can be only connected to hw plugin | ||
| + | I have been working on an alsa effect plugin, but the API/Documentation/Comments of actual code are not that clear that one can undo this in a simple matter. Alas! | ||
Latest revision as of 23:54, 15 September 2009
Also a question more than a comment:
Are there any limitations in the type of slave pcm devices that the dmix plugin can use? I've seen another user's comment that type 'plug' devices cannot be used. In my case I'd like to route the mixed sound to several destinations (hw + loopback-capture) and tried to use the 'copy' plugin for that with negative result. Replacing the slave pcm in the dmix compound from 'copy' or 'plug' to 'hw' or 'dshare' works fine (see commented lines below) but that's not what I want. For mixing in hardware I could use the soundcard but I want the mixed stream to be available as input to other applications and listen to it at the same time.
my /etc/asound.conf for three mixed streams looks like this:
pcm.emu10k1_wave {
type hw
card 0
device 0
channels 2
#channels 2
rate 44100 # fixed, because all dshare devices must use the same samplerate.
#buffer_size 4096 # make these sizes smaller for lower latency
#period_size 2048
#periods 0
#period_time 0
}
pcm.pcm_front {
# will go to front channels of SB-Live
type dshare
#rate 44100 # fixed, because all dshare devices must use the same samplerate.
ipc_key 47110815
#slave.pcm pcm_test_dev0
slave.pcm "emu10k1_wave"
bindings.0 0
bindings.1 1
}
pcm.pcm_rear {
# will go to rear channels of SB-Live
type dshare
#rate 44100 # fixed, because all dshare devices must use the same samplerate.
ipc_key 47110815
slave.pcm "emu10k1_wave"
bindings.0 2
bindings.1 3
#bindings.0 4
#bindings.1 5
}
pcm.out_stream1 {
type copy
# insert output devices here
slave.pcm "pcm_front"
# insert loopback devices here
#slave.pcm "pcm_lpbk1_send"
}
pcm.out_stream2 {
type copy
# insert output devices here
slave.pcm "pcm_rear"
# insert loopback devices here
#slave.pcm "pcm_lpbk2_send"
}
pcm.out_stream3 {
type copy
# insert output devices here
slave.pcm "pcm_front"
# insert loopback devices here
#slave.pcm "pcm_lpbk3_send"
}
pcm.mix_stream1 {
type dmix
ipc_key 8154711
slave {
#pcm "out_stream1"
#pcm "pcm_front"
pcm "emu10k1_wave"
#pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}
pcm.mix_stream2 {
type dmix
ipc_key 8154712
slave {
pcm "out_stream2"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}
pcm.mix_stream3 {
type dmix
ipc_key 8154713
slave {
pcm "out_stream3"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
}
pcm.pcm_main {
type plug
slave.pcm "mix_stream1"
}
pcm.pcm_pre {
type plug
slave.pcm "mix_stream2"
}
pcm.pcm_aux {
type plug
slave.pcm "mix_stream3"
}
Any suggestions for workarounds and clarification on applicable slave plugin types for dmix are highly appreciated. --Klaus 00:58, 24 May 2007 (EST)
Ingomueller.net 02:06, 24 May 2007 (EST): I think, that dmix only supports hw devices as slaves, but I'm not 100% sure... BTW, if you need help with ALSA, the best place to ask is the alsa-user mailing list. Greets, Ingo
Emmef 09:54, 16 September 2009 (EST) Dmix does not support other than hw slaves. I remember to have read somewhere that this was done "for simplicity reasons". When I try to use a non-hw slave, I get
ALSA lib pcm_dmix.c:1013:(snd_pcm_dmix_open) dmix plugin can be only connected to hw plugin
I have been working on an alsa effect plugin, but the API/Documentation/Comments of actual code are not that clear that one can undo this in a simple matter. Alas!