![CentOS 未检测到我的麦克风,我无法保存 alsamixer 设置](https://linux22.com/image/177360/CentOS%20%E6%9C%AA%E6%A3%80%E6%B5%8B%E5%88%B0%E6%88%91%E7%9A%84%E9%BA%A6%E5%85%8B%E9%A3%8E%EF%BC%8C%E6%88%91%E6%97%A0%E6%B3%95%E4%BF%9D%E5%AD%98%20alsamixer%20%E8%AE%BE%E7%BD%AE.png)
我无法录音,我正在检查我的麦克风。
检查
[joseluisbz@centos ~]$ uname -r
5.7.8-1.el8.elrepo.x86_64
[joseluisbz@centos ~]$
[joseluisbz@centos ~]$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC257 Analog [ALC257 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
[joseluisbz@centos ~]$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC257 Analog [ALC257 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 7: HDMI 1 [HDMI 1]
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
card 0: PCH [HDA Intel PCH], device 10: HDMI 4 [HDMI 4]
Subdevices: 1/1
Subdevice #0: subdevice #0
[joseluisbz@centos ~]$
在另一边:
[joseluisbz@centos ~]$ cat /etc/modprobe.d/alsa-base.conf
options snd-hda-intel model=pch position_fix=1
[joseluisbz@centos ~]$
现在检查一下alsamixer
我明白了。
如您所见:我的卡中有:PulseAudio
改变与F6
.
并选择F5
以查看所有设置。
但是,退出时更改不会保存。并且选定的声卡不会被保留。
现在,我想使用sudo alsamixer
.
[joseluisbz@centos ~]$ sudo alsamixer
[sudo] password for joseluisbz:
No protocol specified
xcb_connection_has_error() returned true
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused
cannot open mixer: Connection refused
[joseluisbz@centos ~]$
稍后,进行更改后:
[joseluisbz@centos ~]$ alsamixer
[joseluisbz@centos ~]$ alsactl store
alsactl: state_lock:125: file /var/lib/alsa/asound.state lock error: File exists
[joseluisbz@centos ~]$
[joseluisbz@centos ~]$ alsactl init
alsactl: sysfs_init:48: sysfs path '/sys' is invalid
Found hardware: "HDA-Intel" "Realtek ALC257" "HDA:10ec0257,17aa3835,00100001 HDA:8086280b,80860101,00100000" "0x17aa" "0x3816"
Hardware is initialized using a generic method
[joseluisbz@centos ~]$
[joseluisbz@centos ~]$ alsactl restore
alsactl: state_lock:125: file /var/lib/alsa/asound.state lock error: File exists
alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: File exists
alsactl: sysfs_init:48: sysfs path '/sys' is invalid
Found hardware: "HDA-Intel" "Realtek ALC257" "HDA:10ec0257,17aa3835,00100001 HDA:8086280b,80860101,00100000" "0x17aa" "0x3816"
Hardware is initialized using a generic method
[joseluisbz@centos ~]$
我该如何解决这个问题?
编辑1:
当我跑步时pulseaudio -D
我得到:
$ pulseaudio -D
E: [pulseaudio] main.c: Daemon startup failed.
$
和pulseaudio -v
$ pulseaudio -v
I: [pulseaudio] main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
I: [pulseaudio] main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
I: [pulseaudio] core-util.c: Failed to acquire high-priority scheduling: Permission denied
I: [pulseaudio] main.c: This is PulseAudio 14.0-rebootstrapped
I: [pulseaudio] main.c: Page size is 4096 bytes
I: [pulseaudio] main.c: Machine ID is fb78af0a9247484aad9831a10a928084.
I: [pulseaudio] main.c: Session ID is 3.
I: [pulseaudio] main.c: Using runtime directory /run/user/1000/pulse.
I: [pulseaudio] main.c: Using state directory /home/joseluisbz/.config/pulse.
I: [pulseaudio] main.c: Using modules directory /usr/lib64/pulse-14.0/modules.
I: [pulseaudio] main.c: Running in system mode: no
E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.
$
为了杀死它必须:$ rm -rf /home/joseluisbz/.config/pulse
和:ps aux | grep pulseaudio
$ ps aux | grep pulseaudio
joselui+ 2471 0.0 0.0 1563156 12648 ? Ssl 23:51 0:00 /usr/bin/pulseaudio --daemonize=no --log-target=journal
joselui+ 4960 0.0 0.0 221928 1104 pts/0 S+ 23:59 0:00 grep --color=auto pulseaudio
$
和pulseaudio --dump-conf
$ 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
rescue-streams = yes
lock-memory = no
exit-idle-time = 20
scache-idle-time = 20
dl-search-path = /usr/lib64/pulse-14.0/modules
default-script-file = /etc/pulse/default.pa
load-default-script-file = yes
log-target =
log-level = notice
resample-method = auto
avoid-resampling = no
enable-remixing = yes
remixing-use-all-sink-channels = yes
remixing-produce-lfe = no
remixing-consume-lfe = 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
$
重新启动pulseaudio
:
$ pulseaudio --kill
$ pulseaudio --start
$
清单dnf list installed | grep alsa
$ dnf list installed | grep alsa
alsa-firmware.noarch 1.0.29-6.el8 @AppStream
alsa-lib.x86_64 1.2.4-5.el8 @AppStream
alsa-lib-devel.x86_64 1.2.4-5.el8 @AppStream
alsa-plugins-arcamav.x86_64 1.1.9-1.el8 @AppStream
alsa-plugins-freeworld-a52.x86_64 1.1.6-5.el8 @rpmfusion-free-updates
alsa-plugins-freeworld-lavrate.x86_64 1.1.6-5.el8 @rpmfusion-free-updates
alsa-plugins-maemo.x86_64 1.1.9-1.el8 @AppStream
alsa-plugins-oss.x86_64 1.1.9-1.el8 @AppStream
alsa-plugins-pulseaudio.x86_64 1.1.9-1.el8 @AppStream
alsa-plugins-samplerate.x86_64 1.1.9-1.el8 @AppStream
alsa-plugins-speex.x86_64 1.1.9-1.el8 @AppStream
alsa-plugins-upmix.x86_64 1.1.9-1.el8 @AppStream
alsa-plugins-usbstream.x86_64 1.1.9-1.el8 @AppStream
alsa-plugins-vdownmix.x86_64 1.1.9-1.el8 @AppStream
alsa-tools-firmware.x86_64 1.1.6-1.el8 @AppStream
alsa-ucm.noarch 1.2.4-5.el8 @AppStream
alsa-utils.x86_64 1.2.4-2.el8 @AppStream
alsa-utils-alsabat.x86_64 1.2.4-2.el8 @AppStream
$
更新中..
$ sudo dnf update alsa-lib alsa-utils
Last metadata expiration check: 1:37:40 ago on Thu 22 Dec 2022 10:50:20 PM -05.
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Module yaml error: Unexpected key in data: static_context [line 9 col 3]
Dependencies resolved.
===================================================================================================================================================================================================================
Package Architecture Version Repository Size
===================================================================================================================================================================================================================
Upgrading:
alsa-lib x86_64 1.2.7.2-1.el8 appstream 496 k
alsa-lib-devel x86_64 1.2.7.2-1.el8 appstream 1.0 M
alsa-utils x86_64 1.2.7-1.el8 appstream 1.1 M
Transaction Summary
===================================================================================================================================================================================================================
Upgrade 3 Packages
Total download size: 2.6 M
Is this ok [y/N]: y