Ryochan7/DS4Windows

Updating from 1.7.17 to 3.2.21 renders every single profile useless - 3.3.0 crashes when editing legacy profile

Rings4 opened this issue · 10 comments

Rings4 commented

Describe the bug
I have just updated from version 1.7.17 to version 3.2.21, and none of my profiles work. I backed up my profiles before updating in case they got overwritten. Even importing the profiles from within DS4Windows simply imports a profile with the same name but leaves it completely default. No changes in button presses, touchpad functionality, nor lightbar persist in the profile that is being imported.

Desktop:

  • Controller Make and Model: Sony DS4 v.1 (CUH-ZCT1U)
  • OS: Windows 10 Pro 21H2 Build 19044.2486
  • DS4Windows Version: 3.2.21

Also tested on my Windows 11 Surface Pro

  • OS: Windows 11 Pro 22H2 Build 22621.2283

Additional context
This is preventing me from updating my DS4WIndows, as I have far too many profiles that I do not wish to have to re-create one by one. If there is a way they can be imported to the current version, please let me know.

EDIT 2023-12-17: DS4Windows 3.3.0 crashes when trying to edit a legacy profile.

Let me check real quick...

Yep. That version was released 5 years ago.

I ended up finding out about this problem recently. The problem was initially introduced with DS4Windows 3.2 with the introduction of using XmlSerializer to load profile XML. Using XmlSerializer was not the issue but the custom ProfileMigration class had a flaw in it that would not return the converted XML but only a empty string. XML parsing would fail but those files should not be overwritten from what I have experienced.

The problem was fixed with commits 016654b and 0e6f7ec. It should be cleared up for DS4Windows 3.3. Making some final code tweaks before pushing that version out. My initial time table was to publish that release around Friday (2023/12/15).

Rings4 commented

That's great to hear! I'm looking forward to the update. I hadn't needed to update DS4Windows since 2019 since it just always worked for me, but I recently got a couple 8BitDo controllers and wanted the ability to map the keyboard to the buttons in order to be able to play some games that lack gamepad support. I'm really glad I can do this without losing my profiles once 3.3 is released!

Rings4 commented

I ended up finding out about this problem recently. The problem was initially introduced with DS4Windows 3.2 with the introduction of using XmlSerializer to load profile XML. Using XmlSerializer was not the issue but the custom ProfileMigration class had a flaw in it that would not return the converted XML but only a empty string. XML parsing would fail but those files should not be overwritten from what I have experienced.

The problem was fixed with commits 016654b and 0e6f7ec. It should be cleared up for DS4Windows 3.3. Making some final code tweaks before pushing that version out. My initial time table was to publish that release around Friday (2023/12/15).

@Ryochan7 Unfortunately, the issue persists in 3.3.0. Or rather, it still doesn't work, but now DS4Windows also crashes when I try to edit an old profile.

Here is a profile I am trying that causes the program to crash upon double click/edit:

<!-- DS4Windows Configuration Data. 10/15/2021 3:44:23 AM -->

<DS4Windows>
  <flushHIDQueue>True</flushHIDQueue>
  <touchToggle>True</touchToggle>
  <idleDisconnectTimeout>1800</idleDisconnectTimeout>
  <Color>33,0,255</Color>
  <RumbleBoost>100</RumbleBoost>
  <ledAsBatteryIndicator>True</ledAsBatteryIndicator>
  <FlashType>0</FlashType>
  <flashBatteryAt>10</flashBatteryAt>
  <touchSensitivity>100</touchSensitivity>
  <LowColor>255,0,53</LowColor>
  <ChargingColor>255,255,255</ChargingColor>
  <FlashColor>0,0,0</FlashColor>
  <touchpadJitterCompensation>True</touchpadJitterCompensation>
  <lowerRCOn>False</lowerRCOn>
  <tapSensitivity>0</tapSensitivity>
  <doubleTap>False</doubleTap>
  <scrollSensitivity>0</scrollSensitivity>
  <LeftTriggerMiddle>0</LeftTriggerMiddle>
  <RightTriggerMiddle>0</RightTriggerMiddle>
  <TouchpadInvert>0</TouchpadInvert>
  <L2AntiDeadZone>0</L2AntiDeadZone>
  <R2AntiDeadZone>0</R2AntiDeadZone>
  <L2MaxZone>100</L2MaxZone>
  <R2MaxZone>100</R2MaxZone>
  <ButtonMouseSensitivity>25</ButtonMouseSensitivity>
  <Rainbow>0</Rainbow>
  <MaxSatRainbow>100</MaxSatRainbow>
  <LSDeadZone>10</LSDeadZone>
  <RSDeadZone>10</RSDeadZone>
  <LSAntiDeadZone>20</LSAntiDeadZone>
  <RSAntiDeadZone>20</RSAntiDeadZone>
  <LSMaxZone>100</LSMaxZone>
  <RSMaxZone>100</RSMaxZone>
  <LSRotation>0</LSRotation>
  <RSRotation>0</RSRotation>
  <SXDeadZone>0.25</SXDeadZone>
  <SZDeadZone>0.25</SZDeadZone>
  <SXMaxZone>100</SXMaxZone>
  <SZMaxZone>100</SZMaxZone>
  <SXAntiDeadZone>0</SXAntiDeadZone>
  <SZAntiDeadZone>0</SZAntiDeadZone>
  <Sensitivity>1.3|1.3|1|1|1|1</Sensitivity>
  <ChargingType>0</ChargingType>
  <MouseAcceleration>False</MouseAcceleration>
  <LaunchProgram>
  </LaunchProgram>
  <DinputOnly>False</DinputOnly>
  <StartTouchpadOff>False</StartTouchpadOff>
  <UseTPforControls>True</UseTPforControls>
  <UseSAforMouse>False</UseSAforMouse>
  <SATriggers>-1</SATriggers>
  <SATriggerCond>and</SATriggerCond>
  <SASteeringWheelEmulationAxis>None</SASteeringWheelEmulationAxis>
  <SASteeringWheelEmulationRange>360</SASteeringWheelEmulationRange>
  <TouchDisInvTriggers>-1</TouchDisInvTriggers>
  <GyroSensitivity>100</GyroSensitivity>
  <GyroSensVerticalScale>100</GyroSensVerticalScale>
  <GyroInvert>0</GyroInvert>
  <GyroTriggerTurns>True</GyroTriggerTurns>
  <GyroSmoothingWeight>50</GyroSmoothingWeight>
  <GyroSmoothing>False</GyroSmoothing>
  <GyroMouseHAxis>0</GyroMouseHAxis>
  <GyroMouseDeadZone>10</GyroMouseDeadZone>
  <GyroMouseToggle>False</GyroMouseToggle>
  <GyroOutputMode>Controls</GyroOutputMode>
  <GyroMouseStickTriggers>
  </GyroMouseStickTriggers>
  <GyroMouseStickTriggerCond>and</GyroMouseStickTriggerCond>
  <GyroMouseStickTriggerTurns>False</GyroMouseStickTriggerTurns>
  <GyroMouseStickHAxis>0</GyroMouseStickHAxis>
  <GyroMouseStickDeadZone>30</GyroMouseStickDeadZone>
  <GyroMouseStickMaxZone>830</GyroMouseStickMaxZone>
  <GyroMouseStickAntiDeadX>0.4</GyroMouseStickAntiDeadX>
  <GyroMouseStickAntiDeadY>0.4</GyroMouseStickAntiDeadY>
  <GyroMouseStickInvert>0</GyroMouseStickInvert>
  <GyroMouseStickToggle>False</GyroMouseStickToggle>
  <GyroMouseStickVerticalScale>100</GyroMouseStickVerticalScale>
  <GyroMouseStickSmoothing>False</GyroMouseStickSmoothing>
  <GyroMouseStickSmoothingWeight>50</GyroMouseStickSmoothingWeight>
  <LSCurve>0</LSCurve>
  <RSCurve>0</RSCurve>
  <ProfileActions>Disconnect Controller/Switch Media 3/Switch Media 2 to Default/Switch Default to Media 2</ProfileActions>
  <BTPollRate>4</BTPollRate>
  <LSOutputCurveMode>linear</LSOutputCurveMode>
  <LSOutputCurveCustom>
  </LSOutputCurveCustom>
  <RSOutputCurveMode>linear</RSOutputCurveMode>
  <RSOutputCurveCustom>
  </RSOutputCurveCustom>
  <LSSquareStick>False</LSSquareStick>
  <RSSquareStick>False</RSSquareStick>
  <SquareStickRoundness>5</SquareStickRoundness>
  <SquareRStickRoundness>5</SquareRStickRoundness>
  <L2OutputCurveMode>linear</L2OutputCurveMode>
  <L2OutputCurveCustom>
  </L2OutputCurveCustom>
  <R2OutputCurveMode>linear</R2OutputCurveMode>
  <R2OutputCurveCustom>
  </R2OutputCurveCustom>
  <SXOutputCurveMode>linear</SXOutputCurveMode>
  <SXOutputCurveCustom>
  </SXOutputCurveCustom>
  <SZOutputCurveMode>linear</SZOutputCurveMode>
  <SZOutputCurveCustom>
  </SZOutputCurveCustom>
  <TrackballMode>False</TrackballMode>
  <TrackballFriction>10</TrackballFriction>
  <OutputContDevice>X360</OutputContDevice>
  <Control>
    <Button>
      <TouchLeft>Unbound</TouchLeft>
      <TouchUpper>Unbound</TouchUpper>
      <TouchMulti>Unbound</TouchMulti>
      <TouchRight>Unbound</TouchRight>
      <GyroXPos>Unbound</GyroXPos>
      <GyroXNeg>Unbound</GyroXNeg>
      <GyroZPos>Unbound</GyroZPos>
      <GyroZNeg>Unbound</GyroZNeg>
      <SwipeRight>Unbound</SwipeRight>
    </Button>
  </Control>
  <ShiftControl>
    <Button>
      <GyroZNeg Trigger="19">Unbound</GyroZNeg>
    </Button>
    <Macro>
      <SwipeRight Trigger="13">162/547/119/603/162</SwipeRight>
    </Macro>
    <KeyType>
      <SwipeRight>Macro</SwipeRight>
    </KeyType>
  </ShiftControl>
</DS4Windows>```

More problems. Only tested old profile loading before but even that does not work correctly in the current release. Found some glaring issues mainly with the ProfileDTO class and not populating some data if it does not exist in the XML. The ProfileMigration class was doing its job this time around.

59d8e49

Found some more relevant issues that had been undiagnosed because people did not provide a profile. Going to double post but this issue is also linked to #2827. There was no way to know without the bugged profile in question.

Added some more tests

35b3c03

Looks like this issue will require more immediate attention if possible.

Rings4 commented

Found some more relevant issues that had been undiagnosed because people did not provide a profile. Going to double post but this issue is also linked to #2827. There was no way to know without the bugged profile in question.

Thanks for continuing to look into this. Let me know if you'd like some more profiles of mine. They all produce the same issue.

Making some progress. Hopefully version 3.3.2 behaves a bit better

https://github.com/Ryochan7/DS4Windows/releases/tag/v3.3.2

Rings4 commented

Thank you so much, version 3,3,2 works better from my brief testing! It doesn't crash upon editing an old profile, both by copy pasting the profile into the profiles folder, and by importing the profile within DS4Windows. The two profiles I tested seemed to maintain all their custom mappings, as well.

Are there any other issues you're trying to iron out with this release in regards to old profiles?