This content has been marked as final. Show 7 replies
I'm not familiar with USB midi code - is that part of the JDK? Or it is part of a third-party library or your application?
That assertion failure does not look like a VM/JDK failure as you aren't running as debug VM and hence no assertions are enabled.
Other than that the error seems to indicate a failed system call. You might use strace to see which call is failing and what the error is - that might shed some light.
Also can you run this code on a plain (non-real-time) VM ?
Thanks for your reply,
rawmidi.c is part of the alsa-lib .
I am using the latest alsa-lib-1.0.16 and alsa-driver-1.0.16
putting strace before the java command gives some more info.
[snip lots of stuff]
java: ../../../src/rawmidi/rawmidi.c:264: snd_rawmidi_open_conf: Assertion `err >= 0' failed.
) = ? ERESTART_RESTARTBLOCK (To be restarted)
+++ killed by SIGABRT (core dumped) +++
It happens when you try to open the midi input device.
The code works fine with a plain 64bit VM.
java version "1.6.0_03"
Java(TM) SE Runtime Environment (build 1.6.0_03-b05)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_03-b05, mixed mode)
The java realtime works great for low latency audio (compared to plain java) it would be great to get my keyboard working!
Unfortunately there is nothing I can really do to help. The alsa-lib is not part of the JDK/VM and I have no idea why it might be failing. The strace output is not showing anything. The error comes from this call in snd_rawmidi_params():
but I don't know how to go any further.
817 err = rawmidi->ops->params(rawmidi, params); 818 if (err < 0) 819 return err;
Sun Java RTS is not a 64-bit VM, does this work with a plain 32-bit VM?
It might be that Sun Java RTS's use of memory locking is in someway incompatible with the alsa library, but I don't know why that might be the case.
As you suggested I just tried tried the latest vanilla 32bit JVM and it also fails. So the real time java is off the hook.
Is there a 64bit linux real time java in the pipeline?
I would try installing the 32 bit version of ubuntu 7.10 If you do I would expect this issue to go away.
I think the problem is that the OS does not allow 32 bit apps to run on a 64 bit ONLY os.. At least
that has been my experience with ubuntu only. SuSE and Redhat don't have this issue nor does Solaris
Let me know if this ends up working after re-install.
Gary: This site might assist with at least some 32-bit woes:
Paul: There are no announced plans for 64-bit real-time at this stage.
I did a little reading . . . mixing 32bit and 64bit code is bad news.
It is quite interesting that the rest of code which uses the audio drivers worked perfectly!
It looks like the 32bit java calls the alsa-lib library which is 64bit. Is this the only place where this happens?
I think I could get round this problem by providing 32bit versions of the libraries. I embarked on creating a 32bit chroot cage
but it started to be hard work.
So I installed 32bit ubuntu and now the midi works fine.