Roboron3042 / SteamControllerSinger

This project is a fork of Pila's Steam Controller Singer, including a dirty fix to make the Steam Controller sing again.
BSD 3-Clause "New" or "Revised" License
33 stars 7 forks source link

Notes randomly playing longer/program hang? #4

Open EpicLPer opened 3 years ago

EpicLPer commented 3 years ago

It seems that the program randomly takes a few more milliseconds to process what's trying to be played resulting in a few notes or pauses being played longer than they should.
Not sure if this can be fixed but I'll include a debug level 4 log here and a video showcasing this is available here: https://twitter.com/Stefan__Kern/status/1356071209637736452

Moon_Debug.txt

Roboron3042 commented 3 years ago

Indeed, this is not random, but the consequent of the "dirty fix" - fix which consists on reclaiming the controller every 2 seconds. This causes program to "hang" while the reclaim is happening, and that's what you just noticed. Depending on the song, you can notice it more often, but it will happen every 2 seconds.

Now, while I discovered the root cause and proposed this solution, I can't think on a better one. I'm afraid I don't know enough about libusb - I'm not the original author either.

But hey, improvements can still be made. In my testing, I found most songs worked with 5 seconds of reclaiming period, but I finally settled on 2 because that worked for absolutely all the collection. I can make this an user decision:

-c RECLAIM_PERIOD will change the default reclaiming period (2 seconds). A greater period will reduce notes hanging, but will also increase the probability of losing the control of the controller, depending on the song. All songs are known to fail with reclaim period over 5. After a failed attempt, you will need to reconnect the controller.

Added on #f70e13e. You can try the new release.

EpicLPer commented 3 years ago

5 Seconds seems to just about work for me, but as far as I know it's simply how the Steam Controller handles the reset routing.
If I try to install the WinUSB driver on Windows via Zadig it'll constantly reset itself and "tries to connect", if it fails it'll reconnect itself over and over again, at least on the latest available firmware for that thing. I actually think that there isn't going to be a fix other than the short reconnect period.

Sad that nobody else seems to be interested in this anymore, the Steam controller so far is pretty useless other than a "heavy mouse based games" mouse replacement :(

Roboron3042 commented 3 years ago

Yes, it is most probably a firmware update which started causing this behavior. Maybe Valve did this intentionally for whatever reason, and there's no way to prevent it, other than this workaround.

Still, I'm glad that the singer is still working, even if not perfectly. It's such a unique use...