Giter Club home page Giter Club logo

Comments (6)

computerquip avatar computerquip commented on May 28, 2024

The bug is caused by discontinuing listening to the wireless adapter, which is done here: https://github.com/paroj/xpad/blob/connected_only/xpad.c#L687

Even if a device isn't physically connected to the adapter, this is how the adapter tells you whether a controller is connected or not. You must always be listening.

from xpad.

computerquip avatar computerquip commented on May 28, 2024

The adapter has a hard limit for 4 controllers. On top of this, there are only 4 LED positions. The original XUSB driver also only supported 4 controllers. I remember why I only supported 4 controllers with Xpad5

from xpad.

paroj avatar paroj commented on May 28, 2024

yeah.. I probably should just go with intf->cur_altsetting->desc.bInterfaceNumber for enumerating the wireless controllers.

But this is the usecase I am thinking about and which is covered by the current atomic counter approach:

  1. attach a wired x360 pad (LED1)
  2. connect a wireless x360 pad (LED2)
    the 5th controller is identified by LED1 again

However the counter just keeps incrementing after suspend/ resume. (this is the actual issue with it)

But this is unrelated to only exposing connected devices and I should treat it as a different issue.

from xpad.

paroj avatar paroj commented on May 28, 2024

thanks for the hint regarding listening to the adapter. will try it as soon as I have some time

from xpad.

computerquip avatar computerquip commented on May 28, 2024

Really, you can just hold some global state that can track when controllers are connected.

Using the interface number would break when used in combination with wired controllers.

from xpad.

paroj avatar paroj commented on May 28, 2024

works 👍

from xpad.

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.