[CM] common music, portmidi, filling up queues?

Fernando Lopez-Lezcano nando@ccrma.Stanford.EDU
Wed, 01 Feb 2006 10:33:12 -0800


On Wed, 2006-02-01 at 06:38 -0600, Rick Taube wrote:
> nando -- i just tried your example with 1000 events

Exactly the same code?

> and didnt have this problem on OS X. 

Well, this is happening on linux. 

> what is the value of *portmidi-default-outbuf-size* ? it should be 2048. 

I think that's what it is in the source code. 

> if its not then try setting it to a larger value or 
> \ open portmidi explicitly and pass the value to it:
> 	(portmidi-open :outbuf-size 2048 ... )

Setting it explicitly on open does not solve the problem. 

> as far as i can tell, that is the only method portmidi gives to 
> increase queue size. if increasing this number doesnt fix the problem i 
> think there must be some portmidi/linux issue on lurking.

Increasing the size will not fix the problem, I think. The question is:
what does cm/linux do when the buffer fills up? (assuming that's the
problem - I could be wrong of course) It should either block or keep
queueing messages. An error is not the proper thing to do, I think. 

> btw it seems from your backtrace that my portmidi error reporting isnt 
> working.

Yes, indeed, I don't know what may be the problem. It would seem the
error string does not get translated back into lisp land or something
like that?

This is on Linux, SBCL 0.9.7, cm snapshot of 2005.12.15
-- Fernando

> On Jan 31, 2006, at 7:46 PM, Fernando Lopez-Lezcano wrote:
> 
> > Hi all, I'm running here a CM snapshot from 2005.12.15 and I'm having
> > problems with portmidi. It looks like when the portmidi/alsa internal
> > buffer becomes full Common Music just throws an error and that's it. 
> > For
> > example this plays fine (you have to open the portmidi device first):
> >
> > (events (process for i from 0 below 250
> >                  output (new midi :keynum (+ 60 (mod i 40)) :time 
> > (now))
> >                  wait 0.01)
> >         "midi-port.pm")
> >
> > add one more note (251 instead of 250):
> >
> > (events (process for i from 0 below 251
> >                  output (new midi :keynum (+ 60 (mod i 40)) :time 
> > (now))
> >                  wait 0.01)
> >         "midi-port.pm")
> >
> > and I get:
> > --------
> > bad argument to ERROR: #.(SB-SYS:INT-SAP #XB7FEBDDD)
> >    [Condition of type SIMPLE-TYPE-ERROR]
> >
> > Restarts:
> >   0: [ABORT-REQUEST] Abort handling SLIME request.
> >   1: [ABORT] Exit debugger, returning to top level.
> >
> > Backtrace:
> >   0: (SB-KERNEL:COERCE-TO-CONDITION #.(SB-SYS:INT-SAP #XB7FEBDDD) NIL
> > SIMPLE-ERROR ERROR)
> >   1: (ERROR #.(SB-SYS:INT-SAP #XB7FEBDDD))
> >   2: (PORTMIDI:WRITESHORT #.(SB-SYS:INT-SAP #X082809F0) 3094653 
> > 8340864)
> > [MUNCH]
> > --------
> >
> > Using "(rts" instead minimizes the chance of this happening but the
> > error can be triggered...
> >
> > What could I do about this (other than sending few notes :-)?
> > -- Fernando