Acabei de descobrir como consertar a vibração no Ubuntu para os controladores Shanwan conectados ao USB.
A correção foi encontrada aqui: link
O arquivo linux ... / drivers / hid / hid-sony.c deve ser modificado nas fontes do kernel e o kernel deve ser recompilado.
Eu mudei um pouco (para me adaptar a qualquer cópia do gamepad da Sony PS3 com o produtor "ShanWan" ou "SHANWAN" - minha versão tem nomes maiúsculos):
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) {
O download e a compilação do kernel podem ser encontrados aqui: link depois que as fontes baixarem, modifique hid-sony.c de acordo e compile.