Spotify, freetube, youtube website, either it’s a streaming issue or an audio playback issue. Whenever my cpu is working too hard audio playback stutters and delays making it unlistenable. Actually some games have alright audio so I think it’s a streaming issue. Anyway I want to know how to prioritise sound streaming or playback cpu in linux?

  • diamond@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    2
    ·
    21 hours ago

    none of these applications require particularly low latency, so if you’re on Pipewire, you can increase both min, max and default quantum to something like [1024, 4096]. i have to do this on my N100 laptop and it helps a lot.

    pw-top tells you which app uses which quantum too, and often times, your machine will slightly struggle with apps that suddenly demand lower quantums and cause stuttering. increasing the min quantum fixes this issue.

  • Atemu@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    20 hours ago

    Did you/your distro set up realtime ulimits correctly such that pw can acquire rt priority?

  • curbstickle@anarchist.nexus
    link
    fedilink
    English
    arrow-up
    8
    ·
    2 days ago

    What distribution, DE, browser, etc? Is hardware acceleration enabled? Do you have multiple audio outputs simultaneously enabled?

    A bit more detail would be helpful

  • tekato@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    2 days ago

    Audio from low priority processes is expected to stutter under high CPU load. I experience this a lot when playing music while compiling programs.

    • Karmatrine@sh.itjust.works
      link
      fedilink
      arrow-up
      8
      ·
      edit-2
      2 days ago

      It’s kinda not supposed to happen if your setup is correct.

      Most likely reason is too short buffer. And on high CPU load it’s just getting overrun. There are legitimate ways to mitigate it in pipewire. And even manage some rt prio things. Arch wiki and pipewire docs should have comprehensive info on how to properly setup things. It can be bit complicated because different sources can have different quantum values. So some can stutter and some not, but it should be all configurable. Pipewire is very good in that regard, just sad I don’t see any good tools to manage these values w/o creating/editing configs, so people don’t jump into this rabbit hole of research.

      Please note that defaults on pipewire should not stutter regularly with proper interface, my main audio interface performs way above what pipewire set by default. But I did used different interfaces and some do struggle with default quantum values.

      • tekato@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 day ago

        Yeah you can mitigate it. Doesn’t change the fact that if you have no CPU time available, the audio is not getting played.

  • FauxLiving@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    1 day ago

    Run pw-top while you’re having the issue and post the output.

    It’s probably a bad default setting that’s setting the buffer/quantum incorrectly.

  • erebion@news.erebion.eu
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 day ago

    Does it stutter if you open Pavucontrol? I’ve seen a couple setups where Pipewire stutters when pipewire-pulse is used, as does Pavucontrol.

    (In some setups this only happened when the volume indicator is enabled in Pavucontrol and disappeared when it was switched off.)