This is the README for
The latest version of this README should be available at http://www.alumni.caltech.edu/~dairiki/libmmoss/README.html.
As far as I can tell, the Linux version of Netscape Navigator/Communicator (the latest release as of this writing was Netscape Communicator 4.6) does not support the playing of sound by Java applets.
I have hacked up a replacement for Netscape's implementation of (the
sun.audio.AudioDevice (including some JRI native C
code) which enables the Netscape Java VM to play sound.
Here's a gzipped tar file with the source and binaries for my hacks:
To use these hacks you (most probably) need:
Precompiled binaries are included with this distribution, so no compilation should be necessary.
The kludge consists of three parts:
libmmoss.jarJAR file. (Navigator 3.01 doesn't know about JAR files, if you are using 3.01, you will have to install the individual class files by hand. See below.)
If you're running Netscape Communicator 4.xx, the included
Makefile should be able to install the hacks for you.
(If it doesn't work, or if you'd like to install the hacks manually,
see the next section.
(If you are running Navigator 3.xx, see the old installation notes
Makefile. Pay particular attention to the settings of
MOZILLA_HOMEwhich specifies where you have installed Communicator. Also check the settings of
bindir, which control where the hacks will be installed.
netscape.sh. It may need modification, particularly if you have other fancy plugins (e.g. Acrobat Reader, RealAudio player, etc...) installed. There are notes at the end of
netscape.shregarding how I've dealt with these.
/usr/local/bin/netscape. It will overwrite any wrapper script (or binary) you might already have installed there so make sure this is okay!
bindir, the directory in which the wrapper was installed (default:
libmmoss.jarneed to be installed somewhere.
libmmoss.jarshould be mentioned in
libmmoss.soshould be in a directory which is mentioned by
libmmoss.jaris listed in
CLASSPATHbefore netscape's JAR's, in particular
java40.jar. This is because
libmmoss.jarcontains classes which shadow the classes in
netscape.sh.in. (Or run `make', then look at
With Communicator 4.xx (and later), when my code loads, you will get a dialog box which requests permission to load a native library. You'll have to grant permission for the hacks to work. As of libmmoss version 2.0, you'll also be asked to grant permission to make network connections. You only really need to grant this if you want the EsounD support.
Since, I'm not about to pay money to obtain a certified signing
certificate, if you want to be able to verify the signature on
the libmmoss.jar file, you'll have to download (and trust)
You only need to do this if you want the ``Remember This Decision''
checkbox on the popup dialog to work.
(Note that my
old certificate and the
one before that even
have expired, so even if you've downloaded the certificate(s) for
previous versions of
still have to download the new one.)
(FWIW, the fingerprint of the certificate is
Libmmoss can now output sound through esd, the
You do not need to do anything special to enable esd support,
libmmoss will, if possible, output to esd
and fall back to
/dev/audio output, if not.
ESPEAKER environment variable, if set, is used to find
the esd. Esd support can be disabled by setting
Currently the esd support works okay but not great for me. Problems include:
I'd appreciate feedback on how well the esd support is working for you. Drop me a note with any comments or suggestions.
Javasoft has a dog-barking, train-whistling demo in their tutorial. (You have to find the applet, and then hit some buttons.)
They also have a more vocal demo here.
If you have trouble getting libmmoss to work, the first thing
you should do is take a look at Netscape's Java Console while
trying to play sounds. (In Communicator 4.x, you can get to the
Java Console via the menubar: select
The first time you try to play a sound, libmmoss will print an identifying message on the Java Console. If you do not see something like
then Netscape is not findingLoading Libmmoss-2.0 Java sound for Linux Netscape by G. T. Dairiki
(see http://www.alumni.caltech.edu/~dairiki/libmmoss/ )
libmmoss.jar. Check the setting of
CLASSPATHin your netscape wrapper script.
Once you get past the ``Loading Libmmoss'' message, libmmoss should spew various messages which may or may not help determine why you're not getting any sound.
If you get really stuck, feel free to e-mail me. If possible, include whatever Java Console output you get in your note.
Since Navigator does not know about JAR files, you must install the individual class files, of which there are now four:
The environment variables
should probably be set something like:
export LD_LIBRARY_PATH=/usr/local/netscape/lib export CLASSPATH=/usr/local/netscape/java/classes
If you want and/or need to include the Netscape class archive (e.g.
java_301) in your
For Navigator 3.01, you should not need to list the class archive in your CLASSPATH, as long as you have it installed in one of the ``standard places'':
Netscape Navigator 3.01 tends to crash frequently (particularly when using Java) unless one is using an older version of libc.so. Netscape apparently attempts to free() invalid memory pointers. (Either NULL pointers, or pointers to memory which has already been free()ed.) It seems the newer libc's are more intolerant of this behaviour.
These crashing problems seem to be fixed in Communicator 4.03. So this section does not apply if you are running Communicator.
I ran netscape on libc.so.5.0.9, and it seems to work pretty well. (I have it installed in /lib/old/libc.so.5.0.9, and made a symbolic link /usr/local/netscape/lib/libc.so.5 -> /lib/old/libc.so.5.0.9. Then I run netscape with LD_LIBRARY_PATH=/usr/local/netscape/lib.) The cleanest fix seems to be just to preloading an older, less finicky version or the malloc/free code. I have recently switched over to using this kludge - it seems to work too. More details on this scheme can be found here.
The gnumalloc.so I use can be found in gnumalloc.tar.gz. Which was apparently contributed by Doug Ridgeway. Thanks Doug!
Current version is libmmoss-2.1a.tar.gz
Released 6 Jul, 1999.
Released 14 Jun, 1999.
Released 8 Jun, 1999.
AudioDeviceclass, I took the opportunity to do some pretty extensive restructuring/rewriting of the code. It's highly likely that I've introduced some bugs which didn't used to be there. Let me know when you find them.
Released 25 May, 1999.
InputStream's from 400 bytes up to 512 bytes.
sun.audio.AudioDevice reads from it's
InputStream's in 400 byte blocks. Libmmoss reads
in 512 byte blocks. Some (broken) Java code does not like
producing audio in anything but 400 byte blocks
an example pointed out by Pete Wyckoff).
Released 16 March, 1999.
Released 6 October, 1998.
netscape.shto ensure that
Released 14 October, 1997.
Released 16 June, 1997.
Released 28 May, 1997.
ENODEVerrors which occur while opening /dev/audio do not permanently do us in. This should alleviate the 'no audio dev' problem that I and others have been experiencing. (It may not fix the problem completely, but at least you shouldn't have to restart Netscape to recover from it anymore.)
Geoffrey T. Dairiki
If you have comments or suggestions, email me at firstname.lastname@example.org