Skip to main content

MidiUnavailableException: Audio Device Unavailable

No replies
ksemeks
Offline
Joined: 2010-04-27
Points: 0

Hi, so here's the deal.
When I try to make a new Sequencer object, java throws this exception: javax.sound.midi.MidiUnavailableException: Audio Device Unavailable

Here's the whole error:

<br />
javax.sound.midi.MidiUnavailableException: Audio Device Unavailable<br />
	at com.sun.media.sound.MixerSynth.implOpen(MixerSynth.java:165)<br />
	at com.sun.media.sound.AbstractMidiDevice.doOpen(AbstractMidiDevice.java:144)<br />
	at com.sun.media.sound.AbstractMidiDevice.openInternal(AbstractMidiDevice.java:134)<br />
	at com.sun.media.sound.AbstractMidiDevice.getReceiverReferenceCounting(AbstractMidiDevice.java:339)<br />
	at javax.sound.midi.MidiSystem.getReceiver(MidiSystem.java:243)<br />
	at javax.sound.midi.MidiSystem.getSequencer(MidiSystem.java:442)<br />
	at javax.sound.midi.MidiSystem.getSequencer(MidiSystem.java:348)<br />
	at MiniMusicPlayer1.main(MiniMusicPlayer1.java:9)<br />

And here's the code i want to compile, well actually, a scratch of code:

<br />
import javax.sound.midi.*;</p>
<p>public class MiniMusicPlayer1<br />
{<br />
	public static void main(String[] args)<br />
	{<br />
		try<br />
		{<br />
			Sequencer sequencer = MidiSystem.getSequencer();<br />
		}<br />
		catch (Exception e)<br />
		{<br />
			e.printStackTrace();<br />
		}<br />
	}<br />
}<br />

On the ##java chanell on freenode they told me that this is a OS problem.
I am running Archlinux. I've tried to run the code as root, but the result was the same.
I've tried to find all the processes which uses my sound card and start killing them with the SIGKILL flag, but the output was still the same.
Then I tried to strace the program, but i didn't find anything relevant, but that's me, I don't really know what an strace output should look like, so here's the output. ( I found some No such file or directory referencing to some libs ).
strace.log

I really hope someone here could help me with this issue.