..:: PCSX2 Forums ::..

Full Version: XInput Wrapper for DS3 and Play.com USB Dual DS2 Controller
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510
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.
@PancakeMix: you can clear the controllers by restarting the service, using Service Control Manager or from a command prompt [elevated if using UAC].
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.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510