Where did ALSA input and output go?

Nullifer

New Member
As my title explains I was looking for the ALSA input and output sources that use to be part of OBS, I wanted to use this for getting the lowest latency possible out of my devices.
Or if anyone could help me use straight reaper to route all of my audio and send it to OBS that would be ok too.
 
The latency added by pipewire is very low; are you open to using that? Direct application capture with pipewire, for example, is probably on par with monitoring an ALSA output. And when it comes to capturing a microphone, the (real) latency is usually dominated by other layers.
 

Nullifer

New Member
The latency added by pipewire is very low; are you open to using that? Direct application capture with pipewire, for example, is probably on par with monitoring an ALSA output. And when it comes to capturing a microphone, the (real) latency is usually dominated by other layers.
Sorry I never responded, didn't get notification.
I've since moved over to pipewire jack setup through reaper with qpwgraph.

There is just one issue I can't get my secondary device to behave


Pipewire jack sample issue multiple devices


I need some help figuring this multi device reaper pipewire jack issue out.

Devices, UMC404HD and Elgato Wave XLR sound card.
Newest kernel at time of post, with KDE

So initially

asound (alsa) would not adhere to the pipewire system settings when using reaper, pipewire was set to 128 but asound would set 64, and latency was higher than it should have been along with xruns and weird audio.

This was fixed by setting the UMC404HD to pro audio in kde instead of direct.
So then UMC404HD adheres 128 asound 128 pipewire, allowing for perfect clean audio with 2.6ms in reaper.

The Elgato Wave XLR sound card however refuses to change it's behavior. it's still using 64 samples and causing xruns and garbled audio randomly.
So I unplugged it to get rid of the issue, and ran my mic through the UMC404HD.

But I would still try to figure out how to get the Wave XLR to use 128. I do actually need that extra input, plus the mute button, and I like it's preamp.


[nullifer@archlinux ~]$ pw-metadata -n settings
Found "settings" metadata 32
update: id:0 key:'log.level' value:'2' type:''
update: id:0 key:'clock.rate' value:'48000' type:''
update: id:0 key:'clock.allowed-rates' value:'[ 48000 ]' type:''
update: id:0 key:'clock.quantum' value:'128' type:''
update: id:0 key:'clock.min-quantum' value:'128' type:''
update: id:0 key:'clock.max-quantum' value:'128' type:''
update: id:0 key:'clock.force-quantum' value:'0' type:''
update: id:0 key:'clock.force-rate' value:'0' type:''
[nullifer@archlinux ~]$ cat /proc/asound/card*/pcm*/sub*/hw_params
closed
closed
closed
closed
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 4
rate: 48000 (48000/1)
period_size: 128
buffer_size: 32768
access: MMAP_INTERLEAVED
format: S32_LE
subformat: STD
channels: 4
rate: 48000 (48000/1)
period_size: 128
buffer_size: 32768
closed
access: MMAP_INTERLEAVED
format: S24_3LE
subformat: STD
channels: 1
rate: 48000 (48000/1)
period_size: 64
buffer_size: 32768
closed
 
I've never used JACK (that's a lie, but it may as well be true), so you're on your own with that. I know that you can set per-device rules for _native_ PipeWire, e.g. https://docs.pipewire.org/page_man_pipewire_conf_5.html#pipewire_conf__device_rules - so you can try to force (or squeeze) the clock quantum down to an acceptable value.

I can't quite get my head around your use-case; because using JACK seems like overkill when OBS can handle PipeWire natively (via https://obsproject.com/forum/resources/pipewire-audio-capture.1458/ - which is what I use). It sounds like you have some other things going on which is why you're using JACK, Reaper and qpwgraph (but, then again, I also thought that Reaper could handle PipeWire natively, too).
 

Nullifer

New Member
I've never used JACK (that's a lie, but it may as well be true), so you're on your own with that. I know that you can set per-device rules for _native_ PipeWire, e.g. https://docs.pipewire.org/page_man_pipewire_conf_5.html#pipewire_conf__device_rules - so you can try to force (or squeeze) the clock quantum down to an acceptable value.

I can't quite get my head around your use-case; because using JACK seems like overkill when OBS can handle PipeWire natively (via https://obsproject.com/forum/resources/pipewire-audio-capture.1458/ - which is what I use). It sounds like you have some other things going on which is why you're using JACK, Reaper and qpwgraph (but, then again, I also thought that Reaper could handle PipeWire natively, too).

The answer to my question was to get rid of my global pipewire file and instead make this file which focuses on the Asound (alsa) handoff to pipewire, the file name is not important but location is.
/.config/wireplumber/wireplumber.conf.d/99-wave-xlr-fix.conf

and inside i put



Code:
monitor.alsa.rules = [
  {
    matches = [
      {
        node.name = "~alsa_.*Elgato.*Wave.*XLR.*"
      }
    ]
    actions = {
      update-props = {
        api.alsa.period-size = 256
      }
    }
  },
  {
    matches = [
      {
        node.name = "~alsa_.*BEHRINGER.*UMC404HD.*"
      }
    ]
    actions = {
      update-props = {
        api.alsa.period-size = 128
      }
    }
  }
]

128 is the sample rate I wanted, but something inside the Elgato Wave XLR always forced itself to be half of what it should have been or half of forced global, so i had to double the period size on that device to make it actually force 128sample rate.
Now both devices are pushing clean 2.6ms audio. perfection.

to answer your question, if you're running pure pipewire, inside of reaper "Jack" is pipewire. This way you can route everything you want via qpwgraph and set a jack input on obs.
the reasoning behind this is i have multi audio devices, i want them in sync, I want low latency, and I do not want to be confined to whatever OBS will accept when in comes to plugins, as it is very limited when it comes to vst.
Reaper allows me also to use CLAP instead of vst which uses a fraction of the resources of a vst version of the plugin.
I can also route some devices to my speakers and others to the stream only.

i have all real time monitoring with no desync, all the types of plugins i want. I can reroute my processed mic to discord, or a game if i need to.

honestly the list goes on and on for the reasons behind doing it this way.
While I was on windows I had the wave link software which could somewhat replicate this setup, but this is 100X better.
 
The answer to my question was to get rid of my global pipewire file and instead make this file which focuses on the Asound (alsa) handoff to pipewire, the file name is not important but location is.
/.config/wireplumber/wireplumber.conf.d/99-wave-xlr-fix.conf

and inside i put



Code:
monitor.alsa.rules = [
  {
    matches = [
      {
        node.name = "~alsa_.*Elgato.*Wave.*XLR.*"
      }
    ]
    actions = {
      update-props = {
        api.alsa.period-size = 256
      }
    }
  },
  {
    matches = [
      {
        node.name = "~alsa_.*BEHRINGER.*UMC404HD.*"
      }
    ]
    actions = {
      update-props = {
        api.alsa.period-size = 128
      }
    }
  }
]

128 is the sample rate I wanted, but something inside the Elgato Wave XLR always forced itself to be half of what it should have been or half of forced global, so i had to double the period size on that device to make it actually force 128sample rate.
Now both devices are pushing clean 2.6ms audio. perfection.

to answer your question, if you're running pure pipewire, inside of reaper "Jack" is pipewire. This way you can route everything you want via qpwgraph and set a jack input on obs.
the reasoning behind this is i have multi audio devices, i want them in sync, I want low latency, and I do not want to be confined to whatever OBS will accept when in comes to plugins, as it is very limited when it comes to vst.
Reaper allows me also to use CLAP instead of vst which uses a fraction of the resources of a vst version of the plugin.
I can also route some devices to my speakers and others to the stream only.

i have all real time monitoring with no desync, all the types of plugins i want. I can reroute my processed mic to discord, or a game if i need to.

honestly the list goes on and on for the reasons behind doing it this way.
While I was on windows I had the wave link software which could somewhat replicate this setup, but this is 100X better.
That WirePlumber configuration looks good! I thought it would be possible to set these via a PipeWire configuration, too, e.g. using node rules PipeWire: pipewire.conf NODE RULES (docs), and all the ALSA-specific rules are given here: PipeWire: pipewire-props ALSA PROPERTIES (docs). Perhaps I'm wrong. Anyway, you have a solution, so that's great!

Great work identifying a workaround for the Elgato, too; hope that helps others with the same gear.

You might want to check the output of pw-top to make sure that it's actually using the 'quantum' you want for the node.

FWIW - I use PipeWire's LV2 filter chain module on my audio inputs, but - of course - it provides no user interface for setting them up. I started with Carla to get the right filter settings, then I wrote a script to export a WirePlumber script that creates the filtered output on demand: https://gitlab.com/stephematician/carla-wp-export

I felt that running Carla (or Reaper) in the background all the time was overkill, plus Carla requires a JACK server (e.g. via pw-jack) - perhaps Reaper too if I understand what you're saying.

JACK or not, I guess most of the latency is still down to the actual hardware, the USB, the frame period, and in our case - the filters themselves.
 
Also - because everything is using PipeWire (including OBS), I can simply run:

Code:
PIPEWIRE_LATENCY=512/48000 obs

And the quantum is sorted for any stream to/from OBS; on my machine PipeWire (by default) sets the period to 64 on input and output (can see this either via pw-dump or wpctl inspect).

When I look at pw-top, it shows that the quantum being used is 512, and I can (by first getting the node number from wpctl status | grep OBS) inspect an audio stream from OBS to check that its latency is set:

Code:
user@host:~$ wpctl inspect 108
id 108, type PipeWire:Interface:Node
    adapt.follower.spa-node = ""
    audio.adapt.follower = ""
  * client.id = "135"
    clock.quantum-limit = "8192"
  * factory.id = "7"
    factory.mode = "merge"
    library.name = "audioconvert/libspa-audioconvert"
  * media.category = "Capture"
  * media.class = "Stream/Input/Audio"
    media.name = "[AUDIO] Microphone (PipeWire)"
  * media.role = "Production"
  * media.type = "Audio"
    node.autoconnect = "true"
    node.dont-reconnect = "true"
    node.latency = "512/48000"
...

More details here about PipeWire's buffering: https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/FAQ#pipewire-buffering-explained
 

Nullifer

New Member
Also - because everything is using PipeWire (including OBS), I can simply run:

Code:
PIPEWIRE_LATENCY=512/48000 obs

And the quantum is sorted for any stream to/from OBS; on my machine PipeWire (by default) sets the period to 64 on input and output (can see this either via pw-dump or wpctl inspect).

When I look at pw-top, it shows that the quantum being used is 512, and I can (by first getting the node number from wpctl status | grep OBS) inspect an audio stream from OBS to check that its latency is set:

Code:
user@host:~$ wpctl inspect 108
id 108, type PipeWire:Interface:Node
    adapt.follower.spa-node = ""
    audio.adapt.follower = ""
  * client.id = "135"
    clock.quantum-limit = "8192"
  * factory.id = "7"
    factory.mode = "merge"
    library.name = "audioconvert/libspa-audioconvert"
  * media.category = "Capture"
  * media.class = "Stream/Input/Audio"
    media.name = "[AUDIO] Microphone (PipeWire)"
  * media.role = "Production"
  * media.type = "Audio"
    node.autoconnect = "true"
    node.dont-reconnect = "true"
    node.latency = "512/48000"
...

More details here about PipeWire's buffering: https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/FAQ#pipewire-buffering-explained
Yes I can do it the way you were referring to previously, but the elgato device doesnt obey global settings or individual settings correctly.
It seems to always be half of what is set, atleast when there is a secondary device in the mix.

So the only option was to set the alsa node settings per device, setting wave XLR at double what I wanted

I think this has something to do with its usb settings internally (it only uses full speed)

But now I only have 1 file with that code inside of it. Everything is in sync perfectly .

Pw-top reports correctly as well.
This setting I'm using is the most stable solution i believe. Short of getting rid of the Wave XLR from the setup.
 
Top