Problems with MIDI and Java after update to Java for Mac OS X 10.6 Update 1 on OS X 10.6.2?

Since the Apple software update to Java for Mac OS X 10.6 Update 1 I’ve been having problems running some of my Processing sketches – particularly those using MIDI – and Java applets such as SevenUpLive 1.4.

JavaPreferencesOSX10.6.x500px.jpg

I’ve also been experiencing some memory access errors e.g. “Invalid memory access of location 0x0 eip=0x917108d0” with monoControl and some of my own sketches – which I think are issues with OS X, Java and RAM?

A googled forums.sun.com post and referenced Processing forum post seems to indicate I’m not alone.

They actually advise downgrading back to the previous Java version (thanks!) and/or – more interestingly – ‘forcing’ Processing to run in 32-bit mode – a checkbox option available in the ‘Get Info’ window (there’s also an ‘Open using Rosetta’ option)… and prioritising the Java version OS X uses by default by reordering the list in Java Preferences in Applications>Utilities.

None of these options actually resolved my memory access issues for monoControl – but fortunately these problems seem to have sorted themselves out with my other sketches after a few days (and probably a restart)… not that that’s much help I know.

But my MIDI problems persisted and here’s how I sorted it…

I didn’t update my older white Macbook running OS X 10.5.8 with the Java for Mac OS X 10.5 Update 6 so I’ve been somewhat able to compare and test Java ‘before and after’ – OS X versions aside – and the Java Preferences app in Applications>Utilities shows the differences between configurations on the two systems…

Java SE 6.0 64-bit and 32-bit on my OS X 10.6.2 machine after the update…
J2SE 5.0 32-bit and J2SE 1.4.2 32-bit on my OS X 10.5.8 machine before…

After the MIDI issues I had with my recent upgrade to Snow Leopard – and since I was getting the following error running Processing sketches using the proMIDI library:

“ClassCastException: com.sun.media.sound.MidiInDeviceProvider$MidiInDeviceInfo cannot be cast to de.humatic.mmj.spi.CoreMidiProvider$JSMDevInfo“
I realised this might be an issue (which is kinda was) with mmj“a JNI library providing MIDI support to java applications on Mac OS X“ .

I discovered a new multi-architecture 64bit java compatible mmj was available for €3.50 – which I bought and installed – although it didn’t resolve the error above or stop SevenUpLive crashing. But uninstalling mmj altogether did sort it… since confirmed by a posting at the mmj website…

”Java for Mac OS X 10.6 Update 1 (Dec.3rd 2009) seems to change things in terms of JVM midi support. If you get exceptions in mmj’s ServiceProvider implementation after updating java, try again after removing the library alltogether. It is unclear to us in the moment, how other OS / java combinations behave, but on 10.6.2 midi seems to work without a 3rd party service provider like mmj now. Good news…
Edit: This is now also confirmed by Apple release notes: See Radar #3261490 under JavaSound.”

“Java Sound
Radar #3261490
javax.sound.midi.* API unimplemented for hardware MIDI devices.
Description:
The javax.sound.midi.* API has been unimplemented for hardware MIDI devices on Mac OS X.
Resolution:
This issue has been resolved.”

One Response to “Problems with MIDI and Java after update to Java for Mac OS X 10.6 Update 1 on OS X 10.6.2?”

  1. Not Just In Processing: broadening my creative agenda | Prodical's Blog says:

    […] and it’s been working quite well – since my upgrade to Snow Leopard and the subsequent Problems with MIDI and Java after update to Java for Mac OS X 10.6 Update 1 on OS X 10.6.2 I’m finding that MonoControl crashes out so frequently it’s become effectively […]