11-08-2011 09:06 PM
I did almost a full play through of a mission which is about 1 hour without hitting the problem. I disabled the bps_set_verbosity just for giggles and sure enough I got the bug again within 5 minutes. I'm going to do more testing tonight to see if there is a relation ship that the logging happens to fix it. It sounds like to me that either it's a memory corruption error on my end, which I really thought it could be or maybe there is a race condition with the events and the logging is slowing it down enough.
11-08-2011 09:39 PM
So far I get the problem when bps_set_verbosity isn't set or if it's set to 1. I have yet to get the problem when it's set to 2 but once and awhile instead of spitting out event 0 it give me a event 13157992.
[BPS:INFO] EVENTQUEUE timed out while waiting for event
[BPS:INFO] BPS returning event 0
[BPS:INFO] EVENTQUEUE timed out while waiting for event
[BPS:INFO] BPS returning event 0
[BPS:INFO] BPS returning event 13157992
[BPS:INFO] EVENTQUEUE timed out while waiting for event
[BPS:INFO] BPS returning event 0
11-09-2011 09:59 AM
As a temporary workaround (while we investigate), can you try pulling screen events directly rather than through BPS? Basically call screen_get_event with a timeout of 0 each time you call bps_get_event().
11-10-2011 12:08 AM
So my problem returned and I have no idea why. With light touch event usage there is no problem. After doing exceessive panning, tap gestures would not be detected. For me bps_get_event seems to be delivering events, but the gestures stop being detected and my gesture callback never gets called. I have done a workaround by continuing using bps_get_event and treating each event as a "pan" event (see the gestures sample) and not using gesture sets. It seems to be working for now.
Anyways, sorry for interjecting with this information into LMcRae's thread since my problem seems to be different, although related. Just thought it may be useful somehow.
Scott
11-10-2011 09:31 AM
It's entirely possible that these are related issues. Can you also try why we recommended above -- bypassing bps for screen events and getting these (screen) events directly in your event loop?
11-10-2011 10:27 AM
I haven't tried your suggestion yet. When I fix one of the bug I mentioned, the Win32 version started to crash yester day in the nvogl driver. So it really feels like a memory corruption bug on my end that when giggled around pops up in a different spot. I purchased a copy of BoundsChecker and spent the day sprinkling asserts everywhere. Imanaged to find a couple of memory leaks but nothing else.
I think until I get it running solid on Win32 I again I can't expect the Playbook version to run. Oddly enough it runs on the iPad but I'm sure it's just dumb luck.
11-10-2011 04:33 PM - edited 11-10-2011 04:36 PM
It's entirely possible that these are related issues. Can you also try why we recommended above -- bypassing bps for screen events and getting these (screen) events directly in your event loop?
I believe the problems are related somehow. My code is different than LMcRae's and I integrate touch events differently within my program design, so to use screen_get_event it would take a fair bit of changing, I could lose a day. My first attempt at using screen_get_event didn't work (an error on my end that I couldn't find). I have spent 3-4 days on this issue, and now that I have a working solution I have chosen just to move forward with it.
I'd like to help out since my application is producing the issue, so If the problem comes up again or I get free time, I will try screen_get_event over bps_get_event.
Thanks,
Scott
11-10-2011 04:42 PM
Ok. I have the win32 version running with zero problems. The bug was OpenGL related only and driver specific. I'm very confident at this point that I have no bug as BoundsChecked isn't find any, the app is running on 2 win 32 machines and the iPhone and iPad.
I went back to the Playbook and it's the same problem. I have made an attempt to just use screen event s and by pas the bps events but now I get now events. I suspect I don't know how to do what you're suggesting. Can you give me some pseudo code?
Below is what I tried.
#ifdef BPS_EVENTS
while( true )
{
bps_event_t* event = NULL;
bps_get_event( &event, 1 );
if ( event )
{
int domain = bps_event_get_domain( event );
if ( domain == screen_get_domain() )
{
screen_event_t screenEvent = screen_event_get_event( event );
handleScreenEvent( screenEvent );
}
else
if ( domain == navigator_get_domain() )
{
handleNavigatorEvent( event );
}
else
if ( domain == dialog_get_domain() )
{
handleDialogEvent( event );
}
else
{
log.verbose( Str( "QnxApp::onUpdate: unknown event domain %d", domain ) );
}
}
else
{
break;
}
}
#else
while( !screen_get_event( m_ScreenContext, m_screenEvent, 0 ) )
{
handleScreenEvent( m_screenEvent );
}
#endif
11-11-2011 02:22 PM
I was given what feels like a solution by support offline. I have run with this today and so far it hasn't failed. Below is my event loop. NOTE that you have to not call screen_request_events( m_ScreenContext ). The idea is that bps events and screen events are polled separately.
bool QnxApp::onUpdate()
{
Logger& log = getLogger();
while( true )
{
bps_event_t* event = NULL;
bps_get_event( &event, 1 );
if ( event )
{
int domain = bps_event_get_domain( event );
if ( domain == navigator_get_domain() )
{
handleNavigatorEvent( event );
}
else
if ( domain == dialog_get_domain() )
{
handleDialogEvent( event );
}
else
{
log.verbose( Str( "QnxApp::onUpdate: unknown event domain %d", domain ) );
}
}
else
{
break;
}
}
while( true )
{
screen_event_t screenEvent;
screen_create_event( &screenEvent );
if ( screen_get_event( m_ScreenContext, screenEvent, 0 ) != 0 )
{
log.verbose( "QnxApp::onUpdate: error getting screen event" );
break;
}
// Returns false if the type is SCREEN_EVENT_NONE
if ( handleScreenEvent( screenEvent ) == false )
break;
}
m_Game.onUpdate();
return (m_bQuit == false) ? true : false;
}
12-16-2011 12:55 PM