MightyPrinny / godot-FLMusicLib

GDNative library that plays mp3, chiptune and tracker music files using Game Music Emu, Minimp3 and openmpt
Creative Commons Zero v1.0 Universal
51 stars 7 forks source link

Crash on play_music with Godot 3.2.1 in Linux (Ubuntu Bionic) #3

Closed IoriBranford closed 4 years ago

IoriBranford commented 4 years ago

Script:

extends Node2D

onready var music = preload("res://FLMusicLib/FLMusic.gdns").new()

func _ready():
    music.play_music("res://music/01 - Jagd Flieger.vgz", 0)

The game closes on play_music. Also tried nsf and vgm files. When pressing play in the editor, it quits silently. When exported and run from the command line, it outputs:

handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7ff4af3cef20] (??:0)
[2] ./HSW.x86_64() [0x9e532f] (??:?)
[3] godot_variant godot::__wrapped_method<FLMusicLib, bool, godot::String, int, bool, int, int, int>(void*, void*, void*, int, godot_variant**) (??:0)
[4] ./HSW.x86_64() [0x1b6b9e7] (<artificial>:?)
[5] ./HSW.x86_64() [0xa2077f] (??:?)
[6] ./HSW.x86_64() [0x92059d] (??:?)
[7] ./HSW.x86_64() [0x1b94c89] (<artificial>:?)
[8] ./HSW.x86_64() [0x1ba3785] (<artificial>:?)
[9] ./HSW.x86_64() [0x1725bf5] (??:?)
[10] ./HSW.x86_64() [0x1330508] (??:?)
[11] ./HSW.x86_64() [0x98d6f4] (??:?)
[12] ./HSW.x86_64() [0x16b4dfc] (<artificial>:?)
[13] ./HSW.x86_64() [0x16b4d53] (<artificial>:?)
[14] ./HSW.x86_64() [0x16e7fb7] (??:?)
[15] ./HSW.x86_64() [0x16e803a] (??:?)
[16] ./HSW.x86_64() [0x68210e] (??:?)
[17] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7ff4af3b1b97] (??:0)
[18] ./HSW.x86_64() [0x68fb1e] (??:?)
-- END OF BACKTRACE --
Aborted (core dumped)
MightyPrinny commented 4 years ago

Maybe try the demo, I use debian buster and it works with nsf and vgm, I don't think vgz files work and iirc you have to pass every parameter.

IoriBranford commented 4 years ago

I tried and still had the problem:

music.play_music("res://music/01 - Jagd Flieger.vgm", 0, false, -1, -1, 0)

But the backtrace is a bit different.

handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7f294e902f20] (??:0)
[2] godot::AudioStreamPlayer::is_playing() const (??:0)
[3] FLMusicLib::PlayMusic(godot::String, int, bool, int, int, int) (??:0)
[4] godot_variant godot::__wrapped_method<FLMusicLib, bool, godot::String, int, bool, int, int, int>(void*, void*, void*, int, godot_variant**) (??:0)
[5] ./HSW.x86_64() [0x1b6b9e7] (<artificial>:?)
[6] ./HSW.x86_64() [0xa2077f] (??:?)
[7] ./HSW.x86_64() [0x92059d] (??:?)
[8] ./HSW.x86_64() [0x1b94c89] (<artificial>:?)
[9] ./HSW.x86_64() [0x1ba3785] (<artificial>:?)
[10] ./HSW.x86_64() [0x1725bf5] (??:?)
[11] ./HSW.x86_64() [0x1330508] (??:?)
[12] ./HSW.x86_64() [0x98d6f4] (??:?)
[13] ./HSW.x86_64() [0x16b4dfc] (<artificial>:?)
[14] ./HSW.x86_64() [0x16b4d53] (<artificial>:?)
[15] ./HSW.x86_64() [0x16e7fb7] (??:?)
[16] ./HSW.x86_64() [0x16e803a] (??:?)
[17] ./HSW.x86_64() [0x68210e] (??:?)
[18] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f294e8e5b97] (??:0)
[19] ./HSW.x86_64() [0x68fb1e] (??:?)
-- END OF BACKTRACE --
Aborted (core dumped)

Do you mean a sample project for the library? Where can I find it?

MightyPrinny commented 4 years ago

The demo branch is actually a godot project that you can download, I should've mentioned that in the readme.

IoriBranford commented 4 years ago

The autoloaded global script had the missing piece. add_child(flmusiclib) Thank you.