JDK-6732060 : Unexpected LineUnavailableException
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.sound
  • Affected Version: OpenJDK6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2008-07-31
  • Updated: 2012-03-22
  • Resolved: 2008-09-24
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
OpenJDK6Resolved
Related Reports
Duplicate :  
Description
An attempt to open a data line (explicitly or implicitly) leads to LineUnavailableException if made after calling MidiSystem.getSequencer(true) or MidiSystem.getReceiver().
See the example below.

-------------------------------------------------------------------------------------
package testapp.sound;

import javax.sound.midi.MidiSystem;
import javax.sound.midi.MidiUnavailableException;
import javax.sound.midi.Synthesizer;

public class LUE {
    public static void main(String[] args) {
        LUE inst = new LUE();
        
        try {
            inst.m1(args);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
    
    public void m1(String[] args) throws Exception {

        try {
            
            // MidiSystem.getTransmitter(); - throws MUE, OK
            // MidiSystem.getSynthesizer(); - OK
            // MidiSystem.getSequencer(false); - OK
            
            // calling this makes initiateLUE() throw LUE
            MidiSystem.getSequencer(true);
            
            // calling this makes initiateLUE() throw LUE
            // MidiSystem.getReceiver();
            
        } catch (MidiUnavailableException e) {
            e.printStackTrace();
            System.out.println("MUE thrown, OK. Moving on.");
        }
        
        initiateLUE();
    }

    private void initiateLUE() throws Exception {
        Synthesizer synth =  MidiSystem.getSynthesizer();
        synth.open();
        synth.close();
    }

}
-------------------------------------------------------------------------------------

The output:
-------------------------------------------------------------------------------------
> java -cp classes testapp.sound.LUE
javax.sound.midi.MidiUnavailableException: javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.
        at com.sun.media.sound.SoftSynthesizer.open(SoftSynthesizer.java:777)
        at com.sun.media.sound.SoftSynthesizer.open(SoftSynthesizer.java:712)
        at testapp.sound.LUE.initiateLUE(LUE.java:41)
        at testapp.sound.LUE.m1(LUE.java:36)
        at testapp.sound.LUE.main(LUE.java:12)
-------------------------------------------------------------------------------------

Comments
EVALUATION Issue resolved by the fixes for 6717691.
24-09-2008

EVALUATION Exception should not be thrown.
19-08-2008