Fedora Linux Support Community & Resources Center
  #1  
Old 9th July 2010, 08:41 AM
LinUsr@Flanders Offline
Registered User
 
Join Date: Feb 2008
Location: Flanders
Posts: 155
linuxfedorafirefox
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
__________________
---------------------------------------------------------------
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
---------------------------------------------------------------

Last edited by LinUsr@Flanders; 22nd November 2010 at 09:31 AM.
Reply With Quote
  #2  
Old 19th November 2010, 11:40 PM
fwelland Offline
Registered User
 
Join Date: Mar 2005
Location: US
Posts: 114
linuxfedorafirefox
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
Reply With Quote
  #3  
Old 21st November 2010, 12:03 AM
HMSS013 Offline
Registered User
 
Join Date: Nov 2006
Posts: 511
linuxfedorafirefox
Re: how do I make Java use Pulseaudio?

yum install alsa-plugins-pulseaudio
Reply With Quote
  #4  
Old 22nd November 2010, 09:31 AM
LinUsr@Flanders Offline
Registered User
 
Join Date: Feb 2008
Location: Flanders
Posts: 155
linuxfirefox
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
---------------------------------------------------------------
Reply With Quote
Reply

Tags
java, pulseaudio, sound

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Pulseaudio, make each VT play its sound? Spack971 Using Fedora 1 30th May 2010 04:47 PM
Please, Fedora, Make Pulseaudio Optional, not Mandatory! rookcifer Fedora Focus 33 16th May 2009 05:03 AM
How to make Pulseaudio run stereo playback on a laptop? Clean Mind Hardware & Laptops 0 11th December 2008 10:41 AM
Java and make trispad Programming & Packaging 7 27th February 2007 09:34 PM


Current GMT-time: 03:59 (Monday, 24-11-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Thiene Instagram Photos - Herndon Instagram Photos - Maksi Travel Photos