tags:

views:

290

answers:

3

We have problems playing audio files using JavaZoom's libraries on OpenJDK in Linux, although it works perfectly on Sun JDK. Is there any workaround for this 'Master Gain not supported' exception?

Mohsen

+3  A: 

I've noticed the same thing. I just check for Sun Java before trying to change the gain. Sucks, but on the bright side OpenJDK's audio is performing much better than Sun's for my needs.

EDIT: since others will find this answer through web searches, I'm going to add a bit. OpenJDK's PulseAudioMixer does not appear to adhere to the JSAPI in some cases. For example, it insists that you stop() a line before flush()ing it. JSAPI however specifically says it's legal to flush before stopping. Or in the case you mention, the pulse audio implementation claims to support gain when you call isControlSupported, but then throws an exception anyway. Those are two reasons JavaZoom code won't work in OpenJDK. There are others. In some cases PulseAudioMixer isn't to blame, it just takes a different route in undefined cases (e.g., what happens if you call write() on a line that isn't open?!). I'm in the process of making some code I wrote more robust so it will run on OpenJDK.

Yuvi Masory
A: 

On that page : https://bugs.launchpad.net/ubuntu/+source/openjdk-6/+bug/491784/ there is a patch at the end, and it works for me now. The patch just consist of try & catch. Sorry, I can't find anymore where the author of javazoom put the source online. Contact me if you need them.

Laurent Debricon
+1  A: 

There is a patch against libbasicplayer-java (applied for 3.0-4):

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=567856

However, OpenJDK is still buggy with its gain support:

https://bugs.launchpad.net/zekr/+bug/622663

Mohsen