Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 04-26-2010, 06:16 AM   #1
Mr Beanjamin
LQ Newbie
Registered: Apr 2010
Distribution: Arch Linux
Posts: 1

Rep: Reputation: 0
How do I make Sun Java output sound through PulseAudio using a browser?

Hello everyone,

I am trying to make Sun Java 1.6.0_20 output its sound through PulseAudio. Currently, Java uses the sound card directly, blocking every other application from using sound when a Java program is running. Other applications work just fine, and I can get multiple programs to output sound at the same time as long as no Java program is running. PulseAudio Volume Control lists all programs trying to output sound through PulseAudio, but Java is nowhere to be found when it's playing sound.

I have tried executing "padsp firefox", but Firefox doesn't even start when I try that. I have also tested "padsp konqueror", but when I do that, there's no sound from Java applets. Putting padsp in front of the command to launch the non-browser Java applet does work though.

I have also tried renaming the java binary to java.bin and then creating a file named "java" that says
padsp /opt/java/jre/bin/java.bin "$@"
and then chmod +x it. This should basically do the same thing as putting "padsp" in front of a command, but it does allow Firefox to run. Java still works when I do that, but then I can't hear any sound at all from Java when I access it in a browser, so basically it has the same effect as "padsp konqueror".

To summarise: I would like Firefox to output Java's sound through PulseAudio, but "padsp firefox" doesn't work.

I hope this was clear enough. If I need to supply any more information, please ask, because I don't really know much about outputting sound. Thanks in advance.
Old 04-27-2010, 07:50 PM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Could you provide a link to a page that uses java to produce sound? It would help if you could verify the problem and test a solution.

Does the java program access OSS drivers or Alsa?

Your firefox command is probably a wrapper script which may undo the changes to $LD_PRELOAD that the padsp command made. Try running the binary directly instead:
e.g. padsp -- /usr/lib/firefox/firefox <url>

You might try running the java program w/o pulse, e.g. pasuspender -- firefox <url>
And then use lsof to see which files and devices are opened. Or use "ltrace /usr/lib/firefox/firefox" or "strace /usr/lib/firefox/firefox" which will allow you to discover which libraries and system calls are used. This can often provide valuable clues. Pay particular attention to libraries loaded and errors.


java, pulseaudio, sound

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help getting pulseaudio on optical output. nio Linux - General 0 12-01-2008 07:55 PM
Java Sound (alsa): Can't get a line (sound output) eantoranz Programming 0 10-18-2007 08:10 AM
LXer: Java Look-Alike Project Pushed Sun To Make Java Open Source LXer Syndicated Linux News 0 11-15-2006 03:54 AM
no sound with sun java package in debian using applets fakie_flip Linux - Software 0 10-08-2006 02:22 AM
please tell how to make a plugin for a web-browser (konqueror) using c++ / Qt / Java gajaykrishnan Programming 1 07-22-2004 11:28 AM > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 01:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration