Linux

播放開始時的聲音延遲

  • May 5, 2021

我遇到了令人討厭的音頻問題,感謝您的幫助!

問題:播放開始時聲音延遲 2-3 秒。它僅在空閒後第一次啟動時出現,如果我在其中一個正在播放或剛剛停止時在源之間切換,則可以正常工作。

Manjaro linux,核心 5.10。英特爾音效卡。自動靜音已禁用。添加intel_iommu=igfx_off到 grub 參數。試圖應用解決方案https://wiki.archlinux.org/title/PulseAudio/Troubleshooting,但沒有任何幫助(或者我只是錯過了一些東西)

提示:在以前的硬體上執行良好。從戴爾 xps 9570 切換到 9500(i5-8300H -> i5-10300H)

Pulseaudio 配置:

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/lib/pulse-14.2/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

請檢查這是否有效:

  1. 註銷
  2. Ctrl + Alt + F2 -> 登錄
  3. mv ~/.config/pulse ~/.config/pulse.bak
  4. reboot

引用自:https://unix.stackexchange.com/questions/648063