hAudio: two computers, one headset and a Raspberry Pi in between

Summary

hAudio is an audio system for the Raspberry Pi that mixes the sound of two computers onto a wireless headset and routes the headset microphone to computer 1, computer 2, both or neither. It is controlled through a web interface with sliders, presets, recording and a soundboard, while the signal paths themselves run permanently in PipeWire, even without an open browser. This post shows the setup, technology and limits of version 0.04 and how to build it yourself.

Two computers, one headset

Two computers work on the desk, and a wireless headset with its own radio dongle sits on my head. Normally such a dongle is plugged into exactly one computer. If you want to hear the other one or take a call there, you replug or switch headsets.

hAudio solves this with a Raspberry Pi in the middle. Both computers send their sound to the Pi, which mixes it and passes it on to the headset. The microphone takes the opposite path, and for each computer you decide individually whether it hears it. One computer can run a meeting while the other plays music, and the microphone only reaches the one where you are talking.

PC1 -> USB audio adapter A ----+
                               +-> PipeWire mix -> USB headset adapter -> headset
PC2 -> USB audio adapter B ----+

Headset microphone -> USB headset adapter -> PipeWire -> PC1 and/or PC2

The hardware

You need a Raspberry Pi with Raspberry Pi OS or Debian, two simple USB audio adapters (affiliate link: if you buy something, I get a small commission and the price does not change for you), jack cables (affiliate link) and the headset’s adapter. My hAudio runs on a Raspberry Pi 3 B, which is enough for two stereo paths, recording and the web interface. Each computer is connected to its adapter on the Pi with jack cables: the computer’s sound goes into the adapter’s input, the microphone signal comes back from its output. To the computer this looks like an ordinary headset on the jack socket.

Brand and model of the adapters do not matter; hAudio finds the connected devices itself. In my setup, the 2.4 GHz dongle of a Razer Barracuda X is plugged into the Pi. Since version 0.04 an adapter no longer has to support both directions: an output-only device such as a radio dongle without microphone or a USB DAC can be assigned as the headset; hAudio then routes only the available direction and shows the microphone as NOT AVAILABLE. This came from issue #1 on GitHub.

PipeWire does the work

hAudio does not process any audio itself. The signal paths are loopbacks in PipeWire, the audio server that has replaced PulseAudio on many current Linux systems. hAudio’s Python program creates these connections, monitors them and repairs them when a device disappears. The browser only carries control commands and status values: if it is closed or reloaded, the sound simply continues, and even a restart of the program leaves intact connections in place.

For this to work reliably, PipeWire, WirePlumber and hAudio run under a dedicated system user haudio in the same systemd user session. With loginctl enable-linger this session starts at boot, even if nobody logs in. Running PipeWire as root or putting the program in a different session creates two separate audio worlds that cannot see each other.

The bundled PipeWire configuration sets 48 kHz and a block size (quantum) of 2048 samples, about 43 ms per block. That is unobtrusive for speech and music and gives headroom against dropouts on marginal USB hardware. If you want less delay, you can reduce the quantum, but should then test every path individually.

The web interface

The interface is available on port 8765 of the Pi. Each computer has volume, mute and a live level, the headset has a volume control, and the microphone has the switches PC1 ACTIVE, PC2 ACTIVE and MIC MUTE. At the top are the presets NORMAL, PC1 ONLY, PC2 ONLY and MEETING, which can be overwritten with SAVE CURRENT. MUTE ALL mutes everything and restores the previous state when pressed a second time.

At the bottom the page shows the system state: whether PipeWire is running, whether all paths are up, free storage, load, temperature and the network connection. The live levels only run while a browser is connected, so the Pi does not compute needlessly without an audience. A complete API with interactive documentation is available under /docs.

hAudio web interface with controls for computer 1 and 2, headset and microphone, below recordings, soundboard and system status
The web interface at an early stage in August 2026. Computer 1 is not assigned here, the microphone goes to both computers. The network address has been replaced with an example address.

Recording and soundboard

At the push of a button hAudio records what can be heard in the headset together with the microphone, as an Opus file at 128 kbit/s in one-hour segments. If the microphone is muted, the next segment contains only the headset sound. Muting during a recording automatically starts a new segment, so no private microphone signal ends up in the file unnoticed. Recordings can be played, downloaded, renamed and deleted; playback goes only to the headset, never to the microphone paths to the computers.

hAudio cleans up old recordings itself every hour: after 30 days, or earlier if less than 5 GB is free or the disk is more than 90 percent full. Every deletion is logged in the journal.

The soundboard plays uploaded MP3 files through a dedicated mix bus. They go to the headset and to the currently active microphone paths, so the other side of a meeting hears them too.

USB is the hard part

Most of the work is not in mixing but in recognising the devices. ALSA card numbers and USB device numbers change with every reboot or replug and are useless as identifiers. hAudio therefore remembers the physical USB path and, if the device has a unique serial number, that as well. If such a device moves to another port, hAudio finds it again by itself.

Many cheap, identical adapters have no serial number. In that case hAudio deliberately does not decide on its own, because swapping PC1 and PC2 would send the microphone to the wrong computer. After replugging, you select the adapter again in the web interface. A device can also never get two roles at once, because that would create a feedback loop.

hAudio learns about changes through PipeWire’s events and additionally checks every 30 seconds whether all paths are still up. Only missing or stale connections are replaced; running ones stay untouched.

Known limits

  • Hum: there is no galvanic isolation between the computers and the analogue connections of the adapters. Ground loops can hum or hiss, and software cannot fix that. Stereo audio isolation transformers or galvanically isolated adapters help. Disconnecting the protective earth is not a solution but dangerous.
  • Crackling: several USB devices with their own clocks can occasionally cause dropouts, visible in PipeWire as xruns. The risk rises on a USB hub with a single transaction translator, without realtime priority for PipeWire, and with undervoltage on the Pi.
  • No HTTPS: hAudio offers optional HTTP Basic authentication but no encryption. It belongs in your own network or behind a VPN, an SSH tunnel or a reverse proxy with TLS.

Build it yourself

On a fresh Raspberry Pi OS or Debian with Python 3.11 to 3.13, a few commands are enough. The installation script creates the user, sets up PipeWire, installs the tested dependencies into a separate Python environment, starts the services and waits until the audio paths are ready. It can be run repeatedly; existing configuration is backed up first, recordings and state are kept.

sudo apt update
sudo apt install git
git clone https://github.com/GiT-BeDa/hAudio.git
cd hAudio
sudo scripts/install.sh

Then open the interface at http://<pi-address>:8765 and assign each adapter its role. Two check URLs also show whether everything is running and suit monitoring: /health/live reports whether the program is alive, /health/ready whether all assigned audio paths are up. Updates are installed with sudo scripts/update.sh, which only restarts the program.

Read the logs with journalctl _SYSTEMD_USER_UNIT=haudio-control.service -f. With dropouts, check the kernel log for USB errors and undervoltage before tweaking PipeWire.

What you can take away

  • Leave audio where it belongs: an audio server such as PipeWire routes signals more reliably than a custom program that only manages the connections.
  • Separate control and signal path. If the browser crashes or the program restarts, the sound must not stop.
  • Identify USB devices by path and serial number, never by card or device numbers.
  • Where a mix-up does harm, such as a microphone on the wrong computer, ask rather than guess.
  • Fix ground loops with isolation transformers, not in software and never at the protective earth.

Numbers at a glance

  • hAudio is free software under the GPL-3.0-or-later; version 0.04 was released on 14 October 2026.
  • The web interface and the API run on port 8765, the API documentation under /docs.
  • PipeWire runs at 48 kHz with a quantum of 2048 samples, about 43 ms.
  • Recordings are Opus files at 128 kbit/s in one-hour segments and are deleted after 30 days.
  • Soundboard files may be up to 200 MB.
  • The automated tests check backend, interface and layout in Chromium on desktop and mobile.

References

Remarks

  • The MEETING preset ships with the same settings as NORMAL and is meant to be adapted to your own meeting setup with SAVE CURRENT.
  • Version 0.04 with support for output-only devices was implemented by my SoftwareSklave (German for “software slave”) after the report in issue #1.
  • If you also want to share keyboard and mouse between the two computers, the deskhop project is the matching counterpart.

View hAudio on GitHub

Found a mistake or have something to add? Get in touch.