From alsa-devel-owner@alsa.jcu.cz  Wed Oct 21 00:31:05 1998
Received: from altrade.nijmegen.inter.nl.net (altrade.nijmegen.inter.nl.net [193.67.237.6])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id AAA21630
	for <alsa-devel@jcu.cz>; Wed, 21 Oct 1998 00:29:29 +0200
Received: from obelix.fvdpol.inter.nl.net by altrade.nijmegen.inter.nl.net
	via bd99-1.Breda.NL.net [193.79.246.226] with ESMTP for <alsa-devel@jcu.cz>
	id AAA08768 (8.8.8/3.28); Wed, 21 Oct 1998 00:29:20 +0200 (MET DST)
Received: (from frank@localhost) by obelix.fvdpol.inter.nl.net (8.8.7/8.7.3) id WAA07327 for alsa-devel@jcu.cz; Tue, 20 Oct 1998 22:49:08 +0100
From: Frank van de Pol <F.K.W.van.de.Pol@inter.nl.net>
Message-Id: <199810202149.WAA07327@obelix.fvdpol.inter.nl.net>
Subject: Re: ALSA Sequencer bug found. Tentative fix included.
To: alsa-devel@jcu.cz
Date: Tue, 20 Oct 1998 22:49:08 +0100 (MET)
In-Reply-To: <Pine.LNX.3.95.981014105713.7869B-100000@cyphyn.219.org> from "Fred Floberg" at Oct 14, 98 11:41:53 am
Content-Type: text
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

Fred Floberg wrote:
> When attempting to insert the sequencer modules from 0.2.0-pre6 (same code
> as found in -pre8, I think) insmod refused to load them with the error:
> 
> snd_seq_dispatch_single_event: undefined symbol (that's going from memory)
> 
> After searching through the sequencer code I was able to track down where
> the error was coming from.
> 
> In ..../kernel/seq/seq_queue.c line 317, a call to
> "snd_seq_dispatch_single_event(new_cell);" is being made. Since that
> function is not in the list of exported symbols it generates the error.
> Changing the line to "snd_seq_dispatch_event(new_cell);", which is
> exported, and which calls snd_seq_dispatch_single_event() itself,
> allows the modules to load and function.
> 
> Now I don't know if this was what Frank had intended, or if
> snd_seq_dispatch_single_event() was supposed to be exported - I
> had no luck in attempting to change seq_export.sym etc. to
> include snd_seq_dispatch_single_event. I mainly wanted to call
> attention to the problem.

Thanks, this is indeed a bug: this code should not call the dispatch
routine directly, but the event should first be enqueued. I'll fix it in the
CVS tree. 

Here's a small patch:

--- seq_queue.c~        Tue Oct 20 22:40:17 1998
+++ seq_queue.c Tue Oct 20 22:40:17 1998
@@ -308,15 +308,15 @@
                                           subs->dest.client,
                                           subs->dest.port); */
 
-                                       /* send copy of the cell to the specified destination */
+                                       /* enqueue copy of the cell for the specified subscriber */
                                        new_cell = snd_seq_cell_dup(cell);
                                        if (new_cell) {
                                                new_cell->event.dest.queue = subs->data->dest.queue;
                                                new_cell->event.dest.client = subs->data->dest.client;
                                                new_cell->event.dest.port = subs->data->dest.port;
-                                               snd_seq_dispatch_single_event(new_cell);
+                                               snd_seq_enqueue_single_event(new_cell);
                                        } else {
-                                               snd_printk("seq: failed sending to subscriber %d:%d:%d (no mem)\n",
+                                               snd_printk("seq: failed enqueing for subscriber %d:%d:%d (no mem)\n",
                                                     subs->data->dest.queue,
                                                    subs->data->dest.client,
                                                     subs->data->dest.port);


 
> Also, after getting the sequencer modules to load, I ran usertest2
> and playmidi (from the test utils) with some SMF Type 0 files. It
> sounds as though the tempo was slowed down to 1/4 or less of the
> original speed with some files. Other files seemed to run at closer
> to their real tempo but still not quite.

Yep, sounds familiar. This known bug has been solved, but possibly I didn't
yet commit these changes to the CVS tree. :-( 

> 
> 
> I'd like to help with developement of the sequencer code if I can
> but I am just starting to get familiar with it.

Any assistence would be appreciated! Applications / ports of existing
applications that make use of the ALSA sequencer API are needed most urgent
to validated the API (which is a prerequisite for making it stable).

Cheers,
Frank.

+---- --- -- -  -   -    - 
|Frank van de Pol                  -o)
|F.K.W.van.de.Pol@inter.NL.net     /\\
|                                 _\_v
|Linux - Why use Windows, since there is a door?
|
|ALSA Sequencer: http://www.inter.nl.net/users/F.K.W.van.de.Pol/alsa/

