您尚未登录。

#1 2022-05-31 16:37:12

Tee
会员
注册时间: 2016-09-10
帖子: 138
个人网站

[已解决]这个设定在 wireplumber 里是什么含义?为什么会影响 clock.force-quantum ?

我的设定:

❯ cat ~/.config/wireplumber/main.lua.d/90-alsa-config.lua
-- See /usr/share/wireplumber/main.lua.d/50-alsa-config.lua for all properties,
-- this just overrides some settings for low latency USB audio

alsa_monitor.rules[#alsa_monitor.rules + 1] = {
  matches = {
    {
      { "node.name", "matches", "alsa_input.*" },
    },
    {
      { "node.name", "matches", "alsa_output.*" },
    },
  },
  apply_properties = {
    ["audio.rate"]             = 48000,
    ["api.alsa.period-size"]   = 128,
    ["api.alsa.disable-batch"] = true,
  },
}

alsa_monitor.rules[#alsa_monitor.rules + 1] = {
  matches = {
    {
      { "node.name", "matches", "alsa_*.usb-*" },
    },
  },
  apply_properties = {
    -- USB audio interfaces can take a while to wake up from suspending
    ["session.suspend-timeout-seconds"] = 0,
  },
}

我设定 clock.force-quantum 的命令为:

pw-metadata -n settings 0 clock.force-quantum 2048

如上面所示,我的 api.alsa.period-size 设定为 128。这时如果无把 clock.force-quantum 设定为一个很大的值,如 2048,这是可以的。

V4nea2G.png

但如果 api.alsa.period-size 设定为较小的值,如 64。这时我的 clock.force-quantum 即使设定为 2048,实际上最高只有 1024。

GR5JB1u.png

------------------------------------

在较低延迟下,需要 api.alsa.period-size 设置较小,在录音时我才不会有不正常的声音。

如果 api.alsa.period-size 较大如 1024,无论 clock.force-quantum 设置多小,都会有不正常的声音。

------------------------------------

于是困扰就来了,我需要在低延迟下录音,但又需要在不录音(播放)的时候,重新设置 clock.force-quantum 较大的值,以给音频多一点缓冲。

api.alsa.period-size 这个设定在 wireplumber 里是什么含义?为什么会影响 clock.force-quantum ?


谢谢各位。

最近编辑记录 Tee (2022-07-04 17:48:46)


啦哆咪 - 用Linux制作音乐
https://lado.me

离线

#2 2022-07-04 21:26:37

Tee
会员
注册时间: 2016-09-10
帖子: 138
个人网站

Re: [已解决]这个设定在 wireplumber 里是什么含义?为什么会影响 clock.force-quantum ?

在 pipewire 发起了 issue, 得知 alsa 的 period-size 决定了 quantum 的上限.

详情在:
https://gitlab.freedesktop.org/pipewire … ssues/2501


啦哆咪 - 用Linux制作音乐
https://lado.me

离线

页脚