PW - Loopbacks config cause no audio to be heard until PipeWire restarted

[I apologize in advance if any of my terminology isn’t correct, I’m not really the best at any of this audio rerouting jargon…]

So, whenever I record gameplays with my friends, I use this program called SimpleScreenRecorder. It’s basically the ONLY recorder I can use without having a huge performance impact. HOWEVER, it does come with one very big flaw…

The program itself doesn’t natively support recording from both the Mic source AND the Output audio SIMULTANEOUSLY, only having the ability to capture audio from one Monitor/Sink/Source, whatever you call it… Even the developer’s official site said that you’d need to do your own things with your own audio server to get your mic and speaker combined into one singular Output/Sink. Their guide was for pulseaudio, so I slightly modified the config for pipewire.

Now, I created TWO sinks, A and B. The secondary one, B, is where all of my system audio loopbacks into, just for extra volume control. It loopbacks into the main, singular one which SSR is going to capture, Sink A, which handles both my Mic AND sink B! This setup almost works flawlessly with SSR, except for one issue…

Whenever I log onto my laptop, there’s zero sound at all. The sinks are above the “Original” audio, and nothing goes into the sinks either. OR, if I do hear sound, it’s my own mic for some reason, as if pactl load-module module-loopback was just ran INSTEAD of having args to the command… It’s honestly inconsistent.

A temporary fix I have for this is to restart PipeWire through systemctl manually every time I log on, because trying to do it automatically through XFCE Session Startup will give even more varied results… but it DOES fix the issue, audio sounds great and without any issues. I can hear my system again, and so can SSR hear me after that. The two sinks I made also suddenly go below the “Original” sinks, and now I no longer hear myself, but still hear the audio while everything loops back into Sink A.

this is my config:

pulse.cmd = [

	{ cmd = "load-module" args = "module-null-sink sink_name=duplex_out sink_properties=device.description=duplex_out" flags = [ ] },
	
	{ cmd = "load-module" args = "module-null-sink sink_name=game_out sink_properties=device.description=game_out" flags = [ ] },
	
	{ cmd = "load-module" args = "module-loopback source=easyeffects_sink.monitor sink=game_out" flags = [ ] },
	
	{ cmd = "load-module" args = "module-loopback source=game_out.monitor sink=duplex_out" flags = [ ] },
	
	{ cmd = "load-module" args = "module-loopback source=@DEFAULT_SOURCE@ sink=duplex_out" flags = [ ] }
	
]
1 Like

I really wish there was a comprehensive ‘doc’ for audio in Fedora.

You could write a little shell script to automate you ‘restart’ of PipeWire?

Such as in
linux - How to run a shell script at startup - Stack Overflow OR Run a Script on Startup in Linux | Baeldung on Linux

1 Like

I’ve tried the systemctl user service method before this, but it didn’t really work out like I thought…

I’ve tried the crontab method too, it didn’t work either unfortunately. Does the crontab command execute the script like, right on startup or on logon? I placed a kdialog command inside of the script that I put in the tab to know if it ran or not, and the problem reporting program told me that kdialog crashed because of some unknown error (probably because the X server hasn’t started yet…?)

Yeah. Honestly, same… If only there was a “proper” documentation of PipeWire or audio in Fedora, this post probably wouldn’t had existed…

I’m sorry but I don’t really know. I’m learning as I look things up.

I see you are still on F39. Maybe an upgrade would help? Either way, you should upgrade before F42 comes out.