我有一个带有内置麦克风的 USB 网络摄像头。摄像头正在工作并且麦克风被检测到。但它没有提供任何输入。
输出pacmd list-sources
3 source(s) available.
* index: 0
name: <alsa_input.usb-Jieli_Technology_USB_PHY_2.0-02.mono-fallback>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 9040
volume: mono: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 35466 / 54% / -16.00 dB
volume steps: 65537
muted: no
current latency: 0.00 ms
max rewind: 0 KiB
sample spec: s16le 1ch 44100Hz
channel map: mono
Mono
used by: 0
linked by: 0
configured latency: 0.00 ms; range is 0.50 .. 2000.00 ms
card: 0 <alsa_card.usb-Jieli_Technology_USB_PHY_2.0-02>
module: 7
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "USB Audio"
alsa.id = "USB Audio"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "2"
alsa.card_name = "USB PHY 2.0"
alsa.long_card_name = "Jieli Technology USB PHY 2.0 at usb-0000:02:00.0-6, high speed"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-0000:02:00.0-usb-0:6:1.2"
sysfs.path = "/devices/pci0000:00/0000:00:01.3/0000:02:00.0/usb1/1-6/1-6:1.2/sound/card2"
udev.id = "usb-Jieli_Technology_USB_PHY_2.0-02"
device.bus = "usb"
device.vendor.id = "1224"
device.vendor.name = "Jieli Technology"
device.product.id = "2a25"
device.product.name = "USB PHY 2.0"
device.serial = "Jieli_Technology_USB_PHY_2.0"
device.form_factor = "webcam"
device.string = "hw:2"
device.buffering.buffer_size = "176400"
device.buffering.fragment_size = "88200"
device.access_mode = "mmap+timer"
device.profile.name = "mono-fallback"
device.profile.description = "Mono"
device.description = "USB PHY 2.0 Mono"
module-udev-detect.discovered = "1"
device.icon_name = "camera-web-usb"
ports:
analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: unknown)
properties:
device.icon_name = "audio-input-microphone"
active port: <analog-input-mic>
index: 1
name: <alsa_output.pci-0000_07_00.1.hdmi-stereo-extra1.monitor>
driver: <module-alsa-card.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 1030
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 0.00 ms
max rewind: 0 KiB
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
configured latency: 0.00 ms; range is 0.50 .. 1999.82 ms
monitor_of: 0
card: 1 <alsa_card.pci-0000_07_00.1>
module: 8
properties:
device.description = "Monitor of GK208 HDMI/DP Audio Controller Digital Stereo (HDMI 2)"
device.class = "monitor"
alsa.card = "0"
alsa.card_name = "HDA NVidia"
alsa.long_card_name = "HDA NVidia at 0xf7080000 irq 77"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:07:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:03.1/0000:07:00.1/sound/card0"
device.bus = "pci"
device.vendor.id = "10de"
device.vendor.name = "NVIDIA Corporation"
device.product.id = "0e0f"
device.product.name = "GK208 HDMI/DP Audio Controller"
device.string = "0"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
index: 2
name: <alsa_output.pci-0000_09_00.4.iec958-stereo.monitor>
driver: <module-alsa-card.c>
flags: DECIBEL_VOLUME LATENCY
state: SUSPENDED
suspend cause: IDLE
priority: 1030
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 0.00 ms
max rewind: 0 KiB
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
fixed latency: 100.14 ms
monitor_of: 1
card: 2 <alsa_card.pci-0000_09_00.4>
module: 9
properties:
device.description = "Monitor of Starship/Matisse HD Audio Controller Digital Stereo (IEC958)"
device.class = "monitor"
alsa.card = "1"
alsa.card_name = "HD-Audio Generic"
alsa.long_card_name = "HD-Audio Generic at 0xf7400000 irq 79"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:09:00.4"
sysfs.path = "/devices/pci0000:00/0000:00:08.1/0000:09:00.4/sound/card1"
device.bus = "pci"
device.vendor.id = "1022"
device.vendor.name = "Advanced Micro Devices, Inc. [AMD]"
device.product.id = "1487"
device.product.name = "Starship/Matisse HD Audio Controller"
device.string = "1"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
答案1
根据 的输出pacmd list-sources
,所有麦克风都因闲置而被暂停(这是有道理的)。我发现一些 USB 连接的设备一旦将麦克风设置为,SUSPENDED
它们就永远不会恢复。这个问题通常有两种解决方案:
- 拔下网络摄像头,数到五,然后重新插入。⇢
这将循环 USB 设备和一般来说使所有设备重新上线。 - 更新 PulseAudio 至不是暂停空闲的音频设备。⇢
对于工作中的许多计算机来说,这通常很有效,因为如果没有一把锋利的剪刀,USB 摄像头就无法与计算机物理断开连接。
修改 PulseAudio
为了防止音频设备在空闲时被挂起,您需要注释掉文件中的一行default.pa
。请遵循以下步骤:
打开终端(如果尚未打开)
打开
default.pa
文件进行编辑root
:$ sudo vi /etc/pulse/default.pa
笔记:可以随意使用 以外的其他编辑
vi
器。这更多的是一种习惯的力量,而不是对使用哪种编辑器的隐含建议。找到以下行
load-module module-suspend-on-idle
并将其注释掉。这大约是 90% 的位置。完成后,该行应如下所示:### Automatically suspend sinks/sources that become idle for too long # load-module module-suspend-on-idle
重新启动 PulseAudio:
$ pulseaudio -k
确认您的音频设备可以正常运行:
pacmd list-sources
检查 USB 麦克风,它可能位于索引处,
0
就像您提供的输出中那样,并确认 的值state
。它应该显示IDLE
。当应用程序正在主动使用它时,它将更改为,然后在不再使用后约 30 秒RUNNING
返回到。IDLE
音频混乱
您可能会看到的另一个问题是,应用程序可能不知道要自动使用哪个麦克风,因此输入选择将始终为空。要解决此问题,请打开 PulseAudio 音量控制 (pavucontrol) 应用程序并单击“配置”选项卡。将输出设置为“模拟立体声输出”:
为什么要设置输出解决了输入,我只能猜测。话虽如此,当计算机始终显示没有音频输入设备时,此解决方案确实有效。
答案2
在 Guvcview->AudioControls 中默认设置为输入设备-->脉冲。我刚刚将其更改为 hda intel(我的声卡)并且工作正常!