Compiling 2.2.0 - Crashes upon launch of game

Subforum for discussion and help with ScummVM's iPhone port

Moderator: ScummVM Team

Post Reply
8BitAirwaves
Posts: 22
Joined: Fri Oct 23, 2015 8:19 pm
Location: Boulder, Colorado
Contact:

Compiling 2.2.0 - Crashes upon launch of game

Post by 8BitAirwaves »

I was wondering if anyone had any pointers for me. I compiled ScummVM via terminal and the app crashes when I try to start a game. I compiled with and without the MT-32 emu, same result.

From another thread I saw I should change the Product Name from “scummvm” to “ScummVM” and it crashes the same either way.

Two other notes- I have to change Enable Bitcode in the target to NO to get it to build.
Also I have to use the script below to get it to build without a strange “FLAC.cpp” error which indicates that the export.h file is missing when it is indeed where it should be (build-include-FLAC-export.h)

Finally I’m testing it on a jailbroken iPhone X in iOS 11.1. Thanks for any help :)

Code: Select all

#!/bin/bash
LIBS_ZIP_URL="https://www.scummvm.org/frs/build/scummvm-ios7-libs.zip"
LIBS_ZIP_FILENAME="scummvm-libs.zip"
GIT_REPO_URL="https://github.com/scummvm/scummvm.git"

# Clone the repository
git clone "$GIT_REPO_URL"

# Compile create_project
(cd scummvm/devtools/create_project/xcode; xcodebuild)

# Create the workspace
mkdir build
cd build
curl -L "$LIBS_ZIP_URL" -o "$LIBS_ZIP_FILENAME"
unzip "$LIBS_ZIP_FILENAME"
rm "$LIBS_ZIP_FILENAME"

../scummvm/devtools/create_project/xcode/build/Release/create_project ../scummvm --xcode --enable-fluidsynth --disable-bink --disable-mt32emu --disable-nasm --disable-opengl --disable-theora --disable-taskbar --disable-libcurl --disable-sdlnet
open scummvm.xcodeproj
User avatar
criezy
ScummVM Developer
Posts: 955
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Compiling 2.2.0 - Crashes upon launch of game

Post by criezy »

See https://wiki.scummvm.org/index.php?titl ... mVM/iPhone for up to date build instructions.
In particular
  • It has a link to a newer lib package that contains the libcurl and sdlnet libraries needed to enable cloud and LAN support (and then you no longer need to disable those).
  • It indicates that you need to use --disable-tts. Not disabling it might very well be the reason why it crashes for you.
8BitAirwaves
Posts: 22
Joined: Fri Oct 23, 2015 8:19 pm
Location: Boulder, Colorado
Contact:

Re: Compiling 2.2.0 - Crashes upon launch of game

Post by 8BitAirwaves »

criezy wrote: Tue Oct 22, 2019 8:36 pm See https://wiki.scummvm.org/index.php?titl ... mVM/iPhone for up to date build instructions.
In particular
  • It has a link to a newer lib package that contains the libcurl and sdlnet libraries needed to enable cloud and LAN support (and then you no longer need to disable those).
  • It indicates that you need to use --disable-tts. Not disabling it might very well be the reason why it crashes for you.
Thank you so much! Adding disable tts was indeed the solution to it crashing :)

I did however have to use the code from my original post (a project workspace script) to get it to build which means it doesn’t have Cloud saves or LAN. When I use the scripts from the official wiki (same as the link you kindly provided) I get this error-
“Lexical or Preprocessor issue
‘vorbis/vorbisfile.h’ file not found
vorbis.cpp”

The Vorbis file and proper contents are present in the correct location (build/include/vorbis/vorbisfile.h) so I’m quite lost on what to do.

It seems it can’t locate the header files despite them being located where they should be and xcodes Header Search Path includes the projects entire root directory. Any ideas?
Regardless thank you for your help, I at least have it working without Cloud/LAN thanks to you :)
8BitAirwaves
Posts: 22
Joined: Fri Oct 23, 2015 8:19 pm
Location: Boulder, Colorado
Contact:

Re: Compiling 2.2.0 - Crashes upon launch of game

Post by 8BitAirwaves »

Just a quick update- I am an idiot. I didn’t realize I had to remove the lib and include folders from the downloaded scummvm-ios7-libs-v2 folder within the build directory. No wonder Xcode couldn’t find the headers!

I also had to set the target to Build Settings > Enable Bitcode > NO.

Works great :)
User avatar
criezy
ScummVM Developer
Posts: 955
Joined: Sat Sep 23, 2006 10:41 am
Location: West Sussex, UK

Re: Compiling 2.2.0 - Crashes upon launch of game

Post by criezy »

I have added a comment in the build instructions on the wiki about the need to disable bitcode generation in the build settings. As far as I know this is only needed when you build for a Generic iOS Device as when you build specifically for your device this should be disabled by default (unless this was changed in the latest Xcode version). Ideally we will want to rebuild all the libraries in the libs package to include bitcode but I am lacking motivation to do this :-P (we will really need to do that though if we ever want to publish ScummVM on the AppStore).
8BitAirwaves
Posts: 22
Joined: Fri Oct 23, 2015 8:19 pm
Location: Boulder, Colorado
Contact:

Re: Compiling 2.2.0 - Crashes upon launch of game

Post by 8BitAirwaves »

criezy wrote: Mon Oct 28, 2019 11:25 pm I have added a comment in the build instructions on the wiki about the need to disable bitcode generation in the build settings. As far as I know this is only needed when you build for a Generic iOS Device as when you build specifically for your device this should be disabled by default (unless this was changed in the latest Xcode version). Ideally we will want to rebuild all the libraries in the libs package to include bitcode but I am lacking motivation to do this :-P (we will really need to do that though if we ever want to publish ScummVM on the AppStore).
Thanks mate! I feel very slightly barely useful for the first time, bout time I gave useful information for all the times I’ve received it

I can confirm I build for generic device (so I can use the IPA on all my idevices) so your logic on disabling bitcode is correct, of course :)

Also it would be nice to get it on the App Store but I know Apple is tough on anything that allows third party software running. They removed the good version of iDOS but for years “PowerDOS” has been up there which allows running of games you own.
User avatar
singalen
Posts: 15
Joined: Wed Mar 01, 2006 10:00 am
Contact:

Re: Compiling 2.2.0 - Crashes upon launch of game

Post by singalen »

Built branch-2-1-2 for my iPhone.
FoTAQ from ScummVM site crashes for me when I try to use a bat in BaseMP3Stream::decodeMP3Data(), on _positionInFrame == 0.
I cannot really see anything wrong with the local variables, and libmad is compiled without debug symbols, so cannot immediately step in.

Thread stack:

Code: Select all

com.apple.coreaudio.AQClient (10): EXC_BAD_ACCESS (code=1, address=0x4eca4c)

#0	0x000000010460f27c in III_overlap [inlined] at /Users/bsr/sources/libmad-0.15.1b/layer3.c:2265
#1	0x000000010460f274 in III_decode [inlined] at /Users/bsr/sources/libmad-0.15.1b/layer3.c:2456
#2	0x000000010460f1c4 in mad_layer_III at /Users/bsr/sources/libmad-0.15.1b/layer3.c:2648
#3	0x000000010460ba08 in mad_frame_decode at /Users/bsr/sources/libmad-0.15.1b/frame.c:453
#4	0x00000001042054fc in Audio::BaseMP3Stream::decodeMP3Data(Common::ReadStream&) at /Users/vic/src/scum/scummvm/audio/decoders/mp3.cpp:167
#5	0x0000000104205afc in Audio::BaseMP3Stream::fillBuffer(Common::ReadStream&, short*, int) at /Users/vic/src/scum/scummvm/audio/decoders/mp3.cpp:323
#6	0x0000000104206400 in Audio::MP3Stream::readBuffer(short*, int) at /Users/vic/src/scum/scummvm/audio/decoders/mp3.cpp:364
#7	0x0000000103301bcc in Queen::AudioStreamWrapper::readBuffer(short*, int) at /Users/vic/src/scum/scummvm/engines/queen/sound.cpp:82
#8	0x00000001042aebb0 in Audio::LinearRateConverter<false, false>::flow(Audio::AudioStream&, short*, unsigned int, unsigned short, unsigned short) at /Users/vic/src/scum/scummvm/audio/rate.cpp:237
#9	0x00000001042a9b60 in Audio::Channel::mix(short*, unsigned int) at /Users/vic/src/scum/scummvm/audio/mixer.cpp:616
#10	0x00000001042a994c in Audio::MixerImpl::mixCallback(unsigned char*, unsigned int) at /Users/vic/src/scum/scummvm/audio/mixer.cpp:291
#11	0x000000010430eae4 in OSystem_iOS7::mixCallback(void*, unsigned char*, int) at /Users/vic/src/scum/scummvm/backends/platform/ios7/ios7_osys_sound.cpp:44
#12	0x000000010430ea20 in OSystem_iOS7::AQBufferCallback(void*, OpaqueAudioQueue*, AudioQueueBuffer*) at /Users/vic/src/scum/scummvm/backends/platform/ios7/ios7_osys_sound.cpp:32
Variables in decodeMP3Data, the best I can paste:

Code: Select all

this	Audio::MP3Stream *	0x115d1c000	0x0000000115d1c000
Audio::BaseMP3Stream	Audio::BaseMP3Stream	
_posInFrame	uint	0
_state	Audio::BaseMP3Stream::State	MP3_STATE_READY
_curTime	mad_timer_t	
seconds	long	0
fraction	unsigned long	50803200
_stream	mad_stream	
buffer	const unsigned char *	0x115d218f4	0x0000000115d218f4
bufend	const unsigned char *	""	0x0000000115d22d34
skiplen	unsigned long	0
sync	int	1
freerate	unsigned long	0
this_frame	const unsigned char *	0x115d21a14	0x0000000115d21a14
next_frame	const unsigned char *	0x115d21a74	0x0000000115d21a74
ptr	mad_bitptr	
byte	const unsigned char *	0x115d21a21	0x0000000115d21a21
cache	unsigned short	61
left	unsigned short	8
anc_ptr	mad_bitptr	
anc_bitlen	unsigned int	1
main_data	unsigned char (*)[2567]	0x10c839400	0x000000010c839400
md_len	unsigned int	79
options	int	0
error	mad_error	MAD_ERROR_NONE
_frame	mad_frame	
header	mad_header	
options	int	0
sbsample	mad_fixed_t [2][36][32]	
overlap	mad_fixed_t (*)[2][32][18]	NULL	0x0000000000000000
_synth	mad_synth	
_channels	uint	1
_rate	uint	12000
_buf	byte [40968]	
_inStream	Common::ScopedPtr<Common::SeekableReadStream, Common::DefaultDeleter<Common::SeekableReadStream> >	
_length	Audio::Timestamp	
stream	Common::SeekableSubReadStream &	0x0000000280f7b440
Common::SubReadStream	Common::SubReadStream	
_parentStream	Common::MemoryReadStream *	0x281475b90	0x0000000281475b90
_ptrOrig	const byte *const	0x10c837e00	0x000000010c837e00
_ptr	const byte *	""	0x000000010c839240
_size	uint32	5184
_pos	uint32	5184
_disposeMemory	DisposeAfterUse::Flag	YES
_eos	bool	false
_begin	uint32	0
Looks like the same problem as reported here: viewtopic.php?t=14822
Post Reply