Results 1 to 10 of 10

Thread: Threading issues in the SDK

  1. #1
    Member
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    85

    Threading issues in the SDK

    I'm currently experiencing all kinds of strange issues. I'm trying to replicate problems I have with the Python binding of the SDK I'm working on. I'm linking the 32 bit sixense_s.lib and get crashes and deadlocks.

    I once got a NULL-pointer error in USBManager::is_open() (line 93) (same crash as when you don't call sixenseInit) when trying to run this code:
    Code:
    sixenseInit();
    sixenseExit();
    sixenseInit();
    sixenseIsBaseConnected(0);
    But I cannot replicate that anymore. Instead, I now get an Access violation when caling sixenseExit() the second time, like this:
    Code:
    sixenseInit();
    sixenseExit();
    sixenseInit();
    sixenseExit();
    Call Stack:
    Code:
     	HydraCrash1.exe!boost::thread::joinable()  + 0x31 bytes	C++
     	HydraCrash1.exe!USBManagerWin32::stop()  Line 141 + 0xb bytes	C++
     	HydraCrash1.exe!USBManager::stop()  Line 52	C++
     	HydraCrash1.exe!DriverMain::stop()  Line 432 + 0x5 bytes	C++
     	HydraCrash1.exe!sixenseExit()  Line 41	C++
    >	HydraCrash1.exe!main(int argc, const char * * argv)  Line 13 + 0x5 bytes	C++
    When actually using it, there's usually a delay between initialization and exitting. That leads to a deadlock though:
    Code:
    sixenseInit();
    Sleep(1000);
    sixenseExit();
    This hangs with this call stack:
    Code:
     	ntdll.dll!_ZwWaitForMultipleObjects@20()  + 0x15 bytes	
     	ntdll.dll!_ZwWaitForMultipleObjects@20()  + 0x15 bytes	
     	msvcr100.dll!__unlock_fhandle()  + 0x25 bytes	
     	kernel32.dll!_WaitForMultipleObjectsExImplementation@20()  + 0x8e bytes	
     	kernel32.dll!_WaitForMultipleObjects@16()  + 0x18 bytes	
     	HydraCrash1.exe!boost::this_thread::interruptible_wait()  + 0x1b8 bytes	C++
     	HydraCrash1.exe!boost::thread::join()  + 0x9a bytes	C++
     	HydraCrash1.exe!USBManagerWin32::stop()  Line 141	C++
     	HydraCrash1.exe!USBManager::stop()  Line 52	C++
     	HydraCrash1.exe!DriverMain::stop()  Line 432 + 0x5 bytes	C++
     	HydraCrash1.exe!sixenseExit()  Line 41	C++
    >	HydraCrash1.exe!main(int argc, const char * * argv)  Line 11 + 0x5 bytes	C++
    Also, I'd expect the initialization to actually be done by the time sixenseInit() returns - but it isn't until later that USBManagerWin32::check_devices gets called and connects the device, resulting in queries immediately after sixenseInit() to fail.

  2. #2
    Member
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    85
    Bump......

  3. #3
    Administrator Danny's Avatar
    Join Date
    Jun 2011
    Posts
    702
    I found and fixed the bug. I'll get you an updated SDK. Thanks for reporting this, and sorry it took so long to get back to you.
    Danny Woodall
    Creative Director
    Sixense Entertainment Inc.

  4. #4
    Junior Member
    Join Date
    Jun 2012
    Posts
    12
    Wooh! This indeed sounds like the problem I've been experiencing as well. How do we get hold of the updated SDK?

  5. #5
    Administrator Danny's Avatar
    Join Date
    Jun 2011
    Posts
    702
    SixenseSDK_062512

    Please let me know if this solves your issues. I'll get the SDK link updated if all goes well. This also increases trigger and joystick precision.
    Danny Woodall
    Creative Director
    Sixense Entertainment Inc.

  6. #6
    Member
    Join Date
    Jul 2011
    Location
    Germany
    Posts
    85
    Seems to be working now (although I don't have an actual application to test it with), I could finally finish my Python Binding.

    Steam version of the SDK is apparently quite outdated, it still has unsigned chars for the analog sticks & trigger while the one you provided uses floats.

  7. #7
    Administrator Danny's Avatar
    Join Date
    Jun 2011
    Posts
    702
    Yeah thanks, I am trying to get that updated as well.
    Danny Woodall
    Creative Director
    Sixense Entertainment Inc.

  8. #8
    Junior Member
    Join Date
    Jun 2012
    Posts
    12
    It looks like the new version of the SDK solved my problems in Unity. Thanks!

  9. #9
    Junior Member
    Join Date
    Jun 2012
    Posts
    2
    Worked for me too!
    I'm glad because i've only just gotten my program to a state that it actually builds anyway. The hang on sixenseExit made me think I had done something wrong, but all working now

  10. #10
    Administrator Danny's Avatar
    Join Date
    Jun 2011
    Posts
    702
    Great!

    The latest SDK is available through Steam as well as through our Developer page.
    Danny Woodall
    Creative Director
    Sixense Entertainment Inc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •