OBS Doesn't record desktop sound

Like the title said OBS doesnt record desktop audio and instead it uses the microphone twice. I tried reinstalling pipewire and switched to pulseaudio but neither seemed to work. I looked around the internet too but none of the fixes worked too.

System:    Kernel: 5.15.4-zen1-1-zen x86_64 bits: 64 compiler: gcc v: 11.1.0
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen root=UUID=fd3f5e2d-03d4-49eb-8c74-df426d77447b
rw [email protected] quiet
cryptdevice=UUID=0d9eb220-546a-4a10-9123-6e1de6fb6332:luks-0d9eb220-546a-4a10-9123-6e1de6fb6332
root=/dev/mapper/luks-0d9eb220-546a-4a10-9123-6e1de6fb6332 splash rd.udev.log_priority=3
vt.global_cursor_default=0 systemd.unified_cgroup_hierarchy=1 loglevel=3
Desktop: KDE Plasma 5.23.3 tk: Qt 5.15.2 info: latte-dock wm: kwin_x11 vt: 1 dm: SDDM
Distro: Garuda Linux base: Arch Linux
Machine:   Type: Desktop System: Gigabyte product: B450M DS3H v: N/A serial: <filter>
Mobo: Gigabyte model: B450M DS3H-CF v: x.x serial: <filter> UEFI: American Megatrends v: F51
date: 07/29/2020
Battery:   Device-1: hidpp_battery_0 model: Logitech G305 Lightspeed Wireless Gaming Mouse
serial: <filter> charge: 100% (should be ignored) rechargeable: yes status: Discharging
CPU:       Info: 6-Core model: AMD Ryzen 5 2600X bits: 64 type: MT MCP arch: Zen+ family: 17 (23)
model-id: 8 stepping: 2 microcode: 800820D cache: L2: 3 MiB
flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 86228
Speed: 4008 MHz min/max: 2200/3600 MHz boost: enabled Core speeds (MHz): 1: 4008 2: 4073
3: 4067 4: 3871 5: 4039 6: 4060 7: 4040 8: 4064 9: 3890 10: 3988 11: 4042 12: 4063
Vulnerabilities: Type: itlb_multihit status: Not affected
Type: l1tf status: Not affected
Type: mds status: Not affected
Type: meltdown status: Not affected
Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
Type: spectre_v2
mitigation: Full AMD retpoline, IBPB: conditional, STIBP: disabled, RSB filling
Type: srbds status: Not affected
Type: tsx_async_abort status: Not affected
Graphics:  Device-1: AMD Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] vendor: Micro-Star MSI
driver: amdgpu v: kernel bus-ID: 06:00.0 chip-ID: 1002:67df class-ID: 0300
Display: x11 server: X.Org 1.21.1.1 compositor: kwin_x11 driver: loaded: amdgpu,ati
unloaded: modesetting alternate: fbdev,vesa display-ID: :0 screens: 1
Screen-1: 0 s-res: 1920x1200 s-dpi: 96 s-size: 508x317mm (20.0x12.5") s-diag: 599mm (23.6")
Monitor-1: HDMI-A-0 res: 1920x1200 hz: 60 dpi: 94 size: 518x324mm (20.4x12.8")
diag: 611mm (24.1")
OpenGL: renderer: AMD Radeon RX 570 Series (POLARIS10 DRM 3.42.0 5.15.4-zen1-1-zen LLVM 13.0.0)
v: 4.6 Mesa 21.2.5 direct render: Yes
Audio:     Device-1: AMD Ellesmere HDMI Audio [Radeon RX 470/480 / 570/580/590] vendor: Micro-Star MSI
driver: snd_hda_intel v: kernel bus-ID: 06:00.1 chip-ID: 1002:aaf0 class-ID: 0403
Device-2: AMD Family 17h HD Audio vendor: Gigabyte driver: snd_hda_intel v: kernel
bus-ID: 08:00.3 chip-ID: 1022:1457 class-ID: 0403
Device-3: Razer USA RC30-026902 Gaming Headset [Nari Essential Wireless Receiver] type: USB
driver: hid-generic,snd-usb-audio,usbhid bus-ID: 1-10:7 chip-ID: 1532:051e class-ID: 0300
Sound Server-1: ALSA v: k5.15.4-zen1-1-zen running: yes
Sound Server-2: JACK v: 1.9.19 running: no
Sound Server-3: PulseAudio v: 15.0 running: no
Sound Server-4: PipeWire v: 0.3.40 running: yes
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Gigabyte driver: r8169
v: kernel port: f000 bus-ID: 04:00.0 chip-ID: 10ec:8168 class-ID: 0200
IF: enp4s0 state: up speed: 1000 Mbps duplex: full mac: <filter>
IF-ID-1: anbox0 state: down mac: <filter>
Drives:    Local Storage: total: 1.58 TiB used: 160.81 GiB (9.9%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/sda maj-min: 8:0 model: SATA3 240GB SSD size: 223.57 GiB block-size: physical: 512 B
logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: 8B0 scheme: GPT
ID-2: /dev/sdb maj-min: 8:16 vendor: Western Digital model: WD5000AAKS-07A7B2 size: 465.76 GiB
block-size: physical: 512 B logical: 512 B speed: 3.0 Gb/s type: N/A serial: <filter> rev: 3B01
scheme: MBR
ID-3: /dev/sdc maj-min: 8:32 vendor: Seagate model: ST1000DM010-2EP102 size: 931.51 GiB
block-size: physical: 4096 B logical: 512 B speed: 6.0 Gb/s type: HDD rpm: 7200
serial: <filter> rev: CC43 scheme: GPT
Partition: ID-1: / raw-size: 223.27 GiB size: 223.27 GiB (100.00%) used: 160.81 GiB (72.0%) fs: btrfs
dev: /dev/dm-0 maj-min: 254:0 mapped: luks-0d9eb220-546a-4a10-9123-6e1de6fb6332
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%) used: 720 KiB (0.2%) fs: vfat
dev: /dev/sda1 maj-min: 8:1
ID-3: /home raw-size: 223.27 GiB size: 223.27 GiB (100.00%) used: 160.81 GiB (72.0%) fs: btrfs
dev: /dev/dm-0 maj-min: 254:0 mapped: luks-0d9eb220-546a-4a10-9123-6e1de6fb6332
ID-4: /var/log raw-size: 223.27 GiB size: 223.27 GiB (100.00%) used: 160.81 GiB (72.0%)
fs: btrfs dev: /dev/dm-0 maj-min: 254:0 mapped: luks-0d9eb220-546a-4a10-9123-6e1de6fb6332
ID-5: /var/tmp raw-size: 223.27 GiB size: 223.27 GiB (100.00%) used: 160.81 GiB (72.0%)
fs: btrfs dev: /dev/dm-0 maj-min: 254:0 mapped: luks-0d9eb220-546a-4a10-9123-6e1de6fb6332
Swap:      Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 15.64 GiB used: 512 KiB (0.0%) priority: 100 dev: /dev/zram0
Sensors:   System Temperatures: cpu: 16.8 C mobo: N/A gpu: amdgpu temp: 53.0 C
Fan Speeds (RPM): N/A gpu: amdgpu fan: 228
Info:      Processes: 415 Uptime: 35m wakeups: 3 Memory: 15.64 GiB used: 7.91 GiB (50.6%) Init: systemd
v: 249 tool: systemctl Compilers: gcc: 11.1.0 clang: 13.0.0 Packages: pacman: 2017 lib: 564
Shell: fish v: 3.3.1 default: Bash v: 5.1.8 running-in: konsole inxi: 3.3.08
1 Like

i thought it was only me.

++info: i tried a different device, still same problem

any solution or clue?

https://forum.garudalinux.org/t/pipewire-pulse-audio-recording-broken/

basically use the git wireplumber package

2 Likes

even when using wireplumber the issue persists

did you use the git version? i linked to an gitlab issue in that thread that is the same issue as yours and it was fixed in the latest git the stable package still doesn't have the fix I think. you can also apply the fix yourself by following my instructions in that thread i linked. reboot afterward and it should be working. if not you'll want to post on that gitlab issue to let the devs know that you're still having issues with that

1 Like

Could be so nice and tell me what exactly to change. I don't want to screw my system again. In the thread all it says it's to remove a direction check and i have 0 idea what it is

I don't remember of the top of my head I just looked at what files where modifed for the merge request and edited the one on my system to match. It would probably be alot easier and safer to just install the git package like this
sudo pacman -S wireplumber-git

back when i was having the issue the fix still hadn't been merge so I had to do it by manually editing the file, now installing the git package should be enough to get that fix

seems like it isn't in the pacman version yet, even if i installed the git the direction check in findDefinedTarget() is still there. So you probably will still have to apply the fix manually.

Edit: nvm that just broke my audio, so i put it back @zany130 how did you edit it to get it working?

1 Like

@zany130 how did you edit it to get it working?

1 Like

@jurosic_park
@Carrot
I just edited my /usr/share/wireplumber/scripts/policy-node.lua
To look like how it does here policy-node: Remove direction check (!264) · Merge requests · PipeWire / wireplumber

Basically you just have to remove everything at line 240 and 256

But the fix was merged a week ago so it should be in the wireplumber-gitpackage on chaotic unless it's outdated by a week
You could also try the aur package

With paru/yay

EDIT: seems like the fix was actually reverted see

https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/122

3 Likes

Its broken for me too..

You have to manually edit the file like i said or uninstall pipewire as OBS does not support pipewire and will not fix this(source Selecting an output device results in the app choosing an input instead. · Issue #5533 · obsproject/obs-studio · GitHub)
And wire plumber reverted the fix because they think the issue is on OBS not them

This also affects simple screen recorder BTW and possibly any sound recording app that doesn't support pipewire but works with pipewire-pulse backwards compatibility

Actually, to my knowledge, OBS is built with pipewire? I might be wrong tho.

Also thanks for the fix! But unfortunately it doesn't work, after applying the "patch" when i logged out and back in the desktop audio just recorded a perhaps 1/4 of a second static and then nothing and then static again, and after reboot, it just messed up my audio completely, so no audio devices were listed.

Anyone know when an actual fix will be in the wireplumber-git package?

Meanwhile, any other recording software? :frowning:

EDIT: see https://www.linuxuprising.com/2021/06/obs-studio-27-released-with-wayland-and.html

EDIT 2: I'm thinking that using software such as JACK could solve this problem until a fix is made, because you could create a virtual Output, and reroute the actual output into it, so obs can record it, Also couldn't this be in any way be solved by using the "Pro Audio" in pavucontrol?

Whenever the wireplumber maintainer pushes a fix to the master branch. The package will be updated about 1-2 hours after a new commit has happened :slight_smile:

4 Likes

Actually, after looking a bunch on the OBS github issues, looks like, yes, obs supports only pulseaudio inputs as @zanny130 pointed out, pulseaudio outputs must be sinks, and that's where wireplumber/pipewire is going wrong(?), so would switching to pulseaudio fix this problem?

EDIT: Wild guess, but i found software named Helvum (Tom Wagner / Helvum · GitLab) I'm going to try this out, perhaps it could fix some issues? I'm going in completely blind though.

EDIT: Right! Helvum helped since you can manually route audio from a program, into the OBS Desktop INPUT, and "unroute the desktop INPUT from the audio card", so this would be a solution, until a fix is released, i hope this helps guys! Install it with pacman -S helvum, the only problem would be that there is no way to force, or save config, so every time you want to record audio from, for example, a game, you need to do the routing, and keep an eye on it to see if something reset or not. Still, better than nothing!

ANOTHER EDIT...: Actually, you can reroute the monitor of playback_FL and playback_FR into the OBS desktop audio, and have ALL desktop audio be recorded.. How OBS is supposed to do it, but isn't.


this is the scheme of how obs should have it, but but instead they give your input to Desktop and Mic input

2 Likes

yeah your either going to have to keep doing that or edit the file like I said (Just tried it worked for me) as neither the OBS nor the wireplumber devs want to fix this issue. As the wireplumber devs believe the fault is with OBS and that they need to fix it, and OBS devs says they don't support pipewire so this has nothing to do with them and should be fixed by the wireplumber devs.

Or you can stop using pipewire but I tried switching to pulseaudio and I got a lot of other issues so im just staying with pipewire

EDIT: according to the wire plumber devs apperently you need this fix to https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/5ae75e1d2a08bbf7316c299eddbacf175617fee8 and everthing should work just tried it (with the pipewire git packages) after resteing the changes i did to my wireplumber files and everything works

wireplumber fixes didn't work for me, switching to pulse solved

you need the git version of all your installed pipewire packages for example:

gst-plugin-pipewire-common-git
pipewire-common-git
pipewire-common-alsa-git
pipewire-common-jack-git
pipewire-common-pulse-git
pipewire-common-v4l2-git
pipewire-common-zeroconf-git

so
for example:

paru -S pipewire-common-git gst-plugin-pipewire-common-git pipewire-common-alsa-git pipewire-common-jack-git pipewire-common-pulse-git pipewir
e-common-v4l2-git pipewire-common-zeroconf-git

on my system I had all those so i replaced them with the git version. really I think you only need pipewire-common-pulse-git but its prob not good to mix versions of the different pipewire packages

or switching to pulseaudio is a better solution if that works for you.
you can also

sudo pacman -S pulseaudio-support

and it should replace pipewire-support or you can use the garuda assistant to switch

Yeah, so far im happy with this, as long as it works, im happy that it works, dont want to make stuff worse lmao

1 Like