麦克风在 archlinux 上不工作

麦克风在 archlinux 上不工作

语境

我多年来一直archlinux在笔记本电脑上运行,从来不需要麦克风。现在我需要它,但找不到正确配置它的方法。

我用alsapulseadio

alsamixer作为用户运行我有两个仪表:

  ||      ||
Master  Capture

我将它们都取消静音并启用为合理的(~50%)值。

以 root 身份运行alsamixer我有几个仪表:

  ||        ||        ||      ||      ||       ||
Master  Headphones  Speaker  PCM  Microphone MIC Boot 

 ||      ||       ||        ||       ||
Beep  Loopback Internal  Internal  Capture

如果我启用Loopbackroot我可以通过扬声器听到麦克风的声音

alsamixer如果我以用户身份明确选择我的声卡,我会得到与以 root 身份运行相同的命令(如果我Loopback在此处启用,我也会从扬声器中听到麦克风的声音)。我得到以下信息:

在此输入图像描述

(右侧还有两个Internal仪表,Loopback(启用/禁用)和可变的Off-hook

然而,无论我做什么以及如何干预 alsa 仪表,我都无法将麦克风传递给用户应用程序。本质上,每次运行时arecord我都会得到以下输出:

$ arecord -vv -f dat /dev/null 
Recording WAVE '/dev/null' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
ALSA <-> PulseAudio PCM I/O Plugin
Its setup is:
  stream       : CAPTURE
  access       : RW_INTERLEAVED
  format       : S16_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 16
  buffer_size  : 24000
  period_size  : 6000
  period_time  : 125000
  tstamp_mode  : NONE
  tstamp_type  : GETTIMEOFDAY
  period_step  : 1
  avail_min    : 6000
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 24000
  silence_threshold: 0
  silence_size : 0
  boundary     : 6755399441055744000
#+                                                 | 00%

aplay另一方面,效果很好。


我的声卡是(lspci):

# lspci| grep -i audio
00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 Azalia (Intel HDA)

我看了看拱门维基并尝试设置以下内容/etc/modprobe.d/modprobe.conf(并重新启动机器):

options snd-hda-intel model=dell-m6-dmic

(无论是否有该配置,我都无法让麦克风将数据发送到用户应用程序。)

我当前的hda模块是:

# lsmod |grep hda
snd_hda_codec_si3054    16384  1
snd_hda_codec_realtek    69632  1
snd_hda_codec_generic    69632  1 snd_hda_codec_realtek
snd_hda_intel          32768  5
snd_hda_codec         106496  4 snd_hda_codec_realtek,snd_hda_codec_si3054,snd_hda_codec_generic,snd_hda_intel
snd_hda_core           61440  5 snd_hda_codec_realtek,snd_hda_codec_si3054,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel
snd_hwdep              16384  1 snd_hda_codec
snd_pcm                86016  4 snd_hda_codec_si3054,snd_hda_codec,snd_hda_intel,snd_hda_core
snd                    65536  18 snd_hda_codec_realtek,snd_hda_codec_si3054,snd_hwdep,snd_timer,snd_pcm,snd_hda_codec_generic,snd_hda_codec,snd_hda_intel

为了完整起见,这是我的pulseaudio配置(我没有尝试过干预它):

$ pulseaudio --dump-conf
### Read from configuration file: /etc/pulse/daemon.conf ###
daemonize = no
fail = yes
high-priority = yes
nice-level = -11
realtime-scheduling = yes
realtime-priority = 5
allow-module-loading = yes
allow-exit = yes
use-pid-file = yes
system-instance = no
local-server-type = user
cpu-limit = no
enable-shm = yes
flat-volumes = no
lock-memory = no
exit-idle-time = 20
scache-idle-time = 20
dl-search-path = /usr/lib/pulse-9.0/modules
default-script-file = /etc/pulse/default.pa
load-default-script-file = yes
log-target = 
log-level = notice
resample-method = auto
enable-remixing = yes
enable-lfe-remixing = no
lfe-crossover-freq = 0
default-sample-format = s16le
default-sample-rate = 44100
alternate-sample-rate = 48000
default-sample-channels = 2
default-channel-map = front-left,front-right
default-fragments = 4
default-fragment-size-msec = 25
enable-deferred-volume = yes
deferred-volume-safety-margin-usec = 8000
deferred-volume-extra-delay-usec = 0
shm-size-bytes = 0
log-meta = no
log-time = no
log-backtrace = 0
rlimit-fsize = -1
rlimit-data = -1
rlimit-stack = -1
rlimit-core = -1
rlimit-rss = -1
rlimit-as = -1
rlimit-nproc = -1
rlimit-nofile = 256
rlimit-memlock = -1
rlimit-locks = -1
rlimit-sigpending = -1
rlimit-msgqueue = -1
rlimit-nice = 31
rlimit-rtprio = 9
rlimit-rttime = 200000

根据 Faheem Mitha 的评论,我相信拥有pulseaudio tmpfs正确的权限:

# ls -la /run/user/861213/pulse/
total 4
drwx------ 2 grochmal users  80 Jul  4 21:44 .
drwx------ 5 grochmal users 120 Jul  4 21:46 ..
srw-rw-rw- 1 grochmal users   0 Jul  4 21:44 native
-rw------- 1 grochmal users   4 Jul  4 21:44 pid

并且pavucontrol被静音了。我不知道是pavucontrol什么导致了这个问题:

在此输入图像描述


问题

我没主意了。我相信音频Loopback接口存在于内核空间,因此我的问题是我无法将麦克风数据带入用户空间。然而,我并不能百分百确定。

我可以为(或其他模块)提供哪些其他选项snd-hda-intel,这些选项可能与在环回接口上工作但不会传播到应用程序层的麦克风相关?

我可能做错了什么吗pulseaudio?但话又说回来,一直pulseaudio工作正常(与 一起),而且我经常使用。alsaaudacity

答案1

根据与发帖者的通信(见评论),原来声卡内部被静音了pavucontrol

答案2

我还遇到了我的麦克风在 Arch Linux 上无法工作的问题。就我而言,“输入设备”下没有显示任何设备pavucontrol (它说“没有可用的输入设备”)。遵循 Arch Wiki 的以下建议为我解决了这个问题:

  1. 运行arecord -l以符号形式找出麦克风的 id ,例如,如果输出是hw:CARD,DEVICE

    **** List of CAPTURE Hardware Devices ****
    card 0: PCH [HDA Intel PCH], device 0: ALC269VC Analog[ALC269VC Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    

    那么 id 是hw:0,0

  2. 添加行

    load-module module-alsa-source device=hw:0,0
    

    (指定您的设备 ID)在/etc/pulse/default.pa之前的某处

    .ifexists module-udev-detect.so
    

    线。

  3. 运行pulseaudio -k; pulseaudio -D 以重新启动 PulseAudio 并激活更改。

PulseAudio/故障排除 – PulseAudio 未检测到麦克风 在 ArchWiki 中。

答案3

这个链接帮我解决了:PulseAudio 未检测到麦克风

确定麦克风的卡号和设备号:

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC269VC Analog [ALC269VC Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
In hw:CARD,DEVICE notation, you would specify the above device as hw:0,0.

然后,编辑 /etc/pulse/default.pa 并插入指定您的设备的加载模块行,如下所示:

load-module module-alsa-source device=hw:0,0
# the line above should be somewhere before the line below
.ifexists module-udev-detect.so

最后,重新启动pulseaudio以应用新设置:

$ pulseaudio -k ; pulseaudio -D

如果一切正常,您现在应该会在运行 pavucontrol 时看到麦克风出现(在“输入设备”选项卡下)。

答案4

我遇到了类似的问题,发现我的 USB 麦克风仅显示在 pavucontrol 的“配置”选项卡中。为了让它显示在“输入设备”选项卡下,我必须将其配置更改为“多通道输入”。

此时,为了在 Kdenlive 中使用它进行录音,我需要将内置麦克风更改为静音(在 pavucontrol 中),然后单击 USB 麦克风上的“设置为后备”按钮。

附注,这样做允许 Kdenlive 使用默认 ( default:) 音频麦克风。

相关内容