echolevel
Posts: 9
Joined: Sun Aug 05, 2012 10:38 pm

Java headless vs headful help; sound, etc.

Sun Aug 19, 2012 5:31 pm

Hi there,

A few weeks ago I got some of my audio and midi test apps working (albeit slowly) under OpenJDK and I documented my experiences here. Since then, Oracle's ARM JDK has been released and I've run into some problems...

At first, it looked a bit like the issue that lots of Linux users have with Java: ALSA default device issues which, in my case using OpenJDK, were fixed by installing Pulse Audio. That didn't work this time, however, and on digging a little deeper it appears that the headless version of the Oracle JDK simply doesn't have sound! I have no idea why, other than that Oracle can't envisage a use for headless, command-line, non-GUI audio applications. I can, needless to say, and my projects require it. They don't require any GUI - or even any graphical display whatsoever - as everything's done through MIDI I/O and audio output. Since a GUI is unnecessary, I don't want to have one wasting resources that are needed to keep the playback steady.

So I'll try installing the headful version instead and I'll hope for the best that I can still run my JARs as before from the command line without too many problems... What I'm hoping somebody can tell me is whether there's a serious performance difference between the headless and headful versions - specifically, whether the headful version will always try to run some kind of GUI and, due to that requirement, oblige me to run X (which I really want to avoid)?

This is becoming a dilemma - I need the Oracle JDK for the speed, but I also *think* I need a headless installation for more speed, but a headless Oracle JDK with sound appears not to exist.

Any tips, anecdotes or suggestions appreciated!

echolevel
Posts: 9
Joined: Sun Aug 05, 2012 10:38 pm

Re: Java headless vs headful help; sound, etc.

Sun Aug 19, 2012 6:32 pm

Update - I swapped out the headless binaries for the headful ones and now my audio test app (playing an Amiga MOD file) works, albeit a little stuttery. But it works, so that's grand to be going on with.

Now I just need to establish whether this headful version of the JDK is necessarily more resource-intensive than the headless version, so any information/educated guesses people have would be great. If there's no significant difference, I'll just make do; if there is, then I'll start campaigning for Oracle to implement Java Sound in their headless ARM JDK :)

princec
Posts: 31
Joined: Fri Sep 02, 2011 11:01 am
Contact: Website

Re: Java headless vs headful help; sound, etc.

Tue Aug 21, 2012 11:36 pm

There's no difference whatsoever between headless and headful - all the headful ones provide extra is the libraries and APIs to do AWT and sound, and you're not using the AWT libraries. (Try it for yourself - do a Hello World and run it under each; measure the resource usage before exiting).

Cas :)

echolevel
Posts: 9
Joined: Sun Aug 05, 2012 10:38 pm

Re: Java headless vs headful help; sound, etc.

Wed Aug 22, 2012 1:03 am

princec wrote:There's no difference whatsoever between headless and headful - all the headful ones provide extra is the libraries and APIs to do AWT and sound, and you're not using the AWT libraries. (Try it for yourself - do a Hello World and run it under each; measure the resource usage before exiting).

Cas :)
Thanks for the clarification - puts my mind at ease!

Return to “Other programming languages”