Capturing Controller Data

Any controller that connects to a Mac can be supported. What it takes is data: what the controller says about itself, and the packets it sends when you press each control. The maintainer owns few controllers, so your files are what makes support happen.

Gather what you can on any computer you have, then send it. macOS, Windows, and Linux each show different parts, so files from all three help most.

Contents

  1. Before You Start
  2. On macOS
  3. On Windows
  4. On Linux
  5. Find What Others Know
  6. Send It

Before You Start

  • Write down the VID:PID. It’s two 4-digit hex numbers, such as 045E:028E. It names the controller model.
  • Capture every mode and connection. One capture each for USB, Bluetooth, and the dongle, and for each mode (XInput, DInput, Switch, Mac). Many controllers show a new VID:PID in each mode. Write down how you entered the mode, such as “hold X while turning on”.
  • Press the controls in this order, and write the order down if you change it:
    1. Nothing for 2 seconds.
    2. A, B, X, Y (or Cross, Circle, Square, Triangle).
    3. Left bumper, right bumper.
    4. Left trigger slowly all the way in and out, then the right trigger.
    5. D-pad up, right, down, left.
    6. Left stick: a full slow circle, then click it. Same for the right stick.
    7. Select or Back, Start, Home, then any extra buttons (Share, paddles, touchpad click).
    8. Tilt and turn the controller if it has motion.

On macOS

  1. List controllers and find yours:

    ojd controller list
    
  2. Capture packets while you press each control in order:

    ojd controller capture <controller> --duration 20 --json > capture.jsonl
    
  3. Draft a record. Press each control again while it runs:

    ojd record draft <controller> > draft.plist
    
  4. Save the HID descriptors and the USB tree:

    ioreg -r -c IOHIDDevice -l -w0 > ioreg-hid.txt
    ioreg -p IOUSB -l -w0 > ioreg-usb.txt
    
  5. Bluetooth only: record with PacketLogger, from Apple’s Additional Tools for Xcode. Start it, connect the controller, press each control, then save the .pklg file.

<controller> is the name or VVVV:PPPP from step 1. See Command Reference for more.

On Windows

  1. Hardware IDs. Open Device Manager. Right-click the controller and choose Properties. On Details, pick Hardware Ids. Copy every line.
  2. Descriptors. Run USB Device Tree Viewer. Select the controller and choose File > Save Report.
  3. USB packets with Wireshark and USBPcap:
    1. Install Wireshark. Tick USBPcap in the installer, then restart.
    2. Unplug the controller.
    3. Open Wireshark. Each USBPcap interface is one root hub. Pick the one your controller’s port uses. If unsure, try each in turn.
    4. Start the capture, then plug the controller in.
    5. Press each control in order.
    6. Stop, then File > Save As a .pcapng file.
  4. Note the driver Windows used: Properties > Driver > Driver Details.

On Linux

  1. Descriptors. Find the controller with lsusb, then:

    sudo lsusb -v -d VVVV:PPPP > lsusb.txt
    
  2. Driver. Plug it in, then save what the kernel did and which driver took it (xpad, hid-generic, hid-playstation, and so on):

    sudo dmesg | tail -50 > dmesg.txt
    lsusb -t > lsusb-tree.txt
    
  3. HID reports. Install hid-tools (pip install hid-tools), then run sudo hid-recorder, pick the controller, and press each control in order. Save the output.
  4. USB packets with usbmon and Wireshark:
    1. Run sudo modprobe usbmon.
    2. Note the bus number from lsusb (Bus 003 means usbmon3).
    3. Unplug the controller. Start Wireshark with sudo wireshark and capture on that usbmon interface.
    4. Plug the controller in and press each control in order.
    5. Stop, then save a .pcapng file.
  5. Bluetooth packets. Run sudo btmon -w bluetooth.snoop, connect the controller, press each control, then stop with Control-C.

Find What Others Know

Search for the VID:PID and the controller’s name, and link what you find:

Links to GPL drivers are welcome. OJD takes IDs and byte values from them and writes its own code.

Send It

Open a Controller Support issue and attach the files. Zip them if there are many. Name each file with the system, connection, and mode, such as linux-usb-xinput.pcapng.

You can also open a pull request with a record, or ask in Discussions.

Note

Captures hold only what the controller sends. Check the ioreg and dmesg files before you attach them: they can name your Mac or PC and other devices.