ALSA 无法将 dmix 与路由一起使用
ALSA unable to use dmix with route
我有一个 alsa 配置文件,用于将立体声扬声器映射到我的 5.0 扬声器设置。
文件如下所示:
pcm.all8 {
type plug
slave {
pcm "hw:0,0"
channels 8
}
hint.description "8 channel analog"
}
pcm.music4 {
type route
slave {
pcm all8
channels 8
}
ttable {
0.0 1
1.1 1
0.2 1 # Copy Front Left to Rear Left
1.3 1 # Copy Front Right to Rear Right
0.4 0.8 # Copy Front Left to Front Centre
1.4 0.8 # Copy Front Right to Front Centre
}
hint.description "2 channels duplicated on front and rear"
}
我目前使用“music4”设备从一个程序播放音乐,但我现在还需要第二个程序才能访问该设备。我需要使用 dmix,因为目前设备已锁定。
我尝试将其添加到配置中(我无耻地从 https://www.alsa-project.org/main/index.php/Asoundrc#dmix 复制):
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm music4
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
hint.description "Dmixed - 4 speakers"
}
当我尝试使用此设备时,我收到一条错误消息,提示“dmix 插件只能连接到 hw 插件”,但如何在保留映射的同时做到这一点?
设法解决了这个问题。解决方案如下所示:
pcm.dmixer {
type dmix
ipc_key 1024
ipc_key_add_uid true
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
channels 8
}
bindings {
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
}
hint.description "Raw dmixer - 8 channels"
}
pcm.dmix4 {
type plug
slave.pcm dmixer
slave.channels 8
ttable {
0.0 1
1.1 1
0.2 1 # Copy Front Left to Rear Left
1.3 1 # Copy Front Right to Rear Right
0.4 0.8 # Copy Front Left to Front Centre
1.4 0.8 # Copy Front Right to Front Centre
}
hint.description "Dmixed - 2 channels to 5.0"
}
我有一个 alsa 配置文件,用于将立体声扬声器映射到我的 5.0 扬声器设置。
文件如下所示:
pcm.all8 {
type plug
slave {
pcm "hw:0,0"
channels 8
}
hint.description "8 channel analog"
}
pcm.music4 {
type route
slave {
pcm all8
channels 8
}
ttable {
0.0 1
1.1 1
0.2 1 # Copy Front Left to Rear Left
1.3 1 # Copy Front Right to Rear Right
0.4 0.8 # Copy Front Left to Front Centre
1.4 0.8 # Copy Front Right to Front Centre
}
hint.description "2 channels duplicated on front and rear"
}
我目前使用“music4”设备从一个程序播放音乐,但我现在还需要第二个程序才能访问该设备。我需要使用 dmix,因为目前设备已锁定。
我尝试将其添加到配置中(我无耻地从 https://www.alsa-project.org/main/index.php/Asoundrc#dmix 复制):
pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm music4
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
hint.description "Dmixed - 4 speakers"
}
当我尝试使用此设备时,我收到一条错误消息,提示“dmix 插件只能连接到 hw 插件”,但如何在保留映射的同时做到这一点?
设法解决了这个问题。解决方案如下所示:
pcm.dmixer {
type dmix
ipc_key 1024
ipc_key_add_uid true
slave {
pcm "hw:0,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
channels 8
}
bindings {
0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
}
hint.description "Raw dmixer - 8 channels"
}
pcm.dmix4 {
type plug
slave.pcm dmixer
slave.channels 8
ttable {
0.0 1
1.1 1
0.2 1 # Copy Front Left to Rear Left
1.3 1 # Copy Front Right to Rear Right
0.4 0.8 # Copy Front Left to Front Centre
1.4 0.8 # Copy Front Right to Front Centre
}
hint.description "Dmixed - 2 channels to 5.0"
}