Pulseaudio 防检测耳机

Pulseaudio 防检测耳机

当我插入耳机时,我会看到以下输出设备pavucontrol

Speakers
Analog Output
Headphones (unplugged)

选择扬声器将输出发送到扬声器+耳机。

选择模拟输出或耳机(未插入)仅将输出发送到耳机。

如果我拔掉耳机,我会得到:

Speakers (unavailable)
Analog Output
Headphones (plugged in)

无论我选择什么,我都听不到任何音频。

PulseAudio 似乎对我的耳机感到困惑:拔掉耳机并不会导致我的扬声器消失。

我如何告诉 PulseAudio:

  • 我的扬声器将留在这里。他们永远不会缺席。
  • 当您认为我的耳机未插入时,我的耳机已插入,反之亦然。

pulseaudio -vvvv拔下耳机时的输出:

D: [pulseaudio] module-alsa-card.c: Jack 'Front Mic Jack' is now unplugged
D: [pulseaudio] device-port.c: Setting port analog-input-microphone-front to status no
D: [pulseaudio] device-port.c: Setting port analog-input-microphone-internal to status unknown
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
D: [pulseaudio] module-alsa-card.c: Jack 'Front Headphone Jack' is now plugged in
D: [pulseaudio] device-port.c: Setting port analog-output-speaker to status no
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
D: [pulseaudio] device-port.c: Setting port analog-output-headphones to status yes
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.

插入耳机时:

D: [pulseaudio] module-alsa-card.c: Jack 'Front Mic Jack' is now plugged in
D: [pulseaudio] device-port.c: Setting port analog-input-microphone-front to status yes
D: [pulseaudio] device-port.c: Setting port analog-input-microphone-internal to status no
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
D: [pulseaudio] module-alsa-card.c: Jack 'Front Headphone Jack' is now unplugged
D: [pulseaudio] device-port.c: Setting port analog-output-speaker to status unknown
D: [pulseaudio] device-port.c: Setting port analog-output-headphones to status no
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.

上述内容使我相信“​​module-alsa-card.c”中的某处缺少“not”,并且它以某种方式感觉耳机端口也是麦克风端口。

相关内容