FedoraForum.org - Fedora Support Forums and Community
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2008
    Location
    Flanders
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile (solved)how do I make Java use Pulseaudio?

    Hi,

    Ok, still on to the silent Java. I use Java to (yes, laugh.. .) play Runescape. I can hear the (midi?) music but none of the ambient sounds. In a chatbox I (over) heared that it is clever (needed/required) to use Pulseaudio.

    How do I make the JRE use paulseaudio?

    Tnx

    Thor
    Last edited by LinUsr@Flanders; 22nd November 2010 at 09:31 AM.
    ---------------------------------------------------------------
    Running an Evo 51s, 1 Gb, P4
    40 Gb inside, one Tb on the outside (Iomega Prestige)
    Running F10 as main system
    Server CentOS 5.2 LAMP
    Java dev
    ---------------------------------------------------------------

  2. #2
    Join Date
    Mar 2005
    Location
    US
    Posts
    116
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I make Java use Pulseaudio?

    This may be water under the bridge by now, but I just struggled thru this myself (not for runscape) There are a few ways out on the Web to do this, but this is the method that worked for me -- it is not perfect -- sound can have some stutters in it, it actually seemed to get better after I used it for a bit, weird...there could be a tweak for this...

    Fedora release 13 (Goddard)
    2.6.34.7-61.fc13.i686.PAE #1 SMP
    SUN Jdk installed in /opt/jdk1.6.0_22
    Firefox tweaked to use this JDK...

    DO:

    cp /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/i386/libpulse-java.so /opt/jdk1.6.0_22/jre/lib/i386/.
    cp /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/ext/pulse-java.jar /opt/jdk1.6.0_22/jre/lib/ext/.
    mv /opt/jdk1.6.0_22/jre/lib/i386/libjsoundalsa.so /opt/jdk1.6.0_22/jre/lib/i386/libjsoundalsa.so.bak

    add the following lines to bottom of /opt/jdk1.6.0_22/jre/lib/sound.properties

    javax.sound.sampled.Clip=org.classpath.icedtea.pul seaudio.PulseAudioMixerProvider
    javax.sound.sampled.Port=org.classpath.icedtea.pul seaudio.PulseAudioMixerProvider
    javax.sound.sampled.SourceDataLine=org.classpath.i cedtea.pulseaudio.PulseAudioMixerProvider
    javax.sound.sampled.TargetDataLine=org.classpath.i cedtea.pulseaudio.PulseAudioMixerProvider


    Restart your firefox and try java applet with sound...and try a linux or gnome program with sound too....

    Note: I think the problem is that SUN/Oracle JDK has a default configuration of using ALSA. ALSA is kinda low-level and doesn't support** mixing of multiple streams -- hence why there is high level sound deamon like pulse.. The above steps configure Sun's JDK to use a different sound configuration -- namely the one for OpenJDK/IceTea --which outputs to pulse.... It would be great if Sun/Oracle made 2 'things' for linux jdks: pulse and alsa....




    ** ALSA 'dmix' plugin can do mixing and you can achieve a similar thing by using dmix...ymmv

  3. #3
    Join Date
    Nov 2006
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I make Java use Pulseaudio?

    yum install alsa-plugins-pulseaudio

  4. #4
    Join Date
    Feb 2008
    Location
    Flanders
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: how do I make Java use Pulseaudio?

    Hello fwelland, tried that...and I got sound. I took the liberty of making a note (got a hude notbook by now ) to remember this for the next install...
    Yo hmss013, these were installed, hence my confusion...oh well, Linux still is my thing!!!

    Thanks!

    Thor
    ---------------------------------------------------------------
    Running an Evo 51s, 1 Gb, P4
    40 Gb inside, one Tb on the outside (Iomega Prestige)
    Running F10 as main system
    Server CentOS 5.2 LAMP
    Java dev
    ---------------------------------------------------------------

Similar Threads

  1. Pulseaudio, make each VT play its sound?
    By Spack971 in forum Using Fedora
    Replies: 1
    Last Post: 30th May 2010, 03:47 PM
  2. Replies: 33
    Last Post: 16th May 2009, 04:03 AM
  3. Replies: 0
    Last Post: 11th December 2008, 10:41 AM
  4. Java and make
    By trispad in forum Programming & Packaging
    Replies: 7
    Last Post: 27th February 2007, 09:34 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •