From alsa-devel-owner@alsa.jcu.cz  Wed Oct 21 19:04:43 1998
Received: from cyphyn.219.org (nwhn-sh9-port134.snet.net [204.60.16.134])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id TAA11336
	for <alsa-devel@jcu.cz>; Wed, 21 Oct 1998 19:03:54 +0200
Received: from localhost (emng@localhost)
          by cyphyn.219.org (8.8.4/8.8.4) with SMTP
	  id NAA00647; Wed, 21 Oct 1998 13:05:27 -0400
Date: Wed, 21 Oct 1998 13:05:27 -0400 (EDT)
From: Fred Floberg <emng@geocities.com>
To: F.K.W.van.de.Pol@inter.nl.net
cc: alsa-devel@jcu.cz
Subject: Re: More ALSA Sequencer stuff
In-Reply-To: <199810210714.DAA03037@cyphyn.219.org>
Message-ID: <Pine.LNX.3.95.981021122727.519A-100000@cyphyn.219.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list



On Wed, 21 Oct 1998 F.K.W.van.de.Pol@inter.nl.net wrote:

> Fred Floberg wrote:
> > [Tempo problems with playmidi test program]
> > This is begining to appear to be a problem in
> > alsa-driver/test/seq/midifile.c, which was written by Timothy Thompson,
> > and used in Frank's 'playmidi' test program.
> 
> Hmmm, I get good timing with the MIDI files I tried. Tempo changes are also
> handled. Perhaps you can try if it makes a difference to use tick or
> real-time timestamps (compile option in playmidi.c).

I've tried a number of things: Switching from tick timing to real-time
timing, commenting out a sleep_seq() call in write_ev...(), and even
looking into the lowlevel code for timing issues. No joy.

The symptom seems to be like a bottleneck in the output to the midi
device. i.e. the file begins to play at the correct tempo but soon
slows down during song play, just as though the computer was overloaded
in trying to write the midi data to the keyboard. This seems to happen
just as a number of instruments begin to play. If I wasn't running a
300mhz K6-2 here I would be convinced that the computer was getting
bogged down.

> Do you see this error
> in tempo consistenly on certain or all files? Perhaps you can mail me one of
> these files (please not to the mailing list, use my private mail address). 

I only have a few type 0 midi files here, but all of them exhibit the same
problem to a greater or lesser degree. I'll send you (privately) the one
that exhibits the worst timing.

> > Rather than trying to debug that library I'm going to attempt to port
> > Nathan Laredo's playmidi-2.3 package over to using ALSA's Sequencer.
> 
> Be prepared that some parts of the sequencer core are not yet functional or
> buggy. Please contact me in case of problems/questions. The ALSA sequencer
> API is very dislike the OSS thing.

The hardest part of porting this app is unraveling all of the mocros in
OSS's soundcard.h in order to understand how things are done in the
original code :-) Your API is much more straightforword.

I realize that onboard synth support isn't working yet, so I'll not
try to include that functionality in the port. My main purpose is
to become familiar with accessing an external MIDI device (both input
and output) for another project I'm working on (Csound ALSA-MIDI support)
anyway.


Thanks for the response,

Fred



