![]() - Fix RNNoise configuration: use mono instead of stereo, increase VAD threshold to 95% - Adjust quantum settings: increase min-quantum to 64 for stability - Add comprehensive voice distortion troubleshoot script - Create optional disable-auto-rnnoise.nix for problematic setups - The automatic RNNoise filter can cause artifacts, script helps diagnose and fix |
||
---|---|---|
.. | ||
audio-desktop-integration.nix | ||
disable-auto-rnnoise.nix | ||
easyeffects-presets.nix | ||
pipewire.nix | ||
README.md | ||
troubleshoot-voice-distortion.sh | ||
validate-audio.sh |
PipeWire with WirePlumber Configuration
This module provides a comprehensive PipeWire setup with WirePlumber session management, noise suppression, and GUI tools for audio management.
Features
Core Audio Stack
- PipeWire: Modern audio server with low latency
- WirePlumber: Session manager for device management and routing
- ALSA/PulseAudio/JACK Compatibility: Works with all major audio APIs
- Real-time Processing: RTKit integration for optimal performance
Noise Suppression
- RNNoise Plugin: AI-powered noise suppression for microphones
- EasyEffects Integration: GUI for managing audio effects
- Automatic Filter Chain: Pre-configured noise suppression pipeline
GUI Applications Included
- EasyEffects: Modern audio effects processor with noise suppression
- PulseAudio Volume Control (pavucontrol): Volume and device management
- Helvum: Graphical PipeWire patchbay for routing
- qpwgraph: Qt-based PipeWire graph manager
- pwvucontrol: Native PipeWire volume control
Quick Start
1. Import the Module
Add to your NixOS configuration:
imports = [
./modules/sound/pipewire.nix
];
2. Rebuild System
sudo nixos-rebuild switch
3. Verify Installation
# Check if PipeWire is running
systemctl --user status pipewire
# Launch the audio setup helper
audio-setup
# Test microphone with noise suppression
microphone-test
Using Noise Suppression
Method 1: EasyEffects (Recommended)
- Launch EasyEffects:
easyeffects
or use the application menu - Go to the "Input" tab
- Load the pre-configured "Microphone_Noise_Suppression" preset
- Enable the RNNoise effect
- Adjust the "VAD Threshold" (Voice Activity Detection) as needed
Method 2: PipeWire Filter Chain (Automatic)
The configuration includes an automatic RNNoise filter chain that creates a "Noise Canceling Source" device. This appears as a separate microphone input in audio applications.
GUI Applications Usage
EasyEffects
- Purpose: Real-time audio effects and noise suppression
- Launch:
easyeffects
or from application menu - Features: RNNoise, equalizer, compressor, limiter, gate
- Auto-start: Configured to start with desktop session
Volume Controls
- pavucontrol: Traditional PulseAudio-style interface
- pwvucontrol: Native PipeWire interface
- Usage: Control volumes, switch devices, manage streams
Audio Routing
- Helvum: Visual patchbay for connecting audio streams
- qpwgraph: Advanced graph-based routing interface
- Usage: Route audio between applications and devices
Command-Line Tools
System Status
# PipeWire status overview
wpctl status
# Real-time monitoring
pw-top
# Inspect audio objects
pw-dump | jq '.'
# Show metadata
pw-metadata
Device Management
# List devices
wpctl status
# Set default sink
wpctl set-default SINK_ID
# Set volume
wpctl set-volume SOURCE_ID 80%
# Mute/unmute
wpctl set-mute SOURCE_ID toggle
Testing
# Test microphone
microphone-test
# Record and playback test
arecord -d 5 -f cd test.wav && aplay test.wav
Configuration Details
Audio Quality Settings
- Sample Rate: 48kHz (professional audio standard)
- Buffer Size: 1024 samples (balanced latency/stability)
- Resampling Quality: High (level 4)
- Channels: Stereo support with spatial audio capabilities
Noise Suppression Settings
- RNNoise VAD Threshold: 50% (adjustable)
- VAD Grace Period: 200ms
- Noise Reduction: 80% wet signal
- Processing: Real-time with minimal latency
Performance Optimizations
- Real-time Scheduling: RTKit enabled
- Memory Locking: Enabled for critical processes
- CPU Affinity: Configurable per audio thread
- Quantum Settings: Optimized for low latency
Troubleshooting
Common Issues
No Audio Output
# Check PipeWire is running
systemctl --user restart pipewire pipewire-pulse wireplumber
# Check default devices
wpctl status
Microphone Not Working
# Test microphone detection
arecord -l
# Check permissions
groups $USER | grep audio
High CPU Usage
# Monitor PipeWire performance
pw-top
# Check buffer settings
pw-metadata | grep quantum
Noise Suppression Not Working
- Verify RNNoise plugin is loaded:
ladspa-ls | grep -i noise
- Check EasyEffects preset is loaded
- Ensure correct input device is selected
- Adjust VAD threshold in EasyEffects
Reset Configuration
# Reset user PipeWire configuration
rm -rf ~/.config/pipewire ~/.config/easyeffects
systemctl --user restart pipewire pipewire-pulse wireplumber
Advanced Configuration
Custom Filter Chains
Edit /etc/pipewire/pipewire.conf.d/10-noise-suppression.conf
to modify the RNNoise filter chain parameters.
Device-Specific Settings
Add rules to /etc/wireplumber/wireplumber.conf.d/51-noise-suppression.conf
for specific audio devices.
EasyEffects Presets
Custom presets are stored in /etc/easyeffects/
and can be modified or extended.
Integration with Applications
Discord/Zoom/Teams
- Set default microphone to "Noise Canceling Source" in application settings
- Or use EasyEffects on the regular microphone input
- Adjust noise gate and compressor settings as needed
OBS Studio
- Add "Application Audio Capture" source
- Select the noise-suppressed microphone device
- Or use OBS's built-in noise suppression with the processed audio
Music Production (JACK)
# Start JACK mode if needed
pw-jack your-daw-application
Updates and Maintenance
Updating Configuration
After modifying the Nix configuration:
sudo nixos-rebuild switch
systemctl --user restart pipewire pipewire-pulse wireplumber
Monitoring Performance
Regular checks recommended:
# Weekly performance check
pw-top
# Monthly configuration review
audio-setup