JDK-8140620 : Find and load default.sf2 as the default soundbank on Linux
  • Type: Enhancement
  • Component: client-libs
  • Affected Version: 8,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-10-27
  • Updated: 2017-05-17
  • Resolved: 2015-10-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u102Fixed 9 b94Fixed
Description
As Fedora developers, we have been carrying a custom change in our OpenJDK distribution. It's a symlink from $JAVA_HOME/jre/lib/audio/default.sf2 to /usr/share/soundfonts/default.sf2.

This makes Java have a soft dependency on the default.sf2 file. The
default.sf2 file is the default soundfont file selected by Fedora. If
the default.sf2 file is installed, the presence of this symlink makes
OpenJDK use that default soundfont file to create a higher quality
soundbank than the emergency soundbank it would create otherwise. If the default.sf2 file is missing, OpenJDK falls back to the emergency soundbank which is worse in quality.

This is the original request from a user that prompted
this change: https://bugzilla.redhat.com/show_bug.cgi?id=541466

It turns out, however, that certain applications and build scripts break
when they see a dangling symlink in $JAVA_HOME. An alternative solution that makes sense to me is to load the default.sf2 file from code. The following webrev does that:
http://cr.openjdk.java.net/~omajid/webrevs/linux-default-sf2/

This is similar in concept to the approach that the Windows-specific
code in this file uses.

Does this sound like a sensible change to add in OpenJDK? It would let more linux distributions take advantage of the default.sf2 file and
would allow us to stop carrying a broken symlink. It looks to be of
extremely low risk to me.
Comments
I am not familiar with the bug workflow; please let me know directly if I need to do anything. Thanks!
11-05-2016

URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/3e006ea10d21 User: lana Date: 2015-11-25 21:18:22 +0000
25-11-2015

URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/3e006ea10d21 User: omajid Date: 2015-10-27 21:45:02 +0000
27-10-2015