Just contact Alsa, I learned no one's words really very laborious. A lot of information on the internet did not have this explanation, finally see the official plug-in configuration document according to the personal understanding of the written experience:
(1) First look at the route plugin description:
This plugin can convert channels and change the volume. The configuration instructions are as follows:
Pcm.name {Type route # route & Volume Conversion PCM slave STR # slave name# orslave {# slave definition pcm STR # slave PCM name# orPCM {} # Slave PCM definition [format STR] # Slave format [channels INT] # Slav E channels} ttable {# Transfer table (bi-dimensional compound of cchannels * schannels numb ERs) Cchannel {SCHANNEL REAL # route value (0.0-1.0)}}}
(2) Take a look at the configuration example of 2-channel stereo conversion to mono:
pcm.makemono { type route slave.pcm "hw:0" ttable { 0.0 1 # in-channel 0, out-channel 0, 100% volume 1.0 1 # in-channel 1, out-channel 0, 100% volume }}
Pcm.downmix {
type route SLAVE.PCM" hw:0.0 "ttable {0.0 1 # in-channel 0, Out-channel 0, 100% Volume 1.1 1 # in-channel 1, Out-channel 1, 100% volume
2.0 1
3.1 1
4.0 0.5
4.1 0.5
5.0 0.5
5.1 0.5 #意思是输入第5通道的数据传输给输出通道1,并且音量降低一半 }}
The following diagram can be used to map the above configuration:
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Configuration (. ASOUNDRC profile) that uses the ALSA plug-in to play 5.1-channel audio over a 2-channel stereo card