Arch使用问题

系列 - Start Use Arch

看了好几篇 WiKi 和论坛帖子, 尝试了一些方法并无效果。

检查 lspci -vvlsmod 的输出, 在睡眠前后并无变化, 说明不是驱动的问题:

最后得到 Arch 中文群组 群友的提示, 是 EAPD (External Amplifier Power Down, 外部放大器断电) 。说是因为厂商不按标准设计音频电路, 导致各种问题。电脑睡眠的时候关闭音频放大器, 如果配置不正确, 唤醒之后无法重新激活放大器, 就会没有声音。

如果在 /etc/modprobe.d/modprobe.conf 中设置 model=auto 无效:

1
options snd-hda-intel model=auto

那就要从内核中查找相应的 model, 比如 Realtek 声卡需要查找 https://github.com/torvalds/linux/blob/v6.2/sound/pci/hda/patch_realtek.c

安装 alsa-utils 包, 使用 aplay -l 列出所有声卡和数字音频设备, 得知当前声卡为 ALC256:

1
2
3
4
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC256 Analog [ALC256 Analog]
Subdevices: 0/1
Subdevice #0: subdevice #0

patch_realtek.c 中查找 ALC256_FIXUPALC256_FIXUP_SET_COEF_DEFAULTS, 终于找到这样一行:

1
	SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS),

0x1d05, 0x1132, 即 1d05:1132, 在 /etc/modprobe.d/modprobe.conf 中写入:

1
options snd-hda-intel model=1d05:1132

睡眠再唤醒后声音输出正常, 成功解决问题。

一个终端实时监测蓝牙日志:

1
journalctl -f | grep -i bluetooth

另一个终端重启蓝牙服务:

1
systemctl restart bluetooth.service

这时日志输出中有以下报错:

1
2
3
4
5
6
bluetoothd[17935]: profiles/audio/vcp.c:vcp_init() D-Bus experimental not enabled
bluetoothd[17935]: src/plugin.c:plugin_init() Failed to init vcp plugin
bluetoothd[17935]: profiles/audio/mcp.c:mcp_init() D-Bus experimental not enabled
bluetoothd[17935]: src/plugin.c:plugin_init() Failed to init mcp plugin
bluetoothd[17935]: profiles/audio/bap.c:bap_init() D-Bus experimental not enabled
bluetoothd[17935]: src/plugin.c:plugin_init() Failed to init bap plugin

报告当前耳机电量、让 journalctl 输出的蓝牙日志中不再有以上报错, 都需要开启 D-Bus 的实验性功能:

vim /etc/bluetooth/main.conf, 将 Experimental 的值改为 true:

1
2
3
# Enables D-Bus experimental interfaces
# Possible values: true or false
Experimental = true

重启蓝牙服务:

1
systemctl restart bluetooth.service

可以发现日志中不再报告上面的错误。

/etc/security/faillock.conf 中有几个选项:

1
2
3
# deny = 3
# fail_interval = 900
# unlock_time = 600

意思是 900 秒(15 分钟)内发生 3 次密码输入错误, 锁定该账户 600 秒(10 分钟), 即使再输入正确的密码也不行。

一般用户根本用不到这几种硬件, 所以完全不用处理, 参考 Mkinitcpio#Possibly_missing_firmware_for_module_XXXX