IsmAvatar / LateralGM

A free Game Maker source file editor
http://lateralgm.org/
Other
96 stars 25 forks source link

Error when opening a sound's properties #539

Closed kargaroc closed 3 years ago

kargaroc commented 4 years ago

I'm trying to extract the audio files from an old gm6 file that I have, yet every time I try to, it gives an error. I'm not trying to listen to the file, just extract it.

Note that I don't have PulseAudio installed, and its mentioned in the error log. I assume that it tries to use it, fails because it doesn't exist, and throws an error.

A more graceful way to fail would be to continue as normal, but with sound playback disabled. That way you can at least look at a sound's properties (and presumably save the sound to a file), without PA.

This is the error:

LateralGM Version: 1.8.198
Working Directory: /home/pi/lateralgm/lateralgm.jar

Operating System: Linux
Version: 5.4.51-v7l+
Architecture: arm

Java Name: OpenJDK Client VM
Java Vendor: Oracle Corporation
Version: 1.8.0_212

Current Thread: AWT-EventQueue-1
Available processors (cores): 4
Free memory (bytes): 45194000
Maximum memory (bytes): 259522560
Total memory available to JVM (bytes): 147853312

File system root: /
Total space (bytes): 492258959360
Free space (bytes): 252369625088
Usable space (bytes): 227364233216

Stack trace:
java.lang.IllegalStateException: Line not open
    at org.classpath.icedtea.pulseaudio.PulseAudioClip.getMicrosecondPosition(PulseAudioClip.java:353)
    at org.lateralgm.subframes.SoundFrame$JavaSoundPlayer.getPosition(SoundFrame.java:269)
    at org.lateralgm.subframes.SoundFrame.updatePositionLabel(SoundFrame.java:696)
    at org.lateralgm.subframes.SoundFrame.loadSound(SoundFrame.java:861)
    at org.lateralgm.subframes.SoundFrame.<init>(SoundFrame.java:380)
    at org.lateralgm.subframes.ResourceFrame$DefaultResourceFrameFactory.makeFrame(ResourceFrame.java:102)
    at org.lateralgm.components.impl.ResNode.openFrame(ResNode.java:222)
    at org.lateralgm.components.impl.ResNode.openFrame(ResNode.java:206)
    at org.lateralgm.main.Listener$NodeMenuListener.actionPerformed(Listener.java:857)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:842)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:886)
    at java.awt.Component.processMouseEvent(Component.java:6539)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
    at java.awt.Component.processEvent(Component.java:6304)
    at java.awt.Container.processEvent(Container.java:2239)
    at java.awt.Component.dispatchEventImpl(Component.java:4889)
    at java.awt.Container.dispatchEventImpl(Container.java:2297)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
    at java.awt.Container.dispatchEventImpl(Container.java:2283)
    at java.awt.Window.dispatchEventImpl(Window.java:2746)
    at java.awt.Component.dispatchEvent(Component.java:4711)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
    at java.awt.EventQueue.access$500(EventQueue.java:97)
    at java.awt.EventQueue$3.run(EventQueue.java:709)
    at java.awt.EventQueue$3.run(EventQueue.java:703)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
    at java.awt.EventQueue$4.run(EventQueue.java:733)
    at java.awt.EventQueue$4.run(EventQueue.java:731)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
    at org.GNOME.Accessibility.AtkWrapper$6.dispatchEvent(AtkWrapper.java:715)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
RobertBColton commented 4 years ago

Ah, probably related to the current modern version of the sound editor playback label. May be a regression since lgm16b4, which is good news for you as you can try lgm16b4 to accomplish what you want until a fix is submitted. https://github.com/IsmAvatar/LateralGM/releases/tag/v1.6b4

RobertBColton commented 3 years ago

Alright I've sent the patch 00fcdf627aaf81d6dff222e631962a0fb024d81d for this and you can download v1.8.204 with the fix included. Please let me know if this works, because I wasn't sure if I was also supposed to wrap some of the other methods. https://github.com/IsmAvatar/LateralGM/releases/download/v1.8.204/lateralgm.jar

Some more information about what happened here is that related to #227, this is yet another OpenJDK bug. The documentation for the DataLine and Clip interfaces does not specify that getMicrosecondPosition or getMicrosecondLength should throw exceptions. Yet, here they do under the OpenJDK IcedTea Pulse audio implementation, which is why this does not occur under Oracle's own JDK. https://docs.oracle.com/javase/8/docs/api/javax/sound/sampled/DataLine.html#getMicrosecondPosition-- https://docs.oracle.com/javase/8/docs/api/javax/sound/sampled/Clip.html#getMicrosecondLength--

Although, I do now see that getMicrosecondPosition is defined in terms of when the line was opened. The length explicitly states that it returns a special value when the clip is not open. So maybe it is partly our fault as well.

RobertBColton commented 3 years ago

I decided to send 55914c4f3a047ba15d5daf27d962fdfada7d4635 to fix the duration too. You can download the new LGM 1.8.221 release jar now. With that I am going to close this issue as you should not have any more exceptions under OpenJDK.

If you do have any more issues, please feel free to open a new ticket.