Host with two ASIO drivers at the same time

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I would like to know if an ASIO host that use two ASIO drivers from two different soundcards at the same time exists or if it's theorically possible to program one.

What I want to do is take the audio by using ASIO ins from the first soundcard and send it by using ASIO outs from the second soundcard. The two soundcards are not from the same company.

I'm going to try to program one basic host that does that but I wanted to verify if there are already some programs that can do that. I'll have to do some buffering between the two drivers but I think it might be possible to do.

Post

Tril wrote:What I want to do is take the audio by using ASIO ins from the first soundcard and send it by using ASIO outs from the second soundcard. The two soundcards are not from the same company.
I have three cards in my system. The few hosts I've worked with do allow this already. You can set up different asio devices for input and output. And if that fails, then Asio4All can merge them into one big virtual multi-track asio device.
We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is served over https!!

Post

BertKoor wrote:
Tril wrote:What I want to do is take the audio by using ASIO ins from the first soundcard and send it by using ASIO outs from the second soundcard. The two soundcards are not from the same company.
I have three cards in my system. The few hosts I've worked with do allow this already. You can set up different asio devices for input and output. And if that fails, then Asio4All can merge them into one big virtual multi-track asio device.
Take note though that Asio4ALL does not aggregate ASIO device drivers, only WDM.

Post

BertKoor, can you name a few then. I downloaded many demos of ASIO hosts and found this capability in none of them.

Post

But how will the cards stay in sync?

My soundcard can be used multiple times in the same pc (terratec ewx24/96), but they must be wordclock-synced by toslink and are only using one asio driver.

I cannot see how a software would be able to sync multiple cards via multiple drivers...?

Post

I haven't been able to do that either.
For some reason I seem to remember Cool Edit could do that, maybe Adobe Audition is capable? None of my hosts can, the ASIO driver is selected 'globally' in each app.
Rakkervoksen

Post

bleebsen wrote:But how will the cards stay in sync?

My soundcard can be used multiple times in the same pc (terratec ewx24/96), but they must be wordclock-synced by toslink and are only using one asio driver.

I cannot see how a software would be able to sync multiple cards via multiple drivers...?
If you use the 1st card for input only and the other for output, is the synchronization needed then too (well, maybe if you use same ASIO drivers w/ both)?

As Asio4all and CEntrace drivers supports multiple devices simultaenously (IIRC, both are WDM wrappers) I suppose that the ASIO API is the only limitation for more flexible usage. Maybe this is the reason why there are I/Os from one ASIO device only active at once in Software level.

IIRC, there were mentioned (energyXT forum) that eXT 2 would support simultaenous use of I/Os from multiple audio devices (I quess, HW syncronization is needed then).

ATM, it's possible to output through other sound device only by using some other software + router plug-in to get multible cards into use w/ ASIO drivers (Cubase/eXT/Live/Sonar/etc. (1st ASIO device I/O) <--> StreamBoy <--> another VST/ASIO Host (2nd ASIO device I/O). W/ Voxengo Recorder, it's possible to route output through MME device (maybe you can see outputs from both cards listed there).


Juha

Post

As Asio4all and CEntrace drivers supports multiple devices simultaenously (IIRC, both are WDM wrappers)


btw. CEntrance drivers are not WDM wrappers. They are "true native" drivers and they support devices at the lowest possible level (that's why they are able to give the latency even lower then card's manufacturers driver can)


Tril
It's not a problem to program such host (i can't see any at least). But the question is synchronization of course. If cards are out of sync - it simply won't work as expected. In ASIO context you can't solve it unless you introduce some kind of SRC which will convert the rate of incoming stream to the rate of 'output card' (or vice-versa).

Post

I think CEntrance can only do its "trick" with FireWire devices, it looks like Firewire devices can be properly synchronized ...

Post

The older Logic Audio Gold would allow multiple asio devices (on the PC) however they would still have to be in sync.
my sig will go here

Post

Yes, I already knew that there would be synchronization problems if the cards clocks are not the same (as is usually the case).

I was not thinking of using this in a recording environment where you absolutely need all the samples without any glitches.

I was thinking of using this only for listening to the audio that is in the first card from the second card outputs. It's a situation where I don't mind to drop some info once in a while.

I was thinking of using a small circular buffer between the two cards. There are two situations that can happen :
1 - If the second card reads faster than the first one writes, the buffer will eventually get empty.
2 - If the second card reads slower than the first one writes, the buffer will eventually get full.

In the first situation, I would stop the output a little to get the buffer to get filled enough before restarting the output.
In the second situation, I would flush the buffer once in a while to prevent it to get too full.

It might take many minutes before either situation happen so you would hear a glitch of a few ms once in a while. I could use some window function to smooth out the transition.

Post

hi,

i have done this, one sound card is for recording the other is for hearing. there was giltches, so i used a cirular buffer and still glitches, after some investigation i came to the following:
i read from the first asio driver and copied the data to a circular buffer, and then wrote it to the secound asio driver. after some debuggin g i nootised that the glitches happend when there ware 2 write(to the local buffer) and then two read(read the local buffer and write them to the output asio), i used a 3 buffer and it solved the problem, i think this is due to interrupt priorities..

Post

Its possible to do, but you will need to modify the ASIO library (apart from the synchronization issues).

Basically, the ASIO lib by its design only really allows one callback function. You can change it to have multiple ones, but you then have a problem of mapping the callback to different contexts. (Take a look at the ASIOCallbacks structure).
Unfortunately, the ASIO library doesn't provide a void* that you get in your callback to cast to an object for this purpose.

What you can do is provide multiple 'instances' of callback functions (easy to generate with a template meta program). These functions can then be bound to objects.
(or for the sake of simplicity, if you only allow 2 sound cards have BufferSwitch1 and BufferSwitch2 functions and duplicates of all the others you need).

For synchronization, the buffer switch with time info is useful, since it gives a system clock time stamp from when the interrupt was fired (the ASIO driver may actually give YOU the callback from a thread rather than from the interrupt, so taking the time yourself would be less accurate since it relies on the granularity of the scheduler in the OS kernel).
You can then adjust the speed of the slowest stream by dropping the occasional sample (with suitable low-pass filtering of the time stamp). Easiest to manage if you allow variable block size processing, otherwise you'll need to occasionally do two full process calls when you are about to underrun.

This necessarily introduces an extra block of latency to give a bit of room for time slippage.

Post Reply

Return to “DSP and Plugin Development”