3

I have a ps3 controller but I have the following problem:

  • if I connect by USB it works but the controller never stop to vibrate
  • I cannot manage to connect it via Bluetooth

$ 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
  • How can I properly setup SHANWAN controller on Linux ?
  • Or Where I should I submit a bug report

SHANWAN are not original controller but:

  • they works fine on Windows
  • they are most of not original controller are SHANWAN
  • What is shanwan? From a quick google, this is some kind of controller driver for retropi? – Mark Kirby Dec 18 '16 at 12:26
  • 1
    I think shawan is the producer of the controller. It is a ps3 dualshock compatible device – Postadelmaga Dec 18 '16 at 16:43
2

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.

  • I sent back this joypad so I cannot test ... btw thx – Postadelmaga Sep 7 '17 at 22:33

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.