[Note: this post has been substantially revised since it was first published — JamKazam is now issuing frequent updates, and one of them broke the method was using when I first wrote this. To be fair to JK, that’s probably because one part of it was never exactly right, but skated by. What follows has been updated so that it, y’know, works.]

I spent a day and a half last week trying to figure out how to get audio to route from JamKazam to OBS for streamcasting. Getting JamKazam’s video into OBS was simple; it’s just a window-capture of the JamKazam video window, and I was able to very quickly configure OBS to take video input from JamKazam’s video and from some music-visualization software ( BTW, invoking JK’s video-shuffler, which automatically changes the video-window layout when there are multiple players in the window, crashed the machine — that’s the next challenge).

But audio was a pain in the ass. I’ve done a lot of hating on OS/X audio already here, but I just can’t hate it enough — it’s the worst of Apple arrogance, in which they set things up to be “easy to use” — and they are, until you actually try to do anything with them. Years ago somebody said that Apple products are characterized by a very shallow learning curve that very quickly becomes a vertical brick wall. Nowhere is that more true than it is with audio routing. Of course, there’s a vigorous aftermarket in add-on audio routing products (I regularly use Audio Hijack, but got sticker shock from Loopback, which looks like a really good, if pricey, product). In this case, the problem was complicated by defects in OBS, which appears to have troubles playing nicely with OS/X Catalina. So to be fair, it ain’t all Apple’s fault.

My notes follow.

Lessons learned

  • In order to test properly without further alienating my friends (thank you for your patience, Karl and Charles), I set up a bogus JK user on a dual-boot laptop that runs Windows.  Highly recommended as a testing technique.
  • OBS appears to have issues with the OS/X version of JACK; couldn’t get it to work. For alternate OS/X audio-routing software, I’m using Blackhole.
  • OBS (in its most-current version) has issues with ALL routing software when started from the icon/Finder.   You MUST start it from a terminal window.  This appears to be an issue with OS/X Catalina, mentioned here (with the proper command-line invocation to use to avoid the problem): https://obsproject.com/forum/threads/macos-10-15-catalina-support-status.111343/post-421259 

Routing setup

  • Install Blackhole (sort of a poor man’s Loopback).  Everything you need is here: https://github.com/ExistentialAudio/BlackHole .  Simple installation procedure is fine. Blackhole needs no further setup
  • Set up a multi-output device using AudioMidi Setup.  
    • I call mine “JK Funnel” for clarity.
    • Blackhole should be the master
    • Include your audio interface and Built-in Output as well. This is mostly for convenience in monitoring. Enable “drift correction” on both (that’s what OS/X calls resampling, and if you match the sample rates on your interface, Blackhole, and the Built-in output none should actually occur)
  • While you’re in Audio Midi Setup, go through and make sure you’ve got the sample rates set uniformly for everything you’re using in the multi-output device.
  • You may want to restart the machine after you do this.  I have the sense that sometimes changes don’t “take” until the machine’s restarted, but that could be fantasy.

Interface setup in JK

  • Audio gear device setup in JK:
    • Use whatever inputs you need from your audio interface (in my case, it’s a MOTU)
    • Set outputs to “Blackhole 16ch” channels 1 and 2
  • Track/instrument setup in JK
    • Stereo track from MOTU Microbook ch 3 and 4 ( line in), labelled “Computer”
    • Mono track from MOTU Microbook ch 1 (mic), labelled “Voice”
  • If you screw up any part of this for any reason, save yourself some pain and just delete the whole gear setup and start over.

OBS Audio Setup

  • Settings window, Audio pane
    • Set sample rate to match interface (48K)
    • Set channels stereo
    • Under Devices:
      • Disable everything except Mic/Auxiliary Audio
      • Set it to Blackhole 16 ch
      • Set  monitoring to built-in output.  This is a convenience for testing.
  • In Scenes (main window)
    • Add an “existing audio input capture”
    • Set device to Mic/Aux

OBS Video setup

  • Add video window capture
  • Set to JamKazam video window
    • NOTE : if you’re running multiple workspaces/desktops, JK and OBS must be on the same one; if not, OBS won’t be able to find the JK window.
  • Getting video resolution/scaling right is a nuisance. This works for my setup and limited bandwidth
    • Set JK video window size by
      • Clicking on window
      • Select Webcam from top menu
      • Select “select capture settings”
      • Set to 640×360
    • Adjust OBS scaling, bandwidth and framerates
      • Open Settings
      • In Video tab
        • Set Base Canvas resolution to 1280×720
        • Set Output resolution to 640 x 360
        • Set framerate to 30
    • If OBS is complaining about overwhelming the encoder, see this for more suggestions: https://www.partitionwizard.com/partitionmagic/obs-encoding-overloaded.html

Adding streaming radio (or other video outlets)

Interestingly, the members of the electronic music community have different preferences for how they listen to (or watch) streaming events. It’s possible to extend this setup to send audio only to a streaming radio station by sending an analog signal to a second computer, either by splitting it off from whatever you’re using to monitor JamKazam (I use a small headphone distribution amp), or by cabling from the headphone jack on the Mac. I have tried using AudioHijack to send an icecast/shoutcast stream, and also LadioCast. Both worked initially, but then died after 45 minutes or so. I suspect conflicts or memory leaks.

I have not yet experimented with restream.io, which sends a stream to multiple audiovisual outlets, but if it works with OBS — and it does — there shouldn’t be any reason why it would not work with this as well.

X