A modern C++ application (potentially evolving into a daemon) for interfacing with FireWire (IEEE 1394) audio devices on macOS, providing low-level device discovery, control, and configuration capabilities.
This project implements a FireWire audio device daemon that handles:
- Device discovery and hot-plugging
- AV/C (Audio/Video Control) command interface
- Music and Audio subunit control
- Device Discovery: Automatic detection and monitoring of FireWire audio devices
- Command Interface: Implementation of AV/C command protocol
- Isochronous input/output plugs
- External input/output plugs
- Music subunit plugs
- Audio subunit plugs
- Stream format discovery
- RAII principles
- Smart pointers
- STL containers
- Error handling with
std::expected - Thread-safe operations
- XCode 15 or later
- CMake 3.21 or later
- Modern C++ compiler with C++23 support
- spdlog (v1.13.0) - Modern C++ logging
- Catch2 (v3.5.2) - Testing framework
- IOKit framework
- CoreFoundation framework
I recommend create a XCode project using cmake:
mkdir build && cd build
cmake -G Xcode ..
open FireWireAudioDaemon.xcodeprojThe application is built around several key components:
- Handles device arrival/removal
- Manages device lifecycle
- Provides device enumeration
- High-level device management
- Command routing
- State management
- AV/C command implementation
- Low-level device communication
- Error handling
- Capability discovery
- Format parsing
- Plug configuration
The primary goal is to restore FireWire audio functionality on modern macOS versions by implementing isochronous audio stream handling. Since Apple removed AppleFWAudio.kext from the latest versions of their operating systems, and older devices rely on a specific set of standards, restoring FireWire audio functionality is a feasible task. Currently, I am implementing device handling and planning to add isochronous stream support. I have successfully sent audio to and from a device as a proof of concept, but before advancing further, I need a proper tool to handle device controls effectively.
Contributions are highly encouraged! If you're interested, please submit issues and pull requests to help improve and develop the project further.
This project uses clang-format for consistent code formatting. A .clang-format file is provided in the root directory that defines the project's coding style.
This project requires clang-format version 16.0.0 or later. A script is provided to install the correct version:
# Check if the correct version is installed
./tools/install-clang-format.sh --check-only
# Install the correct version if needed
./tools/install-clang-format.shThe script will detect your operating system and install clang-format using the appropriate package manager (Homebrew for macOS, apt/dnf/pacman for Linux).
The project includes CMake targets for code formatting:
# Format all source files
cmake --build build --target format
# Check if all source files are formatted correctly
cmake --build build --target format-check
# Install the required clang-format version
cmake --build build --target install-clang-formatThese targets are available after configuring the project with CMake.
VSCode
- The project's
.vscode/settings.jsonis already configured to use clang-format - Use the extension of your choice (c/c++ extension or clang-format extension) to format your code on save Xcode
- Install ClangFormat-Xcode
- Configure it to use the project's
.clang-formatfile
A Git pre-commit hook is included that automatically formats your code before committing. The hook:
- Runs clang-format on all staged C/C++/Objective-C files
- Re-stages the formatted files
- Allows you to bypass the hook with
git commit --no-verifyif needed
To enable the hook, make sure it's executable:
chmod +x .git/hooks/pre-commitThis project is licensed under the MIT License.
PVS-Studio - static analyzer for C, C++, C#, and Java code.
- Based on Apple's IOKit FireWire Family framework architecture
- Inspired by AVCVideoServices sample code (found in the FireWire SDK)