我正在编写一些与声音相关的Python程序,所以我使用了SoundDevice python模块,该模块使用了PortAudio库。我使用的是 arch linux 和 deepin 桌面。
如果我刚刚打开计算机并打印可用设备,我会得到:
0 HDA Intel PCH: ALC887-VD Analog (hw:0,0), ALSA (2 in, 2 out)
1 HDA Intel PCH: ALC887-VD Digital (hw:0,1), ALSA (0 in, 2 out)
2 HDA Intel PCH: ALC887-VD Alt Analog (hw:0,2), ALSA (2 in, 0 out)
3 HDA ATI HDMI: 0 (hw:1,3), ALSA (0 in, 8 out)
4 sysdefault, ALSA (128 in, 128 out)
5 front, ALSA (0 in, 2 out)
6 surround40, ALSA (0 in, 2 out)
7 surround51, ALSA (0 in, 2 out)
8 surround71, ALSA (0 in, 2 out)
9 iec958, ALSA (0 in, 2 out)
10 spdif, ALSA (0 in, 2 out)
11 pulse, ALSA (32 in, 32 out)
12 dmixed, ALSA (0 in, 2 out)
13 dsnooped, ALSA (2 in, 0 out)
14 duplex, ALSA (2 in, 2 out)
15 dmix, ALSA (0 in, 2 out)
* 16 default, ALSA (128 in, 128 out)
它说我正在使用 ALSA(128 输入,128 输出)。现在我将打开一个应用程序(比如说 Chromium)并播放一些音乐,然后继续浏览互联网。如果我现在打印可用的设备,我会得到:
0 HDA Intel PCH: ALC887-VD Analog (hw:0,0), ALSA (2 in, 0 out)
< 1 HDA Intel PCH: ALC887-VD Digital (hw:0,1), ALSA (0 in, 2 out)
2 HDA Intel PCH: ALC887-VD Alt Analog (hw:0,2), ALSA (2 in, 0 out)
3 HDA ATI HDMI: 0 (hw:1,3), ALSA (0 in, 8 out)
4 sysdefault, ALSA (128 in, 0 out)
5 iec958, ALSA (0 in, 2 out)
6 spdif, ALSA (0 in, 2 out)
7 pulse, ALSA (32 in, 32 out)
8 dsnooped, ALSA (2 in, 0 out)
9 duplex, ALSA (2 in, 0 out)
> 10 default, ALSA (128 in, 0 out)
它告诉我我正在使用 Intel 作为输出,使用 ALSA (128 in, 0) 作为输入。为什么没有像以前那样有ALSA输入和输出?
这种情况发生在所有使用声音的应用程序中,包括 Audacity。
我目前正在使用 pluse 作为替代方案,但据说 ALSA 更好,所以即使同时打开多个应用程序我也想使用它。
编辑
这是编辑配置后的列表:
> 0 HDA Intel PCH: ALC887-VD Analog (hw:0,0), ALSA (2 in, 2 out)
1 HDA Intel PCH: ALC887-VD Digital (hw:0,1), ALSA (0 in, 2 out)
2 HDA Intel PCH: ALC887-VD Alt Analog (hw:0,2), ALSA (2 in, 0 out)
3 HDA ATI HDMI: 0 (hw:1,3), ALSA (0 in, 8 out)
4 sysdefault, ALSA (128 in, 128 out)
5 front, ALSA (0 in, 2 out)
6 surround40, ALSA (0 in, 2 out)
7 surround51, ALSA (0 in, 2 out)
8 surround71, ALSA (0 in, 2 out)
9 iec958, ALSA (0 in, 2 out)
10 spdif, ALSA (0 in, 2 out)
11 pulse, ALSA (32 in, 32 out)
12 dmix, ALSA (0 in, 2 out)
< 13 default, ALSA (0 in, 128 out)