jsettlers / settlers-remake

A Remake of "The Settlers III" for Windows, Linux, Mac and Android
http://www.settlers-android-clone.com
MIT License
355 stars 101 forks source link

Multiple instances cause "javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 22050.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported." #729

Open krichter722 opened 6 years ago

krichter722 commented 6 years ago

Starting a second instance of JSettlers in the nightly distribution 2018-06-08_21-13-14__24deb9a causes

Source: (file:/home/richter/JSettlers/JSettlers.jar <no signer certificates>)
Warning: Could not load LocaleSuffix [locale=de_DE, useCountry=true]. Falling back to next file.
javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 22050.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.
    at com.sun.media.sound.DirectAudioDevice$DirectDL.implOpen(DirectAudioDevice.java:513)
    at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:121)
    at go.graphics.swing.sound.SwingSoundPlayer$SoundPlayerTask.run(SwingSoundPlayer.java:93)
    at java.lang.Thread.run(Thread.java:748)
javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 22050.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.
    at com.sun.media.sound.DirectAudioDevice$DirectDL.implOpen(DirectAudioDevice.java:513)
    at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:121)
    at go.graphics.swing.sound.SwingSoundPlayer$SoundPlayerTask.run(SwingSoundPlayer.java:93)
    at java.lang.Thread.run(Thread.java:748)
javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 22050.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.
    at com.sun.media.sound.DirectAudioDevice$DirectDL.implOpen(DirectAudioDevice.java:513)
    at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:121)
    at go.graphics.swing.sound.SwingSoundPlayer$SoundPlayerTask.run(SwingSoundPlayer.java:93)
    at java.lang.Thread.run(Thread.java:748)
javax.sound.sampled.LineUnavailableException: line with format PCM_SIGNED 22050.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported.
    at com.sun.media.sound.DirectAudioDevice$DirectDL.implOpen(DirectAudioDevice.java:513)
    at com.sun.media.sound.AbstractDataLine.open(AbstractDataLine.java:121)
    at go.graphics.swing.sound.SwingSoundPlayer$SoundPlayerTask.run(SwingSoundPlayer.java:93)
    at java.lang.Thread.run(Thread.java:748)

to be logged for the second. I have no idea whether multiple instances are supported and I don't see a use case for such a support, but the game should either be a singleton or the exception should be silenced or avoided.