XInput Wrapper for DS3 and Play.com USB Dual DS2 Controller
Thank you so much for making this driver! It is so much simpler and faster to get 4 controllers on Bluetooth to connect with this than with MiJ.

Is there anyway to clear the "Reserve" and reorder the controllers other than restarting the computer, though? That would be an amazing feature to add if there isn't a way at the moment.

Sponsored links

@PancakeMix: you can clear the controllers by restarting the service, using Service Control Manager or from a command prompt [elevated if using UAC].


Attached Files Thumbnail(s)
       
Ok your bluetooth mod has completely taken over my bluetooth module even after uninstalling yours it still stays installed and I had to pick from a list to get my old one back. The problem is that the bluetooth stopped picking up my DS3 the lights just flash after unplugging it from the USB cable.

and trying to uninstall it so I can reinstall to get the Bluetooth working again was not working at all because the bluetooth never uninstalled.
(02-28-2013, 11:39 PM)Topken Wrote: Ok your bluetooth mod has completely taken over my bluetooth module even after uninstalling yours it still stays installed and I had to pick from a list to get my old one back. The problem is that the bluetooth stopped picking up my DS3 the lights just flash after unplugging it from the USB cable.

and trying to uninstall it so I can reinstall to get the Bluetooth working again was not working at all because the bluetooth never uninstalled.

The only way to use the DS3 with a PC is to dedicate the bluetooth adapter to it. If you use your adapter for other things, I suggest getting a second adapter and installing the driver to only one of them.

Sometimes windows likes to keep drivers for devices. If you uninstall the device from device manager, make sure to check "delete driver files."
@Topken: driver install/uninstall has different behaviour from a Windows Application install/uninstall.

Install
1. Windows first makes a backup of the current drivers (for Rollback).
2. Copies the new driver to the driver store.
3. Installs the new driver on to the device.

Uninstall
1. Windows removes the driver from the driver store.
2. Performs a Rollback to the previous driver.
3. Deletes the driver files.

So if you had matched an Install with an Uninstall you would be back to your original drivers.
If you do multiple Installs and one Uninstall, there will be multiple Rollback versions.


@Ashnal: good news, I found the issue that was stopping the XBCD Setup utility from finding the Virtual X360. I've got it up and running on one of my test boxes. Still working on getting it stable though.

@Squall: found an issue in the XBCD Driver which causes BSODs when using Full Range with DeadZone set to 0 on a stick. Occurs on both real & virtual X360s.

Code:
void applyDeadzone2D(PLONG lpAxis1, PLONG lpAxis2, LONG DeadZone, BOOLEAN bFullAxes)
{
#ifdef _WIN64
    /* Can't use floating point math in the 64-bit kernel, so I made
    this really really REALLY crappy code to approximate everything. */

    LONG lAxis1 = *lpAxis1;
    LONG lAxis2 = *lpAxis2;
    LONG lDZ = DeadZone;
    LONG VectorLength = 0;

    VectorLength = mcrowne_isqrt((lAxis1 * lAxis1) + (lAxis2 * lAxis2));
    if ( VectorLength < lDZ )
        lAxis1 = lAxis2 = 0;
    else
    {
        /* Make VectorLength a scale factor for the axes! To avoid numeric
        problems and divisions by zero (!) DeadZone is limited to 0.95f
        here (a little dirty, but it should be OK - who uses such a
        large deadzone anyway). */

        if ( lDZ > 33250 )
            lDZ = 33250;

        lAxis1 -= (lAxis1 * lDZ) / VectorLength;
        lAxis1 = (lAxis1 * MAX_VALUE) / (MAX_VALUE - lDZ);
        lAxis2 -= (lAxis2 * lDZ) / VectorLength;
        lAxis2 = (lAxis2 * MAX_VALUE) / (MAX_VALUE - lDZ);

/*
        if ( bFullAxes )
        {
            // Rescale the axis values so it touches all the corners...
            // I wonder who uses such a monstrosity
            lAxis1 *= 1.4142136f;
            lAxis2 *= 1.4142136f;
        }
*/

        /* Ensure the -35000 to 35000 range */
        if ( lAxis1 > 35000 )    lAxis1 = 35000;
        if ( lAxis1 < -35000 )    lAxis1 = -35000;
        if ( lAxis2 > 35000 )    lAxis2 = 35000;
        if ( lAxis2 < -35000 )    lAxis2 = -35000;
    }

    *lpAxis1 = lAxis1;
    *lpAxis2 = lAxis2;

#else

If the stick is fully centred - VectorLength = 0 and DeadZone = 0, leads to a divide by 0 exception. Quick fix, change

Code:
    if ( VectorLength < lDZ )

to

Code:
    if ( VectorLength <= lDZ )
I cannot get the PS3 controller to work using bluetooth (works fine when connected via USB).

I see the message "bth 00000000 none" in the scp monitor application when the controller connects via bluetooth. Is there anything else I could try?

I am using a bluetooth v2 dongle and the hardware id is listed as supported. I'm also running Windows 8 64-bit.
@dak224: post your ScpService.log and ScpDriver.log.
(03-03-2013, 02:25 AM)Scarlet.Crush Wrote: @dak224: post your ScpService.log and ScpDriver.log.

Log files attached, Thanks

SCP Bluetooth Driver Installer 0.7.0.96 [3/03/2013 12:06:40 AM]

Detected - Microsoft Windows 8 Pro (6.2.9200.0 AMD64)
Selected WIN7 configuration.

INFO - ENTER: DriverPackageInstallW
INFO - Looking for Model Section [SCProductions.NTamd64]...
INFO - Installing INF file 'C:\ScpServer\bin\System\ScpVBus.inf' (Plug and Play).
INFO - Looking for Model Section [SCProductions.NTamd64]...
INFO - Installing devices with Id "root\ScpVBus" using INF "C:\Windows\System32\DriverStore\FileRepository\scpvbus.inf_amd64_a38dc2f185de5e56\scpvbus.inf".
INFO - Will force install because driver is not better and force flag is set.
INFO - ENTER UpdateDriverForPlugAndPlayDevices...
SUCCESS - RETURN UpdateDriverForPlugAndPlayDevices.
INFO - Installation was successful.
SUCCESS - Install completed
INFO - RETURN: DriverPackageInstallW (0x0)
INFO - ENTER: DriverPackagePreinstallW
SUCCESS - .\System\BthWinUsb.inf is preinstalled.
INFO - RETURN: DriverPackagePreinstallW (0x0)
INFO - ENTER: DriverPackagePreinstallW
SUCCESS - .\System\Ds3WinUsb.inf is preinstalled.
INFO - RETURN: DriverPackagePreinstallW (0x0)
INFO - SCP DS3 Service Started.

Pre-Install Succeeded.

-- Pre-Install Summary --
SCP DS3 Service
Bus Driver
DS3 USB Driver
Bluetooth Driver

INFO - ENTER: DriverPackageInstallW
INFO - Looking for Model Section [SCProductions.NTamd64]...
INFO - Installing INF file 'C:\ScpServer\bin\System\ScpVBus.inf' (Plug and Play).
INFO - Looking for Model Section [SCProductions.NTamd64]...
INFO - Installing devices with Id "root\ScpVBus" using INF "C:\Windows\System32\DriverStore\FileRepository\scpvbus.inf_amd64_a38dc2f185de5e56\scpvbus.inf".
INFO - Will force install because driver is not better and force flag is set.
INFO - ENTER UpdateDriverForPlugAndPlayDevices...
SUCCESS - RETURN UpdateDriverForPlugAndPlayDevices.
INFO - Installation was successful.
SUCCESS - Install completed
INFO - RETURN: DriverPackageInstallW (0x0)
INFO - ENTER: DriverPackageInstallW
INFO - Looking for Model Section [SCProductions.NTamd64]...
INFO - Installing INF file 'C:\ScpServer\bin\System\BthWinUsb.inf' (Plug and Play).
INFO - Looking for Model Section [SCProductions.NTamd64]...
INFO - Installing devices with Id "USB\VID_0A12&PID_0001&REV_0134" using INF "C:\Windows\System32\DriverStore\FileRepository\bthwinusb.inf_amd64_4315027a50dcbe75\bthwinusb.inf".
INFO - ENTER UpdateDriverForPlugAndPlayDevices...
SUCCESS - RETURN UpdateDriverForPlugAndPlayDevices.
INFO - Installation was successful.
INFO - Marked Phantom Device with Hardware/Compatible Id 'USB\VID_0A12&PID_0001&REV_0134' for reinstall on next plug-in.
INFO - Marked Phantom Device with Hardware/Compatible Id 'USB\VID_0A12&PID_0001&REV_0134' for reinstall on next plug-in.
INFO - Phantom Device with Hardware/Compatible Id 'USB\VID_0A12&PID_0001&REV_0134' already has 'C:\Windows\System32\DriverStore\FileRepository\bthwinusb.inf_amd64_4315027a50dcbe75\bthwinusb.inf' installed on it.
SUCCESS - Install completed
INFO - RETURN: DriverPackageInstallW (0x0)
INFO - ENTER: DriverPackageInstallW
INFO - Looking for Model Section [SCProductions.NTamd64]...
INFO - RETURN: DriverPackageInstallW (0xE000020B)

Install Succeeded. [Reboot Required]

-- Install Summary --
Bus Driver
Bluetooth Driver


3/03/2013 7:56:50 AM.524 ++ C:\ScpServer\bin\ScpService.exe 0.7.0.96
3/03/2013 7:56:51 AM.491 ++ C:\ScpServer\bin\ScpControl.dll 0.7.0.96
3/03/2013 7:56:59 AM.993 ++ Microsoft Windows 8 Pro (6.2.9200.0 AMD64)
3/03/2013 7:57:01 AM.450 -- USB Device : HID_Worker_Thread Starting
3/03/2013 7:57:01 AM.490 -- Bluetooth : L2CAP_Worker_Thread Starting
3/03/2013 7:57:03 AM.003 -- Bluetooth : HCI_Worker_Thread Starting
3/03/2013 7:57:03 AM.222 << HCI_Reset [0C03]
3/03/2013 7:57:03 AM.273 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 7:57:03 AM.529 << HCI_Read_BD_ADDR [1009]
3/03/2013 7:57:03 AM.629 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 7:57:03 AM.633 << HCI_Read_Buffer_Size [1005]
3/03/2013 7:57:03 AM.637 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 7:57:03 AM.638 -- 0153, 80, 0008, 0002
3/03/2013 7:57:03 AM.643 << HCI_Read_Local_Version_Info [1001]
3/03/2013 7:57:03 AM.646 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 7:57:03 AM.652 -- Master 00:15:83:0C:BF:EB, HCI_Version 3.3164, LMP_Version 3.3164
3/03/2013 7:57:03 AM.653 << HCI_Write_Scan_Enable [0C1A]
3/03/2013 7:57:03 AM.656 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 7:57:03 AM.697 -- Controller : UDP_Worker_Thread Starting
3/03/2013 7:57:32 AM.171 -- USB Device : HID_Worker_Thread Exiting
3/03/2013 7:57:32 AM.361 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 7:57:32 AM.538 -- Bluetooth : HCI_Worker_Thread Exiting
3/03/2013 7:57:32 AM.541 -- Bluetooth : L2CAP_Worker_Thread Exiting
3/03/2013 7:57:32 AM.542 ++ Suspended
3/03/2013 7:57:57 AM.012 ++ Resumed
3/03/2013 7:57:57 AM.091 -- USB Device : HID_Worker_Thread Starting
3/03/2013 7:57:57 AM.094 -- Bluetooth : HCI_Worker_Thread Starting
3/03/2013 7:57:57 AM.094 -- Bluetooth : L2CAP_Worker_Thread Starting
3/03/2013 7:57:57 AM.099 << HCI_Reset [0C03]
3/03/2013 7:57:57 AM.176 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 7:57:57 AM.431 << HCI_Read_BD_ADDR [1009]
3/03/2013 7:57:57 AM.434 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 7:57:57 AM.439 << HCI_Read_Buffer_Size [1005]
3/03/2013 7:57:57 AM.443 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 7:57:57 AM.445 -- 0153, 80, 0008, 0002
3/03/2013 7:57:57 AM.451 << HCI_Read_Local_Version_Info [1001]
3/03/2013 7:57:57 AM.454 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 7:57:57 AM.459 -- Master 00:15:83:0C:BF:EB, HCI_Version 3.3164, LMP_Version 3.3164
3/03/2013 7:57:57 AM.461 << HCI_Write_Scan_Enable [0C1A]
3/03/2013 7:57:57 AM.464 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 7:59:49 AM.644 -- USB Device : HID_Worker_Thread Exiting
3/03/2013 7:59:49 AM.724 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 7:59:49 AM.902 -- Bluetooth : HCI_Worker_Thread Exiting
3/03/2013 7:59:49 AM.905 -- Bluetooth : L2CAP_Worker_Thread Exiting
3/03/2013 7:59:49 AM.905 ++ Suspended
3/03/2013 10:24:59 AM.041 ++ Resumed
3/03/2013 10:24:59 AM.135 -- USB Device : HID_Worker_Thread Starting
3/03/2013 10:24:59 AM.137 -- Bluetooth : HCI_Worker_Thread Starting
3/03/2013 10:24:59 AM.137 -- Bluetooth : L2CAP_Worker_Thread Starting
3/03/2013 10:24:59 AM.143 << HCI_Reset [0C03]
3/03/2013 10:24:59 AM.219 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 10:24:59 AM.475 << HCI_Read_BD_ADDR [1009]
3/03/2013 10:24:59 AM.479 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 10:24:59 AM.484 << HCI_Read_Buffer_Size [1005]
3/03/2013 10:24:59 AM.488 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 10:24:59 AM.490 -- 0153, 80, 0008, 0002
3/03/2013 10:24:59 AM.495 << HCI_Read_Local_Version_Info [1001]
3/03/2013 10:24:59 AM.498 >> HCI_Command_Complete_EV [0E] [00]
3/03/2013 10:24:59 AM.504 -- Master 00:15:83:0C:BF:EB, HCI_Version 3.3164, LMP_Version 3.3164
3/03/2013 10:24:59 AM.507 << HCI_Write_Scan_Enable [0C1A]
3/03/2013 10:24:59 AM.512 >> HCI_Command_Complete_EV [0E] [00]
(03-01-2013, 02:52 PM)Scarlet.Crush Wrote: @Topken: driver install/uninstall has different behaviour from a Windows Application install/uninstall.

Install
1. Windows first makes a backup of the current drivers (for Rollback).
2. Copies the new driver to the driver store.
3. Installs the new driver on to the device.

Uninstall
1. Windows removes the driver from the driver store.
2. Performs a Rollback to the previous driver.
3. Deletes the driver files.

So if you had matched an Install with an Uninstall you would be back to your original drivers.
If you do multiple Installs and one Uninstall, there will be multiple Rollback versions.


@Ashnal: good news, I found the issue that was stopping the XBCD Setup utility from finding the Virtual X360. I've got it up and running on one of my test boxes. Still working on getting it stable though.

@Squall: found an issue in the XBCD Driver which causes BSODs when using Full Range with DeadZone set to 0 on a stick. Occurs on both real & virtual X360s.

Code:
void applyDeadzone2D(PLONG lpAxis1, PLONG lpAxis2, LONG DeadZone, BOOLEAN bFullAxes)
{
#ifdef _WIN64
    /* Can't use floating point math in the 64-bit kernel, so I made
    this really really REALLY crappy code to approximate everything. */

    LONG lAxis1 = *lpAxis1;
    LONG lAxis2 = *lpAxis2;
    LONG lDZ = DeadZone;
    LONG VectorLength = 0;

    VectorLength = mcrowne_isqrt((lAxis1 * lAxis1) + (lAxis2 * lAxis2));
    if ( VectorLength < lDZ )
        lAxis1 = lAxis2 = 0;
    else
    {
        /* Make VectorLength a scale factor for the axes! To avoid numeric
        problems and divisions by zero (!) DeadZone is limited to 0.95f
        here (a little dirty, but it should be OK - who uses such a
        large deadzone anyway). */

        if ( lDZ > 33250 )
            lDZ = 33250;

        lAxis1 -= (lAxis1 * lDZ) / VectorLength;
        lAxis1 = (lAxis1 * MAX_VALUE) / (MAX_VALUE - lDZ);
        lAxis2 -= (lAxis2 * lDZ) / VectorLength;
        lAxis2 = (lAxis2 * MAX_VALUE) / (MAX_VALUE - lDZ);

/*
        if ( bFullAxes )
        {
            // Rescale the axis values so it touches all the corners...
            // I wonder who uses such a monstrosity
            lAxis1 *= 1.4142136f;
            lAxis2 *= 1.4142136f;
        }
*/

        /* Ensure the -35000 to 35000 range */
        if ( lAxis1 > 35000 )    lAxis1 = 35000;
        if ( lAxis1 < -35000 )    lAxis1 = -35000;
        if ( lAxis2 > 35000 )    lAxis2 = 35000;
        if ( lAxis2 < -35000 )    lAxis2 = -35000;
    }

    *lpAxis1 = lAxis1;
    *lpAxis2 = lAxis2;

#else

If the stick is fully centred - VectorLength = 0 and DeadZone = 0, leads to a divide by 0 exception. Quick fix, change

Code:
    if ( VectorLength < lDZ )

to

Code:
    if ( VectorLength <= lDZ )

You're amazing man. I wasn't really expecting any collaboration between the two tool authors I was bugging, but it seems to have helped you both out a bit Laugh

Good to hear.
@dak224: I don't see the DS3 being disconnected from USB in the Service log. [log is cleared every time you restart the service (reboot) so as not to eat up disk space]. Can you do the following -

1. Plug in your DS3 to USB.
2. Reboot your machine.
3. Unplug your DS3 from USB.
4. Wait 30 seconds.
5. Plug in your DS3 to USB.
6. Wait 30 seconds.
7. Unplug your DS3 from USB.
8. Wait 30 seconds.
9. Zip up the ScpService.log and post it as an attachment.

Couple of questions also -
1. Do the lights keep flashing when you disconnect from USB?
2. Is your controller a genuine Sony DS3?

Your dongle is a very early REV of the CSR chip - 0134. Mine for example is 7558.




Users browsing this thread: 15 Guest(s)