pwr-Solaar / Solaar

Linux device manager for Logitech devices
https://pwr-solaar.github.io/Solaar
GNU General Public License v2.0
5.54k stars 410 forks source link

PowerPlay support #1690

Closed Sporesirius closed 2 years ago

Sporesirius commented 2 years ago

Information

Describe the solution you'd like Added support for the Logitech G PowerPlay wireless mouse pad.

in the G Hub it is possible to e.g sync RGB with the mouse or set overall RGB intervals etc. The PowerPlay also has a built-in Lightspeed receiver that lets you pair the mouse in the G Hub.

pfps commented 2 years ago

To start the process of support for a Logitech receiver or device:

Make sure the receiver or device is connected and active.

Look at output of grep -H . /sys/class/hidraw/hidraw*/device/uevent to find where information about the device is kept. You are looking for a line like /sys/class/hidraw/hidrawN/device/uevent:HID_NAME=<NAME> where is the name of your receiver or device. N is the current HID raw number of your receiver or device.

Provide the contents of the file /sys/class/hidraw/hidrawN/device/uevent where N was found above.

Also attach contents of the file /sys/class/hidraw/hidrawN/device/report_descriptor. You will have to copy the contents to a file with txt extension before attaching it. Or, better, install hidrd-convert and provide output of hidrd-convert -o spec /sys/class/hidraw/hidrawN/device/report_descriptor

If your device can connect in multiple ways - via a receiver, via USB (not just charging via a USB cable), via Bluetooth - do this for each way it can connect.

If your device or receiver connects via USB, look at the output of lsusb to find ID of device or receiver and also provide output of lsusb -vv -d xxxx:yyyy where xxxx:yyyy is ID of device or receiver.

To install hidrd on Fedora: sudo dnf install hidrd

Sporesirius commented 2 years ago

Hello @pfps,

I also included the mouse, I do not know if there is something that is needed.

uevent_logitech_powerplay.txt lsusb_logitech_powerplay.txt hidraw7_report_descriptor.txt hidraw6_report_descriptor.txt hidraw5_report_descriptor.txt hidraw1_report_descriptor.txt

pfps commented 2 years ago

Thanks. It appears that the powerplay looks to the system as a lightspeed receiver. But it has an extra device - a Logitech Candy. Solaar doesn't pick up this device because it views lightspeed receivers as only having one device.

To see what is going on please provide the output of solaar -ddd show. This will show the commands Solaar sends to the receiver and the responses that the receiver provides. Hopefully there will be something that Solaar can use to determine that the extra device exists.

Sporesirius commented 2 years ago

The output of solaar -ddd show solaar.txt

pfps commented 2 years ago

PR #1691 is a start at supporting the powerplay. solaar show should show information about the extra device. Try solaar -ddd show and post the output. If that show the extra device, try solaar -ddd (after quitting any running Soalar) and select the extra device if possible. Post the output.

To clone and use Solar from its GitHub repository

git clone https://github.com/pwr-Solaar/Solaar.git
cd Solaar

Run Solaar as bin/solaar from this directory.

To run PR #1691, first clone Solaar if you have not already done so and cd to the clone directory. The first time you download the pull request, fetch it into a new branch and checkout that branch, as in:

git fetch origin pull/1691/head:pull_1691
git checkout pull_1691

To download a new version of the pull request, fetch it and then set your pull branch to the new fetch, as in:

git checkout pull_1691
git fetch origin pull/1691/head
git reset --hard FETCH_HEAD
Sporesirius commented 2 years ago

./solaar -ddd show solaar_pull_1691.txt

pfps commented 2 years ago

OK, the powerplay doesn't have pairing information, which I guess is understandable. Please try solaar -ddd as above, anyway, to see what Solaar picks up under normal operation in pull_1691.

Sporesirius commented 2 years ago

ok, I run solaar -ddd solaar_pull_1691_2.txt

pfps commented 2 years ago

There were some places where Solaar was not expecting device 7. I changed the places I could find, so please download pull_1691 again and run solaar -ddd again.

Sporesirius commented 2 years ago

I could see the PowerPlay mouse pad named Candy in Solaar. solaar_pull_1691_3.txt

pfps commented 2 years ago

That's good. I see that there are a couple features that Solaar can use. I've fixed a few minor problems as well so please download the PR again.

Can you try bin/solaar -ddd show again? It might work now.

Also provide the output of bin/solaar probe. This should show all the receiver registers.

Sporesirius commented 2 years ago

Hi, Solaar crashed with the new commit. solaar_pull_1691_4.txt solaar_probe_pull_1691.txt

pfps commented 2 years ago

The probe output was very helpful. The extra device is missing some information on the receiver whose existence was being assumed by Solaar. The newest version of pull 1691 should fix this problem. (But as I don't have the hardware there may still be problems.)

Please try bin/solaar -ddd show and bin/solaar -ddd and post output.

Sporesirius commented 2 years ago

Crash is fixed. solaar_ddd_show_pull_1691.txt solaar_ddd_pull_1691.txt

pfps commented 2 years ago

OK, so at least we can see what is possible. There is very little that can be done with the Candy companion chip.

All I see is the ability to control lighting in the mouse itself. Is there lighting elsewhere?

Sporesirius commented 2 years ago

On the top left of the mouse pad is a Logitech logo, which can light up in RGB. powerplay In G Hub, you can also pair the mouse with powerplay, so you don't have to use the lightspeed adapter of the mouse.

pfps commented 2 years ago

I don't see a way to control the light on the logo on the pad, unless controlling the mouse also controls the pad. It appears that you have the mouse paired with the pad. Solaar should be able to pair the mouse with a lightspeed adapter and with the pad using the normal pairing mechanisms in Solaar.

Could you take the output from bin/solaar show and paste it into a comment in this thread? That will help people looking for the device later.

Sporesirius commented 2 years ago

@pfps Thanks

bin/solaar show


Lightspeed Receiver
  Device path  : /dev/hidraw9
  USB id       : 046d:C53A
  Serial       : 5B2B9A98
    Firmware   : 40.03.B0014
    Bootloader : 02.09
    Other      : AA.CA
  Has 2 paired device(s) out of a maximum of 1.
  Notifications: wireless, software present (0x000900)
  Device activity counters: (empty)

  1: G502 Gaming Mouse
     Device path  : /dev/hidraw10
     WPID         : 407F
     Codename     : G502
     Kind         : mouse
     Protocol     : HID++ 4.2
     Polling rate : 1 ms (1000Hz)
     Serial number: 636878DB
     Model ID:      407FC08D0000
     Unit ID:       636878DB
        Bootloader: BOT 92.00.B0008
          Firmware: MPM 17.00.B0008
             Other:
     The power switch is located on the base.
     Supports 29 HID++ 2.0 features:
         0: ROOT                   {0000}
         1: FEATURE SET            {0001}
         2: DEVICE FW VERSION      {0003}
            Firmware: Bootloader BOT 92.00.B0008 AAEF21F1FA5F
            Firmware: Firmware MPM 17.00.B0008 407F21F1FA5F
            Firmware: Other
            Unit ID: 636878DB  Model ID: 407FC08D0000  Transport IDs: {'wpid': '407F', 'usbid': 'C08D'}
         3: DEVICE NAME            {0005}
            Name: G502 LIGHTSPEED Wireless Gaming Mouse
            Kind: mouse
         4: WIRELESS DEVICE STATUS {1D4B}
         5: RESET                  {0020}
         6: BATTERY VOLTAGE        {1001}
            Battery: 30% 3766mV , slow recharge.
         7: COLOR LED EFFECTS      {8070}
         8: LED CONTROL            {1300}
         9: ONBOARD PROFILES       {8100}
            Device Mode: Host
            Onboard Profiles (saved): Disable
            Onboard Profiles        : Disable
        10: MOUSE BUTTON SPY       {8110}
        11: REPORT RATE            {8060}
            Polling Rate (ms): 1
            Polling Rate (ms) (saved): 1
            Polling Rate (ms)        : 1
        12: ADJUSTABLE DPI         {2201}
            Sensitivity (DPI) (saved): 600
            Sensitivity (DPI)        : 600
        13: DEVICE RESET           {1802}   internal, hidden
        14: unknown:1803           {1803}   internal, hidden
        15: OOBSTATE               {1805}   internal, hidden
        16: CONFIG DEVICE PROPS    {1806}   internal, hidden
        17: unknown:1811           {1811}   internal, hidden
        18: unknown:1830           {1830}   internal, hidden
        19: unknown:1890           {1890}   internal, hidden
        20: unknown:1891           {1891}   internal, hidden
        21: unknown:18A1           {18A1}   internal, hidden
        22: unknown:1801           {1801}   internal, hidden
        23: unknown:18B1           {18B1}   internal, hidden
        24: unknown:1DF3           {1DF3}   internal, hidden
        25: unknown:1E00           {1E00}   hidden
        26: unknown:1EB0           {1EB0}   internal, hidden
        27: unknown:1863           {1863}   internal, hidden
        28: unknown:1E22           {1E22}   internal, hidden
     Battery: 30% 3766mV , slow recharge.

  7: Candy companion chip
     Device path  : /dev/hidraw11
     Codename     : Candy
     Kind         : touchpad
     Protocol     : HID++ 4.2
     Serial number: 5B2B9A98
     Model ID:      405F00000000
     Unit ID:       32314707
          Firmware: CC  07.00.B0010
        Bootloader: BOT 32.00.B0010
     Supports 11 HID++ 2.0 features:
         0: ROOT                   {0000}
         1: FEATURE SET            {0001}
         2: DEVICE FW VERSION      {0003}
            Firmware: Firmware CC  07.00.B0010 405F
            Firmware: Bootloader BOT 32.00.B0010 405F
            Unit ID: 32314707  Model ID: 405F00000000  Transport IDs: {'wpid': '405F'}
         3: DEVICE NAME            {0005}
            Name: Candy companion chip
            Kind: touchpad
         4: unknown:18A1           {18A1}   internal, hidden
         5: unknown:1E00           {1E00}   hidden
         6: unknown:1EB0           {1EB0}   internal, hidden
         7: DFUCONTROL SIGNED      {00C2}
         8: unknown:1801           {1801}   internal, hidden
         9: DEVICE RESET           {1802}   internal, hidden
        10: unknown:1803           {1803}   internal, hidden
     Battery status unavailable.
pfps commented 2 years ago

Thanks.

As indicated above, there doesn't appear to be a way for Solaar to control the lighting on the pad. Controlling the lighting on the mouse can be done, but there is no documentation on the feature LED CONTROL {1300}.

Sporesirius commented 2 years ago

@pfps that's fine. Thanks for the implementation anyway :+1: Can the issue be closed then? Or should it remain open?

pfps commented 2 years ago

Let's leave the issue open for now. I'll do some fixups on PR #1691 and when they are merged into Solaar the issue will be closed. I may ask you to do some testing of the PR as well.