Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
U. George - 23 Dec 2005 13:21 GMT
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.
Thomas Hawtin - 23 Dec 2005 14:45 GMT
> Trying to close application. part of that close is to close up the
> sound/mixer channel.
[quoted text clipped - 15 lines]
>>         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
Signature

Unemployed English Java programmer
http://jroller.com/page/tackline/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.