Warning: session_start(): open(/home107a/sub005/sc13804-WGNH/pi/session/sess_a1ddad632a724b3b3e8009620e417dbc, O_RDWR) failed: No such file or directory (2) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php on line 247

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php:247) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php on line 247

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php:247) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php on line 247

Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php:247) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/auth.php on line 424

Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php:247) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/lib/plugins/badbehaviour/bad-behavior/screener.inc.php on line 9

Warning: session_write_close(): open(/home107a/sub005/sc13804-WGNH/pi/session/sess_a1ddad632a724b3b3e8009620e417dbc, O_RDWR) failed: No such file or directory (2) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/doku.php on line 121

Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/home107a/sub005/sc13804-WGNH/pi/session) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/doku.php on line 121

Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php:247) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/actions.php on line 210

Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home180/sub005/sc13804-WGNH/pi/inc/init.php:247) in /mounted-storage/home180/sub005/sc13804-WGNH/pi/lib/tpl/dokuwiki/main.php on line 12
devblogs:pokeparadox:it_s_aliiiive_it_s_aliiiive [Project Infinity Wiki]

User Tools

Site Tools


devblogs:pokeparadox:it_s_aliiiive_it_s_aliiiive

It's Aliiiive! It's Aliiiive!

Intercontinental Debugging

Pickle has been a great asset in narrowing down the problem of getting PandoraPanic! to actually successfully start on the Pandora, although the situation did illustrate the problems of time zone and schedule differences. Pickle would ask me for the next function to step into and I would examine my code and see where to go next. It was kind of strange but we finally narrowed down the problem to the Music class.

Silly Bug

Whenever I get a bug like this that has me kicking myself, I do like to make a habit of pointing it out to others. It's not because I like to look like I make a lot of mistakes (which I do… I'm only human.) But it serves as a reminder to myself and others certain “gotchas” that you can fall into when writing code.

#ifdef #endif Dangers

The code was getting to around here before triggering an fpe.

    music.loadMusic("music/PandoraPanic_Title.ogg");
    music.setLooping(true);
    music.play();

Now this either meant that the music file wasn't being loaded properly (doubtful, but I checked with Pickle about the filename just to rule it out.) or the only other possibility was that SDL_Mixer wasn't being initialised properly.

I checked with my engine initialisation code and I was doing a call to Music.init() so it should be initialising… But looking into what Music.init() was doing…

#ifdef PLATFORM_GP2X
   Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 128);			
#endif     
#ifdef PLATFORM_PC
   Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 512);
#endif

we can see it is missing is code to initialise Audio on PLATFORM_PANDORA. This should illustrate the dangers of using #ifdefs and also wrapping library functions. It can be more convenient if you needs slightly different code to be compiled for different platforms 1) but it can obscure a problems.

Quick Fix

It should be noted that this code to initialise sound is very early code in my framework. Back then I didn't even know about the #elif preprocessor! As soon as I thought the sound initialisation was to blame I could see the problem with the code above. There is no fallback for the #ifdef. So I added one.

#ifdef PLATFORM_GP2X
   Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 128);			
#elif PLATFORM_PC
   Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 512);
#elif PLATFORM_PANDORA
   Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 256);
#else
   Mix_OpenAudio(MIX_DEFAULT_FREQUENCY, AUDIO_S16, MIX_DEFAULT_CHANNELS, 512);
#endif

It Lives!

With that fix in place, PandoraPanic! is successfully running on Pandora hardware. The controls need to be mapped sensibly for the hardware, but currently I think SDL has some issues accessing the gaming buttons. So I'll have to map to some keys as a placeholder. I hope a playable version can be demoed soon.

1)
above- a higher value than 128 on GP2X caused stuttering…
You could leave a comment if you were logged in.
devblogs/pokeparadox/it_s_aliiiive_it_s_aliiiive.txt · Last modified: 2009/05/18 08:28 by pokeparadox