How existentialaudio/blackhole works
Project type and purpose
• BlackHole is a system-level macOS virtual audio loopback driver.
• It implements a Core Audio HAL plugin (“driver”) that captures and routes audio between applications with zero added latency.
• The project includes source code (BlackHole/), tests (BlackHoleTests/), an Xcode project, installer/uninstaller scripts, and CI/CD packaging steps.
File structure
• Top-level:
– .github/: issue templates, funding
– BlackHole.xcodeproj/: Xcode project and workspace files
– BlackHoleTests/: C tests exerciser
– Installer/: scripts & HTML assets to create and sign the .pkg
– Uninstaller/: scripts to remove the installed driver
• Misc:
– Images/: documentation assets
– VERSION, CHANGELOG.md, README.md, LICENSE
README for additional insights
• Core Audio integration (no kernel extensions)
• Build targets for multiple channel versions, Intel/Apple Silicon
• Pre-compiler constants for customization (channel count, latency, sample rates, mirror device)
• CI/CD script (Installer/create_installer.sh) signs & notarizes
Main components
a. Development & Build
– Source Code (BlackHole.c + headers)
– Build System (Xcode & xcodebuild)
– Pre-compiler Definitions for customization
– BlackHoleTests harness
b. Packaging & Deployment
– Installer scripts → .pkg installer
– Uninstaller scripts → removal package
– Code signing & notarization (CI/CD)
c. Runtime / Host OS
– Core Audio HAL (the audio subsystem in macOS)
– BlackHole.driver bundle under /Library/Audio/Plug-Ins/HAL
– Hidden and mirrored audio devices created by the driver
d. External Applications
– Sending application (any DAW or system audio source)
– Receiving application (DAW, conferencing app, recording tool)
– Audio MIDI Setup / Sound Preferences (user interface)
Relationships and interactions
– Sending app → Core Audio HAL → BlackHole driver → mirrored device → Core Audio HAL → Receiving app
Architectural patterns and design principles
• Plugin architecture: HAL driver packaged as .driver bundle conforming to Core Audio interfaces
• Configurability via pre-compiler flags (compile-time customization)
• Separation of concerns:
– Code vs. packaging vs. testing vs. installer logic
– Driver logic vs. UI (handled externally via standard macOS tools)
• CI/CD automation for signing, notarization, and packaging