我最近为我的音频捕获卡编写了一个 ALSA 驱动程序,但在 PulseAudio 将其识别为捕获源时遇到了问题。
以下是一些事实,希望你们中有人过去经历过这种情况并能够提供帮助:
采集卡有 2 个音频输入(立体声):一个 HDMI 和一个模拟。直接使用 ALSA 时,我可以从这两个输入中捕获声音。
当我使用 pulseaudio 命令列出音频捕获源时:
$ pactl list | grep -A2 'Source #' | grep 'Name: ' | cut -d" " -f2
输出显示以下内容,它们是板载设备,不使用我的 ALSA 驱动程序:
alsa_output.pci-0000_00_1b.0.analog-stereo.monitor alsa_input.pci-0000_00_1b.0.analog-stereo
因此从上面可以看出我的设备没有被列为捕获源。
当我使用时:
$ pactl list
输出中显示了“我的” ALSA 卡。请参见以下 2 个示例输出:(a) 针对板载卡(不使用我的驱动程序)和 (b) 针对使用我的驱动程序的卡:
(a)机载卡:
Card #0 Name: alsa_card.pci-0000_00_1b.0 Driver: module-alsa-card.c Owner Module: 4 Properties: alsa.card = "10" alsa.card_name = "HDA Intel PCH" alsa.long_card_name = "HDA Intel PCH at 0xfbf20000 irq 67" alsa.driver_name = "snd_hda_intel" device.bus_path = "pci-0000:00:1b.0" sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card10" device.bus = "pci" device.vendor.id = "8086" device.vendor.name = "Intel Corporation" device.product.name = "6 Series/C200 Series Chipset Family High Definition Audio Controller" device.form_factor = "internal" device.string = "10" device.description = "Built-in Audio" module-udev-detect.discovered = "1" device.icon_name = "audio-card-pci" Profiles: output:analog-stereo: Analogue Stereo Output (sinks: 1, sources: 0, priority. 6000) output:analog-stereo+input:analog-stereo: Analogue Stereo Duplex (sinks: 1, sources: 1, priority. 6060) output:analog-surround-40: Analogue Surround 4.0 Output (sinks: 1, sources: 0, priority. 700) output:analog-surround-40+input:analog-stereo: Analogue Surround 4.0 Output + Analogue Stereo Input (sinks: 1, sources: 1, priority. 760) output:analog-surround-41: Analogue Surround 4.1 Output (sinks: 1, sources: 0, priority. 800) output:analog-surround-41+input:analog-stereo: Analogue Surround 4.1 Output + Analogue Stereo Input (sinks: 1, sources: 1, priority. 860) output:analog-surround-50: Analogue Surround 5.0 Output (sinks: 1, sources: 0, priority. 700) output:analog-surround-50+input:analog-stereo: Analogue Surround 5.0 Output + Analogue Stereo Input (sinks: 1, sources: 1, priority. 760) output:analog-surround-51: Analogue Surround 5.1 Output (sinks: 1, sources: 0, priority. 800) output:analog-surround-51+input:analog-stereo: Analogue Surround 5.1 Output + Analogue Stereo Input (sinks: 1, sources: 1, priority. 860) input:analog-stereo: Analogue Stereo Input (sinks: 0, sources: 1, priority. 60) off: Off (sinks: 0, sources: 0, priority. 0) Active Profile: output:analog-stereo+input:analog-stereo Ports: analog-output: Analogue Output (priority 9900) Part of profile(s): output:analog-stereo, output:analog-stereo+input:analog-stereo, output:analog-surround-40, output:analog-surround-40+input:analog-stereo, output:analog-surround-41, output:analog-surround-41+input:analog-stereo, output:analog-surround-50, output:analog-surround-50+input:analog-stereo, output:analog-surround-51, output:analog-surround-51+input:analog-stereo analog-input-microphone: Microphone (priority 8700) Part of profile(s): output:analog-stereo+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:analog-surround-41+input:analog-stereo, output:analog-surround-50+input:analog-stereo, output:analog-surround-51+input:analog-stereo, input:analog-stereo analog-input-linein: Line In (priority 8100) Part of profile(s): output:analog-stereo+input:analog-stereo, output:analog-surround-40+input:analog-stereo, output:analog-surround-41+input:analog-stereo, output:analog-surround-50+input:analog-stereo, output:analog-surround-51+input:analog-stereo, input:analog-stereo
(b)我的一张卡(我有多张卡):
Card #11 Name: alsa_card.1 Driver: module-alsa-card.c Owner Module: 31 Properties: alsa.card = "1" alsa.card_name = "OEM_VISIONRGB_AV" alsa.long_card_name = "OEM_VISIONRGB_AV Analog DGC dada" device.bus_path = "/devices/virtual/sound/card1" sysfs.path = "/devices/virtual/sound/card1" device.string = "1" device.description = "OEM_VISIONRGB_AV" module-udev-detect.discovered = "1" device.icon_name = "audio-card" Profiles: input:analog-stereo: Analogue Stereo Input (sinks: 0, sources: 1, priority. 60) off: Off (sinks: 0, sources: 0, priority. 0) Active Profile: input:analog-stereo Ports: analog-input: Analogue Input (priority 10000) Part of profile(s): input:analog-stereo
请注意,我的卡和板载卡上的“姓名”字段在格式上有很大不同。我测试了:
从
alsa_card.pci-0000_00_1b.0
(板载卡)捕获数据可以正常进行。alsa_card.1
它无法从(我的卡)捕获。
请注意,我的 ALSA 驱动程序仍然缺少一些元素,例如,未包含混频器元素,我推测这可能是 ALSA 和 PULSEAUDIO 之间缺乏合作的原因。根据您的经验,您是否知道混频器元素对于 PULSEAUDIO 是否是将 ALSA 设备限定为捕获源所必需的。
我很抱歉发了这么冗长的信息。不过,上面的内容有没有给你一些启发?