我有一个 ps3 控制器,但遇到以下问题:
- 如果我通过 USB 连接,它可以工作,但控制器永远不会停止振动
- 我无法通过蓝牙连接
$ dmesg
[ 3535.328372] input: SHANWAN PS3 GamePad as /devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/0003:054C:0268.0001/input/input16
[ 3535.329083] sony 0003:054C:0268.0001: input,hiddev0,hidraw0: USB HID v1.10 Joystick [SHANWAN PS3 GamePad] on usb-0000:00:14.0-1/input0
- 如何在 Linux 上正确设置 SHANWAN 控制器?
- 或者 我应该在哪里提交错误报告
SHANWAN 不是原始控制人,但是:
- 它们在 Windows 上运行良好
- 他们大多数不是原始控制人是SHANWAN
答案1
刚刚弄清楚了如何修复 Ubuntu 上连接到 USB 的 Shanwan 控制器的振动。
修复方法在这里找到: https://forums.gentoo.org/viewtopic-t-1038906-start-0.html
应该在内核源中修改文件 linux.../drivers/hid/hid-sony.c,并重新编译内核。
我对其进行了些许改动(以适应任何带有生产商“ShanWan”或“SHANWAN”的索尼 PS3 游戏手柄副本 - 我的版本有大写名称):
struct sony_sc {
__u8 led_count;
};
+/*
+ * The ShanWan reports the same id as the Sony SixAxis, therefore
+ * it can't be added to sony_devices[], but we still need to know which one
+ * we're dealing with.
+ */
+static int is_shanwan_gamepad(struct hid_device *hdev)
+{
+ return strstr(hdev->name, "ShanWan") || strstr(hdev->name, "SHANWAN) ;
+}
+
static __u8 *sixaxis_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize)
{
<..........>
static __u8 *sony_report_fixup(struct hi
struct sony_sc *sc = hid_get_drvdata(hdev);
/*
+ * The ShanWan gamepades when used over USB, times out when
+ * initialising reports, but it works just fine without init.
+ */
+ if((sc->quirks & SIXAXIS_CONTROLLER_USB) && is_shanwan_gamepad(hdev))
+ hdev->quirks |= HID_QUIRK_NO_INIT_REPORTS;
+
+ /*
* Some Sony RF receivers wrongly declare the mouse pointer as a
* a constant non-data variable.
*/
<...........>
static int sixaxis_set_operational_usb(s
/*
* Some compatible controllers like the Speedlink Strike FX and
* Gasia need another query plus an USB interrupt to get operational.
+ * The ShanWan gamepads doesn't like these additional steps.
*/
+ if(is_shanwan_gamepad(hdev))
+ goto out;
+
ret = hid_hw_raw_request(hdev, 0xf5, buf, SIXAXIS_REPORT_0xF5_SIZE,
HID_FEATURE_REPORT, HID_REQ_GET_REPORT);
if (ret < 0) {
内核下载和编译可以在这里找到: https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel 源代码下载后,相应修改hid-sony.c并编译。