![在 Linux Mint 上的 alsamixer 中将默认主音量控制更改为“PCM”](https://linux22.com/image/225769/%E5%9C%A8%20Linux%20Mint%20%E4%B8%8A%E7%9A%84%20alsamixer%20%E4%B8%AD%E5%B0%86%E9%BB%98%E8%AE%A4%E4%B8%BB%E9%9F%B3%E9%87%8F%E6%8E%A7%E5%88%B6%E6%9B%B4%E6%94%B9%E4%B8%BA%E2%80%9CPCM%E2%80%9D.png)
我正在运行 Linux Mint,每当我使用系统的硬件音量控制(例如音量增大/减小按钮)时,它都会调整 alsamixer 中的“PCM 1”级别。但是,我希望它改为调整“PCM”级别。
amixer -c 1
以下是显示可用控件的输出:
Simple mixer control 'PCM',0
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 74
Mono:
Front Left: Playback 74 [100%] [0.00dB] [on]
Front Right: Playback 74 [100%] [0.00dB] [on]
Simple mixer control 'PCM',1
Capabilities: pvolume pswitch pswitch-joined
Playback channels: Front Left - Front Right
Limits: Playback 0 - 74
Mono:
Front Left: Playback 74 [100%] [0.00dB] [on]
Front Right: Playback 74 [100%] [0.00dB] [on]
Simple mixer control 'Mic',0
Capabilities: cvolume cvolume-joined cswitch cswitch-joined
Capture channels: Mono
Limits: Capture 0 - 74
Mono: Capture 74 [100%] [0.00dB] [on]
我尝试修改 PulseAudio 的 default.pa 配置,但这导致音频丢失。
我正在寻找一种不涉及自定义脚本或键绑定的解决方案。我更喜欢直接将标准主音量更改为“PCM”。
任何建议或见解将不胜感激!
根据要求,以下是输出cat ~/.xbindkeysrc
:
## For the benefit of emacs users: -*- shell-script -*-
###########################
# xbindkeys configuration #
###########################
#
# Version: 1.8.7
#
# If you edit this file, do not forget to uncomment any lines
# that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# To specify a key, you can use 'xbindkeys --key' or
# 'xbindkeys --multikey' and put one of the two lines in this file.
#
# The format of a command line is:
# "command to start"
# associated key
#
#
# A list of keys is in /usr/include/X11/keysym.h and in
# /usr/include/X11/keysymdef.h
# The XK_ is not needed.
#
# List of modifier:
# Release, Control, Shift, Mod1 (Alt), Mod2 (NumLock),
# Mod3 (CapsLock), Mod4, Mod5 (Scroll).
#
# The release modifier is not a standard X modifier, but you can
# use it if you want to catch release events instead of press events
# By defaults, xbindkeys does not pay attention with the modifiers
# NumLock, CapsLock and ScrollLock.
# Uncomment the lines above if you want to pay attention to them.
#keystate_numlock = enable
#keystate_capslock = enable
#keystate_scrolllock= enable
# Examples of commands:
"xbindkeys_show"
control+shift + q
# set directly keycode (here control + f with my keyboard)
#"xterm"
# c:41 + m:0x4
# specify a mouse button
#"xterm"
# control + b:2
#"xterm -geom 50x20+20+20"
# Shift+Mod2+alt + s
#
## set directly keycode (here control+alt+mod2 + f with my keyboard)
#"xterm"
# alt + c:0x29 + m:4 + mod2
#
## Control+Shift+a release event starts rxvt
#"rxvt"
# release+control+shift + a
#
## Control + mouse button 2 release event starts rxvt
#"rxvt"
# Control + b:2 + Release
##################################
# End of xbindkeys configuration #
##################################
#"xdotool type 'r'"
#Control+Alt + Right
和输出pacmd list-cards
:
4 card(s) available.
index: 0
name: <alsa_card.pci-0000_01_00.1>
driver: <module-alsa-card.c>
owner module: 7
properties:
alsa.card = "2"
alsa.card_name = "HDA NVidia"
alsa.long_card_name = "HDA NVidia at 0xdc080000 irq 17"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:01:00.1"
sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card2"
device.bus = "pci"
device.vendor.id = "10de"
device.vendor.name = "NVIDIA Corporation"
device.product.id = "10f0"
device.product.name = "GP104 High Definition Audio Controller"
device.string = "2"
device.description = "GP104 High Definition Audio Controller"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
profiles:
output:hdmi-stereo: Digital Stereo (HDMI)-Ausgabe (priority 38668, available: unknown)
output:hdmi-stereo-extra1: Digital Stereo (HDMI 2)-Ausgabe (priority 38468, available: unknown)
output:hdmi-stereo-extra2: Digital Stereo (HDMI 3)-Ausgabe (priority 38468, available: unknown)
output:hdmi-stereo-extra3: Digital Stereo (HDMI 4)-Ausgabe (priority 5700, available: no)
output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4)-Ausgabe (priority 600, available: no)
output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4)-Ausgabe (priority 600, available: no)
off: Aus (priority 0, available: unknown)
active profile: <output:hdmi-stereo>
sinks:
alsa_output.pci-0000_01_00.1.hdmi-stereo/#11: GP104 High Definition Audio Controller Digital Stereo (HDMI)
sources:
alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor/#14: Monitor of GP104 High Definition Audio Controller Digital Stereo (HDMI)
ports:
hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: yes)
properties:
device.icon_name = "video-display"
device.product.name = "LG HDR 4K
"
hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: yes)
properties:
device.icon_name = "video-display"
device.product.name = "27GL650F
"
hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: yes)
properties:
device.icon_name = "video-display"
device.product.name = "27GL650F
"
hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)
properties:
device.icon_name = "video-display"
index: 1
name: <alsa_card.usb-SteelSeries_SteelSeries_Arctis_9_000000000000-00>
driver: <module-alsa-card.c>
owner module: 8
properties:
alsa.card = "1"
alsa.card_name = "SteelSeries Arctis 9"
alsa.long_card_name = "SteelSeries SteelSeries Arctis 9 at usb-0000:00:14.0-3.1, full speed"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-0000:00:14.0-usb-0:3.1:1.0"
sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-3/1-3.1/1-3.1:1.0/sound/card1"
udev.id = "usb-SteelSeries_SteelSeries_Arctis_9_000000000000-00"
device.bus = "usb"
device.vendor.id = "1038"
device.vendor.name = "SteelSeries ApS"
device.product.id = "12c4"
device.product.name = "SteelSeries Arctis 9"
device.serial = "SteelSeries_SteelSeries_Arctis_9_000000000000"
device.string = "1"
device.description = "SteelSeries Arctis 9"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-usb"
profiles:
output:stereo-game+output:stereo-chat+input:mono-chat: Spiel-Ausgabe + Chat-Ausgabe + Chat-Eingabe (priority 5100, available: unknown)
input:mono-chat: Chat-Eingabe (priority 1, available: unknown)
output:stereo-chat: Chat-Ausgabe (priority 5000, available: unknown)
output:stereo-chat+input:mono-chat: Chat-Ausgabe + Chat-Eingabe (priority 5000, available: unknown)
output:stereo-game: Spiel-Ausgabe (priority 5000, available: unknown)
output:stereo-game+input:mono-chat: Spiel-Ausgabe + Chat-Eingabe (priority 5000, available: unknown)
off: Aus (priority 0, available: unknown)
active profile: <output:stereo-game+output:stereo-chat+input:mono-chat>
sinks:
alsa_output.usb-SteelSeries_SteelSeries_Arctis_9_000000000000-00.stereo-game/#1: SteelSeries Arctis 9 Spiel
alsa_output.usb-SteelSeries_SteelSeries_Arctis_9_000000000000-00.stereo-chat/#2: SteelSeries Arctis 9 Chat
sources:
alsa_output.usb-SteelSeries_SteelSeries_Arctis_9_000000000000-00.stereo-game.monitor/#1: Monitor of SteelSeries Arctis 9 Spiel
alsa_output.usb-SteelSeries_SteelSeries_Arctis_9_000000000000-00.stereo-chat.monitor/#2: Monitor of SteelSeries Arctis 9 Chat
alsa_input.usb-SteelSeries_SteelSeries_Arctis_9_000000000000-00.mono-chat/#3: SteelSeries Arctis 9 Chat
ports:
usb-gaming-headset-output-stereo: Headphones (priority 0, latency offset 0 usec, available: unknown)
properties:
usb-gaming-headset-input: Headset Microphone (priority 0, latency offset 0 usec, available: unknown)
properties:
index: 2
name: <alsa_card.usb-046d_081b_61151E20-02>
driver: <module-alsa-card.c>
owner module: 9
properties:
alsa.card = "3"
alsa.card_name = "USB Device 0x46d:0x81b"
alsa.long_card_name = "USB Device 0x46d:0x81b at usb-0000:00:14.0-6, high speed"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-0000:00:14.0-usb-0:6:1.2"
sysfs.path = "/devices/pci0000:00/0000:00:14.0/usb1/1-6/1-6:1.2/sound/card3"
udev.id = "usb-046d_081b_61151E20-02"
device.bus = "usb"
device.vendor.id = "046d"
device.vendor.name = "Logitech, Inc."
device.product.id = "081b"
device.product.name = "Webcam C310"
device.serial = "046d_081b_61151E20"
device.form_factor = "webcam"
device.string = "3"
device.description = "Webcam C310"
module-udev-detect.discovered = "1"
device.icon_name = "camera-web-usb"
profiles:
input:mono-fallback: Mono-Eingabe (priority 1, available: unknown)
off: Aus (priority 0, available: unknown)
active profile: <input:mono-fallback>
sources:
alsa_input.usb-046d_081b_61151E20-02.mono-fallback/#4: Webcam C310 Mono
ports:
analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: unknown)
properties:
device.icon_name = "audio-input-microphone"
index: 3
name: <alsa_card.pci-0000_00_1f.3>
driver: <module-alsa-card.c>
owner module: 10
properties:
alsa.card = "0"
alsa.card_name = "HDA Intel PCH"
alsa.long_card_name = "HDA Intel PCH at 0x2ffff20000 irq 139"
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 = "a2f0"
device.product.name = "200 Series PCH HD Audio"
device.form_factor = "internal"
device.string = "0"
device.description = "Eingebautes Tongerät"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
profiles:
input:analog-stereo: Analog Stereo-Eingabe (priority 32833, available: unknown)
output:analog-stereo: Analog Stereo-Ausgabe (priority 6500, available: no)
output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6565, available: unknown)
output:analog-surround-21: Analog Surround 2.1-Ausgabe (priority 1300, available: no)
output:analog-surround-21+input:analog-stereo: Analog Surround 2.1-Ausgabe + Analog Stereo-Eingabe (priority 1365, available: unknown)
output:analog-surround-40: Analog Surround 4.0-Ausgabe (priority 1200, available: no)
output:analog-surround-40+input:analog-stereo: Analog Surround 4.0-Ausgabe + Analog Stereo-Eingabe (priority 1265, available: unknown)
output:analog-surround-41: Analog Surround 4.1-Ausgabe (priority 1300, available: no)
output:analog-surround-41+input:analog-stereo: Analog Surround 4.1-Ausgabe + Analog Stereo-Eingabe (priority 1365, available: unknown)
output:analog-surround-50: Analog Surround 5.0-Ausgabe (priority 1200, available: no)
output:analog-surround-50+input:analog-stereo: Analog Surround 5.0-Ausgabe + Analog Stereo-Eingabe (priority 1265, available: unknown)
output:analog-surround-51: Analog Surround 5.1-Ausgabe (priority 1300, available: no)
output:analog-surround-51+input:analog-stereo: Analog Surround 5.1-Ausgabe + Analog Stereo-Eingabe (priority 1365, available: unknown)
output:analog-surround-71: Analog Surround 7.1-Ausgabe (priority 1200, available: no)
output:analog-surround-71+input:analog-stereo: Analog Surround 7.1-Ausgabe + Analog Stereo-Eingabe (priority 1265, available: unknown)
output:iec958-stereo: Digital Stereo (IEC958)-Ausgabe (priority 38268, available: unknown)
output:iec958-stereo+input:analog-stereo: Digital Stereo (IEC958)-Ausgabe + Analog Stereo-Eingabe (priority 38333, available: unknown)
off: Aus (priority 0, available: unknown)
active profile: <output:iec958-stereo+input:analog-stereo>
sinks:
alsa_output.pci-0000_00_1f.3.iec958-stereo/#3: Eingebautes Tongerät Digital Stereo (IEC958)
sources:
alsa_output.pci-0000_00_1f.3.iec958-stereo.monitor/#5: Monitor of Eingebautes Tongerät Digital Stereo (IEC958)
alsa_input.pci-0000_00_1f.3.analog-stereo/#6: Eingebautes Tongerät Analog Stereo
ports:
analog-input-front-mic: Front Microphone (priority 8500, latency offset 0 usec, available: no)
properties:
device.icon_name = "audio-input-microphone"
analog-input-rear-mic: Rear Microphone (priority 8200, latency offset 0 usec, available: yes)
properties:
device.icon_name = "audio-input-microphone"
analog-input-linein: Line In (priority 8100, latency offset 0 usec, available: no)
properties:
analog-output-lineout: Line Out (priority 9000, latency offset 0 usec, available: no)
properties:
analog-output-headphones: Headphones (priority 9900, latency offset 0 usec, available: no)
properties:
device.icon_name = "audio-headphones"
iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)
properties:
答案1
如果您不介意每次更新(或重新安装)pulseaudio后都更改该文件,或者作为初步测试,您可以直接更改此文件:
/usr/share/pulseaudio/alsa-mixer/paths/usb-gaming-headset-output-stereo.conf
在文件中删除,1
后Element PCM
。 (我认为您不需要类似的东西,0
。)更改文件后,使用以下命令重新启动pulseaudio服务器:
systemctl --user restart pulseaudio
为了避免不断更改文件,您需要复制以下文件:
/usr/share/pulseaudio/alsa-mixer/paths/usb-gaming-headset-output-stereo.conf
/usr/share/pulseaudio/alsa-mixer/profile-sets/usb-gaming-headset.conf
到相同的名称下的任何名称(不与其他现有文件冲突/替换其他现有文件)各自目录,例如:
/usr/share/pulseaudio/alsa-mixer/paths/usb-gaming-headset-output-stereo-0.conf
/usr/share/pulseaudio/alsa-mixer/profile-sets/usb-gaming-headset-0.conf
然后,在新的配置文件集文件 ( usb-gaming-headset-0.conf
) 中,替换全部实例s带有混音器路径文件副本的usb-gaming-headset-output-stereo
名称(不带)( )。.conf
usb-gaming-headset-output-stereo-0
如果您没有进行或恢复了原始文件中的更改,请不要忘记删除,1
混音器路径文件的副本 ( )。usb-gaming-headset-output-stereo-0.conf
最后,创建一个带有前缀的udev规则文件91-
(以便覆盖 的相关效果90-pulseaudio.rules
),例如:
/etc/udev/rules.d/91-pulse-pcm.rules
(确保它有扩展名.rules
)
包含以下内容行( 的值ENV{PULSE_PROFILE_SET}
应是为配置文件集文件的副本选择的名称):
SUBSYSTEM=="sound", ACTION=="change", KERNEL=="card*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="12c4", ENV{PULSE_PROFILE_SET}="usb-gaming-headset-0.conf"
(确保不要混淆SUBSYSTEM
和SUBSYSTEMS
。不要错过S
in ATTRS
。也不要混淆==
和=
。)
完成所有工作后,运行以下命令或重新启动以应用它们:
sudo systemctl restart systemd-udevd
sudo systemctl restart systemd-udev-trigger
systemctl --user restart pulseaudio
PS 您的发行版可能会在某些时候隐式地让您的系统使用 pipelinewire,例如在某个系统更新/升级之后。我不知道 Pipewire 是否也有问题,但如果有一天黑客不再有效,那么开关可能是原因。 (那时pacmd list-sinks
会说pulseaudio没有运行,同时pactl list sinks
会列出“pipewire-pulse”提供的可用接收器)。