potato/README.md
2026-01-27 15:24:29 -07:00

114 lines
2.7 KiB
Markdown

# Potato Audio Router
A high-performance, PipeWire-native audio routing application built with Qt6 and C++.
## Current Status: Milestone 1 - Core PipeWire Integration
### Completed Features
- ✅ Qt6 + CMake project structure
- ✅ PipeWire integration with `pw_thread_loop`
- ✅ Node and port discovery via registry callbacks
- ✅ Link creation and destruction
- ✅ Lock-free communication (atomics)
- ✅ CLI test application
### Requirements
**Build Dependencies:**
- CMake >= 3.16
- Qt6 >= 6.2 (Core, Widgets)
- libpipewire >= 1.0.0
- libspa >= 0.2
- pkg-config
- C++17 compiler (GCC 9+, Clang 10+)
**Runtime Dependencies:**
- PipeWire service running
### Building
```bash
# Install dependencies (Fedora/RHEL)
sudo dnf install qt6-qtbase-devel pipewire-devel cmake gcc-c++ pkg-config
# Install dependencies (Ubuntu/Debian)
sudo apt install qt6-base-dev libpipewire-0.3-dev cmake build-essential pkg-config
# Install dependencies (Arch)
sudo pacman -S qt6-base pipewire cmake gcc pkg-config
# Build
mkdir build
cd build
cmake ..
make
# Run test
./potato-test
```
### Testing
The CLI test application (`potato-test`) will:
1. Connect to PipeWire
2. List all discovered nodes
3. Attempt to create a link between a source and sink
4. Delete the link
5. Print a graph dump
```bash
# Make sure PipeWire is running
systemctl --user status pipewire
# Run the test
./build/potato-test
```
Expected output:
```
=== Potato Audio Router - PipeWire Integration Test ===
Version: 1.0.0
Initializing PipeWire...
PipeWire initialized successfully
Waiting for nodes to be discovered...
=== Running PipeWire Tests ===
Test 1: List all nodes
Found X nodes:
[42] alsa_output.pci-0000_00_1f.3.analog-stereo
Type: Hardware | Class: Sink
...
```
### Architecture
```
potato-audio-router/
├── CMakeLists.txt
├── src/
│ ├── pipewire/
│ │ ├── pipewirecontroller.{h,cpp} # Main PipeWire integration
│ │ ├── nodeinfo.{h,cpp} # Data structures
│ │ ├── portinfo.{h,cpp} # Port information
│ └── main_test.cpp # CLI test application
└── build/ # Build artifacts
```
**Key Components:**
- `PipeWireController`: Main class managing PipeWire connection
- Uses `pw_thread_loop` for non-blocking operation
- Registry callbacks for node/port/link discovery
- Thread-safe with QMutex for shared state
- Qt signals/slots for event notification
### Next Steps (Milestone 2)
- [ ] Integrate QtNodes library for visual graph editing
- [ ] Create GUI application skeleton
- [ ] Map PipeWire nodes to visual nodes
- [ ] Implement drag-and-drop connections
### License
TBD