Sound sinks not closed on finish. #21

Closed
IsmAvatar opened this Issue Jul 25, 2012 · 1 comment

Comments

Projects
None yet
1 participant
@IsmAvatar
Owner

IsmAvatar commented Jul 25, 2012

To reproduce, load in a sound, and click the play button. On newer versions of Ubuntu, the sink can be observed by visiting Sound Settings (accessible from the sound applet indicator) > Applications. Observe that the sink appears and never goes away. Furthermore, the sink is not recycled - clicking play again opens a new sink.

The java sound demo doesn't exhibit this behavior. http://java.sun.com/products/java-media/sound/samples/JavaSoundDemo
This may only affect PCM_signed (but again, Java sound demo doesn't have this issue).

Notice that terminating the JVM will cause these sinks to automatically close.

@IsmAvatar

This comment has been minimized.

Show comment
Hide comment
@IsmAvatar

IsmAvatar Jul 26, 2012

Owner

I wasn't able to reproduce this very well versus Java Sound Demo (basically, I can't confirm that Java Sound Demo doesn't exhibit this behavior), but I am able to confirm that the sinks are left open, which is enough to implement a solution.

Resolved in 3ce031b on the JoshEdit branch by draining the sink instead of looping until !isAvailable.
Also worth noting, the Stop button is also now implemented in that revision, although a Todo is to make it work for older sinks (e.g. user presses play button twice, the first play reference is lost and can't be stopped until it fully drains)

Owner

IsmAvatar commented Jul 26, 2012

I wasn't able to reproduce this very well versus Java Sound Demo (basically, I can't confirm that Java Sound Demo doesn't exhibit this behavior), but I am able to confirm that the sinks are left open, which is enough to implement a solution.

Resolved in 3ce031b on the JoshEdit branch by draining the sink instead of looping until !isAvailable.
Also worth noting, the Stop button is also now implemented in that revision, although a Todo is to make it work for older sinks (e.g. user presses play button twice, the first play reference is lost and can't be stopped until it fully drains)

@IsmAvatar IsmAvatar closed this Jul 26, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment