Repository: pwr-Solaar/Solaar

Issue:
logitech g pro x wireless support
**Information**
- 1.1.0
- Distribution: Ubuntu 21.04
- Kernel version (ex. `uname -srmo`): Linux 5.11.0-41-generic x86_64 GNU/Linux

- solaar: error: Traceback (most recent call last):
  File "/usr/share/solaar/lib/solaar/cli/__init__.py", line 200, in run
    raise Exception('No devices found')
Exception: No devices found


Hi amazing work!
Logitech g pro x wireless
https://www.logitechg.com/es-es/products/gaming-audio/pro-x-wireless-headset.html
Checking this new headset which is fairly new. Should be already supported or working implicitly or will need support?
Thanks


Discussion:
Solaar only handles devices that use Logitech's HID++ interface.   This covers most Logitech keyboards, mice, and tablets.   There are likely some Logitech headsets that are covered, but most or all are not.
How is your headset connected - USB dongle or BlueTooth?

To find out for sure whether your device uses HID++ requires parsing its report descriptors.  First, you need to install hidrd-convert.  On Fedora this is done via `sudo dnf install hidrd` - on Ubuntu it is probably `sudo apt install hidrd`.  Then run this script while the headset is connected and active and post the result
```
#!/usr/bin/bash

for f in /sys/class/hidraw/hidraw*
do
    echo DEVICE $f
    cat $f/device/uevent
    hidrd-convert -o spec $f/device/report_descriptor
    echo
done
```
Hi,
it is USB dongle
uevent:
DRIVER=hid-generic
HID_ID=0003:0000046D:00000ABA
HID_NAME=Logitech PRO X Wireless Gaming Headset
HID_PHYS=usb-0000:03:00.0-3/input3
HID_UNIQ=
MODALIAS=hid:b0003g0001v0000046Dp00000ABA

The descriptor i've been unable to install anything related to hidrd in ubuntu > 18.04 seems no longer supported
Find attached as txt the file, i just :
sudo cat /sys/class/hidraw/hidraw4/device/report_descriptor | tee descriptor.txt

[descriptor.txt](https://github.com/pwr-Solaar/Solaar/files/7730666/descriptor.txt)

thank you

Thanks.  That decodes to 
<details>

```
Usage Page (Consumer),                  ; Consumer (0Ch)
Usage (Consumer Control),               ; Consumer control (01h, application collection)
Collection (Application),
    Report ID (1),
    Usage (Volume Inc),                 ; Volume increment (E9h, re-trigger control)
    Usage (Volume Dec),                 ; Volume decrement (EAh, re-trigger control)
    Report Size (1),
    Report Count (2),
    Logical Minimum (0),
    Logical Maximum (1),
    Input (Variable),
    Report Size (6),
    Report Count (1),
    Input (Constant, Variable),
    Report Size (24),
    Input (Constant, Variable),
End Collection,
Usage Page (FF43h),                     ; FF43h, vendor-defined
Usage (0202h),
Collection (Application),
    Report ID (17),
    Report Count (19),
    Report Size (8),
    Logical Maximum (255),
    Usage (02h),
    Input,
    Usage (02h),
    Output,
End Collection,
Usage Page (FF00h),                     ; FF00h, vendor-defined
Usage (01h),
Collection (Application),
    Usage (0Ah),
    Collection (Logical),
        Report ID (255),
        Report Count (1),
        Report Size (32),
        Usage (0Bh),
        Logical Minimum (-2147483647),
        Logical Maximum (2147483647),
        Input (Variable),
    End Collection,
    Usage (22h),
    Collection (Logical),
        Report ID (144),
        Usage (33h),
        Report Size (8),
        Logical Minimum (0),
        Logical Maximum (255),
        Input (Variable),
        Usage (34h),
        Input (Variable),
        Usage Page (Desktop),           ; Generic desktop controls (01h)
        Usage (Byte Count),             ; Byte count (3Bh, dynamic value)
        Report Size (16),
        Logical Maximum (65535),
        Input (Variable),
        Usage Page (FF00h),             ; FF00h, vendor-defined
        Usage (0Ah),
        Collection (Logical),
            Usage Page (Ordinal),       ; Ordinal (0Ah)
            Usage Minimum (01h),
            Usage Maximum (0Ah),
            Report Count (10),
            Report Size (8),
            Logical Maximum (255),
            Input (Variable),
        End Collection,
    End Collection,
    Usage Page (FF00h),                 ; FF00h, vendor-defined
    Usage (22h),
    Collection (Logical),
        Report ID (144),
        Usage (33h),
        Report Count (1),
        Output (Variable),
        Usage (34h),
        Output (Variable),
        Usage Page (Desktop),           ; Generic desktop controls (01h)
        Usage (Byte Count),             ; Byte count (3Bh, dynamic value)
        Report Size (16),
        Logical Maximum (65535),
        Output (Variable),
        Usage Page (FF00h),             ; FF00h, vendor-defined
        Usage (0Ah),
        Collection (Logical),
            Usage Page (Ordinal),       ; Ordinal (0Ah)
            Usage Minimum (01h),
            Usage Maximum (0Ah),
            Report Count (10),
            Report Size (8),
            Logical Maximum (255),
            Output (Variable),
        End Collection,
    End Collection,
    Usage Page (FF00h),                 ; FF00h, vendor-defined
    Usage (22h),
    Collection (Logical),
        Report ID (196),
        Usage (33h),
        Report Count (1),
        Input (Variable),
        Usage (34h),
        Input (Variable),
        Usage Page (Desktop),           ; Generic desktop controls (01h)
        Usage (Byte Count),             ; Byte count (3Bh, dynamic value)
        Report Size (16),
        Logical Maximum (65535),
        Input (Variable),
        Usage Page (FF00h),             ; FF00h, vendor-defined
        Usage (0Ah),
        Collection (Logical),
            Usage Page (Ordinal),       ; Ordinal (0Ah)
            Usage Minimum (01h),
            Usage Maximum (3Bh),
            Report Count (59),
            Report Size (8),
            Logical Maximum (255),
            Input (Variable),
        End Collection,
    End Collection,
    Usage Page (FF00h),                 ; FF00h, vendor-defined
    Usage (22h),
    Collection (Logical),
        Report ID (196),
        Usage (33h),
        Report Count (1),
        Output (Variable),
        Usage (34h),
        Output (Variable),
        Usage Page (Desktop),           ; Generic desktop controls (01h)
        Usage (Byte Count),             ; Byte count (3Bh, dynamic value)
        Report Size (16),
        Logical Maximum (65535),
        Output (Variable),
        Usage Page (FF00h),             ; FF00h, vendor-defined
        Usage (0Ah),
        Collection (Logical),
            Usage Page (Ordinal),       ; Ordinal (0Ah)
            Usage Minimum (01h),
            Usage Maximum (3Bh),
            Report Count (59),
            Report Size (8),
            Logical Maximum (255),
            Output (Variable),
        End Collection,
    End Collection,
    Usage Page (FF00h),                 ; FF00h, vendor-defined
    Usage (0Ch),
    Collection (Logical),
        Report ID (255),
        Usage Page (Desktop),           ; Generic desktop controls (01h)
        Usage (Byte Count),             ; Byte count (3Bh, dynamic value)
        Report Count (1),
        Feature (Variable),
        Usage (Counted Buffer),         ; Counted buffer (3Ah, logical collection)
        Collection (Logical),
            Usage Page (Ordinal),       ; Ordinal (0Ah)
            Usage Minimum (01h),
            Usage Maximum (3Eh),
            Report Count (62),
            Feature (Variable),
        End Collection,
    End Collection,
    Usage Page (FF00h),                 ; FF00h, vendor-defined
    Usage (0Ch),
    Collection (Logical),
        Report ID (226),
        Usage Page (Desktop),           ; Generic desktop controls (01h)
        Usage (Byte Count),             ; Byte count (3Bh, dynamic value)
        Report Count (1),
        Input (Variable),
        Usage (Counted Buffer),         ; Counted buffer (3Ah, logical collection)
        Collection (Logical),
            Usage Page (Ordinal),       ; Ordinal (0Ah)
            Usage Minimum (01h),
            Usage Maximum (3Eh),
            Report Count (62),
            Input (Variable),
        End Collection,
    End Collection,
End Collection
```
</details>

The relevant part is
```
Usage Page (FF43h),                     ; FF43h, vendor-defined
Usage (0202h),
Collection (Application),
    Report ID (17),
    Report Count (19),
    Report Size (8),
    Logical Maximum (255),
    Usage (02h),
    Input,
    Usage (02h),
    Output,
End Collection,
```

Which seems to indicate that Solaar might be able to control this device.

Please provide output of `lsusb -vv -d 046d:0ABA` to show which USB interfaces the device presents.
Result

<details>

```
sudo lsusb -vv -d 046d:0ABA

Bus 001 Device 002: ID 046d:0aba Logitech, Inc. PRO X Wireless Gaming Headset
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x046d Logitech, Inc.
  idProduct          0x0aba 
  bcdDevice            1.00
  iManufacturer           3 Logitech
  iProduct                4 PRO X Wireless Gaming Headset
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0101
    bNumInterfaces          4
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              1 PRO X Wireless Gaming Headset
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength       0x0047
        bInCollection           2
        baInterfaceNr(0)        1
        baInterfaceNr(1)        2
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             6
        wTerminalType      0x0201 Microphone
        bAssocTerminal          0
        bNrChannels             1
        wChannelConfig     0x0000
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                 3
        bSourceID               6
        bControlSize            1
        bmaControls(0)       0x03
          Mute Control
          Volume Control
        bmaControls(1)       0x00
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             7
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bSourceID               3
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                 2
        bSourceID               1
        bControlSize            1
        bmaControls(0)       0x03
          Mute Control
          Volume Control
        bmaControls(1)       0x00
        bmaControls(2)       0x00
        iFeature                0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID             5
        wTerminalType      0x0301 Speaker
        bAssocTerminal          0
        bSourceID               2
        iTerminal               0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           7
        bDelay                  0 frames
        wFormatTag         0x0001 PCM
      AudioStreaming Interface Descriptor:
        bLength                26
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             1
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            6 Discrete
        tSamFreq[ 0]        16000
        tSamFreq[ 1]        22050
        tSamFreq[ 2]        24000
        tSamFreq[ 3]        32000
        tSamFreq[ 4]        44100
        tSamFreq[ 5]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes           13
          Transfer Type            Isochronous
          Synch Type               Synchronous
          Usage Type               Data
        wMaxPacketSize     0x0090  1x 144 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioStreaming Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay         0x0000
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       1
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       2
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           1
        bDelay                  0 frames
        wFormatTag         0x0001 PCM
      AudioStreaming Interface Descriptor:
        bLength                26
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            6 Discrete
        tSamFreq[ 0]        16000
        tSamFreq[ 1]        22050
        tSamFreq[ 2]        24000
        tSamFreq[ 3]        32000
        tSamFreq[ 4]        44100
        tSamFreq[ 5]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes           13
          Transfer Type            Isochronous
          Synch Type               Synchronous
          Usage Type               Data
        wMaxPacketSize     0x0120  1x 288 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioStreaming Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x01
            Sampling Frequency
          bLockDelayUnits         0 Undefined
          wLockDelay         0x0000
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              2 PRO X Wireless Gaming Headset
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     384
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0020  1x 32 bytes
        bInterval               1
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)
```
</details>

Resolving patch:
diff --git a/lib/logitech_receiver/descriptors.py b/lib/logitech_receiver/descriptors.py
--- a/lib/logitech_receiver/descriptors.py
+++ b/lib/logitech_receiver/descriptors.py
@@ -739,3 +739,14 @@ def get_btid(btid):
 # Some exotics...
 
 _D('Fujitsu Sonic Mouse', codename='Sonic', protocol=1.0, wpid='1029')
+
+# Headset
+
+_D(
+    'Logitech PRO X Wireless Gaming Headset',
+    codename='PRO Wireless Headset',
+    protocol=2.0,
+    interface=3,
+    kind=_DK.headset,
+    usbid=0x0aba
+)
diff --git a/lib/logitech_receiver/device.py b/lib/logitech_receiver/device.py
--- a/lib/logitech_receiver/device.py
+++ b/lib/logitech_receiver/device.py
@@ -397,7 +397,9 @@ def feature_request(self, feature, function=0x00, *params, no_reply=False):
 
     def ping(self):
         """Checks if the device is online, returns True of False"""
-        protocol = _base.ping(self.handle or self.receiver.handle, self.number, long_message=self.bluetooth)
+        protocol = _base.ping(
+            self.handle or self.receiver.handle, self.number, long_message=self.bluetooth or self._protocol >= 2.0
+        )
         self.online = protocol is not None
         if protocol:
             self._protocol = protocol
diff --git a/lib/logitech_receiver/hidpp10.py b/lib/logitech_receiver/hidpp10.py
--- a/lib/logitech_receiver/hidpp10.py
+++ b/lib/logitech_receiver/hidpp10.py
@@ -43,6 +43,7 @@
     remote=0x07,
     trackball=0x08,
     touchpad=0x09,
+    headset=0x0D,  # not from Logitech documentation
     remote_control=0x0E,  # for compatability with HID++ 2.0
     receiver=0x0F  # for compatability with HID++ 2.0
 )


Test patch: