[Ardour-Users] Multiple USB devices, Ardour, Alsa, and Jack

rob rob at curates-egg.org
Sat Feb 2 02:11:02 PST 2008


Dewey Smolka wrote:
> Someone on the PulseAudio list pointed me to jack_diplomat as a way of
> running separate jackd sessions on each device and merging them as a
> single session. I did manage to compile it and get the program running
> and syncing the cards but I haven't been able to get Ardour working in
> this setup. And I'm not sure that it's exactly ideal.
>   
This was good advice.

> Most of what I've read about the possibility or impossibility of
> running multiple cards simultaneously under Alsa has focused on the
> idea of merging multiple cheap cards into a single capture/playback
> device. The big problem as I understand is the fact that there's no
> way to keep the clocks synced between the devices. I understand that
> problem, but this isn't what I want to accomplish, and I'm not sure
> how a bit of clock drift would be a problem for what I'm trying to do.
> (I am, however, willing to accept the idea that I'm too married to the
> analog way of doing things and don't understand the importance of the
> word clock.)
>   
The secret to digital logic (much like music) is... timing.  If you 
can't link the word-clock on these devices then you will get glitches in 
the audio.

> I guess my main question is this: Is it possible to merge these
> devices under Alsa such that Jack would be able to address both
> devices simultaneously? I wouldn't ever be using the MX200 during
> recording, but during mixdown I'd need to be able to send to the MX200
> (secondary USB device), receive from the MX200, and send to the Omega
> (primary USB device).
>
> Please, please, someone tell me that what I want to do is possible.
>   
I'd be lying if I said this is possible.

I'll try to explain 'how it works' simply;

Digital audio is handled in 'blocks' of samples called 'periods'.  The 
minimum number of periods is 2 - this allows the CPU to read/write one 
of the periods, whilst the other is read/written by the soundcard.  When 
the blocks are full/empty (record/playback), the soundcard signals to 
the CPU that it's (1) releasing it's block for the CPU to access, and 
(2) taking one of the blocks for continuing record/playback.

This signal is (essentially) what the ALSA software interface reveals - 
there is no way to handle anything less than a 'block'.

Now imagine two cards with the same block size, but not synchronised.  
When one card block is full/empty, the other is only partially so.  This 
is what causes the glitches.  Now imagine the two sample-rates aren't 
spot-on - the size of the glitch grows/shrinks like the beating between 
two notes.

In what way did Ardour 'not work' with jack diplomat?

R




More information about the Ardour-Users mailing list