defaults.pcm.rate_converter "linear" # spk represents the physical sink (playback) pcm.spk { type plug slave.pcm "hw:wm8524audio,0" } # mic represents the physical source (capture) pcm.mic { type plug slave.pcm "hw:micfilaudio,0" } # Following two definitions define the Virtual Sink (playback) stream # pwloop stands for playback write loopback pcm.pwloop { type hw card Loopback device 1 subdevice 0 } # prloop stands for playback read loopback pcm.prloop { type hw card Loopback device 0 subdevice 0 } # Following two definitions define the Virtual Source (capture) stream # cwloop stands for capture write loopback pcm.cwloop { type hw card Loopback device 1 subdevice 1 } # crloop stands for capture read loopback pcm.crloop { type hw card Loopback device 0 subdevice 1 } # As multiple sources may play audio at the same time, we use the mix # plugin. Otherwise only a single playback source would be allowed. pcm.mix { type dmix ipc_key 1001 slave { pcm "pwloop" format S32_LE rate 48000 channels 2 buffer_size 512 period_size 128 } } pcm.split { type dsnoop ipc_key 1002 slave { pcm "crloop" format S32_LE rate 16000 channels 1 buffer_size 512 period_size 128 } } # Applications like Alexa read/write from/to default stream. # Unfortunately we can't have default capture stream and # default playback stream. ALSA offers the asym plugin, which # allows to define a default capture/playback stream as one device. # The plug plugin is introduced for automatic sample rate and format # conversion. pcm.!default { type asym playback.pcm "plug:mix" capture.pcm "plug:split" }