Re: [linux-audio-dev] MIDI sync issues; mmc, mtc, ...

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] MIDI sync issues; mmc, mtc, ...
From: Dan Mills (dmills_AT_spamblock.demon.co.uk)
Date: Fri Dec 22 2000 - 18:15:08 EET


On Fri, 22 Dec 2000, Kai Vehmanen wrote:

> Hmm, interesting. This is pretty close to what I've had in mind... except
> I'd use a ringbuffer or some other statically allocated structure.
> Allocating memory from the audio thread during processing wouldn't be a
> good thing.

Yea, good idea.
 
> Huh, this is some heavy stuff. :) On a average Linux box the situation is
> even worse than that - you can't even _get_ the exact sample rate of the
> soundcard. This leads us to the old problem of trying to use multiple
> cheap consumer cards for multichannel playback or recording. Sounds
> promising, but in reality the cards run at slightly different speeds and
> your streams will sooner or later go out of sync.

Of course you can do what I did a few uears ago, multiple consumer
soundcards, remove the crystals, and build a single clock source
which is then bussed to all the cards in the system....
WRT the sample rate issue:
Obviously you cannot get the exact sample rate, as it is a clock,
it can only be compared with another clock source, In my setup I
compared with the sample number as calculated from the MTC stream
(Knowing the theoretical sample rate of the system), and then
added or dropped samples to bring the two clocks into alignment.
Does the alsa midi RX code timestamp the incomming data? That
would make the processing much easier.

In fact this trick could be used to sync (in software), multiple
consumer cards....., Going to have to have a play with that,
select on all the fd's, when a card unblocks, make a note of the
TSC, then compute the drift and sample double as needed to maintain
lock, the devil is in the detail, but it might work.

Regards, Dan.

-- 
The email address **IS** valid (You do **NOT** need to remove spamblock).
And on the evening of the first day the lord said.....
..... LX 1, GO!! and there was light!


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Dec 22 2000 - 19:53:33 EET