Just figured out how to fix vibration on Ubuntu for Shanwan controllers attached to USB.
The fix was found here :
https://forums.gentoo.org/viewtopic-t-1038906-start-0.html
File linux.../drivers/hid/hid-sony.c should be modified in kernel sources and kernel should be recompiled.
I've slightly changed it (to adapt for any Sony PS3 gamepad copy with producer "ShanWan" or "SHANWAN" - my version has capital names):
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) {
The kernel download and compile can be found here:
https://wiki.ubuntu.com/Kernel/BuildYourOwnKernel
after sources download, modify hid-sony.c accordingly and compile.