Asynchronous I/O with jackd

After my recent problems getting the ice1712 (EWS88MT) working with jackd/ardour, I am now running a ‘workaround’ solution - I’ve built a version of the jack alsa backend that allows asynchronous operation between inputs and outputs on the same card (I think its important to mention that I’m not trying to make multiple cards work together - that’s just doomed from the start, but just input and outputs on the same card that will not stay in sync). It works like this (any feedback welcome) :

jack alsa driver waits in poll() on all channel file descriptors

When something happens that triggers a retrun from poll(), check and see if it was capture, playback (or both).

If capture, read the data in and process the graph, storing the output in a ring buffer instead of passing it straight to the output which may not be ready since the inputs/outputs are not synchronised :frowning:

If playback, play the data in the ring buffer out through the alsa driver.

This prevents xruns, it does mean the latency is up to another buffer (but at low latency thats not too bad), occasionally there are still over/underruns in the ring buffer(unavoidable if the I/O can’t stay in sync) but this means a few dropped samples in the output feed not an xrun so the record side is still ok.

Advantages are that I can record while playing back out of the outputs, disadvantages are as above. For normal mixing, I use playback only which means I get no xruns and no clicks and pops.

The code is very much a ‘lash up’ at the moment just to test it but I thought it worth posting the idea to see if anyone has any suggestions? Are there other ways to workround this problem etc…

Sorry, I hope I havent caused any offence, I simply thought it might be helpful to raise some of these issues in the hope that it would help make an already excellent project even better - apologies.

this is a very very inappropriate forum for this. please repost this on the jack mailing list where it will receive appropriate attention.