Skip to content

xi-Rick/dualaudio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

🎧 DualAudio - Multi-Output Audio Script

Transform your Linux desktop into a professional multi-output audio setup in seconds!

Play the same audio through multiple devices simultaneously – perfect for streaming, presentations, multi-speaker systems, or sending sound to both headphones and HDMI outputs at once.


🌟 Why DualAudio?

This isn't just another audio script – it's your personal audio engineer that creates rock-solid, persistent multi-output configurations across any modern Linux distribution. Whether you're running Arch, Fedora, Ubuntu, or Alpine, this script delivers a perfectly configured dual audio setup.

  • 🎯 Universal Linux Support: Works on 10+ Linux distributions and families
  • 🔄 Persistent Configuration: Survives reboots with automatic recovery
  • 🛠️ Interactive Selection: Choose exactly which devices to combine
  • 📊 Smart Monitoring: Auto-detects and recovers from device changes
  • Zero Hassle: Safe backups, colorful logging, and error recovery
  • 🔧 SystemD Integration: Optional auto-start monitoring service

🚀 Quick Start

# Download the script
curl -O https://raw.githubusercontent.com/xi-Rick/dualaudio/main/dualaudio.sh
chmod +x dualaudio.sh

# Run with defaults (recommended)
./dualaudio.sh

That's it! Your multi-output audio is configured and ready to use.


🖥️ Supported Distributions


Arch Linux
Pure rolling release

EndeavourOS
User-friendly Arch

Manjaro
Stable releases

CachyOS
Performance-first

Fedora
Cutting-edge (43+)

Debian
Rock-solid stable

Ubuntu
Popular choice

openSUSE
Enterprise-ready

RHEL / CentOS / AlmaLinux / Rocky
Enterprise Linux family

Alpine Linux
Lightweight

Gentoo
Source-based power

Plus any distribution with PipeWire or PulseAudio (pactl-compatible)


📖 Usage Guide

Basic Commands

# Quick setup with defaults (recommended for first-time setup)
./dualaudio.sh

# Interactive mode 
./dualaudio.sh --interactive

# Custom sink name
./dualaudio.sh --sink-name MyAudioMix

# Test your audio after setup
./dualaudio.sh --interactive --test-audio

# Enable volume normalization
./dualaudio.sh --volume-normalize

Advanced Options

# Monitor device changes in real-time
./dualaudio.sh --monitor

# Install as a systemd user service
./dualaudio.sh --install-service

# Reset everything and restore defaults
./dualaudio.sh --reset

# Check for script updates
./dualaudio.sh --check-updates

# Custom config directory
./dualaudio.sh --config-dir ~/.config/custom-audio

All Options

Option Description
--interactive Choose specific sinks to combine
--sink-name NAME Custom name for combined sink (default: DualAudio)
--config-dir DIR Custom config directory
--monitor Monitor and auto-recover device changes
--install-service Install systemd monitoring service
--reset Remove combined sink and restore defaults
--test-audio Play test sound after setup
--volume-normalize Enable volume normalization
--check-updates Check for script updates
--help Show help information
--version Show version information

🎯 Real-World Use Cases

🎙️ Streaming Setup

./dualaudio.sh --interactive --volume-normalize
# Select: Headphones + Virtual Audio Cable for OBS

Perfect for streamers who need to monitor audio while capturing to streaming software.

🏢 Presentation Mode

./dualaudio.sh --interactive
# Select: Laptop Speakers + HDMI Projector

Present with confidence – audio plays through both your laptop and the projector.

🎬 Home Theater

./dualaudio.sh --interactive --test-audio
# Select: USB DAC + Bluetooth Speakers

Create a surround-sound-like experience with multiple speaker systems.

🎮 Gaming + Recording

./dualaudio.sh --interactive --monitor --install-service
# Select: Gaming Headset + Virtual Audio for Recording

Game with high-quality audio while recording to a separate device.


⚙️ How It Works

DualAudio leverages the power of PipeWire's (or PulseAudio's) module-combine-sink to create a virtual audio device that mirrors output to multiple physical devices.

┌─────────────────┐
│  Audio Source   │
│ (Music, Games)  │
└────────┬────────┘
         │
         ▼
┌─────────────────┐
│  DualAudio Sink │
│  (Virtual Dev)  │
└────┬────────┬───┘
     │        │
     ▼        ▼
┌─────────┐ ┌──────────┐
│Headphone│ │  HDMI    │
│         │ │  Output  │
└─────────┘ └──────────┘

Key behaviors:

  • Creates a persistent combined sink configuration
  • Sets the combined sink as your default audio output
  • Monitors device changes and auto-recreates if needed
  • Works with both PipeWire and PulseAudio backends
  • Safely backs up existing configurations

🛠️ Installation Requirements

Core Requirements

  • PipeWire (preferred) or PulseAudio (with pactl)
  • pactl command (from pipewire-pulse or pulseaudio-utils)
  • systemctl (for service management, optional)

Optional Tools

  • jq - For robust JSON parsing
  • curl - For update checking
  • paplay/aplay/speaker-test - For audio testing

Distribution-Specific Installation

🔷 Arch / Manjaro / EndeavourOS / CachyOS
sudo pacman -S pipewire pipewire-pulse wireplumber pulseaudio-utils pavucontrol jq
🔷 Fedora / RHEL / CentOS / AlmaLinux / Rocky
sudo dnf install pipewire pipewire-pulse wireplumber pulseaudio-utils pavucontrol jq
🔷 Debian / Ubuntu / Pop!_OS / Linux Mint
sudo apt update
sudo apt install pipewire pipewire-pulse wireplumber pulseaudio-utils pavucontrol jq
🔷 openSUSE / SLES
sudo zypper install pipewire pipewire-pulse wireplumber pulseaudio-utils pavucontrol jq
🔷 Alpine Linux
sudo apk add pipewire pipewire-pulse wireplumber alsa-utils pulseaudio-utils pavucontrol jq
🔷 Gentoo
sudo emerge --ask media-video/pipewire media-sound/pulseaudio pulseaudio-utils pavucontrol app-arch/jq

🤝 Contributing

Contributions are welcome! Here's how you can help:


📚 Resources & Documentation

Official Documentation

Community Support

Related Projects


📜 License

This project is open source and available under the MIT License.


⭐ Show Your Support

If DualAudio helped you create the perfect multi-output audio setup:

  • ⭐ Star this repository
  • 🐛 Report bugs and suggest features
  • 🔀 Fork and contribute improvements
  • 📣 Share with the Linux audio community

🎧 Ready to Experience Multi-Output Audio Paradise? 🎧

curl -O https://raw.githubusercontent.com/xi-Rick/dualaudio/main/dualaudio.sh
chmod +x dualaudio.sh
./dualaudio.sh

Transform your Linux audio setup today!


Made with 🎵 for the Linux audio community

About

Play the same audio through multiple devices simultaneously – perfect for streaming, presentations, multi-speaker systems, or sending sound to both headphones and HDMI outputs at once.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages