Skip to content

PortAudio consumer: new ASIO multi-channel audio output with video-scheduled dispatch#1720

Open
gmeisel01 wants to merge 1 commit intoCasparCG:masterfrom
gmeisel01:portaudio-consumer
Open

PortAudio consumer: new ASIO multi-channel audio output with video-scheduled dispatch#1720
gmeisel01 wants to merge 1 commit intoCasparCG:masterfrom
gmeisel01:portaudio-consumer

Conversation

@gmeisel01
Copy link

Adds a new PortAudio consumer providing ASIO multi-channel audio output, targeted at professional live event and LED wall deployments requiring more than 2 channels of audio output.

Architecture
Uses a lock-free FIFO ring buffer to bridge CasparCG's push model with PortAudio's pull callback model. Audio packets are video-scheduled (same approach as the OAL consumer fix) and written to the FIFO by a high-priority dispatch thread. The PortAudio callback reads from the FIFO on demand.

ASIO-only
Enumerates only ASIO devices with fuzzy name matching (space-insensitive). Requires ASIO drivers to be installed (hardware ASIO, ASIO4ALL, or FlexASIO). Logs a clear error with installation guidance if no ASIO device is found.

Auto-tuning latency compensation
Enabled by default. Measures timing error after each dispatch and adjusts compensation every 10 seconds (200+ samples, 75% correction factor). Correctly handles the systematic offset introduced by ASIO hardware buffer latency, which varies by device and buffer size.

Configuration (casparcg.config)

  • device-name — ASIO device name (fuzzy matched, uses default if omitted)
  • output-channels — number of output channels (default 2)
  • buffer-size-frames — ASIO buffer size in frames (default 128)
  • latency-compensation-ms — initial latency compensation (default 40ms, auto-tuned at runtime)
  • fifo-ms — FIFO buffer size in milliseconds (default 50ms)
  • auto-tune-latency — enable/disable auto-tuning (default true)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant