Share a multichannel audio card with other apps?

AaronD

Active Member
I'm using OBS to produce a virtual camera for an online meeting. That works.

I also want to record a local copy of the meeting window, which is basically a video screenshot on the same machine that OBS runs on. But because that video is different from what OBS is doing, I have to use something else to record it, correct? OBS can do a very limited amount of multitrack audio and send different tracks to different places, but there's only ever one picture.

Given that, and the need for this different-picture recording to have its own soundtrack as well, I need to get OBS to share the hardware that it's using for audio input. That hardware is a Behringer X32 digital sound board that offers a 32-track USB "sound card". I have a stereo broadcast mix, completely finished inside the X32, while OBS insists on interpreting tracks 1-8 as 7.1 surround and downmixing that to stereo. So I put the broadcast mix on the front corners 1&2 and keep the rest off, as shown below. (what I'm calling "tracks" here, are called "Outputs" in the X32's settings) The "subwoofer" on track 6 is ignored in OBS, and so I thought I might commandeer that for the mono auxiliary soundtrack. Tracks 9-32 already have their own purpose that I haven't pursued at all yet.
1604630146964.png


I can record my video screenshot with ffmpeg -f x11grab ..., but when I also point it to that "sound card", it refuses to use it while OBS is running. Likewise for Audacity; it can't see that card either while OBS is running. When I close OBS, *then* the other apps can use the card, so I know they work. Is there a way to make OBS share its raw audio source with something else?

Or I guess if OBS can pass that track through without affecting the stereo broadcast mix - neither streamed nor recorded from OBS, only passed through as a virtual sound card - that would work too.

Or if I'm wrong about OBS only ever producing one picture, and it *can* in fact both produce the meeting feed and record the meeting window at the same time - with different audio for each, cherry-picked out of the same multitrack input - that would be absolutely awesome! I already have a "screengrab" scene that I've used on occasion, which would suffice for that picture, provided that I could simultaneously send a different scene *to* the meeting.
 

AaronD

Active Member
Okay, I got this now:
Screenshot.png

It appears that all that's left is to have the JACK Input Client as a Global device and not tied to a specific scene. Is that possible?
 

AaronD

Active Member
This video is the key:

Something that took amazingly long for Google to tell me, was that PulseAudio can now work directly with Jack. Set that up, and PA's connection to Jack becomes available in OBS's Global Audio devices. OBS still insists on downmixing 7.1 to stereo, but at least I can use Jack now, to keep the "surround" channels off, instead of wasting those channels of my USB sound card.

screen_2.png


And Jack can also feed ffmpeg, for the auxiliary recording.

screen_3.png


So, after a bit *more* googling about persistent Jack connections (1), how to feed ffmpeg (2), etc., I think I'm finally set.

(1) Jack defaults to nothing connected, and needs to be told again every time it starts. But that can also be automated. (the check box and .xml file in the top-left window of the full screenshot)

(2) ffmpeg's Jack source gets to name itself anything it wants, from the command line. It then appears as a Jack device. Once that's done (sleep 1 in between to be sure), another command - or a UI action - can make the connection. I have mine scripted so that it "just works".
 
Top