Page 1 of 1

Crashes with sound patch

Posted: 28.03.2017, 23:13
by HB
With resolving the linking error of the audio patch Celestia can be build properly, however the executable crashes all the time.
Celestia is build with VC++ 2008 express edition on a windows 7 x86 enterprise machine.

It for sure that it is related with the audio support patch. I comment out all code related to audio support of celx.cpp, celestiacore.h and cpp, command.cpp and cmdparser.cpp. Further the link to fmod libraries and paths in celestia.vcproj. In short get rid of audio support.

A build of Celestia with the above modifications, thus without audio, works fine.

In a stadium of fault-finding it might be better to have audio support as a compiler option. In this way other changes to Celestia can be committed without the interference of the debug phase of audio support.

Posted: 29.03.2017, 06:16
by Alexell
The executable file does not crash all the time. Of 10 starts, only 3 falls. Demo scripts from the scripts\audio folder work well, clearly show how the audio patch works. I did not comment on the audio patch on my Celestia, because crashes do not happen too often.

As already written in this comment, we need help to find out the cause of the problem. There may be memory leaks.

Added after 4 minutes 23 seconds:
HB, I hope you remember to put fmod.dll in the root folder Celestia?

Posted: 29.03.2017, 22:00
by HB
What I've found out so far on this issue is that the audio patch is not compatible with Windows 7 x86 Enterprise which includes Service Pack 1.
Celestia crashes at the moment the cel scripts are initialised and/or loaded into memory during the start-up phase. This has been shown by the results of a Process Monitor tool. As far as I remember scripts have been caused memory leaks in the past. So likely indeed a memory leak.

The workaround for this problem is simple: just change the compatibility mode of Celestia. Anything from Windows XP onwards is ok. I've used a compatibility with Windows 7. By turning on compatibility mode an extra layer(shims) are between Celestia and Windows. A function call from the application to a windows dll is now to that shim instead of direct to the dll.

Later on I'll do the same trick on a debug build of Celestia. Maybe some other causes can be found with that as well.

What I'd like to know from the Celestia community if this problem also occurs on other Windows platforms as XP, Vista, 8, 8.1, 10 etc. with compatibility mode turned off?

Added after 38 minutes 9 seconds:
Start up Celestia with sound demo celx the following error appears:
[string "E:\C++\VC++2008\Celestia-master\script\au..."]:42: attempt to call method 'play' (a nil value)

Posted: 31.03.2017, 15:19
by Alexell
HB wrote:What I'd like to know from the Celestia community if this problem also occurs on other Windows platforms as XP, Vista, 8, 8.1, 10 etc. with compatibility mode turned off?
This is what we know when I'll post binary files on forum for review. But it will be in a month or two.
HB wrote:Start up Celestia with sound demo celx the following error appears:

[string "E:\C++\VC++2008\Celestia-master\script\au..."]:42: attempt to call method 'play' (a nil value)

Are you sure you're running the right script? I have everything working, I can even record video, where it will be seen that all works fine.

Posted: 01.04.2017, 09:53
by HB
I wrote:
Start up Celestia with sound demo celx the following error appears:

[string "E:\C++\VC++2008\Celestia-master\script\au..."]:42: attempt to call method 'play' (a nil value)

It's a mistake made by me. Start up Celestia with a cel(x) scripts will point to my original Celestia application. That's an earlier version without the audio patch.
Sorry by that.
However sound_demo.celx will start a audio file comment.ogg, which doesn't exist. Fix that by a correction of the celx script.(ogg -> mp3)
Audio works fine now.

Still continue looking for memory leaks, it's hard job to do.