• luciferofastora@feddit.org
    link
    fedilink
    arrow-up
    13
    arrow-down
    1
    ·
    edit-2
    8 hours ago

    My pipewire seems to have issues with crackling audio and severely dampening my mic and I have no clue why.

    Still better than Windows.

    • FauxLiving@lemmy.world
      link
      fedilink
      arrow-up
      13
      ·
      edit-2
      4 hours ago

      My pipewire seems to have issues with crackling audio and severely dampening my mic and I have no clue why.

      Pipewire’s default quantum (buffer size, effectively) is incredibly low, this is good for low latency audio but anytime your system is too busy to keep the buffers filled you get crackling.

      If you look at pw-top you’ll see all of your devices and nodes. The quant column is probably 1 or a very small number for the devices.

      You can increase the quantum with this command. This only lasts until pipewire restarts:

       pw-metadata -n settings 0 clock.min-quantum 512
      

      At a sample rate of 48000, this is roughly a 10ms buffer. 1024 is 20ms, etc. You want it as low as possible without getting crackling. Start with 512 and adjust from there (you don’t have to use a power of 2, a quantum of 1234 works just as well).

      severely dampening my mic and I have no clue why.

      By default pipewire doesn’t do any ‘mic boost’, as Windows calls it. You can get the same effect by raising the maximum volume.

      In your sound control panel you should be able to turn the mic up higher than 100%. In KDE Plasma, you can do this in System Settings -> Sound -> Configure Volume Controls… [top right button] -> Raise maximum volume.

      Alternatively, you can use EasyEffects to add a compressor. This will boost your mic volume and also prevent it from getting too loud

      Compressors basically reduce the dynamic range of an audio signal by attenuating loud sounds and boosting quieter ones, this would provide a better mix.

      Other useful plug-ins are noise canceling, (kills background noise) and echo canceling (lets you play sound out of your speakers which won’t get picked up by your mic). Sometimes apps, like Discord, will do this signal processing for you while others, like Signal, do no signal processing.

    • HereIAm@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      4 hours ago

      Oh I had this issue and it drove me bonkers trying to fix it! I have to go digging a not to try and remember what fixed it in the end.

    • 1984@lemmy.today
      link
      fedilink
      arrow-up
      1
      ·
      5 hours ago

      Read the arch wiki on troubleshooting pulse audio. I remember having this issue long ago.

      • luciferofastora@feddit.org
        link
        fedilink
        arrow-up
        2
        ·
        4 hours ago

        The issue occurred yesterday gaming with friends and I didn’t have time to troubleshoot yet, but I’ll keep that in mind, thanks!

    • Frenchgeek@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      7 hours ago

      I’m still trying to figure out why the only real way of taking screenshots fast in Wayland is to do a video capture of the desktop with pipewire…

        • Frenchgeek@lemmy.ml
          link
          fedilink
          arrow-up
          2
          ·
          2 hours ago

          I need it to automate fishing in Minecraft, and the normal way to take screenshots in Python (which is one line with PIL) on Linux went from at least 30 possible fps on X11 to 2 on Wayland. The only way to do it fast enough then is to use Pipewire. Which is one hell of a convoluted mess. (The next part of this whole mess will be finding a way to send mouse clicks without having Minecraft registering a mouse move too in case xdotools stop working)

          • prole@lemmy.blahaj.zone
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            2 hours ago

            You need the print screen key for something else is what you’re saying (I had trouble following your reply)?

            Can only speak for KDE, but you can easily change the screenshot shortcut to something else in settings.

            • Frenchgeek@lemmy.ml
              link
              fedilink
              arrow-up
              1
              ·
              edit-2
              15 minutes ago

              I’m writing a script that automatically take screenshots of the desktop (in particular the Minecraft game window) and then use OpenCV to do template matching to recognize if I’ve caught a fish or not.

              If I use any usual screenshot capabilities of any python library, I simply cannot take pictures fast enough (at least 10 images per second) to have the script work (under Wayland the usual system top out at 2 images per second).

              The only way fast enough I’ve found so far is to use Pipewire to create a livestream of the desktop and get frames of it to do the job.

              And it is a complex mess. (At least I’ve found a (very basic and badly documented) library to do most of the work instead of having to work it all through Dbus myself.)

              It’s just that what once was a single line in my previous X11 script is now a full on script by itself, and I understand almost nothing of it.