我遇到了与此问题中描述的完全相同的问题:耳机声音输出与线路输出混合。不幸的是,这个问题没有发布答案。我不确定以这种方式发布问题是否合适(我是这些论坛的新手),但我已经尝试了几个星期来解决这个问题,但没有成功。
我遇到此问题的系统使用带有三个模拟输出的 CS4207。三个输出中只有两个连接:耳机和线路输出。我在 Windows 上测试了音频硬件,并验证所有硬件均按预期运行(这和我进行的其他一些测试使我相信这是 Alsa 或 pulseaudio 的驱动程序问题)。
我看到的问题如下:当选择 Line Out 作为声音输出时,声音按预期工作(即,声音仅来自连接到 Line Out 端口的扬声器),但是当选择 Headphones 作为声音输出时,声音来自连接到 Headphones 端口的扬声器和连接到 Line Out 端口的扬声器。
通过 Alsamixer 查看声音设置同时更改所选的输出设备有助于说明问题。
当选择 Line Out 为输出时:
当选择耳机作为输出时:
正如您在此处看到的,当选择 Line Out 为输出时,耳机会自动静音并将音量设置为零,但是当选择 Headphones 为输出时,Line Out 音量和静音设置不会受到影响。
为了解决这个问题,我一直在进行修改/usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf
,虽然我可以看到更改正在应用(声音设置更改和 alsamixer 更改),但我还没有找到具有预期效果的修改。
我不确定下面的任何内容是否有用,但我将重现原始帖子中生成的输出,这些输出指出了这个问题(以下输出来自我的系统,我只是运行与原始帖子相同的命令)。请注意,在运行这些命令之前,我已将所有修改恢复到 analog-output-headphones.conf。
sudo aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: CS4207 Analog [CS4207 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 1: CS4207 Digital [CS4207 Digital]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [DELL U2713HM]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [BenQ LCD]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 8: HDMI 2 [HDMI 2]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 9: HDMI 3 [HDMI 3]
Subdevices: 1/1
Subdevice #0: subdevice #0
出现问题时(选择耳机作为输出):
pacmd list-sinks
1 sink(s) available.
* index: 1
name: <alsa_output.pci-0000_00_1f.3.analog-stereo>
driver: <module-alsa-card.c>
flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: RUNNING
suspend cause: (none)
priority: 9039
volume: front-left: 27022 / 41% / -23.09 dB, front-right: 27023 / 41% / -23.08 dB
balance 0.00
base volume: 52057 / 79% / -6.00 dB
volume steps: 65537
muted: no
current latency: 4.86 ms
max request: 0 KiB
max rewind: 0 KiB
monitor source: 1
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 4
linked by: 4
configured latency: 4.00 ms; range is 4.00 .. 2000.00 ms
card: 0 <alsa_card.pci-0000_00_1f.3>
module: 21
properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "CS4207 Analog"
alsa.id = "CS4207 Analog"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0x6001110000 irq 155"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1f.3"
sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "51ca"
device.form_factor = "internal"
device.string = "front:0"
device.buffering.buffer_size = "352800"
device.buffering.fragment_size = "176400"
device.access_mode = "mmap+timer"
device.profile.name = "analog-stereo"
device.profile.description = "Analog Stereo"
device.description = "Built-in Audio Analog Stereo"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
ports:
analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: yes)
properties:
analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: no)
properties:
device.icon_name = "audio-speakers"
analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: yes)
properties:
device.icon_name = "audio-headphones"
active port: <analog-output-headphones>
出现问题时(选择耳机作为输出)
pactl list sink-inputs
Sink Input #1
Driver: protocol-native.c
Owner Module: 10
Client: 10
Sink: 1
Sample Specification: s16le 1ch 44100Hz
Channel Map: mono
Format: pcm, format.sample_format = "\"s16le\"" format.rate = "44100" format.channels = "1" format.channel_map = "\"mono\""
Corked: no
Mute: no
Volume: mono: 65536 / 100% / 0.00 dB
balance 0.00
Buffer Latency: 0 usec
Sink Latency: 4851 usec
Resample method: copy
Properties:
media.name = "playback"
application.name = "speech-dispatcher"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "34"
application.process.id = "4710"
application.process.user = [removed]
application.process.host = "localhost.localdomain"
application.process.binary = "sd_espeak-ng"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "cbd63041d9194224ad624e9ddb6a37da"
application.process.session_id = "2"
module-stream-restore.id = "sink-input-by-application-name:speech-dispatcher"
Sink Input #2
Driver: protocol-native.c
Owner Module: 10
Client: 11
Sink: 1
Sample Specification: s16le 1ch 44100Hz
Channel Map: mono
Format: pcm, format.sample_format = "\"s16le\"" format.rate = "44100" format.channels = "1" format.channel_map = "\"mono\""
Corked: no
Mute: no
Volume: mono: 65536 / 100% / 0.00 dB
balance 0.00
Buffer Latency: 0 usec
Sink Latency: 4839 usec
Resample method: copy
Properties:
media.name = "playback"
application.name = "speech-dispatcher"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "34"
application.process.id = "4724"
application.process.user = [removed]
application.process.host = "localhost.localdomain"
application.process.binary = "sd_cicero"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "cbd63041d9194224ad624e9ddb6a37da"
application.process.session_id = "2"
module-stream-restore.id = "sink-input-by-application-name:speech-dispatcher"
Sink Input #3
Driver: protocol-native.c
Owner Module: 10
Client: 12
Sink: 1
Sample Specification: s16le 1ch 44100Hz
Channel Map: mono
Format: pcm, format.sample_format = "\"s16le\"" format.rate = "44100" format.channels = "1" format.channel_map = "\"mono\""
Corked: no
Mute: no
Volume: mono: 65536 / 100% / 0.00 dB
balance 0.00
Buffer Latency: 0 usec
Sink Latency: 4829 usec
Resample method: copy
Properties:
media.name = "playback"
application.name = "speech-dispatcher"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "34"
application.process.id = "4728"
application.process.user = [removed]
application.process.host = "localhost.localdomain"
application.process.binary = "sd_dummy"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "cbd63041d9194224ad624e9ddb6a37da"
application.process.session_id = "2"
module-stream-restore.id = "sink-input-by-application-name:speech-dispatcher"
Sink Input #4
Driver: protocol-native.c
Owner Module: 10
Client: 13
Sink: 1
Sample Specification: s16le 1ch 44100Hz
Channel Map: mono
Format: pcm, format.sample_format = "\"s16le\"" format.rate = "44100" format.channels = "1" format.channel_map = "\"mono\""
Corked: no
Mute: no
Volume: mono: 65536 / 100% / 0.00 dB
balance 0.00
Buffer Latency: 0 usec
Sink Latency: 4818 usec
Resample method: copy
Properties:
media.name = "playback"
application.name = "speech-dispatcher"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "34"
application.process.id = "4731"
application.process.user = [removed]
application.process.host = "localhost.localdomain"
application.process.binary = "sd_generic"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "cbd63041d9194224ad624e9ddb6a37da"
application.process.session_id = "2"
module-stream-restore.id = "sink-input-by-application-name:speech-dispatcher"
当问题未发生时(选择 Line Out 作为输出):
pactl list sink-inputs
Sink Input #1
Driver: protocol-native.c
Owner Module: 10
Client: 10
Sink: 1
Sample Specification: s16le 1ch 44100Hz
Channel Map: mono
Format: pcm, format.sample_format = "\"s16le\"" format.rate = "44100" format.channels = "1" format.channel_map = "\"mono\""
Corked: no
Mute: no
Volume: mono: 65536 / 100% / 0.00 dB
balance 0.00
Buffer Latency: 0 usec
Sink Latency: 3734 usec
Resample method: copy
Properties:
media.name = "playback"
application.name = "speech-dispatcher"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "34"
application.process.id = "4710"
application.process.user = [removed]
application.process.host = "localhost.localdomain"
application.process.binary = "sd_espeak-ng"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "cbd63041d9194224ad624e9ddb6a37da"
application.process.session_id = "2"
module-stream-restore.id = "sink-input-by-application-name:speech-dispatcher"
Sink Input #2
Driver: protocol-native.c
Owner Module: 10
Client: 11
Sink: 1
Sample Specification: s16le 1ch 44100Hz
Channel Map: mono
Format: pcm, format.sample_format = "\"s16le\"" format.rate = "44100" format.channels = "1" format.channel_map = "\"mono\""
Corked: no
Mute: no
Volume: mono: 65536 / 100% / 0.00 dB
balance 0.00
Buffer Latency: 0 usec
Sink Latency: 4804 usec
Resample method: copy
Properties:
media.name = "playback"
application.name = "speech-dispatcher"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "34"
application.process.id = "4724"
application.process.user = [removed]
application.process.host = "localhost.localdomain"
application.process.binary = "sd_cicero"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "cbd63041d9194224ad624e9ddb6a37da"
application.process.session_id = "2"
module-stream-restore.id = "sink-input-by-application-name:speech-dispatcher"
Sink Input #3
Driver: protocol-native.c
Owner Module: 10
Client: 12
Sink: 1
Sample Specification: s16le 1ch 44100Hz
Channel Map: mono
Format: pcm, format.sample_format = "\"s16le\"" format.rate = "44100" format.channels = "1" format.channel_map = "\"mono\""
Corked: no
Mute: no
Volume: mono: 65536 / 100% / 0.00 dB
balance 0.00
Buffer Latency: 0 usec
Sink Latency: 4794 usec
Resample method: copy
Properties:
media.name = "playback"
application.name = "speech-dispatcher"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "34"
application.process.id = "4728"
application.process.user = [removed]
application.process.host = "localhost.localdomain"
application.process.binary = "sd_dummy"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "cbd63041d9194224ad624e9ddb6a37da"
application.process.session_id = "2"
module-stream-restore.id = "sink-input-by-application-name:speech-dispatcher"
Sink Input #4
Driver: protocol-native.c
Owner Module: 10
Client: 13
Sink: 1
Sample Specification: s16le 1ch 44100Hz
Channel Map: mono
Format: pcm, format.sample_format = "\"s16le\"" format.rate = "44100" format.channels = "1" format.channel_map = "\"mono\""
Corked: no
Mute: no
Volume: mono: 65536 / 100% / 0.00 dB
balance 0.00
Buffer Latency: 0 usec
Sink Latency: 4788 usec
Resample method: copy
Properties:
media.name = "playback"
application.name = "speech-dispatcher"
native-protocol.peer = "UNIX socket client"
native-protocol.version = "34"
application.process.id = "4731"
application.process.user = [removed]
application.process.host = "localhost.localdomain"
application.process.binary = "sd_generic"
application.language = "C"
window.x11.display = ":0"
application.process.machine_id = "cbd63041d9194224ad624e9ddb6a37da"
application.process.session_id = "2"
module-stream-restore.id = "sink-input-by-application-name:speech-dispatcher"
我终于搞明白了。非常感谢:
解决方案如下...
添加底部的
/usr/share/pulseaudio/alsa-mixer/paths/analog-output-lineout.conf
add:添加底部的
/usr/share/pulseaudio/alsa-mixer/paths/analog-output-headphones.conf
add:注意:这些文件中声明出现的顺序
.conf
很重要。我曾将这些[Element <name>]
声明添加到这些文件的中间,但这导致了问题。我建议先将它们放在底部,如果不行的话,将它们稍微移动一下(我还没有彻底测试过移动它们,所以这个建议可能是个幌子,如果你发现是这种情况,我很抱歉)。