Code Monkey home page Code Monkey logo

Comments (4)

streetpea avatar streetpea commented on May 22, 2024

Here are the main issues I’ve come up with from feedback in order of importance to address:

  1. Noisiness
  2. Missing springiness (DualSense has effects that produce a sort of springy ba-dum that ends up playing as multiple notes on Steam Deck. This is especially apparent in menus of games like Ghost of Tsushima and The Witcher 3 PS5 upgraded version)
  3. Some small haptics / footsteps are missed

It seems the causes of 1 and 2 are largely:

  1. The Steam Deck having one volume for haptics. For example, a 50 Hz effect can only be played at a set decibel level
    AND
  2. Looking at haptic controller implementations, there also appear to be filters in the PS5 controller hardware that are eliminating some effects. Currently, I have a simple cutoff based on the power of the audio signal to cut out unwanted haptics but while it’s better than nothing, it needs improvement (there are plenty of haptics that don’t actually get played on the DualSense / get filtered completely or are played at a low volume so as to not be felt by the player). This improvement can most likely come with a more sophisticated filter (of course we will have to do this in software not hw like the DualSense) and will likely need to be more aggressive than the dualsense due to the seeming inability to play low sounds / weak effects. I tried changing the duty cycle on the PWM to see if that would help but it mostly just results in different harmonics getting highlighted.

The other issue (3.) seems to be largely caused by playing 5 packets at a time to be able to determine power frequencies (since we have to figure out the frequency as opposed to just playing the sound via audio playback) due to packet spacing issues. Changing to 1 packet per analysis eliminates this (but causes other problems). Currently, I’m adding zero padding to the analysis. Since we are not using autocorrelation, this isn’t necessary. Removing it seems to largely fix 3 and causes some issues currently (resolution gained from interleaving lost) but it doesn’t seem to be a big issue. Resampling could also be used if necessary to help fix this though comes at increased processing cost.

Another cause for 1 is that small changes in frequency can reduce harmonizing / resonant frequencies that get produced when playing the same frequency for a period of time. Since these aren’t happening in the Steam Deck version we hear more harmonizing. However, i think the loudness / filter is probably the bigger issue. One hot fix to reduce noise would be to reduce the repeat count of effects to low such as 1 or 2 but this makes all effects feel rather bumpy and so probably isn’t a good solution.

from chiaki4deck.

jbaiter avatar jbaiter commented on May 22, 2024

Looking at haptic controller implementations, there also appear to be filters in the PS5 controller hardware that are eliminating some effects.

In the DualSense USB State Packet, there is a single bit that toggles a "Haptic Low-Pass-Filter" (according to the person who reverse-enginereed it). Maybe that has something to with it?

Packet Structure (See field `54.1`)
struct USBGetStateData { // 63
/* 0  */ uint8_t LeftStickX;
/* 1  */ uint8_t LeftStickY;
/* 2  */ uint8_t RightStickX;
/* 3  */ uint8_t RightStickY;
/* 4  */ uint8_t TriggerLeft;
/* 5  */ uint8_t TriggerRight;
/* 6  */ uint8_t SeqNo; // always 0x01 on BT
/* 7.0*/ Direction DPad : 4;
/* 7.4*/ uint8_t ButtonSquare : 1;
/* 7.5*/ uint8_t ButtonCross : 1;
/* 7.6*/ uint8_t ButtonCircle : 1;
/* 7.7*/ uint8_t ButtonTriangle : 1;
/* 8.0*/ uint8_t ButtonL1 : 1;
/* 8.1*/ uint8_t ButtonR1 : 1;
/* 8.2*/ uint8_t ButtonL2 : 1;
/* 8.3*/ uint8_t ButtonR2 : 1;
/* 8.4*/ uint8_t ButtonCreate : 1;
/* 8.5*/ uint8_t ButtonOptions : 1;
/* 8.6*/ uint8_t ButtonL3 : 1;
/* 8.7*/ uint8_t ButtonR3 : 1;
/* 9.0*/ uint8_t ButtonHome : 1;
/* 9.1*/ uint8_t ButtonPad : 1;
/* 9.2*/ uint8_t ButtonMute : 1;
/* 9.3*/ uint8_t ButtonLeftFunction : 1; // DualSense Edge
/* 9.4*/ uint8_t ButtonRightFunction : 1; // DualSense Edge
/* 9.5*/ uint8_t ButtonLeftPaddle : 1; // DualSense Edge
/* 9.6*/ uint8_t ButtonRightPaddle : 1; // DualSense Edge
/* 9.7*/ uint8_t UNK1 : 1; // appears unused
/*10  */ uint8_t UNK2; // appears unused
/*11  */ uint32_t UNK_COUNTER; // Linux driver calls this reserved, tools leak calls the 2 high bytes "random"
/*15  */ int16_t AngularVelocityX;
/*17  */ int16_t AngularVelocityZ;
/*19  */ int16_t AngularVelocityY;
/*21  */ int16_t AccelerometerX;
/*23  */ int16_t AccelerometerY;
/*25  */ int16_t AccelerometerZ;
/*27  */ uint32_t SensorTimestamp;
/*31  */ int8_t Temperature; // reserved2 in Linux driver
/*32  */ TouchData TouchData;
/*41.0*/ uint8_t TriggerRightStopLocation: 4; // trigger stop can be a range from 0 to 9 (F/9.0 for Apple interface)
/*41.4*/ uint8_t TriggerRightStatus: 4;
/*42.0*/ uint8_t TriggerLeftStopLocation: 4;
/*42.4*/ uint8_t TriggerLeftStatus: 4; // 0 feedbackNoLoad
                                       // 1 feedbackLoadApplied
                                       // 0 weaponReady
                                       // 1 weaponFiring
                                       // 2 weaponFired
                                       // 0 vibrationNotVibrating
                                       // 1 vibrationIsVibrating
/*43  */ uint32_t HostTimestamp; // mirrors data from report write
/*47.0*/ uint8_t TriggerRightEffect: 4; // Active trigger effect, previously we thought this was status max
/*47.4*/ uint8_t TriggerLeftEffect: 4;  // 0 for reset and all other effects
                                        // 1 for feedback effect
                                        // 2 for weapon effect
                                        // 3 for vibration
/*48  */ uint32_t DeviceTimeStamp;
/*52.0*/ uint8_t PowerPercent : 4; // 0x00-0x0A
/*52.4*/ PowerState PowerState : 4;
/*53.0*/ uint8_t PluggedHeadphones : 1;
/*53.1*/ uint8_t PluggedMic : 1;
/*53.2*/ uint8_t MicMuted: 1; // Mic muted by powersave/mute command
/*53.3*/ uint8_t PluggedUsbData : 1;
/*53.4*/ uint8_t PluggedUsbPower : 1;
/*53.5*/ uint8_t PluggedUnk1 : 3;
/*54.0*/ uint8_t PluggedExternalMic : 1; // Is external mic active (automatic in mic auto mode)
/*54.1*/ uint8_t HapticLowPassFilter : 1; // Is the Haptic Low-Pass-Filter active?
/*54.2*/ uint8_t PluggedUnk3 : 6;
/*55  */ uint8_t[8] AesCmac;
};

Source: https://controllers.fandom.com/wiki/Sony_DualSense#Input_Reports

from chiaki4deck.

cgarst avatar cgarst commented on May 22, 2024

My initial impression of the haptics were that they felt too strong. A config to simply reduce the intensity would be nice to have.

from chiaki4deck.

streetpea avatar streetpea commented on May 22, 2024

The haptic intensity is something set for the controller (I.e., all haptics are at the same strength) which you can set via the system settings on the Steam Deck via Settings->Controller->Calibration & Advanced Settings-> Haptics Settings. When a program drives haptics it should just be at the intensity set via that menu. Having said that, having a better filter will mean haptics are played less as mentioned above which may result in the haptics feeling “weaker” even if they are output at the same strength. However, if it still isn’t to your liking at that point it would likely be something to configure via system settings. I could also configure it directly but since it’s already available on system settings it’s probably best to let users change it there.

In other words, this should partially fix itself with the updates above and the other part would be adding the info of how to configure haptic intensity via the above menu to the documentation.

from chiaki4deck.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.