Wednesday, January 25, 2012

Player.play() stops after 17 calls: A grueling, long-standing JFugue bug

If you use JFugue, it's possible that you've come across a bug where JFugue's Player.play() method stops play after it is called around 17 times. Brian Tarbox and I have been trying hard to track this one down... and we think the problem lies within the javax.sound.midi code.

It seems that Java's Sequencer.open() and Sequencer.close() methods might be happening asynchronously. As we were debugging this, we found that we'd get an IllegalArgumentException from a Sequencer that should have just been opened. It's possible that it was opened, but then the close() that was called shortly beforehand might have finally taken affect.

The bug is Issue 49 on Google Code, in case anyone would like to lend a hand!

2 comments:

  1. This bug happens for me in JFugue5, but in JFugue (2003-2008) the bug does NOT appear.

    ReplyDelete
  2. Well that's interesting. I'll have to check that out. What version of the JRE are you using in both cases?

    ReplyDelete

Note: Only a member of this blog may post a comment.