Questions about audio

Hi!

I’m working on a casparcg client that is directed towards live events/corporate shows with custom resolutions for led walls. I know its not designed for it, but for now it’s a fun project.

I’d like to be able to work with multiple audio output channels, but less than 16. Is it possible to set a hard limit in the config for example to 8ch?
I tried using ffmpeg consumer to output audio to alsa, but it always says that the channel count is less than 16 and uninitializes the consumer.
Are there any other options I could try?
I tried searching for answeres, but most posts i found are quite old and seem to be already deprecated.

Just for understanding: Why would it be essential to be able to set a limit?

My main workflow right now is connecting display port output from a media server to screen management system and getting the video as well as 8ch audio that I can route to Dante.

When I tried doing that with Casparcg I got the error that the consumer can’t handle 16ch and it uninitialize.

Maybe there is a workaround for it that I couldn’t find.

Aha, so you use the Screen Consumer and System Audio, right? They only support two channels of audio. the trick would be to use one ore multiple Decklink cards. They support embedded audio up to 16 channels.

That’s what I fell back to.

I was trying to get more audio outputs by using ffmpeg consumer but as stated before couldn’t get it to work.

Oh, I forgot. If anyone is interested here is the repo for the client I’m working on.

Would love some pointers from more experienced.

I am waiting for @Julusian to accept my PR #1714 that enables multiple (stereo) outputs using OAL consumer. This is something I had an immediate need for, for a setup with two small LED walls and sound domes. Both are fed from one CCG Server with two Screen + OAL consumers running on two channels.

I’ve fixed a few issues in the OAL consumer and it’s now actually usable for simple stereo setups with Screen + OAL through HDMI out. No need for fancy cards.

There is also a PR #1720 by @gmeisel that introduces multi-channel PortAudio consumer. It needs a bit of a clean-up and simplification (sorry @gmeisel :wink: ) I was going to take a look at it at some point and/or use it as a starting point.

@Julusian indicated he likes PortAudio, so maybe at some point it will replace the OAL consumer.

BTW if anyone wants to test run my build, I have Debian and Ubuntu packages here:

Nice!

This is exactly what I needed. Will test it when I’ll be back at the warehouse.

The FFmpeg consumer’s audio path enforces 16 channels and isn’t designed for flexible channel counts — you’ve hit a real wall there.

We’ve been working on exactly this problem for professional live events and LED wall deployments. There are three open PRs against the main CasparCG repo that together address this properly:

The PortAudio PR is the direct answer to your question — configurable channel count, ASIO device selection with fuzzy name matching, and video-scheduled dispatch so audio stays locked to your output. Builds and runs on both Windows and Linux.

Not merged yet but all three are production-tested. Worth a look.

Tested it, very nice work. Although i’m still struggling with random crashes, which put the tests on hold.

Thanks for testing and for the feedback

Random crashes are definitely something we want to track down. To help narrow it down, could you share:

  • Windows or Linux?

- Which audio device/driver — ASIO, WASAPI, or JACK?

- Does the crash happen on startup, after running for a period of time, or triggered by a specific operation (load, play, stop, device change)?

- Any crash log or stack trace from the CasparCG log folder?

In the meantime here are the most common causes we’re aware of with PortAudio consumers: **COM apartment threading (Windows/ASIO)**— All PortAudio calls (Pa_Initialize, Pa_OpenStream, Pa_StartStream) must share the same COM apartment thread. If your ASIO driver is strict about this, any cross-thread call can produce an unpredictable crash.

We moved Pa_Initialize into the executor thread specifically to address this but some drivers may still be sensitive. **FIFO underrun** — If the ring buffer between CasparCG’s push model and PortAudio’s pull callback drains completely the callback can read from an invalid position.

This is more likely under high CPU load or when the buffer size and FIFO depth settings are too small for your system.

Try increasing `` in the config if you suspect this. **Device disconnection or driver reset** — PortAudio does not handle surprise device removal or driver-level resets gracefully and will likely crash if the device disappears while streaming. Make sure your ASIO device is stable before starting CasparCG.

If you want a build that already has all three PRs (screen consumer, OAL fix, and PortAudio) integrated and ready to compile without any patching, we maintain a complete fork at: GitHub - gmeisel01/CasparCG_Enhanced · GitHub

Any details you can share from the log would be really helpful — even the last few lines before the crash would give us something to work with.

The crashes are cef induced on Ubuntu, so nothing specific to your’s pr build.

I will get back to it next week, but I need to first figure out those cef crashes.

Forgot to post update here. The extended version is running on my dev machines and it’s working great! The portaudio was exactly what i was missing!