Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audio on Windows Loopback to send via Ultragrid #430

Open
maybites opened this issue Feb 28, 2025 · 6 comments
Open

Audio on Windows Loopback to send via Ultragrid #430

maybites opened this issue Feb 28, 2025 · 6 comments

Comments

@maybites
Copy link

Hi

We are trying to create a virtual loopback on a windows machine to pipe the output of a Multichannel Mix in Reaper and send it via ultragrid.

Does anyone have an idea to realize this reliably?

@MartinPulec
Copy link
Collaborator

Hi, maybe a dumb question - some 3rd party audio loopback SW like VB Cable won't do the job? Also, UG wasapi audio capture module should be capable to capture the computer audio output with -s wasapi:loopback. Unfortunately I don't know the Reaper specifics - does the SW use some uncommon output or just the OS-offered API?

@maybites
Copy link
Author

we need a solution for 48+ channels.

https://vb-audio.com/Matrix/index.htm is very promising, it has a virtual 64 channel ASIO device that can route its input to its output through a matrix and can thus be used for loopback, but ultragrid doesn't recognize it, while reaper does just fine.

If ultragrid was able to connect to the virtual ASIO Slot, the problem would be solved.

MartinPulec added a commit that referenced this issue Mar 7, 2025
PortAudio/ASIO drivers seem refuse initialization if
CoInitilizeEx initialized as COINIT_MULTITHREADED but they do for
COINIT_APARTMENTTHREADED.

Windows devices that could be affected by this change tested and seem
to work, namely:
- DeckLink
- DirectShow
- WASAPI

refer to GH-430
@MartinPulec
Copy link
Collaborator

UltraGrid doesn't support ASIO directly, i.a. for licensing reason - we couldn't distribute the binary builds with ASIO.

Nevertheless, PortAudio does support ASIO. So with the help with Portaudio DLL, this can worked around. If you download current UG build (the word current this is important, I've just done one fix for PA/ASIO to work) and if you replace the libportaudio.dll in the directory with this one, it may work.

While I was trying the above, I must have set the sample rate to match the VB mixer setting, which was 44100 Hz (48 kHz is UG default), so something like this:
-s portaudio:dev=VASIO-64A -a sample_rate=44100,channels=32

Note that I didn't tested much (actually nearly not at all - except that it captures some data). So if you decide to try out, feel free to report problems.

@maybites
Copy link
Author

maybites commented Mar 8, 2025

Marvelous! I will try it next week and get back to you with my report.

@maybites
Copy link
Author

It works like a charm. Very much appreciated!

In the below screenshot I am sending 32 audio channels from maxmsp via VBAudioMatrix to Ultragrid (I am using Telemersive Gateway as a UI wrapper).

It works fine with up to 16 channels (OPUS - 256000 bit/s - 48000Hz).

when sending 32 or even 64 channels the sound quality suffers and I have lots of crackling and dropouts. What would be the suggested settings for such a use case?

Image

@MartinPulec
Copy link
Collaborator

This could be perhaps a performance issue.

Can you look if the "slow" part is the sender or the receiver? You can look into for this lines:
[Audio sender] Sent 233472 samples in last 5.06 seconds. or [audio dec.] Received 466944/466944 B, decoded 233472. In this example, obviously the sender is not managing to send all samples (it is 48 kHz), the decoder as well, but this is the consequence in this particular case. If neither case, is there anything suspicious in the UG output (packet drops etc.)?

Also I believe that 256 kbps is perhaps superfluously much for Opus - I don't believe that the quality scales much beyond - let say - 128 kbps per channel with that codec.

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

No branches or pull requests

2 participants