Crashing Randomly on Compile [Sound.hx:118: Error]

245 views
Skip to first unread message

Pizzamakesgames

unread,
Oct 12, 2015, 5:46:08 AM10/12/15
to HaxeFlixel
Hey there!

I've been having this issue ever since I've started using Haxeflixel, so it's nothing new to me, but it's starting to get irritating.
Every say like 5th compile, the game will crash and the log will show this:

Build succeeded
Done(0)
haxelib run lime run
"Project.xml" neko -debug
Running process: D:\hyperdev\haxe\haxe\haxelib.exe run lime run "Project.xml" neko -debug
Sound.hx:118: Error: Could not load "assets/music/SnowPath_nonproperloop.ogg"
AL lib
: (EE) MMDevApiOpenPlayback: Device init failed: 0x80004005
Invalid operation (/)
Called from flixel.system.FlxSound::update line 241
Called from flixel.system.frontEnds.SoundFrontEnd::update line 273
Called from flixel.FlxGame::update line 696
Called from flixel.FlxGame::step line 648
Called from flixel.FlxGame::onEnterFrame line 493
Called from openfl._legacy.events.EventDispatcher::dispatchEvent line 98
Called from openfl._legacy.display.DisplayObject::__dispatchEvent line 182
Called from openfl._legacy.display.DisplayObject::__broadcast line 161
Called from openfl._legacy.display.DisplayObjectContainer::__broadcast line 280
Called from openfl._legacy.display.Stage::__render line 1103
Called from openfl._legacy.display.Stage::__checkRender line 351
Called from openfl._legacy.display.Stage::__pollTimers line 1084
Called from openfl._legacy.display.Stage::__doProcessStageEvent line 430
Done(1)

Is this problem known? The file is definitely not the .ogg file as it'll just work if I try compiling again without changing anything.

Andrei Regiani

unread,
Oct 12, 2015, 6:03:00 AM10/12/15
to haxef...@googlegroups.com
>Is this problem known?
No

Try to build with -Dnext

lime test neko -debug -Dnext

Also, post your versions

haxelib list

'next' refers to OpenFL backend, the current version of HaxeFlixel is using by default the legacy OpenFL, I just wonder if will solve your problem.

Pizzamakesgames

unread,
Oct 12, 2015, 6:23:30 AM10/12/15
to haxef...@googlegroups.com
Hey Andrei, thank you very much. Here's the results:

D:\hyperdev\Projects\Skullz2>lime test neko -debug -Dnext
Uncaught exception - load.c(237) : Failed to load library : ./std.ndll

D
:\hyperdev\Projects\Skullz2>haxelib list
actuate
: [1.8.6]
box2d
: [1.2.3]
flixel
-addons: [1.1.0]
flixel
-demos: [1.1.2]
flixel
-templates: [1.0.2]
flixel
-tools: 1.1.0 [1.1.1]
flixel
-ui: [1.0.2]
flixel
: [3.3.11]
haxelib_client
: [3.2.0-rc.3]
hxcpp
: [3.2.102]
layout
: [1.2.1]
lime
-samples: 2.5.1 [2.6.0]
lime
: 2.5.2 [2.6.1]
nme
: [5.4.2]
openfl
-samples: 3.1.0 [3.3.0]
openfl
: 3.2.2 [3.3.2]
swf
: 1.9.1 [2.0.1]

Pizzamakesgames

unread,
Oct 12, 2015, 6:30:25 AM10/12/15
to HaxeFlixel
Uh, any way to revert that? That error just came up for the first time and now it's not going away anymore.

Andrei Regiani

unread,
Oct 12, 2015, 6:34:33 AM10/12/15
to haxef...@googlegroups.com
Next time don't trust strangers in the internet. Just kidding :P delete folder export/, this should clean the build process

On Mon, Oct 12, 2015 at 1:30 PM, Pizzamakesgames <feliks...@online.de> wrote:
Uh, any way to revert that? That error just came up for the first time and now it's not going away anymore.

--
HaxeFlixel Development Community
See our github https://github.com/haxeflixel/ and our documentation http://haxeflixel.com/documentation/
---
You received this message because you are subscribed to a topic in the Google Groups "HaxeFlixel" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/haxeflixel/bjJICASBDo0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to haxeflixel+...@googlegroups.com.
Visit this group at http://groups.google.com/group/haxeflixel.
To view this discussion on the web visit https://groups.google.com/d/msgid/haxeflixel/77aded09-33fa-4bef-8fb0-40d14ea8be89%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Andrei Regiani

unread,
Oct 12, 2015, 6:46:04 AM10/12/15
to haxef...@googlegroups.com
Can you build any of the HaxeFlixel demos (one that has sounds) to check if this issue is only with your project?

Pizzamakesgames

unread,
Oct 12, 2015, 7:00:05 AM10/12/15
to haxef...@googlegroups.com
Phew, that fixed it, thanks!
 
I have a hunch, though I have no idea if that could be it. While trying to compile with -Dnext, I first got an error about a string that should rather be a TextFormat.align in one of my lines unrelated to the sound. I fixed that, then I got the ndll error. I didn't get that error about the String when compiling from FlashDevelop, so I didn't know there was something wrong to begin with. So, might that somehow lead to the crashing with the error wrongly pointing to the .ogg file not being able to be loaded? I havn't experienced any crashes since.

Pizzamakesgames

unread,
Oct 12, 2015, 7:26:35 AM10/12/15
to HaxeFlixel
Yeah, did a load more compiling and it didn't crash still. Just weird that it didn't throw the same error while compiling with FlashDevelop. Would wonder why that is, otherwise I'd say this is solved. Sorry for wasting your time with a simple mistake like that.

Pizzamakesgames

unread,
Oct 13, 2015, 10:20:54 AM10/13/15
to haxef...@googlegroups.com
Did have some more crashes with both .ogg and .wav files on the neko target. In fact, trying to replicate it just now "worked" first try.

Build succeeded
Done(0)
haxelib run lime run "Project.xml" neko -debug
Running process: D:\hyperdev\haxe\haxe\haxelib.exe run lime run "Project.xml" neko -debug
AL lib: (EE) MMDevApiOpenPlayback: Device init failed: 0x80004005
Sound.hx:118: Error: Could not load "assets/sounds/stepsfx1.ogg"
Sound.hx:118: Error: Could not load "assets/sounds/stepsfx2.ogg"
Sound.hx:118: Error: Could not load "assets/sounds/stepsfx1.ogg"
Invalid operation (/)
Called from flixel.system.FlxSound::update line 241
Called from flixel.group.FlxTypedGroup::update line 89
Called from Snow01x::update line 82
Called from flixel.FlxState::tryUpdate line 155
Called from flixel.FlxGame::update line 700
Called from flixel.FlxGame::step line 648
Called from flixel.FlxGame::onEnterFrame line 493
Called from openfl._legacy.events.EventDispatcher::dispatchEvent line 98
Called from openfl._legacy.display.DisplayObject::__dispatchEvent line 182
Called from openfl._legacy.display.DisplayObject::__broadcast line 161
Called from openfl._legacy.display.DisplayObjectContainer::__broadcast line 280
Called from openfl._legacy.display.Stage::__render line 1103
Called from openfl._legacy.display.Stage::__checkRender line 351
Called from openfl._legacy.display.Stage::__pollTimers line 1084
Called from openfl._legacy.display.Stage::__doProcessStageEvent line 430
Done(1)


Last time I found an unrelated error by using "neko test lime" via cmd, which I thought caused the problem, though now this approach compiled fine right after.

Was not able to recreate the issue on any project other than mine, though.

Snow01x::update line 82 is super.update();

Pizzamakesgames

unread,
Oct 13, 2015, 2:14:24 PM10/13/15
to HaxeFlixel
Another info that may be helpful: on a completely unrelated game I did have an issue where the finished windows standalone build would randomly not have any sound on every odd start of the game, which reflects the inability to load any sound files on compile with this project. 

Andrei Regiani

unread,
Oct 13, 2015, 2:26:51 PM10/13/15
to haxef...@googlegroups.com
That's not normal, something is broken in your installation, not hard to happen when the whole stack of tools are supported by different developers.

I'm not sure if this is a good advice
, but I in your position would reinstall everything, Haxe, OpenFL, Lime, HaxeFlixel, even FlashDevelop, using latest versions. The last hope would be to use everything git/dev version.

On Tue, Oct 13, 2015 at 9:14 PM, Pizzamakesgames <feliks...@online.de> wrote:
Another info that may be helpful: on a completely unrelated game I did have an issue where the finished windows standalone build would randomly not have any sound on every odd start of the game, which reflects the inability to load any sound files on compile with this project. 

--
HaxeFlixel Development Community
See our github https://github.com/haxeflixel/ and our documentation http://haxeflixel.com/documentation/
---
You received this message because you are subscribed to the Google Groups "HaxeFlixel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haxeflixel+...@googlegroups.com.

Pizzamakesgames

unread,
Oct 13, 2015, 4:04:12 PM10/13/15
to haxef...@googlegroups.com
Thanks for the suggestion! Did reinstall FlashDevelop, Haxe, Neko, OpenFL, Lime, Haxeflixel and even Visual Studio. Will report back after the next working period.

Pizzamakesgames

unread,
Oct 15, 2015, 8:19:08 AM10/15/15
to haxef...@googlegroups.com
I'm afraid that didn't fix it. Having as much as 3 crashes in a row before it just starts without any errors again. The project isn't particularly big yet, so it might still be easy to figure it out by process of elimination. If only I had some pointers...is there anything I could do to help figure it out except remove parts of the project one by one until I'm sure it doesn't crash anymore?

Pizzamakesgames

unread,
Oct 18, 2015, 6:36:47 AM10/18/15
to haxef...@googlegroups.com
I still need to do some testing, but I think I may have found the issue here. Up until now, I was handling sounds like this:

var step1sfx = new FlxSound();

override public function create():Void
{
step1sfx.loadEmbedded("assets/sounds/stepsfx1.ogg", false);
}

Now, I'm handling them like this:

var introsfx1_1:FlxSound;

override public function create():Void
{
introsfx1_1 = FlxG.sound.load("1_introsfx1");
}

With this in the Project.xml:

<assets path="assets/sounds" unless="flash">
<sound path="1_introsfx1.ogg" id="1_introsfx1" />
</assets>

Might this have been causing the crashes?

Pizzamakesgames

unread,
Oct 18, 2015, 6:54:15 AM10/18/15
to HaxeFlixel
Humm, totally just crashed again. Bummer.

Build succeeded
Done(0)
haxelib run lime run "Project.xml" neko -debug
Running process: D:\Projects\hyperdev\haxe\haxelib.exe run lime run "Project.xml" neko -debug
AL lib: (EE) MMDevApiOpenPlayback: Device init failed: 0x80004005
Sound.hx:118: Error: Could not load "assets/sounds/1_introsfx1.ogg"
Invalid operation (/)
Called from flixel.system.FlxSound::update line 241
Called from flixel.group.FlxTypedGroup::update line 89
Called from flixel.system.frontEnds.SoundFrontEnd::update line 278
Called from flixel.FlxGame::update line 696
Called from flixel.FlxGame::step line 648
Called from flixel.FlxGame::onEnterFrame line 493
Called from openfl._legacy.events.EventDispatcher::dispatchEvent line 98
Called from openfl._legacy.display.DisplayObject::__dispatchEvent line 182
Called from openfl._legacy.display.DisplayObject::__broadcast line 161
Called from openfl._legacy.display.DisplayObjectContainer::__broadcast line 286
Message has been deleted

SruloArt

unread,
Oct 18, 2015, 7:53:10 AM10/18/15
to HaxeFlixel
* I've seen that error before, most likely you have another audio device (like a sound card, HDMI audio output etc) on your machine, disabling it should "solve" that issue (not really a fix, but this would have to do).

* HaxeFlixel should have a workaround, but that would only be relevant to OpenFL-Next (make sure the proper device is initialized), but personally I think should be resolved at the Lime-level.  

Pizzamakesgames

unread,
Oct 18, 2015, 11:19:07 AM10/18/15
to haxef...@googlegroups.com
Since I also do a lot of audio work, I have an abundance of audio devices. I often work on music simultaneous to the game, meaning I can't possibly disable them all every time I compile. The issue also persists on the completed build. Any time it's started there's a chance it won't have any audio. As I can't possibly know the audio devices of any given player, that issue would even persist if I were able to disable the extra audio devices on my end.

andre...@gmail.com

unread,
Oct 18, 2015, 1:10:34 PM10/18/15
to haxef...@googlegroups.com
Could you prepare a simple demo where we can reproduce this error? What OS you use?

On Oct 18, 2015, at 18:19, Pizzamakesgames <feliks...@online.de> wrote:

Since I also do a lot of audio work, I have an abundance of audio devices. I often work on music simultaneous to the game, meaning I can't possibly disable them all every time I compile. Also the issue persists on the completed game. Any time it's started there's a chance it won't have any audio...that's not acceptable, is it?

--
HaxeFlixel Development Community
See our github https://github.com/haxeflixel/ and our documentation http://haxeflixel.com/documentation/
---
You received this message because you are subscribed to the Google Groups "HaxeFlixel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to haxeflixel+...@googlegroups.com.
Visit this group at http://groups.google.com/group/haxeflixel.

Pizzamakesgames

unread,
Oct 20, 2015, 8:18:32 AM10/20/15
to HaxeFlixel
Thanks, yeah I'd be happy to make a demo reproducing the issue for you, though it hasn't been occuring anymore since last time I posted. I did a couple miscellaneous things...I'll see if it won't turn up again after a couple days of developing and report back.

Pizzamakesgames

unread,
Oct 23, 2015, 9:07:43 AM10/23/15
to HaxeFlixel
Had the error come up very rarely when working on the game yesterday,  didn't have any luck reproducing the issue today, both with a demo project that does nothing but load a sound in the MenuState's create function as well as the game on which it has been happening, compiling both projects dozens of times. Will keep you posted.

Pizzamakesgames

unread,
Oct 25, 2015, 5:41:51 AM10/25/15
to haxef...@googlegroups.com
Oh Interesting, it just happened while the game was running. The sound was just gone and then the next time a sound object was gonna get loaded, the Output threw the same "Sound.hx:118: Error: Could not load" as when compiling.

Pizzamakesgames

unread,
Oct 25, 2015, 6:12:38 AM10/25/15
to HaxeFlixel
Here is the game: https://itch.io/jam/bitesizedhorror/rate/40764

The sound cuts out right where the text "It's not every day that you..." comes up, then again on "Supposedly, there was this fella..." and again later. It seems to fix itself if you deselect/reselect the window. Furthermore, the game consistently crashed on using FlxG.sound.playMusic("path/to/music.ogg");

Here's the game's source if anybody wants to try and help me figure out what's going on: https://www.dropbox.com/s/53m2udvvlua46ax/SkullzTwoText.rar

Pizzamakesgames

unread,
Oct 25, 2015, 6:25:06 AM10/25/15
to HaxeFlixel
Apparently using neko instead of cpp does the trick at least for the cutting out during gameplay problem.

Pizzamakesgames

unread,
Oct 25, 2015, 6:44:52 AM10/25/15
to HaxeFlixel
Here's what's happening if I try "lime test neko -debug -Dnext"

D:\Projects\hyperdev\Projects\SkullzTwoText>lime test neko -debug -Dnext
D:/Projects/hyperdev/haxe/lib/flixel/3,3,11/flixel/input/gamepad/FlxGamepadManag
er.hx:360: lines 360-369 : Class not found : JoystickEvent

Pizzamakesgames

unread,
Oct 25, 2015, 7:20:34 AM10/25/15
to HaxeFlixel
This is the appropriate function throwing the error, by the way:

...\haxe\lib\openfl\3,3,9\openfl\_legacy\media\Sound.hx

public function load (stream:URLRequest, context:SoundLoaderContext = null, forcePlayAsMusic:Bool = false):Void {
bytesLoaded = 0;
bytesTotal = 0;
__handle = lime_sound_from_file (stream.url, forcePlayAsMusic);
if (__handle == null) {
trace ("Error: Could not load \"" + stream.url + "\"");
dispatchEvent (new IOErrorEvent (IOErrorEvent.IO_ERROR));
} else {
url = stream.url;
__loading = true;
__checkLoading ();
__loading = false;
dispatchEvent (new Event (Event.COMPLETE));
}
}

Pizzamakesgames

unread,
Oct 25, 2015, 8:14:39 AM10/25/15
to HaxeFlixel
At this point I might be better off exporting to flash and using a wrapper, eh?

Pizzamakesgames

unread,
Oct 25, 2015, 8:33:53 AM10/25/15
to HaxeFlixel
Flash export seems to be running well: http://pizzamakesgames.itch.io/a-skullz-story

Pizzamakesgames

unread,
Oct 25, 2015, 10:53:51 AM10/25/15
to HaxeFlixel
Ah, by the way, disabling all audio devices other than my speakers didn't change anything about the problem :/ 

SruloArt

unread,
Oct 25, 2015, 1:37:44 PM10/25/15
to HaxeFlixel
* I recommend you to approach https://twitter.com/grapefrukt, he encountered the same issue when he released Rymdkapsel on Steam, he got it solved somehow, I hope.

Pizzamakesgames

unread,
Oct 25, 2015, 3:19:12 PM10/25/15
to HaxeFlixel
Thank you! I've sent him a tweet, that'd be cool if he knew something about that. I'm afraid I might have littered up the thread with a little too much information by now, I hope people will still be able to see the issue through this mess. To summarize it again real quick:

It's about this error: Sound.hx:118: Error: Could not load "assets/music/SnowPath_nonproperloop.ogg", leading to no sound on every odd start of the game, only on the cpp target, after it's already been compiled, and it's happening inconsistently. The appropriate scripts the error is pointing to are openfl's sound.hx and flixel's FlxSound. Though, I'm suspecting the fault to be somewhere within my setup or the code of my game.

Pizzamakesgames

unread,
Oct 26, 2015, 6:29:58 AM10/26/15
to HaxeFlixel
Something curious that may or may not be related. I'm typing text during gameplay, with each letter playing a sound. I've been having issues with the sound cutting out after a while. While testing, it seemed like the sound would always cut out at pretty precisely sound number 255. Of course, when trying to record the issue multiple times, it never cut out at all for some reason.

Here is it as it should be working and as it only did when trying to record the issue: https://youtu.be/WNi0ItXkOdM

Pizzamakesgames

unread,
Oct 26, 2015, 9:50:28 AM10/26/15
to haxef...@googlegroups.com
Filed two Issue Reports on the HaxeFlixel GitHub repo to spare people the mess of this thread if they want to try and solve the issue:
Reply all
Reply to author
Forward
0 new messages