10 ms·
Show HN: DualShock calibration in the browser using WebHID
This website uses undocumented HID commands of both DS4 and DualSense to re-center and recalibrate DualShock analog sticks.
- terandle 3y agoHelped out with the drift on my DualSense, now I don't have to trash it, thanks man!
- the__alchemist 3y agoHey - total tangent, but... I'm playing through Horizon Forbidden West. It's the first game on PC I've played that supports the DualSense (PS5 controller)'s haptic motors and adaptive triggers. They are something else when integrated properly with game events and sounds. It would be cool if this were integrated into more games!
- deleted 3y ago[deleted]
- TylerE 3y agoFunny, I wish most games gave more options to turn them down. Some newer games are REALLY excessive with it. I encountered one game recently that felt it was necessary (no way to disable) to make the controller vibrate every single time you used the d-pad in the UI.
- mdrzn 3y agoHelvetica with font-weight 300 makes the text really thin and hard to read at 100% zoom.
- deleted 3y ago[deleted]
- rokkamokka 3y agoLooks great on mobile, fwiw
- CodeWriter23 3y agoI think you misspelled "younger eyes"
- NelsonMinar 3y agoReally nicely done! Can recalibration help when the controller is connected to a Playstation? Does it store the calibration somehow in the controller? Or is this only useful on a PC? I'd love to somehow restore my PS5 DualSense that's fallen victim to stick drift. I looked once in Steam's debug info and instead of the stick reading 0 at center it was reading about 20,000. Given the max is 32,767 I've lost 2/3 of the useful range, so maybe there's no fixing it with software.
- bilekas 3y agoDS4Windows is a decent tool for the dual sense, I think they have an offset you can configure while using it on PC but it wont store to the controller itself..
- evilhackerdude 3y agoi fixed a busted analog stick by opening it up and cleaning the sensor thanks to some youtube video.
- jwrallie 3y agoThat works quite well, but I had to repeat it a few months later. I recommend cleaning also the other stick as the plastic in the DS4 casing can break from opening it too often.
- aidenn0 3y agoI have revived my CH Mach III twice now with DeoxIT on the potentiometers. I've owned that stick for over 30 years at this point. P.S. I wish someone made a modern joystick with a similar feel, but more than two buttons.
- John_Cena 3y agoThe CH Mach III looks tight! I was messing around with a DOS game Sword of the Samurai and was wondering what types of sticks were being used by enthusiasts at the time since that game supported a joystick. What kind of things were you playing with that when you purchased it new? I'm in this industry in no small part to watching my brother play Descent with a joystick in the 90s. I think his was made by the same company - F-16 Flightstick. I remember it having suction cups on the bottom though
- sumo89 3y ago"I noticed that many repair technicians were using my scripts to recalibrate controllers, which significantly reduced repair times and costs. However, many of them were also having a tough time setting up the environment to run the scripts: Python, libusb, Windows drivers, and all that complicated stuff: the user experience was completely off. This led me to the idea of creating a multiplatform web UI that could simplify everything. I developed a prototype and shared the link on a Facebook group for repair technicians, where it was warmly (..really warmly!) received." That's so wholesome. Other people would have seen their software being used and decided they should be turning a profit from it.
- deleted 3y ago[deleted]
- pvg 3y agoI am guessing the author is an alien tapped into the Strategic Galactic Good Cheer & Chill Reserve. That explains being able to provide a free utility/online service to the audience of 'gamers, when their controller is effed up'.
- jorvi 3y ago[flagged]
- troupo 3y agoYou could acquaint yourself with the timeline of WebHID. Google presented a "spec" that wasn't even a spec. They were asked to create a better spec. Instead they just shipped WebHID, and several months later dumped several hundred pages of specifications saying "there". Whatever your position on hardware standards are, this is not how standards are presented. Edit: the status of WebHID is literally "not a W3C Standard nor is it on the W3C Standards Track." and it's current state is barely above "scratched on a napkin". But Google couldn't care less
- jorvi 3y agoI am acquainted with the process. Did you just miss entire premise of the article, how WebHID made the lives of a bunch of working people much better? Would you rather make these people have a much more difficult time now so Firefox diehard can have a “proper” WebHID in 5 years..?
- troupo 3y agoThere's nothing "die hard" about wanting to create a proper standard (and being aware of the trade offs) instead of just implementing whatever Google deigns worthy of throwing up. Now Firefox cannot even implement the "proper HID" because Google has already shipped their version
- TehCorwiz 3y agoIt's detecting my Sony original DS4 controller as a clone.
- al_al 3y agoIs it a DS V1 or V2? What is the build date of the firmware?
- herpdyderp 3y agoCalibration immediately errors out for my DualSense. Luckily mine doesn't actually need any calibration, I was just trying it out :)
- al_al 3y agoWhat is the build date of your firmware? Sometimes updating the firmware to the latest version solves any issue
- alickz 3y agocool
- sotix 3y ago> It is available only for Google Chrome, Chromium or compatiable browsers (e.g. Edge) because it uses WebHID, a javascript extension that can be used to send commands to a HID device. I didn’t know about WebHID, but it’s interesting Firefox doesn’t support it. According to Mozilla’s position[0]: > This API, like WebUSB, provides access to generic devices. Though this API is limited to human interface devices (HID), the same concerns apply as WebUSB, namely that devices are generally not designed with access from arbitrary websites in their threat model. [0]: https://mozilla.github.io/standards-positions/#webhid https://mozilla.github.io/standards-positions/#webhid
- deleted 3y ago[deleted]
- colordrops 3y agoWhat is the chrome team's threat model for this? Why are they ok with it?
- TylerE 3y agoProbably because it's listening to two general purpose input devices all the time at the very least? If you're that paranoid you probably shouldn't be using a non air-gapped machine in the first place.
- 0cf8612b2e1e 3y agoChrome enables Chrome OS. These security holes are allowed into the spec to ensure the Chrome machines are not totally hobbled.
- modeless 3y agoThey are OK with it because it's behind an explicit permission dialog and the user has to specifically choose a single device to grant access. I doubt there's been a single instance of a real world attack using this API. It's been enabled by default in Chrome for years, so it's not like there hasn't been an opportunity. This is just concern trolling by people who dislike the modern web for other reasons.
- michaelmrose 3y agoSo a malicious website can brick controllers. Good for author but I'm surprised its even possible.
- deleted 3y ago[deleted]
- hbn 3y agoYou have to give it permissions to interface with the device, but also it sounds like a site wouldn't be able to so much "brick" it but rather miscalibrate it since it's not permanent. I assume it's just setting some offset values specific to the controller based on the stick's center point and whatnot. If a malicious site were to do that, you could just come back to this site and fix it.
- michaelmrose 3y agoReading it more clearly the developer actually expresses concern about allowing the code to run on clones resulting in potentially bricking them due to not supporting the same operations. Perhaps its more accurately a possible deficiency in clone controllers that the developer supposes may be in danger.
- aidenn0 3y agoDoes this mean that a malicious website could intentionally miscalibrate any HID devices connected, or does it ask for permissions?
- ultimatt42 3y agoThe site has to request permission to access a device, then the user has to select the device from a permission dialog to grant access.
- aidenn0 3y agoGood; that's way better than being able to reflash your PS4 controllers with a drive-by.
- al_al 3y agoit does ask for permission, but a malicious website could ask it for a valid reason and then brick it, yup. On the other side, a controller should not be brickable via HID commands...
- opan 3y agoAre there any plans to support Switch Pro Controllers?
- heystefan 3y agoCan I detect analog stick drift with this?
- steelbrain 3y agoChrome is doing amazing work with these WebAPIs. Here's a quick list of things enabled by Chrome being open-minded and allowing WebHID and WebUSB APIs to exist: - Turn your Stadia controllers into bluetooth controllers: https://stadia.google.com/controller/index_en_GB.html https://stadia.google.com/controller/index_en_GB.html - Android Flash Tool: https://flash.android.com/welcome https://flash.android.com/welcome - fastboot.js - FastBoot API but entirely though the web: https://kdrag0n.github.io/fastboot.js/demo/ https://kdrag0n.github.io/fastboot.js/demo/ - WebADB - Android debugging interface through the web: https://app.webadb.com/ https://app.webadb.com/ and here's my favorite (because I used it in my RX-8) - Node-Carplay - Carplay interface through a USB dongle in your browser with no external dependencies!!1! (https://github.com/rhysmorgan134/node-CarPlay https://github.com/rhysmorgan134/node-CarPlay)
- hnburnsy 3y agoAre these really the job of your browser?
- AgentME 3y agoThe browser is a great for distribution (apps are just URLs) and security (web pages need to ask permission before accessing anything on your computer outside of their domain). More people should question the common belief that desktop OSes (without enforced app sandboxing) do a proper job at being a platform for utilities like OP's. When you download and run an .exe on a normal Windows pc, you're giving it read and write access to everything on your user account. It's bad that you're required to put so much trust in developers to run programs on typical desktop systems; this either ends up causing people to be extremely picky about what they run or to give out trust too freely and get bitten by malware often. Platforms like the browser which sandbox (web) apps and enforce a granular permission system are terrific.
- hnburnsy 3y agoWith all the APIs available to the browser at what point do I have the same worry that an .exe brings?
- hnburnsy 3y agoJFC, is there any host functionality that Chrome will not try and implement in the browser. No wonder it is so bloated and leaks your fingerprint in a million different ways. Apple says they will not implement WebHID and 15 other "features" in WebKit... >Here are some examples of features we have decided to not yet implement due to fingerprinting, security, and other concerns, and where we do not yet see a path to resolving those concerns: Web Bluetooth Web MIDI API Magnetometer API Web NFC API Device Memory API Network Information API Battery Status API Web Bluetooth Scanning Ambient Light Sensor HDCP Policy Check extension for EME Proximity Sensor WebHID Serial API Web USB Geolocation Sensor (background geolocation) User Idle Detection
- xcdzvyn 3y agoI completely understand the desire to not implement such things, but I also understand why they exist. Unfortunately, perhaps due to a mixture of elitism, protectionism, and market dominance, writing cross-platform software in any capacity, let alone cross platform software that requires low-level hardware access, Bluetooth, video, geolocation, etc., is far harder than it deserves to be, and using the web as an abstraction layer makes these things a million times easier. edit: It's also far easier to distribute this stuff. I just want my video game controller working in slightly better order - I don't want to have to install some bluetooth library and then choose between an x86 Mac, ARM Mac, x86 Windows, x64 Windows, AppImage, deb, flatpak, .tar.gz, snap, my package manager (if it's even there), try install it, shit, it doesn't run on my distro, patch it, use it once, then uninstall it.
- solardev 3y agoThis is amazing!! Thank you! I don't even have a PS controller and I'm grateful this exists. I hope you'll do one for Xbox Elite controllers and button remapping next :) It sucks having to boot into a Windows VM to remap them.