dechamps / FlexASIO

A flexible universal ASIO driver that uses the PortAudio sound I/O library. Supports WASAPI (shared and exclusive), KS, DirectSound and MME.
Other
1.4k stars 76 forks source link

Support for auxillary 2ndary output #157

Open phu54321 opened 2 years ago

phu54321 commented 2 years ago

Hello, I'm using flexasio for playing rhythm games. These game uses ASIO for low latency audios.

What I wanna do, is I want to record my gameplay while using flexAsio. Using loopback mode on wasapi shared mode is unacceptable, as it incurs >10~20ms of additional latency. It'd be great if we could record flexasio output regardless of the backend it's using. I don't care how it could be recorded, and I'm okay if it's recordable by any means on OBS software. (obs-asio, vb-cable, anything)

I think the easiest solution is to let flexasio output to some secondary output without using portaudio. (Since portaudio doesnt support multiple output as indicated on another issue) On OBS side we can compensate for arbitary latency anyway. If we can waveout to secondary device, one can just waveout to vb-cable's input (virtual audio cable) and record that cable's output on OBS side.

Another way is to allow loopbacking flexasio's output to flexasio's input. Then we can utilize obs-asio package to record the output.

What would be the easiest / most maintainable way to allow recording asio output on OBS? Thanks.

dechamps commented 2 years ago

I think the easiest solution is to let flexasio output to some secondary output without using portaudio. (Since portaudio doesnt support multiple output as indicated on another issue)

"Not using PortAudio" is not an easier way to get a secondary output. Quite the opposite, in fact: trying to implement multiple output outside of PortAudio might be harder than adding that feature to PortAudio itself.

Another way is to allow loopbacking flexasio's output to flexasio's input.

"loopbacking flexasio's output to flexasio's input" does not really make sense. What you mean is sending the input of FlexASIO running in one process to the output of another instance of FlexASIO running in another process, which is a very different proposition whose implementation is far from trivial.

I think basically what you're asking for is to add inter-host routing functionality to FlexASIO. That's a valid request, but I don't think it's likely to get done as it would require quite a bit of work. The required code could quite possibly be larger than the entire current codebase of FlexASIO itself. Someone would need to be motivated enough to do that work, and I'm afraid that's not going to be me.

One could also argue that this is out of scope for FlexASIO and would be better achieved by writing some kind of ASIO driver "wrapper" that could run on top of FlexASIO (or any other ASIO driver).

In fact, isn't this precisely what Synchronous Audio Router does? It might be a potential solution, especially given its zero-latency design.

phu54321 commented 2 years ago

Oh, I'll take a look at SAR. Never heard about that program. Thanks for the suggestion!

phu54321 commented 2 years ago

Tried some investigation, but SAR and ASIOLink are both abandonware and they don't seem to work.

I'll think how I could make some meaningful PR for this issue.

dechamps commented 2 years ago

ASIOLink: author is dead, cannot make new purchases.

My understanding is that ASIOLink Pro is free nowadays.

phu54321 commented 2 years ago

"Patcher" option isn't valid for me :( If he/she (one claiming to be the original author's nephew?) really had the source, he/she should have compiled a new version w/o licensing stuff. Not releasing some kind of warez-style patcher. I haven't investigated well yet if this is the warez case or not, but better be safe.