Skip to content

PipeWire audio engine with DSP core (used by OpenLinkHub)

License

Notifications You must be signed in to change notification settings

jurkovic-nikola/openlinkhub-rt-audio-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenLinkHub RT Audio Engine

A low-latency, real-time audio engine built on PipeWire, designed for virtual audio routing and DSP processing.
This engine is used by OpenLinkHub to provide headset audio control, EQ, and output routing with minimal latency.

The core audio engine is implemented in C, with a Go control plane exposed via a simple HTTP API.


Notes

  • Virtual PipeWire sink name: openlinkhub-virtual-device
  • Developed as part of OpenLinkHub, but the audio engine is self-contained and reusable.
  • See main.go for examples or audio.h for API access.

Requirements

This project depends on PipeWire development headers and uses pkg-config via CGO.

Required dependencies

  • PipeWire (0.3)
  • pkg-config
  • PipeWire development headers
    • sudo dnf install pipewire-devel pkg-config for RPM based distros
    • sudo apt install libpipewire-0.3-dev pkg-config for DEB based distros

Running

$ go run .
API running on 127.0.0.1:7777
- GET  /sinks                 -> list sinks (JSON)
- POST /sink?serial=XXXX      -> select sink
- POST /band?i=5&db=12        -> EQ band
- POST /master?db=-6          -> master gain
- POST /stop                  -> stops the engine
- POST /current-sink          -> get current sink (JSON)
[DEBUG 24486.006] Physical sink: CORSAIR VIRTUOSO MAX WIRELESS Gaming Receiver Analog Stereo (alsa_output.usb-Corsair_CORSAIR_VIRTUOSO_MAX_WIRELESS_Gaming_Receiver_A9SVC43300IDO4-00.analog-stereo)
[DEBUG 24486.006] connect_capture_latency: 128/48000
[DEBUG 24486.006] connect_capture_latency_max: 256/48000
[DEBUG 24486.006] capture : unconnected -> connecting
[DEBUG 24486.006] connect_playback_latency: 128/48000
[DEBUG 24486.006] connect_playback_latency_max: 256/48000
[DEBUG 24486.006] playback: unconnected -> connecting
[DEBUG 24486.006] playback connected to target serial=71
[DEBUG 24486.006] Running.
[DEBUG 24486.006] Virtual sink: openlinkhub-virtual-device (OpenLinkHub Virtual Audio Device)
[DEBUG 24486.006] Playback node: openlinkhub-virtual-device-playback (role=Music, category=Playback)
[DEBUG 24486.006] Ring buffer: 512 frames (0.01s)
[DEBUG 24486.006] capture : connecting -> paused
[DEBUG 24486.006] playback: connecting -> paused
[DEBUG 24486.019] playback: paused -> streaming

API server:

  • 127.0.0.1:7777

HTTP API

List available sinks

GET /sinks

Returns a JSON list of available PipeWire sinks (excluding the engine’s own virtual sink).

Example:

[
  {
    "index": 0,
    "serial": 69,
    "name": "alsa_output.usb-...",
    "desc": "Corsair Headset Analog Stereo"
  }
]

Select output sink

POST /sink?serial=XXXX

Routes audio output to the sink identified by its serial number.

Adjust EQ band

POST /band?i=5&db=12
  • i — band index (1–10)
  • db — gain in decibels

Set master gain

POST /master?db=-6

Sets the global output gain in decibels.

Get current sink

POST /current-sink

Returns the currently selected sink as JSON.

Stop the engine

POST /stop

Gracefully stops the audio engine.


About

PipeWire audio engine with DSP core (used by OpenLinkHub)

Resources

License

Stars

Watchers

Forks

Contributors