Skip to content

6. Compilation instructions

pkv edited this page Apr 21, 2021 · 1 revision

Outdated instructions ==> Juce library

The currently released plugin relies on Juce library. The instructions below are for bassasio. I'll only sketch the steps for now.

  • You'll have to compile a juce.lib file with asio support (use projucer and select asio; compile in VS2019).
  • Once it's done, clone this project and checkout to asio-juce branch.
  • Compile in obs-studio as a native plugin by copying the obs-asio src files into obs-studio/plugins directory (add the project to CMakeLists.txt).
  • You'll need to set JUCE_INCLUDE_DIR, JUCE_LIBRARY, JUCE_LIBRARY_DEBUG in cmake-gui for obs-studio.
  • compile obs-studio following instructions from obs-studio wiki.

How to compile and install the plugin (outdated)

There are four versions of the plugin, one built using RtAudio library which is free and open-source,
another relying on Bassasio library which is closed-source and free for non-commercial use;
another again one relying on Portaudio library which is free and open source. lastly, the most recent version relies on Juce library

  • RtAudio plugin: due to ASIO sdk limitations it is not possible to load more than one ASIO driver at a time.
    This means a single ASIO source can be created in OBS. Duplication of the source however is still possible.
  • Portaudio plugin (released): due to ASIO sdk limitations it is not possible to load more than one ASIO driver at a time.
    But several sources can be created with different channel selections.
  • Bassasio plugin: the Bassasio library is able to bypass the ASIO sdk limitations. As a result several ASIO devices can be used at the same time.
  • Juce plugin: this plugin has multi-device capability like the bassasio plugin.

Additionally, it is possible to create several ASIO sources from the same device with different channel selections (not duplicates).

Due to superior capabilities we advise the use of either the juce plugin or the bassasio plugin. The latter will require you to be able to compile and build the plugin for yourself.

Build instructions for bassasio plugin

Build instructions for the other versions of the plugin (portaudio, rtaudio and Juce) are similar).

Prerequisites:

  • Microsoft Visual Studio (tested on VS Community 2015 and 2017 but 2013 should work).
  • Qt : donwload from here
  • cmake-gui download here.
  • Download bassasio dll and lib from Bassasio website.
    (Be careful there are x86 and x64 versions of the dll and lib ; pick the versions according to your OBS Studio binary.)

Compilation of Asio Plugin.

Instructions for compiling the plugin as stand-alone.
  • Git clone this repo : https://github.com/pkviet/obs-asio/ : git clone https://github.com/pkviet/obs-asio/
  • In the obs-asio folder: git checkout asiobass . This will set obs-asio to the asiobass branch.
  • Git clone obs-studio: git clone https://github.com/obsproject/obs-studio/
  • Create a build folder in obs-studio folder; set the variables QTDIR and DepsPath as explained in the build instructions for obs-studio. Hit configure and generate with cmake-gui. Hit Open Project in cmake-gui. Compile obs-studio in RelWithDebInfo setting.
    • Actually only libobs needs to be compiled. So it is only necessary to compile the libobs project in Visual Studio.
    • For those who find it too difficult to compile obs-studio, the obs.dll and obs.lib files are provided in deps/libobs folder of obs-asio.
      • You still need to git clone obs-studio and to create a build subfolder; additionally create: obs-studio/build/libobs/RelWithDebInfo and copy there obs.lib found in obs-asio/deps/libobs.
  • Create a build folder in obs-asio folder
  • Open cmake-gui, choosing as build folder : obs-asio/build and main folder: obs-asio. cmake variables
  • Set the following vars in cmake-gui by clicking "Add Entry":
    • QTDIR (path) : location of the Qt environment suited for your compiler and architecture; for instance for me it is C:/Qt/5.10.1/msvc2017_64
    • LIBOBS_INCLUDE_DIR (path) : location of the libobs subfolder in the source code of OBS Studio; for instance for me it is C:/obs-studio/libobs
    • LIBOBS_LIB (filepath) : location of the obs.lib file; this is in the deps/libobs folder; for instance for me it is: C:/obs-studio/build/libobs/obs.lib
    • BASS_ASIO_INCLUDE_DIR (path): path to the folder where bassasio.h is located; for me it is for instance E:/Downloads/streaming/bassasio14/c
    • BASS_ASIO_LIB (filepath) : path to the folder where bassasio.lib is located. For instance: E:/Downloads/streaming/bassasio14/c/x64/bassasio.lib

cmake configure step settings

  • In cmake-gui, hit Configure, Generate and open Visual Studio.
  • Build in Visual Studio. (You'll want to select a RelWithDebInfo build.)
  • This will create obs-asio.dll in obs-asio\build\RelWithDebInfo; copy it with bassasio.dll in obs-studio Program folder: in "C:\Program Files\obs-studio\obs-plugins\64bit"
    (if you have compiled the 64 bit versions).
  • Lastly copy the en-US.ini file from obs-asio\src\data\locale to "C:\Program Files\obs-studio\data\obs-plugins\obs-asio\locale" (create the necessary folders and sub-folders if they don't exist).
Compile the plugin as well as OBS-Studio
  • git clone --recursive https://github.com/pkviet/obs-studio
  • In obs-studio folder, git checkout asiobass_master
  • Create a build folder in obs-studio folder.
  • Start cmake-gui, choosing as build folder : obs-studio/build and main folder: obs-studio.
  • As explained in OBS-Studio wiki here add DepsPath and QtDir paths.
  • Either drop bassasio.h in the folder $DepsPath/win64/include or $DepsPath/win32/include folder (given by DepsPath)
    • OR indicate BASS_ASIO_INCLUDE_DIR = path to the folder where bassasio.h is located.
  • Similarly drop bassasio.dll & bassasio.lib in $DepsPath/win64/bin or $DepsPath/win32/bin
    • OR provide BASS_ASIO_LIB = filepath to library bassasio.lib ; the bassasio.dll should be dropped in the folder mentioned above.
  • The rest is as explained in OBS-Studio wiki.

Usage

  • Once the plugin is installed, there will appear a new source: Asio Input. source
  • Create an Asio Input source; its Properties window opens up: props
  • Set the sample rate, bitdepth (sample size) and buffer size.
  • Make sure the settings you've just picked correspond to those set by the asio driver of your device. You can access your driver through the ASIO driver control panel button (see screenshot above).
  • In the Source Properties window, select the input channels of your asio device (Rearoute in the previous screenshot).
    • OBS Channel 1 is the first audio output channel, etc. For stereo there are obviously two output channels. For surround sound output, there will be more: ex for 7.1 surround there will be 8 entries from OBS channel 1 to OBS Channel 8.
    • The drop downs for OBS Channels 1-8 allow routing from input channels of the asio device to output channels of obs-studio.