Giter Club home page Giter Club logo

Comments (11)

atar-axis avatar atar-axis commented on July 17, 2024

Are you sure about that? I mean, there is absolutely no indication in the HID descriptor that one can control the brightness!

from xpadneo.

kakra avatar kakra commented on July 17, 2024

A friend told me that the controller should indicate in the four corners of the X logo which controller number you're using. This works at least with the Xbox, not sure about Windows. So it should be possible but maybe not through the normal bluetooth hid connection? Maybe this is possible only with the dongle. Also, I'm not sure if he owns the new Xbox One S controller but the older one.

from xpadneo.

atar-axis avatar atar-axis commented on July 17, 2024

A friend told me that the controller should indicate in the four corners of the X logo which controller number you're using.

Hum... I know that the old Xbox 360 Controller does that, but I never saw that anywhere else. There is also just one LED behind the Xbox-button on the newer One Gamepads.

"Diming the light" seems to be a functionality which is only available for the elite controller, at least according to some comments here: https://xbox.uservoice.com/forums/251650-console-hardware-accessories/suggestions/6029021-dim-the-bright-power-light-on-the-xbox-one-control?page=3&per_page=20

Would be nice if you chase that up at your friend :)

At the moment I don't see any way to do that.

from xpadneo.

atar-axis avatar atar-axis commented on July 17, 2024

Looks like it is possible indeed: https://www.neogaf.com/threads/xbox-one-lights-go-dimmer.723997/

But as you already said, not over BT - I close this issue therefore.

from xpadneo.

atar-axis avatar atar-axis commented on July 17, 2024

Another hint that it is possible: https://github.com/JRHeaton/XboxOneControllerDev

from xpadneo.

Slavko-P avatar Slavko-P commented on July 17, 2024

Another hint that it is possible: https://github.com/JRHeaton/XboxOneControllerDev

Any updates regarding this hint?

from xpadneo.

kakra avatar kakra commented on July 17, 2024

Current Xbox controllers have a vendor-defined descriptor extension which may expose the LED brightness and RGB control. This hasn't been explored yet but it's on the todo list. USB hints won't help here.

from xpadneo.

Slavko-P avatar Slavko-P commented on July 17, 2024

Current Xbox controllers have a vendor-defined descriptor extension which may expose the LED brightness and RGB control. This hasn't been explored yet but it's on the todo list. USB hints won't help here.

Unrelated to xpadneo: So in theory if I did it over USB, the setting would be permanent?

from xpadneo.

kakra avatar kakra commented on July 17, 2024

I don't think so, this state would be cleared when the controller disconnects. You could send a custom HID packet via udev when the controller connects, xpadneo create a raw hid device node. I've seen the vendor extensions only for the Elite 2 controller currently which can store custom profiles inside the controller itself, this is probably encoded in reports 0x06, 0x07, 0x08, 0x09, and/or 0x0a. One of those can probably program LED color and brightness. The HID protocol is very similar to the GIP protocol but uses different report numbers, and GIP has a sequence number embedded into the protocol itself for synchronization (afaik, HID does that in an outer layer):
https://github.com/atar-axis/xpadneo/blob/master/docs/descriptors/xbe2_linux.md

So in theory, you could peek into the GIP protocol e.g. in the xone source code to get an idea how it works for HID. You may also need to record wireshark traces of the Windows app to see how it uses these reports.

Also, it looks like I didn't decode report descriptor 11 into the table:

0x06, 0x00, 0xFF,  //   Usage Page (Vendor Defined 0xFF00)
0x09, 0x06,        //   Usage (0x06)
0xA1, 0x02,        //   Collection (Logical)
0x85, 0x0B,        //     Report ID (11)
0x09, 0x14,        //     Usage (0x14)
0x15, 0x00,        //     Logical Minimum (0)
0x25, 0x64,        //     Logical Maximum (100)
0x75, 0x08,        //     Report Size (8)
0x95, 0x01,        //     Report Count (1)
0xB1, 0x02,        //     Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0xC0,              //   End Collection

It basically describes a HID report with a single (count = 1) byte value (report size = 8 bits) and a value range of 0 to 100. Not sure what happens if you'd write 0x0B 0x20 (ID + data) to the raw HID device, maybe it sets the LED brightness, maybe the controller explodes.

There's a code example how to send rumble as raw data in misc/examples/c_hidraw, you could add more features to it if you like.

If your particular controller model doesn't have the required report IDs in the HID descriptor, you won't be able to send them: The controller will ignore them, or maybe even crash. You'll get a binary descriptor in /sys/module/hid_xpadneo/drivers/hid:xpadneo/0005:045E:*/report_descriptor (preprocessed by xpadneo). I think if you have a debug kernel, you can also get a decoded descriptor from debugfs. Otherwise use the online decoder as linked in the descriptor docs.

from xpadneo.

moviuro avatar moviuro commented on July 17, 2024

@kakra I don't understand at all what's happening in hidraw.c.

Did someone actually achieve turning the LED off when the controller is using bluetooth? My report descriptor (Bluetooth XBox One X controller) below:

Thanks https://eleccelerator.com/usbdescreqparser/
0x05, 0x01,        // Usage Page (Generic Desktop Ctrls)
0x09, 0x05,        // Usage (Game Pad)
0xA1, 0x01,        // Collection (Application)
0x85, 0x01,        //   Report ID (1)
0x09, 0x01,        //   Usage (Pointer)
0xA1, 0x00,        //   Collection (Physical)
0x09, 0x30,        //     Usage (X)
0x09, 0x31,        //     Usage (Y)
0x15, 0x00,        //     Logical Minimum (0)
0x27, 0xFF, 0xFF, 0x00, 0x00,  //     Logical Maximum (65534)
0x95, 0x02,        //     Report Count (2)
0x75, 0x10,        //     Report Size (16)
0x81, 0x02,        //     Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              //   End Collection
0x09, 0x01,        //   Usage (Pointer)
0xA1, 0x00,        //   Collection (Physical)
0x09, 0x33,        //     Usage (Rx)
0x09, 0x34,        //     Usage (Ry)
0x15, 0x00,        //     Logical Minimum (0)
0x27, 0xFF, 0xFF, 0x00, 0x00,  //     Logical Maximum (65534)
0x95, 0x02,        //     Report Count (2)
0x75, 0x10,        //     Report Size (16)
0x81, 0x02,        //     Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              //   End Collection
0x05, 0x01,        //   Usage Page (Generic Desktop Ctrls)
0x09, 0x32,        //   Usage (Z)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x03,  //   Logical Maximum (1023)
0x95, 0x01,        //   Report Count (1)
0x75, 0x0A,        //   Report Size (10)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x00,        //   Logical Maximum (0)
0x75, 0x06,        //   Report Size (6)
0x95, 0x01,        //   Report Count (1)
0x81, 0x03,        //   Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x01,        //   Usage Page (Generic Desktop Ctrls)
0x09, 0x35,        //   Usage (Rz)
0x15, 0x00,        //   Logical Minimum (0)
0x26, 0xFF, 0x03,  //   Logical Maximum (1023)
0x95, 0x01,        //   Report Count (1)
0x75, 0x0A,        //   Report Size (10)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x00,        //   Logical Maximum (0)
0x75, 0x06,        //   Report Size (6)
0x95, 0x01,        //   Report Count (1)
0x81, 0x03,        //   Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x01,        //   Usage Page (Generic Desktop Ctrls)
0x09, 0x39,        //   Usage (Hat switch)
0x15, 0x01,        //   Logical Minimum (1)
0x25, 0x08,        //   Logical Maximum (8)
0x35, 0x00,        //   Physical Minimum (0)
0x46, 0x3B, 0x01,  //   Physical Maximum (315)
0x66, 0x14, 0x00,  //   Unit (System: English Rotation, Length: Centimeter)
0x75, 0x04,        //   Report Size (4)
0x95, 0x01,        //   Report Count (1)
0x81, 0x42,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,Null State)
0x75, 0x04,        //   Report Size (4)
0x95, 0x01,        //   Report Count (1)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x00,        //   Logical Maximum (0)
0x35, 0x00,        //   Physical Minimum (0)
0x45, 0x00,        //   Physical Maximum (0)
0x65, 0x00,        //   Unit (None)
0x81, 0x03,        //   Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x09,        //   Usage Page (Button)
0x19, 0x01,        //   Usage Minimum (0x01)
0x29, 0x0C,        //   Usage Maximum (0x0C)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x01,        //   Logical Maximum (1)
0x75, 0x01,        //   Report Size (1)
0x95, 0x0C,        //   Report Count (12)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x00,        //   Logical Maximum (0)
0x75, 0x01,        //   Report Size (1)
0x95, 0x04,        //   Report Count (4)
0x81, 0x03,        //   Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x0C,        //   Usage Page (Consumer)
0x0A, 0xB2, 0x00,  //   Usage (Record)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x01,        //   Logical Maximum (1)
0x95, 0x01,        //   Report Count (1)
0x75, 0x01,        //   Report Size (1)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x00,        //   Logical Maximum (0)
0x75, 0x07,        //   Report Size (7)
0x95, 0x01,        //   Report Count (1)
0x81, 0x03,        //   Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x05, 0x0F,        //   Usage Page (PID Page)
0x09, 0x21,        //   Usage (0x21)
0x85, 0x03,        //   Report ID (3)
0xA1, 0x02,        //   Collection (Logical)
0x09, 0x97,        //     Usage (0x97)
0x15, 0x00,        //     Logical Minimum (0)
0x25, 0x01,        //     Logical Maximum (1)
0x75, 0x04,        //     Report Size (4)
0x95, 0x01,        //     Report Count (1)
0x91, 0x02,        //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x15, 0x00,        //     Logical Minimum (0)
0x25, 0x00,        //     Logical Maximum (0)
0x75, 0x04,        //     Report Size (4)
0x95, 0x01,        //     Report Count (1)
0x91, 0x03,        //     Output (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x09, 0x70,        //     Usage (0x70)
0x15, 0x00,        //     Logical Minimum (0)
0x25, 0x64,        //     Logical Maximum (100)
0x75, 0x08,        //     Report Size (8)
0x95, 0x04,        //     Report Count (4)
0x91, 0x02,        //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x09, 0x50,        //     Usage (0x50)
0x66, 0x01, 0x10,  //     Unit (System: SI Linear, Time: Seconds)
0x55, 0x0E,        //     Unit Exponent (-2)
0x15, 0x00,        //     Logical Minimum (0)
0x26, 0xFF, 0x00,  //     Logical Maximum (255)
0x75, 0x08,        //     Report Size (8)
0x95, 0x01,        //     Report Count (1)
0x91, 0x02,        //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x09, 0xA7,        //     Usage (0xA7)
0x15, 0x00,        //     Logical Minimum (0)
0x26, 0xFF, 0x00,  //     Logical Maximum (255)
0x75, 0x08,        //     Report Size (8)
0x95, 0x01,        //     Report Count (1)
0x91, 0x02,        //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0x65, 0x00,        //     Unit (None)
0x55, 0x00,        //     Unit Exponent (0)
0x09, 0x7C,        //     Usage (0x7C)
0x15, 0x00,        //     Logical Minimum (0)
0x26, 0xFF, 0x00,  //     Logical Maximum (255)
0x75, 0x08,        //     Report Size (8)
0x95, 0x01,        //     Report Count (1)
0x91, 0x02,        //     Output (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
0xC0,              //   End Collection
0xC0,              // End Collection

// 283 bytes

// best guess: USB HID Report Descriptor

from xpadneo.

kakra avatar kakra commented on July 17, 2024

It looks like the vendor extensions are gone from HID with current firmwares. I'll explore this after v0.10 is released.

from xpadneo.

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.