I have two devices playback_bt (Connects to BT chip) and aduplex_rtp (which delivers audio to a device/speaker over rtp). I can use aplay to play sound to them individually. I want to be able to write sound to the Loudspeaker device and it come out of both devices simultaneously. Below is my asound.conf. This must me done with just ALSA and preferably without using the multi plugin. This is on an embedded linux.
Here's a diagram. I want to figure out what I need to do to make the red lines work. [1]: https://i.sstatic.net/bmD9YhnU.png
My asound.conf
defaults.pcm.rate_converter "samplerate"
defaults.pcm.dmix.rate 8000
pcm.capture {
type dsnoop
ipc_key 1765
ipc_perm 0666
slave.pcm "hw:Loopback,0"
slave.channels 1
slave.period_time 20000
slave.periods 2
slave.rate 8000
}
pcm.playback {
type dmix
ipc_key 1766
ipc_perm 0666
slave.pcm "hw:Loopback,0"
slave.channels 1
slave.period_time 20000
slave.periods 2
slave.rate 8000
}
pcm.aduplex {
type asym
playback.pcm "dmix"
capture.pcm "dsnoop"
}
pcm.capture_rtp {
type dsnoop
ipc_key 1131
ipc_perm 0666
slave.pcm "hw:Loopback,1"
slave.channels 1
slave.period_time 20000
slave.periods 2
slave.rate 8000
}
pcm.playback_rtp {
type dmix
ipc_key 1132
ipc_perm 0666
slave.pcm "hw:Loopback,1"
slave.channels 1
slave.period_time 20000
slave.periods 2
slave.rate 8000
}
pcm.aduplex {
type asym
capture.pcm "capture"
playback.pcm "playback"
}
pcm.LoudspeakerPCM {
type plug
slave.pcm playback
hint {
show on
description "Loudspeaker PCM"
}
}
pcm.NotificationPCM {
type plug
slave.pcm playback
hint {
show on
description "Notification PCM"
}
}
pcm.Loudspeaker {
type softvol
slave.pcm LoudspeakerPCM
control {
name 'Loudspeaker Master Softvol Control'
card 0
}
}
pcm.Notification {
type softvol
slave.pcm NotificationPCM
control {
name 'Notification Master Softvol Control'
card 0
}
}
pcm.aduplex_rtp {
type asym
capture.pcm "capture_rtp"
playback.pcm "playback_rtp"
hint {
description "Duplex RTP"
}
}
pcm.aduplex_rtp_plug {
type plug
slave.pcm aduplex_rtp
hint {
description "RTP Capture/Playback with Volume Control"
}
}
pcm.capture_rtp_vol {
type softvol
slave.pcm capture_rtp
control {
name 'RTP Capture Softvol Control'
card 0
}
}
pcm.Microphone {
type plug
slave.pcm "dsnoop"
hint {
show on
description "Microphone PCM"
}
}
pcm.MicrophoneSoftVol {
type softvol
slave.pcm Microphone
control {
name 'Microphone Master Softvol Control'
card 0
}
}
pcm.!default {
type plug
slave.pcm "aduplex"
hint {
description "Combined capture/inject"
}
}
pcm.bt-sco {
type hw
card BluetoothPCM
device 0
channels 1
format S16_LE
}
ctl.bt-sco {
type hw
card BluetoothPCM
device 0
}
pcm.playback_bt {
type plug
slave.pcm "bt-sco"
route_policy default
hint {
description "Bluetooth Playback"
}
}
pcm.mic_bt {
type plug
slave.pcm capture_bt
hint {
description "Bluetooth Microphone"
}
}
pcm.bt_mic_vol {
type softvol
slave.pcm mic_bt
control {
name 'Bluetooth Microphone Master Softvol Control'
card BluetoothPCM
}
}
pcm.playback_bt_vol {
type softvol
slave.pcm pcm.playback_bt
control {
name 'Bluetooth Playback Master Softvol Control'
card BluetoothPCM
}
}
pcm.capture_bt {
type dsnoop
ipc_key 103
ipc_perm 0666
slave {
pcm bt-sco
}
} ```