We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSound,  Music Libraries › Minim, ubuntu and error: Unable to return...
Page Index Toggle Pages: 1
Minim, ubuntu and error: Unable to return... (Read 2483 times)
Minim, ubuntu and error: Unable to return...
May 18th, 2010, 3:24pm
 
Hi to all,

new in processing, and trying to use the sound librarie Minim to play some samples.

I´m using Ubuntu 9.10(may be is related with the SO), and when I try
to run the code I get:

==== JavaSound Minim Error ====
==== Couldn't open the line: null

==== JavaSound Minim Error ====
==== Unable to return a SourceDataLine: unsupported format - PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian

I´m using one of the examples of the Processing enviroment,
"Load sample"

I cannot find any problem related, any help would be very appreciated.

Thanks.

Re: Minim, ubuntu and error: Unable to return...
Reply #1 - May 19th, 2010, 2:12am
 
I have almost the exact same problem under Ubuntu 10.04 Lucid Lynx. I get:

==== JavaSound Minim Error ====
==== Couldn't open the line: Audio Device Unavailable

==== JavaSound Minim Error ====
==== Unable to return a SourceDataLine: unsupported format - PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian

Using openjdk instead of sun-java6 seems to work, but I'm using the controlP5 library which doesn't work corrctly with openjdk.

From what I can make out it seems that sun-java6 uses the ALSA sound mixer instead of PulseAudio, which is what Ubuntu uses now. I hope somebody has an idea on how to fix this.
Re: Minim, ubuntu and error: Unable to return...
Reply #2 - May 19th, 2010, 2:36am
 
OK, I think I might have solved it. Referring to this bug:

https://bugs.launchpad.net/ubuntu/+source/sun-java6/+bug/457144

it seems that all you have to do is to copy libpulse-java.so and pulse-java.jar from openjdk to sun-java6:

Code:

sudo cp /usr/lib/jvm/java-6-openjdk/jre/lib/i386/libpulse-java.so /usr/lib/jvm/java-6-sun/jre/lib/i386/

sudo cp /usr/lib/jvm/java-6-openjdk/jre/lib/ext/pulse-java.jar /usr/lib/jvm/java-6-sun/jre/lib/ext/


The problem is that the Ubuntu guys want to support openjdk and not sun-java6 (it has even been excluded from the main repositories), so the chances of sun-java6 getting PulseAudio support are pretty slim. This fix does seem to work though!
Re: Minim, ubuntu and error: Unable to return...
Reply #3 - May 22nd, 2010, 1:35pm
 
Thanks Gerrit,

now pulseaudio works for sun-java-6, the fact is, when I followed the steps I was able to play samples, but I was trying to set the volume with setVolume() method, and now suddenly there is no sound at all(loading other sketches that before worked the sound output.)

Also I uninstalled alsa, to have only pulseadio as I read that there was a problem in between in Ubuntu.

Any idea?
Thanks.
Page Index Toggle Pages: 1