SunVox for ZGE
Moderator: Moderators
Re: SunVox for ZGE
Did you try setting "CallingConvention" property of the ZExternalLibrary component to "cdecl"?
Re: SunVox for ZGE
The result is the same with "cdecl" on linux.
By the way, is it better to use "Stdcall" or "Cdecl"? The wikipedia page is a bit obscure for me
By the way, is it better to use "Stdcall" or "Cdecl"? The wikipedia page is a bit obscure for me
Re: SunVox for ZGE
Hi Ats,
K
They are just different conventions. The biggest difference is that libraries that use STDCALL clean up the memory used to call a function themselves, while CDECL expects the caller to do this instead ( in that case ZGE takes care of this ). The author of a library can just pick which convention they prefer ( most platforms / compilers support both ).
K
Re: SunVox for ZGE
In addition to what Kjell wrote, "stdcall" is mostly a thing on Windows. "cdecl" is the most common convention on other platforms.
Do the Sunvox calls before "sv_load_from_memory" seem to work?
"sv_init" is supposed to return a value larger than zero if successful so please check for that.
Maybe you can also try calling the Sunvox library from a simple C project just to check that your Sunvox binary is ok.
Do the Sunvox calls before "sv_load_from_memory" seem to work?
"sv_init" is supposed to return a value larger than zero if successful so please check for that.
Maybe you can also try calling the Sunvox library from a simple C project just to check that your Sunvox binary is ok.
Re: SunVox for ZGE
Thanks for the explanations. So setting the CallingConvention automatically could be another use of adding LINUX as a builtin constant.
Anyway, I test using sunvox_lofi.so and it's working. So either my old linux computer is too old, which seems a bit odd, or the sunvox.so library is broken. I'm going to plug another computer to test. There are so much power cables around me right now...
Here's the linux trace using sunvox_lofi.so :
Anyway, I test using sunvox_lofi.so and it's working. So either my old linux computer is too old, which seems a bit odd, or the sunvox.so library is broken. I'm going to plug another computer to test. There are so much power cables around me right now...
Here's the linux trace using sunvox_lofi.so :
Code: Select all
Desired audio buffer size: 2048 frames
ALSA: pulse
ALSA HW Default rate: 44100
ALSA HW Rate: 44100 frames
ALSA HW Buffer size: 4096 frames
ALSA HW Period size: 227
ALSA HW Periods: 0
ALSA SW Avail min: 227
ALSA SW Start threshold: 1
ALSA SW Stop threshold: 4096
SOUND: sundog_sound_deinit() begin
SOUND: sundog_sound_deinit() end
Max memory used: 1848214
Re: SunVox for ZGE
After a bit of work to make my test run on Linux 64, I'm having the same results. So the sunvox.so lib might be broken?
Re: SunVox for ZGE
If this is the officially built sunvox.so file then I would try to check with the sunvox community: https://warmplace.ru/forum/viewforum.php?f=12
Let me know how it goes and if I can help in some other way.
Re: SunVox for ZGE
Turns out only some musics are crashing sunvox.so
NightRadio should be on it: https://warmplace.ru/forum/viewtopic.php?f=12&t=5735
NightRadio should be on it: https://warmplace.ru/forum/viewtopic.php?f=12&t=5735
Re: SunVox for ZGE
You were right on the other thread, .elf 64 file needs .so 64 library file.
Now it's not crashing, but it's not working either.
Here's the result for the linux x86_64 SunVox test with a music file that was previously working with sunvox.so (not sunvox_lofi.so)
The slot number is random each time.
Now it's not crashing, but it's not working either.
Here's the result for the linux x86_64 SunVox test with a music file that was previously working with sunvox.so (not sunvox_lofi.so)
Code: Select all
// launch app + sunvox init
// I'm oppening slot 0...
Wrong slot number 1891074528! Correct values: 0...15
Wrong slot number 1891074528! Correct values: 0...15
Wrong slot number 1891074528! Correct values: 0...15
// not playing music
// then after closing app
Wrong slot number 1891074480! Correct values: 0...15
Wrong slot number 1891074480! Correct values: 0...15
SOUND: sundog_sound_deinit() begin
SOUND: sundog_sound_deinit() end
Max memory used: 116332
Re: SunVox for ZGE
In order to verify, I compiled SDL2 Player_linux.bin on my old i386.
The musics that where previously working with 32bits sunvox_lofi.so aren't working anymore.
Again, no crash, but no music either:
Edit:
All right, my fault. Too many cables around me to plug and unplug, and the audio cable was on the wrong slot.
It's working perfectly on i386, 32bits linux and sunvox_lofi.so library...
The musics that where previously working with 32bits sunvox_lofi.so aren't working anymore.
Again, no crash, but no music either:
Code: Select all
// open app
Desired audio buffer size: 2048 frames
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM pulse
ALSA ERROR: Can't open audio device pulse: No such file or directory
ALSA: default
ALSA HW Default rate: 44100
ALSA HW Rate: 44100 frames
ALSA HW Buffer size: 3763 frames
ALSA HW Period size: 940
ALSA HW Periods: 0
ALSA SW Avail min: 940
ALSA SW Start threshold: 1
ALSA SW Stop threshold: 3763
// music isn't playing
// then quit app
SOUND: sundog_sound_deinit() begin
SOUND: sundog_sound_deinit() end
Max memory used: 1429381
All right, my fault. Too many cables around me to plug and unplug, and the audio cable was on the wrong slot.
It's working perfectly on i386, 32bits linux and sunvox_lofi.so library...
Re: SunVox for ZGE
Please try this:
Since you can build ZDesigner, try building it in 64-bit mode. Then use it to generate the binary.
Since you can build ZDesigner, try building it in 64-bit mode. Then use it to generate the binary.
Re: SunVox for ZGE
Interesting test. So I set Delphi Compiler to "Release config - Win 64bit platform" and compiled ZDesigner.exe
Then I compiled the SunVox example to x86_64 linux, then run the elf on my x86_64 linux computer.
I verified that I'm effectively using linux x86_64 sunvos.so too.
The result is the same during initialization:
Wrong slot number 1891074528! Correct values: 0...15
(I'm currently building ZgeBullet.so on the i386 to see how it goes)
Then I compiled the SunVox example to x86_64 linux, then run the elf on my x86_64 linux computer.
I verified that I'm effectively using linux x86_64 sunvos.so too.
The result is the same during initialization:
Wrong slot number 1891074528! Correct values: 0...15
(I'm currently building ZgeBullet.so on the i386 to see how it goes)
Re: SunVox for ZGE
Ok. Just to be sure, I made an update now that makes ZDesigner output 64-bit compatible output regardless if it is built in 32-bit or 64-bit.
Re: SunVox for ZGE
Please try inserting writeln-statements to see that the correct code is executed.
In ZExpressions.pas
line 2309, insert line with "writeln('checking args: ' + argtypes);"
line 2351, change the line with "assert" into "writeln('fail');"
Then build and check if those lines appear in the output.
In ZExpressions.pas
line 2309, insert line with "writeln('checking args: ' + argtypes);"
line 2351, change the line with "assert" into "writeln('fail');"
Then build and check if those lines appear in the output.
Re: SunVox for ZGE
I like it when I have things to test with my morning coffee
But the results aren't incredible:
(just to be sure, other versions of sunvox.so (ex: 32bits) only displays "./sunvox.so" and exit)
But the results aren't incredible:
Code: Select all
./SunVox_x86_64_debug
checking args:
fail
checking args:
fail
checking args:
fail
checking args:
fail
checking args:
fail
Wrong slot number -1803177552! Correct values: 0...15
checking args:
fail
checking args:
fail
checking args:
fail
Wrong slot number -1803177552! Correct values: 0...15
checking args:
fail
Wrong slot number -1803177552! Correct values: 0...15
checking args:
fail
Wrong slot number -1803177600! Correct values: 0...15
checking args:
fail
Wrong slot number -1803177600! Correct values: 0...15
SOUND: sundog_sound_deinit() begin
SOUND: sundog_sound_deinit() end
Max memory used: 116332