DirectX 6.1
 

This informative post may help clarify the benifits of v6.1

Reproduced as found on the Usenet with minor editing for tidiness

* From Martin Puryear <[email protected]>

(DTM Note: please don't hassle this person with minor queries... he may not be so happy to give out all this information in future if he get's harrassed as a result)

I'm glad to venture off topic with you: I wrote the kernel-mode
sequencer and hardware driver model for DirectMusic.

DirectMusic definitely improves MIDI timing.  It's not a total panacea,
though (more below on why Windows is seemingly real-time-hostile).

The main improvements of DMusic are:
* you are given a very high-resolution clock -- the same one used by the
rest of the audio system

* you send each MIDI event to DirectMusic along with the timestamp (you
can specify down to 100nanosec granularity) for when it should play

* in the case of software synths, these timestamps specify the actual
sample on which the PCM data for that note will begin

* in the case of very sophisticated HW synths (DSP-based), these
timestamps can be passed to the DSP, who can time the events to an exact
sample

* otherwise, a kernel-mode sequencer will deliver events to the hardware
when they are due -- running from a 1 millisec timer
Pro: A DMusic SW synth should provide jitter-free playback, as it can
place the resultant sound on exactly the desired sample.
Con: The problem with any SW synth is latency (I believe it is still as
high as 100 ms, so these are not useful for THRU or playing live).

Pro: A DSP-based HW synth should provide jitter-free playback and
extremely low latency as well.
Con: I don't know of any high-end devices of this ilk that support
DMusic yet.

Pro: Other DirectMusic HW synths should have good latency (300 microsec,
or essentially NIL), and the jitter should be +/- 500 microsec.
Con: The jitter is only theoretical (again, see below).

One other thing -- DirectMusic 6.1 is user-mode only and Win9x only,
There is no kernel support, but there is a user-mode synth that runs
great on Win95 and Win98.  DirectX 7 is basically done now, and includes
kernel-mode support (Win98 OSR and Win2000).  Butts are being kicked
HARD regarding NT slippage (new VP), so I wouldn't be surprised to see
Windows 2000 ship a lot sooner than the worst-case estimates.

There is other stuff in DirectMusic above my level, like support for
DownLoadable Sounds, an interactive compositional engine, an authoring
application for interactive content, MIDI tools a la Bars'n'Pipes, etc.
It's pretty cool.


Now, about why Windows can't be a better real-time platform:

- Rogue drivers/devices can turn off interrupts or lock the PCI bus for
very long periods of time, so even the kernel-mode sequencer (running at high
priority) gets shut out.  This is a holdover from the bad old days of VxDs.
Video drivers are the well-known example, but it's not limited to
third-party drivers.  Certain MS drivers are guilty, too. 


This can screw with MIDI timing, since the 1 millisec timer is blocked by this
activity.  This abuse of system resources needs to be monitored and somehow
stopped.

We talked about this at the AudioX meeting at NAMM.  It was amazing the
groundswell among audio IHVs -- everyone agrees on this.


- The thread scheduler deals in 10 msec ticks, so you can't get good
latency from user-mode code, or even kernel-mode code that doesn't run
privileged.  Hence, everyone heads down into the kernel and runs privileged. 

There is general escalation of priority as everyone feels they need to up the
ante priority-wise in order to get anything done. 

Disk and network activity is done at elevated priority (masking other tasks from
occurring), in order to achieve maximum throughput. 
This is the exact right thing for Joe Random Corporate User, but dead wrong for
those of us that require real-time performance.  Extensions to the kernel (to handle real-time scheduling, resource reservation, etc.) are desperately needed.

The Windows 9x team always cared about multimedia, but there was so much hacky

code in there (and out there) -- it wasn't robust enough to deal with these problems.

The NT organization is embedded in the server/SQL mindset, where "throughput
is king", so this has been a long hard sell.  It will happen eventually, though.


In the meantime, DirectMusic does what it can by passing timestamps from top
to bottom.

 

 

 

Read the latest news updates DTM Site Content The Desktop Music Mailing List Homepage This link not functional yet This link not functional yet Contact the Author