Sound API: MixerSourceLine.implClose() hangs on object.wait()

U

U. George

Trying to close application. part of that close is to close up the
sound/mixer channel.

Every once in a while the close hangs. From what I can see is that the
Sound API is stuck in MixerSourceLine.implClose() in an object wait.
"RunOnExit" prio=10 tid=0x410d6c00 nid=0x4382 in Object.wait() [0x41da9000..0x41da97bc]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:484)
at com.sun.media.sound.MixerSourceLine.implClose(MixerSourceLine.java:274)
- locked <0x51708180> (a java.lang.Object)
at com.sun.media.sound.AbstractDataLine.close(AbstractDataLine.java:422) - locked <0x51708870> (a com.sun.media.sound.HeadspaceMixer)
at jGPS.MISC.Voices.executeOnExit(Voices.java:361)
at jGPS.RunOnExit.run(RunOnExit.java:36)


Does Anyone know what MixerSourceLine is waiting for? As the point of
close(), there are no sounds being processed.
 
T

Thomas Hawtin

U. George said:
Trying to close application. part of that close is to close up the
sound/mixer channel.

Every once in a while the close hangs. From what I can see is that the
Sound API is stuck in MixerSourceLine.implClose() in an object wait.
"RunOnExit" prio=10 tid=0x410d6c00 nid=0x4382 in Object.wait()
[0x41da9000..0x41da97bc]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
at java.lang.Object.wait(Object.java:484)
at
com.sun.media.sound.MixerSourceLine.implClose(MixerSourceLine.java:274)
- locked <0x51708180> (a java.lang.Object)
at
com.sun.media.sound.AbstractDataLine.close(AbstractDataLine.java:422)
- locked <0x51708870> (a com.sun.media.sound.HeadspaceMixer)
at jGPS.MISC.Voices.executeOnExit(Voices.java:361)
at jGPS.RunOnExit.run(RunOnExit.java:36)
Does Anyone know what MixerSourceLine is waiting for? As the point of
close(), there are no sounds being processed.

Looking at the source in Mustang, it appears to be waiting for the
native implementation to callback notifying that the resource has been
destroyed.

Perhaps it is a bug in the drivers. Does it work on other hardware?

OTOH, the code isn't thread-safe at all. It's a mess. The comments don't
inspire much confidence ("It doesn't look like we have a good case of
concurrent programming here.").

It looks like the code you are having problems with is running off an
exit handler. Possibly somewhere JavaSound is trying to create a thread,
which should fail. A similar problem happened when disposing of certain
AWT components attempted to restart the AWT Event Dispatch Thread. If it
is possible, perhaps try closing all the resources before calling
System.exit.

Tom Hawtin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top