From: Takashi Iwai <tiwai@suse.de>
To: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: ALSA OSS MIDI emulation: input problems
Date: Wed, 26 Mar 2003 18:53:29 +0100 [thread overview]
Message-ID: <s5hvfy6nheu.wl@alsa2.suse.de> (raw)
In-Reply-To: <200303260700.h2Q709p03090@sprite.physics.adelaide.edu.au>
[-- Attachment #1: Type: text/plain, Size: 1571 bytes --]
At Wed, 26 Mar 2003 17:30:09 +1030 (CST),
Jonathan Woithe wrote:
>
> Hi all
>
> I've been messing with the following problem on and off for the last few
> weeks. It occurs when the OSS sequencer emulation is used with Jazz++
> 4.1.3. In essence, incoming MIDI events from an external MIDI interface
> have their time quantised to multiples of 48 ticks, which is not very
> satisfactory.
>
> After a lot of messing around, I think I'm starting to work out why this is.
> Jazz++ updates its play position every 48 ticks and the trigger for this is
> a SEQ_ECHO event. When one of these arrives, jazz increments its time
> counters, sets another SEQ_ECHO event to happen in 48 ticks time and then
> finishes. This means that in the absence of MIDI input, jazz++ time goes up
> in increments of 48 ticks.
>
> Now, when input occurs, Jazz++ needs to know the current time, which is very
> unlikely to be a multiple of 48 ticks. Under nateive OSS it seems that
> before the NOTEON event (for example) OSS sends a TMR_WAIT_ABS event to
> update the application on the current time - the NOTEON event then follows
> and is assumed to have occurred at the "current time" which of course will
> be the time set by the TMR_WAIT_ABS event.
>
> The problem as I see it is that the ALSA OSS emulation does not send this
> TMR_WAIT_ABS event - it only sends the NOTEON event. Jazz gets this and
> without any TMR_WAIT_ABS to tell it otherwise, assumes that it occured at
> the "current" time - which is always a multiple of 48 ticks.
does the attached patch cure?
Takashi
[-- Attachment #2: seq-oss-timestamp.dif --]
[-- Type: application/octet-stream, Size: 563 bytes --]
Index: alsa-kernel/core/seq/oss/seq_oss_midi.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/core/seq/oss/seq_oss_midi.c,v
retrieving revision 1.8
diff -u -r1.8 seq_oss_midi.c
--- alsa-kernel/core/seq/oss/seq_oss_midi.c 12 Mar 2003 11:26:20 -0000 1.8
+++ alsa-kernel/core/seq/oss/seq_oss_midi.c 26 Mar 2003 17:51:31 -0000
@@ -593,6 +593,7 @@
break;
}
+ snd_seq_oss_readq_put_timestamp(dp->readq, ev->time.tick, dp->seq_mode);
snd_seq_oss_readq_put_event(dp->readq, &ossev);
return 0;
next prev parent reply other threads:[~2003-03-26 17:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-26 7:00 ALSA OSS MIDI emulation: input problems Jonathan Woithe
2003-03-26 17:53 ` Takashi Iwai [this message]
2003-03-26 23:24 ` Jonathan Woithe
2003-03-27 9:14 ` Takashi Iwai
2003-03-27 22:28 ` Jonathan Woithe
2003-03-28 9:57 ` Takashi Iwai
2003-03-31 0:14 ` Jonathan Woithe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=s5hvfy6nheu.wl@alsa2.suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@lists.sourceforge.net \
--cc=jwoithe@physics.adelaide.edu.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.