Bug 873199 - No sound from Java applications with pulseaudio
Summary: No sound from Java applications with pulseaudio
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: java-1.7.0-openjdk
Version: 17
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Omair Majid
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-05 10:37 UTC by Martin Wilck
Modified: 2012-11-27 18:30 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-11-06 15:02:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Webex error-pop-up (8.19 KB, image/png)
2012-11-06 15:00 UTC, Martin Wilck
no flags Details

Description Martin Wilck 2012-11-05 10:37:52 UTC
Description of problem:
Sound doesn't work in Java applications

Version-Release number of selected component (if applicable):
java-1.7.0-openjdk-1.7.0.9-2.3.3.fc17.1.x86_64

How reproducible:
always

Steps to Reproduce:
1. run a Java application that requires sound in a Fedora standard configuration
  
Actual results:
No sound

Expected results:
Sound works

Additional info:
It's sufficient to edit /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.9.x86_64/jre/lib/sound.properties, uncomment the lines

javax.sound.sampled.Clip=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
javax.sound.sampled.Port=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
javax.sound.sampled.SourceDataLine=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider
javax.sound.sampled.TargetDataLine=org.classpath.icedtea.pulseaudio.PulseAudioMixerProvider

and comment the respective lines referencing "com.sun.media.sound.DirectAudioDeviceProvider" and "com.sun.media.sound.PortMixerProvider".

Because Fedora's desktop is focused on Pulseaudio, this setting should be made by default.

See also:
http://forums.fedoraforum.org/showthread.php?t=248326
http://lists.freedesktop.org/archives/pulseaudio-discuss/2010-June/007145.html

Comment 1 Omair Majid 2012-11-06 14:18:52 UTC
(In reply to comment #0)
> Sound doesn't work in Java applications

What application can I use to verify this behaviour?

> Because Fedora's desktop is focused on Pulseaudio, this setting should be
> made by default.

From what I know the PulseAudio-based mixer provides some advantages over the alsa-based mixer but both should work equally well on a stock fedora configuration.

> See also:
> http://forums.fedoraforum.org/showthread.php?t=248326
> http://lists.freedesktop.org/archives/pulseaudio-discuss/2010-June/007145.
> html

These look like half-truths to me. PulseAudio should be set up so that applications using the user-space alsa API don't notice any change. Please take a look at:
http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/PerfectSetup#ALSA_Applications

The data flow for applications using the ALSA api ends up looking like this:
Application -> ALSA (userspace api) -> PulseAudio -> ALSA (kernel api) -> Hardware 

If this is broken, we should fix this. But please provide more details.

Comment 2 Martin Wilck 2012-11-06 15:00:54 UTC
Created attachment 639408 [details]
Webex error-pop-up

Hmm, it looks as if the attached pop-up made me draw wrong conclusions. I was trying to attend a Red Hat Webinar (!) using F17 and got this error. First thing I tried was Oracle Java, with no success. Then I searched the web and found the resources mentioned about Pulseaudio.

I just tested again using the Java sound demo (http://www.oracle.com/technetwork/java/index-139508.html) and it works fairly well even without the Pulseaudio settings in the Java config file.

So, this bug can be closed, and I still have no idea why Webex fails under Fedora.

Comment 3 Omair Majid 2012-11-06 15:31:41 UTC
(In reply to comment #2)
> I still have no idea why Webex fails under Fedora.

Does Webex work for you with the changes to sound.properties that you proposed?

Comment 4 Martin Wilck 2012-11-07 12:26:13 UTC
I had no chance to test that. Someone would need to setup  a test session with sound. The Webex standard test session has no audio, so the problem wasn't detected.


Note You need to log in before you can comment on or make changes to this bug.