[linux-audio-dev] MIDI Time Code on a multitasking OS

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

Subject: [linux-audio-dev] MIDI Time Code on a multitasking OS
From: Paul Barton-Davis (pbd_AT_Op.Net)
Date: Fri Apr 14 2000 - 06:03:18 EEST


I am having a hard time understand how any multitasking OS with a
timer interrupt of less than 500Hz can ever properly support an
application that wants to send MIDI Time Code.

According to the specs for MTC, a running device is supposed to send 1
quarter frame message every quarter SMPTE frame. For a 30 frame SMPTE
rate, than corresponds to a 2 byte message roughly every 2msec.

I can see no way to ever schedule such things under Linux (or any
other non-RT OS) with any reliability. You can't really use the kernel
sequencer (even if HZ was increased to allow 2msec event resolution),
because you don't know the correct time code value until its time to
send it. Well, obviously, as long as things are streaming along, you
do, but it seems pretty silly to me to preload a bunch of data that
may change at any time and have to constantly be flushed.

Does anyone have any thoughts/knowledge/ideas on how existing programs
that generate MTC do this under Windows or MacOS ?

Quick datapoint: by doing it "incorrectly" according to the spec, and
sending the full 8 quarter frames (needed to fully specify a SMPTE
time) all at once, every 20ms (c/o a SCHED_FIFO task that is woken by
the audio h/w), a Mackie D8B keeps thinking that the device its
getting MTC from is stopping and starting. I suspect that many
"correct" receivers of MTC will conclude the same, since to use MTC,
you need to establish a PLL, and this kind of bursty delivery of MTC
will "confuse" a PLL into thinking that things are running, stopping,
etc.

--p


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

This archive was generated by hypermail 2b28 : Fri Apr 14 2000 - 06:29:15 EEST