我想使用 ALSA 和 Pulseaudio 从多个输入设备录制音频。更准确地说,我想玩 UltraStar Deluxe。这是一个使用SDL的游戏。据我所知,它仅支持 ALSA。只要我简单地使用虚拟 ALSA“脉冲”设备进行输出和输入,一切都工作正常。不幸的是,这只允许一个输入设备,但我想从三个独立的 (USB) 麦克风进行录音。将三种来源混合为一个并不是一种选择。
https://wiki.archlinux.de/title/Pulseaudio#Mehrere_PulseAudio_ALSA_Ger.C3.A4te建议通过添加来定义额外的 ALSA PCM
pcm.<pcmname> {
type pulse
device <devicename>
}
给我的~/.asoundrc
。不幸的是,我无法弄清楚脉冲音频设备名称的用途。我尝试使用我猜的pulseaudio名称alsa_card.usb-0d8c_C-Media_USB_Audio_Device-00-Device
。arecord -L
显示附加的虚拟 ALSA PCM,但无法从中记录并给出错误消息ALSA lib pcm_pulse.c:752:(pulse_prepare) PulseAudio: Unable to create stream: Entität nicht vorhanden
(最后一个德语位转换为沿 的内容Entity not existant
)。虚拟 ALSA PCM 不会在 UltraStar Deluxe 中显示。
我怎样才能实现这个目标?有可能吗?我用 Pulseaudio 来做其他事情,它工作得很好。如果没有 Pulseaudio,许多程序的工作会很麻烦,而且音频不稳定。
这是输出pacmd list-cards
:
4 card(s) available.
index: 0
... (HDMI Output Device stripped)
index: 1
name: <alsa_card.pci-0000_00_1b.0>
driver: <module-alsa-card.c>
owner module: 6
properties:
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0xf6130000 irq 48"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1b.0"
sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "1e20"
device.product.name = "7 Series/C210 Series Chipset Family High Definition Audio Controller"
device.form_factor = "internal"
device.string = "0"
device.description = "Internes Audio"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
profiles:
input:analog-stereo: Analog Stereo Eingang (priority 60, available: unknown)
output:analog-stereo: Analog Stereo Ausgang (priority 6000, available: unknown)
output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: unknown)
output:analog-surround-40: Analog Surround 4.0 Ausgang (priority 700, available: unknown)
output:analog-surround-40+input:analog-stereo: Analog Surround 4.0 Ausgang + Analog Stereo Eingang (priority 760, available: unknown)
output:analog-surround-41: Analog Surround 4.1 Ausgang (priority 800, available: unknown)
output:analog-surround-41+input:analog-stereo: Analog Surround 4.1 Ausgang + Analog Stereo Eingang (priority 860, available: unknown)
output:analog-surround-50: Analog Surround 5.0 Ausgang (priority 700, available: unknown)
output:analog-surround-50+input:analog-stereo: Analog Surround 5.0 Ausgang + Analog Stereo Eingang (priority 760, available: unknown)
output:analog-surround-51: Analog Surround 5.1 Ausgang (priority 800, available: unknown)
output:analog-surround-51+input:analog-stereo: Analog Surround 5.1 Ausgang + Analog Stereo Eingang (priority 860, available: unknown)
output:iec958-stereo: Digital Stereo (IEC958) Ausgang (priority 5500, available: unknown)
output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958) Ausgang + Analog Stereo Eingang (priority 5560, available: unknown)
off: Aus (priority 0, available: unknown)
active profile: <output:analog-stereo>
sinks:
alsa_output.pci-0000_00_1b.0.analog-stereo/#0: Internes Audio Analog Stereo
sources:
alsa_output.pci-0000_00_1b.0.analog-stereo.monitor/#0: Monitor of Internes Audio Analog Stereo
ports:
analog-input: Analoge Eingabe (priority 10000, latency offset 0 usec, available: unknown)
properties:
analog-input-microphone: Mikrofon (priority 8700, latency offset 0 usec, available: no)
properties:
device.icon_name = "audio-input-microphone"
analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
properties:
analog-output: Analoge Ausgabe (priority 9900, latency offset 0 usec, available: unknown)
properties:
iec958-stereo-output: Digitaler Ausgang (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
properties:
index: 2
name: <alsa_card.usb-0d8c_C-Media_USB_Audio_Device-00-Device>
driver: <module-alsa-card.c>
owner module: 7
properties:
alsa.card = "1"
alsa.card_name = "C-Media USB Audio Device"
alsa.long_card_name = "C-Media USB Audio Device at usb-0000:00:1d.0-1.5, full speed"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-0000:00:1d.0-usb-0:1.5:1.0"
sysfs.path = "/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.0/sound/card1"
udev.id = "usb-0d8c_C-Media_USB_Audio_Device-00-Device"
device.bus = "usb"
device.vendor.id = "0d8c"
device.vendor.name = "C-Media Electronics, Inc."
device.product.id = "0008"
device.product.name = "C-Media USB Audio Device "
device.serial = "0d8c_C-Media_USB_Audio_Device"
device.string = "1"
device.description = "C-Media USB Audio Device "
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-usb"
profiles:
input:analog-mono: Analog Mono Eingang (priority 1, available: unknown)
output:analog-stereo: Analog Stereo Ausgang (priority 6000, available: unknown)
output:analog-stereo+input:analog-mono: Analog Stereo Ausgang + Analog Mono Eingang (priority 6001, available: unknown)
output:iec958-stereo: Digital Stereo (IEC958) Ausgang (priority 5500, available: unknown)
output:iec958-stereo+input:analog-mono: Digital Stereo (IEC958) Ausgang + Analog Mono Eingang (priority 5501, available: unknown)
off: Aus (priority 0, available: unknown)
active profile: <input:analog-mono>
sources:
alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono/#1: C-Media USB Audio Device Analog Mono
ports:
analog-input-microphone: Mikrofon (priority 8700, latency offset 0 usec, available: unknown)
properties:
device.icon_name = "audio-input-microphone"
analog-output: Analoge Ausgabe (priority 9900, latency offset 0 usec, available: unknown)
properties:
iec958-stereo-output: Digitaler Ausgang (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
properties:
index: 3
name: <alsa_card.usb-0d8c_C-Media_USB_Audio_Device-00-Device_1>
driver: <module-alsa-card.c>
owner module: 8
properties:
alsa.card = "2"
alsa.card_name = "C-Media USB Audio Device"
alsa.long_card_name = "C-Media USB Audio Device at usb-0000:00:1d.0-1.6, full speed"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-0000:00:1d.0-usb-0:1.6:1.0"
sysfs.path = "/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.6/2-1.6:1.0/sound/card2"
udev.id = "usb-0d8c_C-Media_USB_Audio_Device-00-Device_1"
device.bus = "usb"
device.vendor.id = "0d8c"
device.vendor.name = "C-Media Electronics, Inc."
device.product.id = "0008"
device.product.name = "C-Media USB Audio Device "
device.serial = "0d8c_C-Media_USB_Audio_Device"
device.string = "2"
device.description = "C-Media USB Audio Device "
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-usb"
profiles:
input:analog-mono: Analog Mono Eingang (priority 1, available: unknown)
output:analog-stereo: Analog Stereo Ausgang (priority 6000, available: unknown)
output:analog-stereo+input:analog-mono: Analog Stereo Ausgang + Analog Mono Eingang (priority 6001, available: unknown)
output:iec958-stereo: Digital Stereo (IEC958) Ausgang (priority 5500, available: unknown)
output:iec958-stereo+input:analog-mono: Digital Stereo (IEC958) Ausgang + Analog Mono Eingang (priority 5501, available: unknown)
off: Aus (priority 0, available: unknown)
active profile: <input:analog-mono>
sources:
alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device_1.analog-mono/#2: C-Media USB Audio Device Analog Mono
ports:
analog-input-microphone: Mikrofon (priority 8700, latency offset 0 usec, available: unknown)
properties:
device.icon_name = "audio-input-microphone"
analog-output: Analoge Ausgabe (priority 9900, latency offset 0 usec, available: unknown)
properties:
iec958-stereo-output: Digitaler Ausgang (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
properties:
问候
赫尔曼
答案1
我自己想出来了。我错误地认为“设备”选项需要设备名称。相反,需要一个源(或接收器,取决于您想要实现的目标)名称。例如,这使我可以通过 ALSA 访问由pulseaudio处理的单个麦克风:
pcm.pulse_mic1 {
type pulse
device alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono
}
ctl.pulse_mic1 {
type pulse
device alsa_input.usb-0d8c_C-Media_USB_Audio_Device-00-Device.analog-mono
}