Ubuntu

Sound does not work with openjdk

18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libbasicplayer-java (Ubuntu)
Undecided
Unassigned

Bug Description

I am using a java software (zekr) that has audio playback feature. This feature works with sun-java6-jre, but not with openjdk-6-jre, instead I get this error:

java.lang.IllegalArgumentException: Master Gain not supported
 org.classpath.icedtea.pulseaudio.PulseAudioLine.getControl(PulseAudioLine.java:89)
 org.classpath.icedtea.pulseaudio.PulseAudioSourceDataLine.getControl(PulseAudioSourceDataLine.java:51)
 javazoom.jlgui.basicplayer.BasicPlayer.openLine(Unknown Source)
 javazoom.jlgui.basicplayer.BasicPlayer.initLine(Unknown Source)
 javazoom.jlgui.basicplayer.BasicPlayer.startPlayback(Unknown Source)
 javazoom.jlgui.basicplayer.BasicPlayer.play(Unknown Source)
 net.sf.zekr.engine.audio.DefaultPlayerController.play(DefaultPlayerController.java:83)
 net.sf.zekr.ui.AudioPlayerUiController.playerTogglePlayPause(AudioPlayerUiController.java:163)
 net.sf.zekr.engine.audio.ui.AudioPlayerForm$5.widgetSelected(AudioPlayerForm.java:325)
 org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
 org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
 org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1176)
 org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3493)
 org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3112)
 net.sf.zekr.ui.BaseForm.loopEver(BaseForm.java:36)
 net.sf.zekr.ZekrMain.startZekr(ZekrMain.java:63)
 net.sf.zekr.ZekrMain.main(ZekrMain.java:88)

ProblemType: Bug
Architecture: i386
Date: Thu Dec 3 10:28:38 2009
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: wl
Package: openjdk-6-jre 6b16-1.6.1-3ubuntu1
ProcEnviron:
 LANGUAGE=en_US:en_GB:en
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-15.50-generic
SourcePackage: openjdk-6
Uname: Linux 2.6.31-15-generic i686

Hello,

  I changed the audio backend in /etc/java-6-openjdk/sound.properties , and it worked ! So the problem is with pulseaudio backend.

Oleksij Rempel (olerem) wrote :

Do you use pulseaudio on your system?

On Tue, Dec 29, 2009 at 12:09:42PM -0000, fishor wrote:
> Do you use pulseaudio on your system?
---end quoted text---

Yes.

--
 ‎أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0xEDDDA1B7 (@ subkeys.pgp.net)
 GPG Fingerprint: 8206 A196 2084 7E6D 0DF8 B176 BC19 6A94 EDDD A1B7

Oleksij Rempel (olerem) wrote :

Hmm...
can you please attach output of "pacmd ls > pa_list.txt" at the time you
try to play sound with java.

Attached is the output of pacmd ls > pa_list.txt

--
 ‎أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0xEDDDA1B7 (@ subkeys.pgp.net)
 GPG Fingerprint: 8206 A196 2084 7E6D 0DF8 B176 BC19 6A94 EDDD A1B7

Oleksij Rempel (olerem) wrote :

As you can see in this part, java do not have problems to access pulse:
index: 99
 driver: <protocol-native.c>
 flags: START_CORKED
 state: CORKED
 sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>
 volume: 0: 100%
         0: 0.00 dB
         balance 0.00
 muted: no
 current latency: 0.00 ms
 requested latency: 113.38 ms
 sample spec: s16le 1ch 11025Hz
 channel map: mono
              Mono
 resample method: speex-float-1
 module: 8
 client: 87 <Java>
 properties:
  media.name = "Audio Stream"
  application.name = "Java"
  native-protocol.peer = "UNIX socket client"
  native-protocol.version = "16"
  application.process.id = "26076"
  application.process.user = "ant1"
  application.process.host = "ants"
  application.process.binary = "java"
  window.x11.display = ":0.0"
  application.language = "en_US.UTF-8"
  application.process.machine_id = "0b5a826cfe1ab9dd2bb7c9444a89694a"
  application.process.session_id = "0b5a826cfe1ab9dd2bb7c9444a89694a-1262064218.846503-57789871"
  module-stream-restore.id = "sink-input-by-application-name:Java"

Do you have any problems with mplayer? i so it in your list.
Is it possible that your java application some how hardwired with alsa?
The problem is, if you set java to use alsa, it will still use pulse
with alsa2pulse plugin, which has problems too.

On Thu, Dec 31, 2009 at 05:45:31AM -0000, fishor wrote:
> Do you have any problems with mplayer? i so it in your list.

Nope, mplayer is fine.

> Is it possible that your java application some how hardwired with alsa?
> The problem is, if you set java to use alsa, it will still use pulse
> with alsa2pulse plugin, which has problems too.

I dunno about that, how can I find out ?

--
 ‎أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0xEDDDA1B7 (@ subkeys.pgp.net)
 GPG Fingerprint: 8206 A196 2084 7E6D 0DF8 B176 BC19 6A94 EDDD A1B7

Mohammad Derakhshani (mderakhs) wrote :

Infact we have tested this on a few fresh installation of Ubuntu. In my experience all other audio software, e.g, mplayer, works fine, but when we use openjdk-6-jre this bug shows itself.

Oleksij Rempel (olerem) wrote :

> I dunno about that, how can I find out ?

I would grep the source of your software for any word like sound or
alsa.

Sadenly i can't help you with this bug, currently i in ZA and use
expensive Internet, downloading the source will reduce my fonds.

This defently depends on this software, if this is bug in jdk or pulse
we should know how to reproduce it.

Using pulse in jdk config just discovered this bug, the config is not a
bug. So please, do not ask changing config defaults.

Can you try to replace sound file with some other settings , for example
other sample rate (44100).

Mohsen Saboorian (mohsens) wrote :

As far as Zekr source code is concerned, I can bear witness that there is not a single line of anything related to sound or alsa. We just use basicplayer playback API: open(), play(), pause(), stop() and setGain(float), which itself delegates to standard javax.media (JMF) methods (for the case of mp3, it then finds mp3spi, which uses tritonus and jlayer API).

question: does this problem also happens with .ogg, .mp3 and .spx files. I want to know if this relates to jlayer API, or other libraries.

On Sun, Jan 03, 2010 at 06:37:34PM -0000, Mohsen Saboorian wrote:
> question: does this problem also happens with .ogg, .mp3 and .spx files.
> I want to know if this relates to jlayer API, or other libraries.
---end quoted text---

The same problem happens with .spx files.

--
 ‎أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0xEDDDA1B7 (@ subkeys.pgp.net)
 GPG Fingerprint: 8206 A196 2084 7E6D 0DF8 B176 BC19 6A94 EDDD A1B7

Oleksij Rempel (olerem) wrote :

Am Sonntag, den 03.01.2010, 18:37 +0000 schrieb Mohsen Saboorian:
>
> question: does this problem also happens with .ogg, .mp3 and .spx
> files.
> I want to know if this relates to jlayer API, or other libraries.

Hmm... josm (javaopenstreetmap) accept only wav format and it is
working. this mean this will just send it to SourceDataLine without
decoding. I do not think *SPI make any difference.

This is source of player used by josm:
http://josm.openstreetmap.de/browser/trunk/src/org/openstreetmap/josm/tools/AudioPlayer.java?rev=1865

i noticed thay restrict output format in some way - see lines 287-291:
if (speed * bytesPerSecond > 256000.0) {
 speed = 256000 / bytesPerSecond;
...
may be this is the reason.

Try to get some more info from pulse.
set log-level to debug in /etc/pulse/daemon.conf

Hello,

  Mohsen pointed me to this:
  http://stackoverflow.com/questions/1914216/master-gain-not-supported-in-openjdk

  So the problem is partially in openjdk & javazoom.

--
 ‎أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0xEDDDA1B7 (@ subkeys.pgp.net)
 GPG Fingerprint: 8206 A196 2084 7E6D 0DF8 B176 BC19 6A94 EDDD A1B7

Hello,

  The following patch for libbasicplayer-java package fixed the issue.

Matthias Klose (doko) on 2010-03-22
affects: openjdk-6 (Ubuntu) → libbasicplayer-java (Ubuntu)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libbasicplayer-java - 3.0-3ubuntu1

---------------
libbasicplayer-java (3.0-3ubuntu1) lucid; urgency=low

  * Work with openjdk's pulseaudio sound implementation (Ahmed El-Mahmoudy).
    LP: #491784.
  * Use default-{jdk,jre} dependencies.
 -- Matthias Klose <email address hidden> Mon, 22 Mar 2010 23:05:17 +0000

Changed in libbasicplayer-java (Ubuntu):
status: New → Fix Released
Donut123 (donut123) wrote :

Hello...I have this problem with my Java.
I am running Ultimate Edition 2.8.
It is the same as 10.10 Ubuntu.
The sound does not work on this site and similar ones.
https://bugs.launchpad.net/ubuntu/+source/libbasicplayer-java/+bug/491784

Donut123 (donut123) wrote :

  What about 3.0.5 ?

libbasicplayer-java
I have the same issue as it was then.

Peter Lundqvist (peterl) wrote :

On Sat, Nov 27, 2010 at 11:59:27PM -0000, Peter Lundqvist wrote:
> There seems to be a fix for this:
> http://icedtea.classpath.org/hg/icedtea6/rev/f08bf2c87805
---end quoted text---

This patch seems to be applied in Natty, anyone willing to test on Natty ?

--
 ‎أحمد المحمودي (Ahmed El-Mahmoudy)
  Digital design engineer
 GPG KeyID: 0xEDDDA1B7
 GPG Fingerprint: 8206 A196 2084 7E6D 0DF8 B176 BC19 6A94 EDDD A1B7

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers