Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How can I properly remove/fix handling joystick events?  (Read 4066 times)

0 Members and 1 Guest are viewing this topic.

ChonDee

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
How can I properly remove/fix handling joystick events?
« on: August 04, 2012, 02:56:43 am »
Hi,

A while ago I have noticed that while I have my 360 Wireless receiver installed (whether it is in use, or plugged in at all does not matter) SFML produces extremely low performance, and it completely hangs while the mouse is being moved, or keyboard input is being received.

Laurent helped me out with:
Quote
Can you try to comment line 121 of src/SFML/Window/WindowImpl.cpp (ProcessJoystickEvents();) and recompile SFML?

This completely fixed the issue, I can live with the gamepad not being usable with SFML for the time being.

Recently however, I have started using MS AppVerifier, mostly to help debug issues with multiple threads, but   it also stops my program when the above line is commented out in the source, producing this log:

Quote
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<avrf:logfile xmlns:avrf="Application Verifier">
   <avrf:logSession TimeStarted="2012-08-03 : 17:33:15" PID="8424" Version="2">
      <avrf:logEntry Time="2012-08-03 : 17:33:17" LayerName="Handles" StopCode="0x303" Severity="Error">
         <avrf:message>NULL handle passed as parameter. A valid handle must be used.</avrf:message>
         <avrf:parameter1>0 - Not used.</avrf:parameter1>
         <avrf:parameter2>0 - Not used.</avrf:parameter2>
         <avrf:parameter3>0 - Not used.</avrf:parameter3>
         <avrf:parameter4>0 - Not used.</avrf:parameter4>
         <avrf:stackTrace>
            <avrf:trace>vfbasics!AVrfpHandleSanityChecks+29 (d:\avrf\source\base\avrf\vrfcommon\handle.c @ 178)</avrf:trace>
            <avrf:trace>vfbasics!AVrfpNtClearEvent+1f (d:\avrf\source\base\avrf\vrfcommon\handle.c @ 418)</avrf:trace>
            <avrf:trace>KERNELBASE!ResetEvent+e ( @ 0)</avrf:trace>
            <avrf:trace>DINPUT!+40f095a3 ( @ 0)</avrf:trace>
            <avrf:trace>DINPUT!+40f07c37 ( @ 0)</avrf:trace>
            <avrf:trace>DINPUT!+40f0b23b ( @ 0)</avrf:trace>
            <avrf:trace>DINPUT!+40f05ab7 ( @ 0)</avrf:trace>
            <avrf:trace>WINMM!joyConfigChanged+638 ( @ 0)</avrf:trace>
            <avrf:trace>WINMM!joyGetPosEx+50 ( @ 0)</avrf:trace>
            <avrf:trace>sfml-window-d-2!sf::priv::JoystickImpl::isConnected+ad (e:\myfiles\downloads\laurentgomila-sfml-2.0-rc-68-ga0c1f5f\laurentgomila-sfml-a0c1f5f\src\sfml\window\win32\joystickimpl.cpp @ 66)</avrf:trace>
            <avrf:trace>sfml-window-d-2!sf::priv::JoystickManager::update+e2 (e:\myfiles\downloads\laurentgomila-sfml-2.0-rc-68-ga0c1f5f\laurentgomila-sfml-a0c1f5f\src\sfml\window\joystickmanager.cpp @ 80)</avrf:trace>
            <avrf:trace>sfml-window-d-2!sf::priv::WindowImpl::processJoystickEvents+38 (e:\myfiles\downloads\laurentgomila-sfml-2.0-rc-68-ga0c1f5f\laurentgomila-sfml-a0c1f5f\src\sfml\window\windowimpl.cpp @ 150)</avrf:trace>
            <avrf:trace>sfml-window-d-2!sf::priv::WindowImpl::popEvent+45 (e:\myfiles\downloads\laurentgomila-sfml-2.0-rc-68-ga0c1f5f\laurentgomila-sfml-a0c1f5f\src\sfml\window\windowimpl.cpp @ 106)</avrf:trace>
            <avrf:trace>sfml-window-d-2!sf::Window::pollEvent+28 (e:\myfiles\downloads\laurentgomila-sfml-2.0-rc-68-ga0c1f5f\laurentgomila-sfml-a0c1f5f\src\sfml\window\window.cpp @ 183)</avrf:trace>
            <avrf:trace>BlackBookEngine!main+1d0 (e:\myfiles\dropbox\!programming\blackbookengine\blackbookengine\black book engine\main.cpp @ 121)</avrf:trace>
            <avrf:trace>BlackBookEngine!__tmainCRTStartup+1bf (f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 555)</avrf:trace>
            <avrf:trace>BlackBookEngine!mainCRTStartup+f (f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c @ 371)</avrf:trace>
            <avrf:trace>kernel32!BaseThreadInitThunk+12 ( @ 0)</avrf:trace>
            <avrf:trace>ntdll!RtlInitializeExceptionChain+63 ( @ 0)</avrf:trace>
            <avrf:trace>ntdll!RtlInitializeExceptionChain+36 ( @ 0)</avrf:trace>
         </avrf:stackTrace>
      </avrf:logEntry>
   </avrf:logSession>
</avrf:logfile>

I am wondering what would be the correct way to remove processing joystick input, and also if there is any progress on possibly fixing whatever is causing the performance problems with certain joysticks/gamepads.

Thanks in advance!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: How can I properly remove/fix handling joystick events?
« Reply #1 on: August 04, 2012, 11:18:08 am »
It's already fixed in the latest sources. Maybe even in the release candidate.
Laurent Gomila - SFML developer

ChonDee

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
Re: How can I properly remove/fix handling joystick events?
« Reply #2 on: August 04, 2012, 06:47:29 pm »
Thanks for the reply, but I still have the same issue in both the release candidate and the snapshot I compiled yesterday.

I have tried this on 2 computers (but with the same 360 wireless receiver).

Am I the only one encountering this?