SHANWAN /PC/PS3/Android Wireless CONTROLLER On Lakka

Hi, I am having a problem getting my ShanWan / PC/PS3/Android (#0) Wireless Gamepad to work with Lakka software which is on my Raspberry Pi 3. It seems like it’s pairing but I am not getting any buttons to work. The gamepad works just fine with Retropie software and all buttons work but I want to use Lakka Software. Is there anything I need to do to get it to work in Lakka? P.S. My Regular USB wired gamepads work just fine in Lakka I am only have a problem with my Wireless one.

My shanwan works well, except that it’s constantly vibrating when I plug the wire. Except that, it auto pairs on the first time I plug it and reconnects nicely.

Mine works well with Retropie Software, but for some reason it doesn’t work at all with Lakka Software. I was thinking maybe I have to add something in my “config file or any other file” to get it to work. In Lakka options It shows under “Input settings” as ShanWan / PC/PS3/Android (#0) Device but no buttons work. I use my wireless keyboard to scroll through the different options in Lakka and try to reset buttons notting happens. Please note: This Gamepad comes with a RF receiver that connects via USB.

With the new LibreELEC based builds, my SHANWAN works perfectly without the vibrating bug!

http://le.builds.lakka.tv/

Hi! Just figured out how to fix vibration on Lakka whan Shanwan controllers are attached to USB (in fact my controllers are still vibrating on 2.0 and 2.1 releases). The fix was found here: https://forums.gentoo.org/viewtopic-t-1038906-start-0.html 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) {

Can you try format the source code or provide a diff ? It will be more clear.

build.XX/linux-4.9.29/drivers/hid/hid-sony.c: https://drive.google.com/open?id=0B0oD_n2MwkUlZm41elZQNFFqS2c

differences:

+/*
+ * The ShanWan PS(R) Ga`epad 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 hid_device *hdev, __u8 *rdesc,
                unsigned int *rsize)
{
        struct sony_sc *sc = hid_get_drvdata(hdev);
+    /*
+    * The ShanWan gamepads, 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.
         */
        if ((sc->quirks & VAIO_RDESC_CONSTANT) && *rsize >= 56 &&

<--------------->

        /*
         * Some compatible controllers like the Speedlink Strike FX and
         * Gasia need another query plus an USB interrupt to get operational.
+         * The ShanWan gamepads don'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);

(sorry for “handmade diff”, “+” in the line beginning means strings to add. The position is quite clear from the text around. Let me know if it is clear… I can not upload the modied file here…).

Hi , I just unscrewed the back of my Shanwan clone and removed the vibration modules from the controller , i hate when it is vibrating plus i dont need them and it is adding weight to the controller.

If i wanted i could just resolder those cables.

Bluetooth and vibrating issue should be fixed in BlueZ 5.48 and kernel 4.15.

Source

1 Like

Do you plan to release a new Lakka build which will include new BlueZ and kernel?

@qvoffka yes when we update to new LibreELEC version.