..:: PCSX2 Forums ::..

Full Version: ScpToolkit (XInput Wrapper aka ScpServer Reloaded)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(11-22-2015, 12:07 AM)Nefarius Wrote: [ -> ]No I haven't because I don't need to; the XInput API has no request for a controller shut-off and since the communication between the game, the Xbox emulator driver and the wrapper service is done via official Microsoft XInput API calls the error must be something else since there simply is no way the game or whatever application is "requesting" the controller to shut off.

Ok, but not directly requested.  Say for instance... because a variable got a value outside of what it was expecting and the software threw the disconnect request out of circumstance

There was a reference in the log to this:

<log4j:event logger="ScpControl.ScpDevice" timestamp="1447728830678" level="ERROR" thread="9"><log4j:message>Unexpected error in HCI_Worker_Thread: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.Collections.Generic.SortedDictionary`2.get_Item(TKey key)
at ScpControl.Bluetooth.BthDongle.OnCompletedCount(Byte lsb, Byte msb, UInt16 count)


Anything relying on the output of that for setting other values or returns would be giving wrong values because it is missing whatever that is suppose to be

So backtracking function returns that may interact with that or if not function returns, any statements that depend on that being one thing and getting this instead, would not be correct.

API notwithstanding...
(11-17-2015, 07:14 PM)bchiemara Wrote: [ -> ]Here's something I've noticed.

I play DCUO Online and have my PS3 (nearly new) Controller (Sony Official bought from Walmart brand new) connected via Rocketfish Bluetooth dongle.  Up until recently, I have not had any issues wireless or wired with the controller.  (I am an Electrical Technician and Technology Expert and Software programmer for the company I work for.)

Recently (not sure if this is due to a Windows 10 update or not) during heavy fights in DCUO (I'm a tank role so I am in the middle of the action all the time) where I am mashing buttons to complete combos to stay alive, my controller will not only disconnect, but shut OFF and then when I press the PS button to reconnect it, it can't find the dongle anymore.

My quick fix is to plug the controller in (while my character is standing there getting a beating) and then the controller connects.  BUT, during it being connected via wire, it will occasionally disconnect and reconnect (this is tolerable except that it interrupts my combos which I need to complete fully to get the full effects and benefits from namely heals and power recovery not just damage out).

My next step is to solder a USB cable directly to the controller motherboard and make my DS3 a wired controller unless someone on here can shed some light on if this is an issue with the software dropping out due to too many commands being sent to it.

System Specs:

Windows 10 Pro
AMD Phenom II x3 720 3.30 Ghz per core
ECS Black Series a780gm-a Motherboard
8GB Ram
Primary Drive: Intel SSD 128GB
Secondary Storage: 4TB NAS quality / certified SATA Drives (4 - 1 TB drives)
ATI HD R7 260x Dual Dissipation XFX series with 2GB DDR5


All drivers are updated. (Including SCP I just updated it last night to this version I was using one from 2012 prior to last night... still no change in behavior)

Is there a way to see communication stress or communication stress with CPU Load comparison to see if during the game combat (and it isn't everywhere, actually during normal enemy fights [I've grouped up 8 guys at a time] nothing like this happens, but during boss fights is when this strange thing occurs.)

Just to reiterate... this only occurs during FINAL boss fights... sub bosses and normal enemies (up to 8 simultaneously) I don't have an issue with the controller.

This has not ever happened in any other game... I play Star Trek Online with my PS3 controller and been in heavy fights and with 4 10slot (40 combinations of buttons) trays bound to the controller, I am pressing nearly every combination of buttons simultaneously in a frenzy for hours and have not had it drop out.

DCUO only has two rows of 4 powerslots (Left shift and action buttons, Right Shift and Action buttons, then the normal action button actions).

My system does not overheat or even come close, nor am I even touching my RAM limit during gameplay.

Swap is in SSD so anything that gets paged is a non-issue.

Other than the possibility of the USB port the dongle is on going bad (but it works 100% of the time anywhere else I use the controller) or the controller going bad (but it works 100% of the time anywhere else I use the controller), the only thing I can think of is:

A. DCUO is sending some type of forcefeedback command that the SCP Server /controller is inadvertently mistaking for a PS3 system shut the controller off command (see console -> turn off controller)

B. The SCP server is getting flooded with input commands and eventually just gets out of sync and resets the connection [then forgets it can pair] with the controller.

C. A combination of both

I should also point out that I've been using SCP since 2012 when I switched from MotioninJoy.

Controller software should have a checkbox to say 'Ignore shut off commands' so you have to manually shut of or disconnect the controller (outside of the timer that can be set to shut it off due to inactivity.)

Since I haven't replied to your initial post here are my thoughts:

Ad A: highly improbable, this would mean that the game somehow manages to submit a malformed API call to XInput. I'll look up MSDN if this is even possible.
Ad B: flooding is not possible; the driver is polling the devices, if it can't read the incoming data fast enough you should see a high CPU load cause by the SCP service process.
Ad C: well, long shot.
(11-22-2015, 12:18 AM)Nefarius Wrote: [ -> ]Since I haven't replied to your initial post here are my thoughts:

Ad A: highly improbable, this would mean that the game somehow manages to submit a malformed API call to XInput. I'll look up MSDN if this is even possible.
Ad B: flooding is not possible; the driver is polling the devices, if it can't read the incoming data fast enough you should see a high CPU load cause by the SCP service process.
Ad C: well, long shot.

A is highly improbable I agree, but we are talking about a heavily modified Unreal Engine game that has had its share of enormous bugs.  So if the XInput API has the possibility of passing a command that can cause the controller to either disconnect or disconnect via simply being told to power down, I would not put it past DC sloppy coding being the culprit.
(11-22-2015, 12:11 AM)bchiemara Wrote: [ -> ]Ok, but not directly requested.  Say for instance... because a variable got a value outside of what it was expecting and the software threw the disconnect request out of circumstance

There was a reference in the log to this:

<log4j:event logger="ScpControl.ScpDevice" timestamp="1447728830678" level="ERROR" thread="9"><log4j:message>Unexpected error in HCI_Worker_Thread: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
  at System.Collections.Generic.SortedDictionary`2.get_Item(TKey key)
  at ScpControl.Bluetooth.BthDongle.OnCompletedCount(Byte lsb, Byte msb, UInt16 count)


Anything relying on the output of that for setting other values or returns would be giving wrong values because it is missing whatever that is suppose to be

So backtracking function returns that may interact with that or if not function returns, any statements that depend on that being one thing and getting this instead, would not be correct.

API notwithstanding...

HCI errors are Bluetooth host errors; I suspect a connection loss somewhere in the Bluetooth stack due to radio interference or something else.

This exception in particular means that the Bluetooth connection was unintentionally dropped by the controller without any requests from the software.
(11-22-2015, 12:21 AM)bchiemara Wrote: [ -> ]A is highly improbable I agree, but we are talking about a heavily modified Unreal Engine game that has had its share of enormous bugs.  So if the XInput API has the possibility of passing a command that can cause the controller to either disconnect or disconnect via simply being told to power down, I would not put it past DC sloppy coding being the culprit.

Here's the API reference. I looked through the relevant code in the toolkit and even if there could slip a malformed request through it would do nothing but rumble randomly since - no matter what - only the two bytes for the controller speeds are read back and everything else is discarded.
(11-22-2015, 12:23 AM)Nefarius Wrote: [ -> ]HCI errors are Bluetooth host errors; I suspect a connection loss somewhere in the Bluetooth stack due to radio interference or something else.

I'm sitting litteraly 2.5 feet from the dongle, which is on the front panel of my tower on top of a tv stand next to my flatpanel (which is the same one I've had for 3 years now).

It would have to be an intense interference signal to overcome this distance from receiver to transmitter (I started out as an Electrical Engineer 20 years ago when you actually had to replace integrated circuit parts with a hand iron).

Not saying impossible, but I highly doubt interference of that magnitude would go unnoticed (2.5 ghz range would knock out my wifi  on my G router [my wife's iPhone 4 is connected to as the only device] trust me she would let me know if she was having internet problems on it)

And really, nothing else in my immediate area (not saying I know what the neighbors have, but again, my wifi would be acting up)

I will have to find my other dongle to see if it is possible this newer one is going bad...

Also, though, this disconnect happens during it being connected via usb cable.

It will randomly disconnect and then immediately reconnect (because it is connected via wire).
(11-22-2015, 12:28 AM)bchiemara Wrote: [ -> ]I'm sitting litteraly 2.5 feet from the dongle, which is on the front panel of my tower on top of a tv stand next to my flatpanel (which is the same one I've had for 3 years now).

It would have to be an intense interference signal to overcome this distance from receiver to transmitter (I started out as an Electrical Engineer 20 years ago when you actually had to replace integrated circuit parts with a hand iron).

Not saying impossible, but I highly doubt interference of that magnitude would go unnoticed (2.5 ghz range would knock out my wifi  on my G router [my wife's iPhone 4 is connected to as the only device] trust me she would let me know if she was having internet problems on it)

And really, nothing else in my immediate area (not saying I know what the neighbors have, but again, my wifi would be acting up)

Wouldn't count on that; when I first tried the software with my HTPC I was sitting two and a half meters away from the dongle which was plugged into the front USB port directly facing towards me and my controller with nothing but air in between. I had so many random lags and dropped button presses I nearly threw the controller out of the window. The WiFi router was placed maybe 40 centimeters away from the dongle and working fine. I then placed the dongle on top of my shelf in the same room with a 5 meter USB repeater cable and what do you know; working flawlessly since then!
(11-22-2015, 12:32 AM)Nefarius Wrote: [ -> ]Wouldn't count on that; when I first tried the software with my HTPC I was sitting two and a half meters away from the dongle which was plugged into the front USB port directly facing towards me and my controller with nothing but air in between. I had so many random lags and dropped button presses I nearly threw the controller out of the window. The WiFi router was placed maybe 40 centimeters away from the dongle and working fine. I then placed the dongle on top of my shelf in the same room with a 5 meter USB repeater cable and what do you know; working flawlessly since then!

My router is on the far wall furthest from where I am with my bluetooth, knowing radio transmissions as intimately as I do, I'm pretty sure it is not my router...

Also, I know C# (not as intimately as I know VB.NET) but you said it doesn't have null exception or object reference...

So in your log... what generated this:

<log4j:event logger="ScpService.Ds3Service" timestamp="1447902165062" level="FATAL" thread="1"><log4j:message>An unhandled exception occured: System.NullReferenceException: Object reference not set to an instance of an object.
   at HidSharp.ReportDescriptors.Parser.ReportDescriptorParser.ParseMain(MainItemTag tag, UInt32 value)
   at HidSharp.ReportDescriptors.Parser.ReportDescriptorParser.Parse(EncodedItem item)
   at HidSharp.ReportDescriptors.Parser.ReportDescriptorParser.Parse(IEnumerable`1 items)
(11-22-2015, 12:37 AM)bchiemara Wrote: [ -> ]My router is on the far wall furthest from where I am with my bluetooth, knowing radio transmissions as intimately as I do, I'm pretty sure it is not my router...

Also, I know C# (not as intimately as I know VB.NET) but you said it doesn't have null exception or object reference...

So in your log... what generated this:

<log4j:event logger="ScpService.Ds3Service" timestamp="1447902165062" level="FATAL" thread="1"><log4j:message>An unhandled exception occured: System.NullReferenceException: Object reference not set to an instance of an object.
   at HidSharp.ReportDescriptors.Parser.ReportDescriptorParser.ParseMain(MainItemTag tag, UInt32 value)
   at HidSharp.ReportDescriptors.Parser.ReportDescriptorParser.Parse(EncodedItem item)
   at HidSharp.ReportDescriptors.Parser.ReportDescriptorParser.Parse(IEnumerable`1 items)

I did not say the router was causing interference; I meant that both devices where in the same room while one (WLAN) was working and the other (Bluetooth) not and just moving it's height and position has gained a huge improvement, for whatever reason.

I also did not say C# has no null exceptions; the log has caught one while the software tried to interpret the devices HID report descriptor which failed but was handled by my catch block and the software could continue. This error is minor though since I don't use the report descriptor for anything else but debugging.
(11-22-2015, 12:43 AM)Nefarius Wrote: [ -> ]I did not say the router was causing interference; I meant that both devices where in the same room while one (WLAN) was working and the other (Bluetooth) not and just moving it's height and position has gained a huge improvement, for whatever reason.

I also did not say C# has no null exceptions; the log has caught one while the software tried to interpret the devices HID report descriptor which failed but was handled by ma catch block and the software could continue.

I saw that, and stand corrected you did not say it does not have null exception...

BUT interference aside, this issue persists even while connected via wire