hydra

Terminal replacement for Loopback — virtual audio devices and routing on macOS, from a ratatui TUI.
Log | Files | Refs | README | LICENSE

README.md (13441B)


      1 ![BlackHole: Audio Loopback Driver](Images/blackhole-banner-830px.png)
      2 
      3 # BlackHole: Audio Loopback Driver
      4 
      5 ![Platform: macOS](https://img.shields.io/badge/platform-macOS-lightgrey)
      6 [![Release](https://img.shields.io/github/v/release/ExistentialAudio/BlackHole)](https://github.com/ExistentialAudio/BlackHole/releases)
      7 [![License](https://img.shields.io/github/license/ExistentialAudio/BlackHole)](LICENSE)
      8 [![Twitter](https://img.shields.io/badge/Follow%20on%20Twitter-1da1f2)](https://twitter.com/ExistentialAI)
      9 [![Facebook](https://img.shields.io/badge/Like%20on%20Facebook-4267B2)](https://www.facebook.com/Existential-Audio-103423234434751)
     10 
     11 BlackHole is a modern macOS virtual audio loopback driver that allows applications to pass audio to other applications with zero additional latency.
     12 
     13 ### [Download Installer](https://existential.audio/blackhole) 
     14 
     15 ### [Join the Discord Server](https://discord.gg/y8BWfnWRnn)
     16 
     17 ## Funding
     18 
     19 Sponsor: https://github.com/sponsors/ExistentialAudio
     20 
     21 ## Table of Contents
     22 
     23 - [Features](#features)
     24 - [Installation Instructions](#installation-instructions)
     25 - [Uninstallation Instructions](#uninstallation-instructions)
     26 - [User Guides](#user-guides)
     27 - [Developer Guides](#developer-guides)
     28 - [Feature Requests](#feature-requests)
     29 - [FAQ](#faq)
     30 - [Wiki](https://github.com/ExistentialAudio/BlackHole/wiki)
     31 
     32 ## Features
     33 
     34 - Builds 2, 16, 64, 128, and 256 audio channels versions
     35 - Customizable channel count, latency, hidden devices
     36 - Customizable mirror device to allow for a hidden input or output
     37 - Supports 8kHz, 16kHz, 44.1kHz, 48kHz, 88.2kHz, 96kHz, 176.4kHz, 192kHz, 352.8kHz, 384kHz, 705.6kHz and 768kHz sample rates
     38 - Zero additional driver latency
     39 - Compatible with macOS 10.10 Yosemite and newer
     40 - Builds for Intel and Apple Silicon
     41 - No kernel extensions or modifications to system security necessary
     42 
     43 ![Audio MIDI Setup](Images/audio-midi-setup.png)
     44 
     45 ## Installation Instructions
     46 
     47 ### Option 1: Download Installer
     48 
     49 1. [Download the latest installer](https://existential.audio/blackhole)
     50 2. Close all running audio applications
     51 3. Open and install package
     52 
     53 ### Option 2: Install via Homebrew
     54 
     55 - 2ch: `brew install blackhole-2ch`
     56 - 16ch: `brew install blackhole-16ch`
     57 - 64ch: `brew install blackhole-64ch`
     58 
     59 ## Uninstallation Instructions
     60 
     61 ### Option 1: Use Uninstaller
     62 
     63 - [Download BlackHole 2ch Uninstaller](https://existential.audio/downloads/BlackHole2chUninstaller.pkg)
     64 - [Download BlackHole 16ch Uninstaller](https://existential.audio/downloads/BlackHole16chUninstaller.pkg)
     65 - [Download BlackHole 64ch Uninstaller](https://existential.audio/downloads/BlackHole64chUninstaller.pkg)
     66 
     67 ### Option 2: Manually Uninstall
     68 
     69 1. Delete the BlackHole driver with the terminal command:
     70    
     71     `rm -R /Library/Audio/Plug-Ins/HAL/BlackHoleXch.driver` 
     72    
     73    Be sure to replace `X` with either `2`, `16`, or `64`.
     74    
     75    Note that the directory is the root `/Library` not `/Users/user/Library`.
     76 
     77 2. Restart CoreAudio with the terminal command:
     78 
     79     `sudo killall -9 coreaudiod`
     80 
     81 For more specific details [visit the Wiki](https://github.com/ExistentialAudio/BlackHole/wiki/Uninstallation).
     82 
     83 ## User Guides
     84 
     85 ### Logic Pro X
     86 
     87 - [Logic Pro X to FaceTime](https://existential.audio/howto/StreamFromLogicProXtoFaceTime.php)
     88 - [Logic Pro X to Google Meet](https://existential.audio/howto/StreamFromLogicProXtoGoogleMeet.php)
     89 - [Logic Pro X to Skype](https://existential.audio/howto/StreamFromLogicProXtoSkype.php)
     90 - [Logic Pro X to Zoom](https://existential.audio/howto/StreamFromLogicProXtoZoom.php)
     91 
     92 ### GarageBand
     93 
     94 - [GarageBand to FaceTime](https://existential.audio/howto/StreamFromGarageBandToFaceTime.php)
     95 - [GarageBand to Google Meet](https://existential.audio/howto/StreamFromGarageBandToGoogleMeet.php)
     96 - [GarageBand to Skype](https://existential.audio/howto/StreamFromGarageBandToSkype.php)
     97 - [GarageBand to Zoom](https://existential.audio/howto/StreamFromGarageBandToZoom.php)
     98 
     99 ### Reaper
    100 
    101 - [Reaper to Zoom](https://noahliebman.net/2020/12/telephone-colophon-or-how-i-overengineered-my-call-audio/) by Noah Liebman
    102 
    103 ### Record System Audio
    104 
    105 1. [Setup Multi-Output Device](https://github.com/ExistentialAudio/BlackHole/wiki/Multi-Output-Device)
    106 2. In `Audio MIDI Setup` → `Audio Devices` right-click on the newly created Multi-Output and select "Use This Device For Sound Output"
    107 3. Open digital audio workstation (DAW) such as GarageBand and set input device to "BlackHole" 
    108 4. Set track to input from channel 1-2
    109 5. Play audio from another application and monitor or record in your DAW
    110 
    111 ### Route Audio Between Applications
    112 
    113 1. Set output driver to "BlackHole" in sending application
    114 2. Output audio to any channel
    115 3. Open receiving application and set input device to "BlackHole" 
    116 4. Input audio from the corresponding output channels
    117 
    118 ## Developer Guides
    119 
    120 ### A license is required for all non-GPLv3 projects
    121 Please support our hard work and continued development. To request a license [contact Existential Audio](mailto:devinroth@existential.audio).
    122 
    123 ### Build & Install
    124 After building, to install BlackHole:
    125 
    126 1. Copy or move the built `BlackHoleXch.driver` bundle to `/Library/Audio/Plug-Ins/HAL`
    127 2. Restart CoreAudio using `sudo killall -9 coreaudiod`
    128 
    129 ### Customizing BlackHole
    130 
    131 The following pre-compiler constants may be used to easily customize a build of BlackHole.
    132 
    133 ```
    134 kDriver_Name
    135 kPlugIn_BundleID
    136 kPlugIn_Icon
    137 
    138 kDevice_Name
    139 kDevice_IsHidden
    140 kDevice_HasInput
    141 kDevice_HasOutput
    142 
    143 kDevice2_Name
    144 kDevice2_IsHidden
    145 kDevice2_HasInput
    146 kDevice2_HasOutput
    147 
    148 kLatency_Frame_Size
    149 kNumber_Of_Channels
    150 kSampleRates
    151 ```
    152 
    153 They can be specified at build time with `xcodebuild` using `GCC_PREPROCESSOR_DEFINITIONS`. 
    154 
    155 Example:
    156 
    157 ```bash
    158 xcodebuild \
    159   -project BlackHole.xcodeproj \
    160   GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS kSomeConstant=value'
    161 ```
    162 
    163 Be sure to escape any quotation marks when using strings. 
    164 
    165 ### Renaming BlackHole
    166 
    167 To customize BlackHole it is required to change the following constants. 
    168 - `kDriver_Name`
    169 - `kPlugIn_BundleID` (note that this must match the target bundleID)
    170 - `kPlugIn_Icon`
    171 
    172 These can specified as pre-compiler constants using ```xcodebuild```.
    173 
    174 ```bash
    175 driverName="BlackHole"
    176 bundleID="audio.existential.BlackHole"
    177 icon="BlackHole.icns"
    178 
    179 xcodebuild \
    180   -project BlackHole.xcodeproj \
    181   -configuration Release \
    182   PRODUCT_BUNDLE_IDENTIFIER=$bundleID \
    183   GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS
    184   kDriver_Name=\"'$driverName'\"
    185   kPlugIn_BundleID=\"'$bundleID'\"
    186   kPlugIn_Icon=\"'$icon'\"'
    187 ```
    188 
    189 ### Customizing Channels, Latency, and Sample Rates
    190 
    191 `kNumber_Of_Channels` is used to set the number of channels. Be careful when specifying high channel counts. Although BlackHole is designed to be extremely efficient at higher channel counts it's possible that your computer might not be able to keep up. Sample rates play a roll as well. Don't use high sample rates with a high number of channels. Some applications don't know how to handle high channel counts. Proceed with caution.
    192 
    193 `kLatency_Frame_Size` is how much time in frames that the driver has to process incoming and outgoing audio. It can be used to delay the audio inside of BlackHole up to a maximum of 65536 frames. This may be helpful if using BlackHole with a high channel count. 
    194 
    195 `kSampleRates` set the sample rate or sample rates of the audio device. If using multiple sample rates separate each with a comma (`,`). For example: `kSampleRates='44100,48000'`.
    196 
    197 ### Mirror Device
    198 
    199 By default BlackHole has a hidden mirrored audio device. The devices may be customized using the following constants. 
    200 
    201 ```
    202 // Original Device
    203 kDevice_IsHidden
    204 kDevice_HasInput
    205 kDevice_HasOutput
    206 
    207 // Mirrored Device
    208 kDevice2_IsHidden
    209 kDevice2_HasInput
    210 kDevice2_HasOutput
    211 ```
    212 
    213 When all are set to true a 2nd BlackHole will show up that works exactly the same. The inputs and outputs are mirrored so the outputs from both devices go to the inputs of both devices.
    214 
    215 This is useful if you need a separate device for input and output.
    216 
    217 Example
    218 
    219 ```
    220 // Original Device
    221 kDevice_IsHidden=false
    222 kDevice_HasInput=true
    223 kDevice_HasOutput=false
    224 
    225 // Mirrored Device
    226 kDevice2_IsHidden=false
    227 kDevice2_HasInput=false
    228 kDevice2_HasOutput=true
    229 ```
    230 
    231 In this situation we have two BlackHole devices. One will have inputs only and the other will have outputs only.
    232 
    233 One way to use this in projects is to hide the mirrored device and use it behind the scenes. That way the user will see an input only device while routing audio through to the output behind them scenes. 
    234 
    235 Hidden audio devices can be accessed using `kAudioHardwarePropertyTranslateUIDToDevice`.
    236 
    237 ### Continuous Integration / Continuous Deployment
    238 
    239 BlackHole can be integrated into your CI/CD. Take a look at the [create_installer.sh](https://github.com/ExistentialAudio/BlackHole/blob/master/Installer/create_installer.sh) shell script to see how the installer is built, signed and notarized.
    240 
    241 ## Feature Requests
    242 
    243 If you are interested in any of the following features please leave a comment in the linked issue. To request a features not listed please create a new issue.
    244 
    245 - [Sync Clock with other Audio Devices](https://github.com/ExistentialAudio/BlackHole/issues/27) in development see v0.3.0
    246 - [Output Blackhole to other Audio Device](https://github.com/ExistentialAudio/BlackHole/issues/40)
    247 - [Add Support for AU Plug-ins](https://github.com/ExistentialAudio/BlackHole/issues/18)
    248 - [Inter-channel routing](https://github.com/ExistentialAudio/BlackHole/issues/13)
    249 - [Record Directly to File](https://github.com/ExistentialAudio/BlackHole/issues/8)
    250 - [Configuration Options Menu](https://github.com/ExistentialAudio/BlackHole/issues/7)
    251 - [Support for Additional Bit Depths](https://github.com/ExistentialAudio/BlackHole/issues/42)
    252 
    253 ## FAQ
    254 
    255 ### Why isn't BlackHole showing up in the Applications folder?
    256 
    257 BlackHole is a virtual audio loopback driver. It only shows up in `Audio MIDI Setup`, `Sound Preferences`, or other audio applications.
    258 
    259 ### How can I listen to the audio and use BlackHole at the same time?
    260 
    261 See [Setup a Multi-Output Device](https://github.com/ExistentialAudio/BlackHole/wiki/Multi-Output-Device).
    262 
    263 ### What bit depth does BlackHole use, and can I change it?
    264 
    265 BlackHole uses 32-bit float bit depth since macOS Core Audio natively uses 32-bit at the system level. This provides the broadest compatibility and greatest audio headroom.
    266 
    267 This format is lossless for up to 24-bit integer. All applications should be able to playback and record audio, and do not require adjusting bit depth at the BlackHole driver level.
    268 
    269 ### How can I change the volume of a Multi-Output device?
    270 
    271 Unfortunately macOS does not support changing the volume of a Multi-Output device but you can set the volume of individual devices in Audio MIDI Setup. 
    272 
    273 ### Why is nothing playing through BlackHole? 
    274 
    275 - Check `System Preferences` → `Security & Privacy` → `Privacy` → `Microphone` to make sure your digital audio workstation (DAW) application has microphone access. 
    276 
    277 - Check that the volume is all the way up on BlackHole input and output in ``Audio MIDI Setup``.
    278 
    279 - If you are using a multi-output device, due to issues with macOS the Built-in Output must be enabled and listed as the top device in the Multi-Output. [See here for details](https://github.com/ExistentialAudio/BlackHole/wiki/Multi-Output-Device#4-select-output-devices).
    280 
    281 ### Why is audio glitching after X minutes when using a multi-output or an aggregate?
    282 
    283 - You need to enable drift correction for all devices except the Clock Source also known as Master Device or Primary Device.
    284 
    285 ### Why is the Installer failing?
    286 
    287 - Certain versions of macOS have a known issue where install packages may fail to install when the install package is located in certain folders. If you downloaded the .pkg file to your Downloads folder, try moving it to the Desktop and open the .pkg again (or vice-versa).
    288 
    289 ### What Apps Don't Work with Multi-Outputs?
    290 
    291 Unfortunately multi-outputs can be buggy and some apps won't work with them at all. Here is a list of known ones. If additional incompatible applications are found, please report them by opening an [issue](https://github.com/ExistentialAudio/BlackHole/issues).
    292 
    293 - Apple Podcasts
    294 - Apple Messages
    295 - HDHomeRun
    296 
    297 ### AirPods with an Aggregate/Multi-Output is not working.
    298 
    299 The microphone from AirPods runs at a lower sample rate which means it should not be used as the primary/clock device in an Aggregate or Multi-Output device. The solution is to use your built-in speakers (and just mute them) or BlackHole 2ch as the primary/clock device. BlackHole 16ch will not work as the primary since the primary needs to have 2ch. 
    300 
    301 Read [this discussion](https://github.com/ExistentialAudio/BlackHole/issues/146) for more details.
    302 
    303 ### Can I integrate BlackHole into my app?
    304 
    305 BlackHole is licensed under GPL-3.0. You can use BlackHole as long as your app is also licensed as GPL-3.0. For all other applications please [contact Existential Audio directly](mailto:devinroth@existential.audio).
    306 
    307 ## Links and Resources
    308 ### [MultiSoundChanger](https://github.com/rlxone/MultiSoundChanger)
    309 A small tool for changing sound volume even for aggregate devices cause native sound volume controller can't change volume of aggregate devices
    310 ### [BackgroundMusic](https://github.com/kyleneideck/BackgroundMusic)
    311 Background Music, a macOS audio utility: automatically pause your music, set individual apps' volumes and record system audio.
    312