[prev in list] [next in list] [prev in thread] [next in thread] 

List:       alsa-devel
Subject:    [alsa-devel] Re: Sequencer Memory Pool Bug (fwd)
From:       Fred Floberg <ffloberg () snet ! net>
Date:       1999-12-30 19:09:08
[Download RAW message or body]




On Thu, 30 Dec 1999, Takashi Iwai wrote:

> >>>>> On Wed, 29 Dec 1999 14:00:15 -0500 (EST), Fred Floberg
> <ffloberg@snet.net> said: 
> 
> > After some more testing it seems that output type clients that use
> > nonblocking writes (namely 'playmidi1', 'seq sender' and HyperSeq)
> > hang after a while.
> 
> Just a note: playmidi1 uses blocking mode unless the flag in its
> source is redefined.  And playmidi1 never uses EVENT_NOTE type as I
> wrote in the previous mail.  If playmidi1 causes the same bug, there
> must be another reason.

I had recompiled playmidi1 to use nonblocking writes (by not defining
USE_BLOCKING_MODE) as a test.

> 
> > In HyperSeq, I can force things to keep going by calling
> > snd_seq_reset_pool_output(), but that seems like a  kludge.
> 
> Generally EAGAIN error happens because there is really no room
> available in memory pool.  Except for the bug you reported, the
> behavior seems reasonable.  Applications can detect it using select()
> before writing a data.

I was sure that resetting the memory pool wasn't a real fix for the problem. :-)

As I have compiled it, playmidi1 uses select() to test for free space.

HyperSeq uses select() (via gdk_input_add()) to listen for ECHO events
sent to itself for the purposes of timing like seq sender does.

> BTW, if EVENT_NOTE is the problem, a workaround would be to use
> EVENT_NOTEON and EVENT_NOTEOFF pair instead of EVENT_NOTE event in
> your program.

I don't think that EVENT_NOTE is the problem. As you say, playmidi1
doesn't use EVENT_NOTE and still when it is compiled to use nonblocking
writes the bug is triggered.

For some reason the memory pool is not being freed up (quickly enough?).

HyperSeq is a program (a sequencer) that I'd written back in March/April
of this year. Although it was unfinished, it was a working program. I'd
never had a problem with the memory pool at that time. The same is true
for seq and playmidi1.


BTW, Takashi, I found your tutorial web pages on subscriptions and the
ALSA sequencer to be very helpful. Thank you. I would suggest that
they go into the official ALSA documentation.



Fred


------
To unsubscribe from <alsa-devel@alsa-project.org> mailing list send message
'unsubscribe' in the body of message to <alsa-devel-request@alsa-project.org>.
BUG/SMALL PATCH REPORTING SYSTEM: http://www.alsa-project.org/cgi-bin/bugs

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic