dimtpap / obs-pipewire-audio-capture

🔊 Audio device and application capture for OBS Studio using PipeWire
https://obsproject.com/forum/resources/pipewire-audio-capture.1458/
GNU General Public License v2.0
354 stars 12 forks source link

Input and output captures do not create nodes in PipeWire but Application Capture does #67

Open platyple opened 2 months ago

platyple commented 2 months ago

Hello, i'm currently trying out this plugin because running OBS through pipewire-pulse is giving me issues, and i am unable to use it to capture my desktop audio or microphone.

When creating an Input or Output Capture, my sources/sinks are listed in the dropdown but no node is created in qpwgraph and there's no signal showing up in OBS. Creating an Application Capture does create nodes in qpwgraph and works just fine, but is of no use to me. I've tried this with the latest releases of both OBS and this plugin as well as building both from HEAD, to no avail.

Here's a log with PIPEWIRE_DEBUG=3 of creating an Output Capture, Input Capture and Application Capture in that order. https://gist.github.com/platyple/70973166f7499923adcabdba2937b48a

pipewire --version; wireplumber --version pipewire Compiled with libpipewire 1.2.1 Linked with libpipewire 1.2.1 wireplumber Compiled with libwireplumber 0.5.5 Linked with libwireplumber 0.5.5

Let me know if you need any other info Cheers!

ericzlmd commented 1 month ago

Hi.

Wondering if you were able to figure this out?

dimtpap commented 1 month ago

What's the output of running pw-cli info for the node you want to capture? You can use pw-cli ls to find the ID of the node, then use that ID in pw-cli info <id>

platyple commented 1 month ago

here you go, the outputs for a source and sink respectively https://gist.github.com/platyple/b04c89fcb5be7875f23f69c39e2f58d4 this is with both OBS and the plugin compiled from HEAD today.

If you need anything else let me know :)

platyple commented 1 month ago

i feel kind of stupid for not having tried this before, but selecting a source/sink from a hardware device (instead of a remapped one) successfully creates a node, which errors with

15:17:57.860: [pipewire] Created stream 0x5728985f3e10
15:17:57.862: User added source 'Audio Input Capture (PipeWire) 2' (pipewire_audio_input_capture) to scene 'Audio'
15:18:00.471: [pipewire] 0x5728985f3e10 streaming from 87
15:18:00.523: [pipewire] 0x5728985f3e10 Got format: rate 44100 - channels 0 - format 8
15:18:00.545: avresample_open failed: error code -22
15:18:00.545: creation of resampler failed

going off of some forum posts about NDI in OBS i'm guessing this has to do with my interface having too many channels for OBS to handle, which is why i'm using remapped sources and sinks in the first place.

dimtpap commented 1 month ago

I'll be working on a fix but currently a workaround is to add the audio.channels property to your nodes, set to the amount of audio channels the node has. For a example a node with stereo channels should have audio.channels set to 2

platyple commented 1 month ago

Thanks for the info! I didn't know that property existed but i'm gonna add it to my configuration for good measure.