Closed muzena closed 4 years ago
OK, there is a race condition. I'll have to figure out how to get rid of it.
@muzena OK, there is a new version of PR #932 Please try it out with the GUI.
@pfps Now it works again, but 'solaar -dd' and 'solaar -dd show' is showing some error.
solaar show
is not going to work correctly with this receiver. The receiver just doesn't provide enough information to set up the devices correctly. Solaar has been patched so that solaar show
doesn't completely break. So the errors are the best that can be expected.
The Solaar GUI is not reporting any real errors, just error returns from receiver commands. This is also to be expected and only means that some information is not available. With the most recent patches, Solaar appears to be doing the best that can be expected.
@doctor64 How does PR #932 work for you? Can you check that you have a mouse at location 1 and a keyboard at location 3? It looks as if @muzena has it the other way around.
@pfps Sorry, missed this issue. Just found this and already open issue #943. Yes, I have mouse at 1 and keyboard at 3. this was verified by reported battery levels and features bits. Note what EX100 (and i think other 27 mhz receivers) have single byte wpid.
@pfps As far as I remember, this old receiver return single-byte wpid, second byte changes (semi) randomly. It was a reason why I constructed fake wpid in device.py
# fix EX100 wpid
if receiver.ex100_wpid_fix: # EX100 receiver
self.wpid = _strhex(link_notification.data[2:3]) + '00'
and in notifications.py
wpid = _strhex(n.data[2:3] + n.data[1:2])
# workaround for short EX100 wpids
if protocol_name == '27 MHz':
wpid = _strhex(n.data[2:3]) + '00'
I think we need to bring back removed code and set WPID for old devices like LX5 and M30 to 5600 and 6800 instead of 5612 and 6822. Do you wish to fix this or I will provide a PR?
In this issue there is what appears to be an EX100 that is reporting full WPIDs.
Maybe there are old and new EX100s with the same USB ID?
The EX100s here are severely limited - see the probe output - so solaar show can only limp along with your fixes.
Maybe the right solution for solaar show
is to just have a fake device with a fake device type (but I don't really want to add a fake device type.
@pfps You mean what exist receiver with USB ID 0x046d:0x0517 (ex100 and similar) but reporting full wpid? I doubt so. At least for EX100 kernel report short WPIDs.
[ 145.045596] usb 1-2.2.3: new low-speed USB device number 11 using xhci_hcd
[ 145.171258] usb 1-2.2.3: New USB device found, idVendor=046d, idProduct=c517, bcdDevice=38.10
[ 145.171259] usb 1-2.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 145.171260] usb 1-2.2.3: Product: USB Receiver
[ 145.171261] usb 1-2.2.3: Manufacturer: Logitech
[ 145.179308] logitech-djreceiver 0003:046D:C517.0005: hidraw2: USB HID v1.10 Keyboard [Logitech USB Receiver] on usb-0000:00:14.0-2.2.3/input0
[ 145.243366] logitech-djreceiver 0003:046D:C517.0006: hiddev1,hidraw3: USB HID v1.10 Mouse [Logitech USB Receiver] on usb-0000:00:14.0-2.2.3/input1
[ 145.314566] logitech-djreceiver 0003:046D:C517.0006: device of type 27 Mhz (0x02) connected on slot 1
[ 145.322608] logitech-djreceiver 0003:046D:C517.0006: device of type 27 Mhz (0x02) connected on slot 3
[ 145.330602] logitech-hidpp-device 0003:046D:003F.0007: HID++ 1.0 device connected.
[ 145.394638] input: Logitech Wireless Mouse PID:003f as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.2/1-2.2.3/1-2.2.3:1.1/0003:046D:C517.0006/0003:046D:003F.0007/input/input26
[ 145.394927] logitech-hidpp-device 0003:046D:003F.0007: input,hidraw4: USB HID v1.11 Mouse [Logitech Wireless Mouse PID:003f] on usb-0000:00:14.0-2.2.3/input1:1
[ 145.402606] logitech-hidpp-device 0003:046D:0065.0008: HID++ 1.0 device connected.
[ 145.450782] input: Logitech Wireless Keyboard PID:0065 as /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.2/1-2.2.3/1-2.2.3:1.1/0003:046D:C517.0006/0003:046D:0065.0008/input/input27
[ 145.451038] logitech-hidpp-device 0003:046D:0065.0008: input,hidraw5: USB HID v1.11 Keyboard [Logitech Wireless Keyboard PID:0065] on usb-0000:00:14.0-2.2.3/input1:3
@muzena Can you, please, provide output of your dmesg related to logitech receiver in question?
@doctor64 Are you sure about the other byte in the WPID? If so, the fix is to bring back your changes and fix the four descriptors (which I added back in March).
I probably was mistaken about the full WPIDs because I was assuming that the four devices had independent existence, but they actually came from this issue.
On a bit further thought, it might be best to create WPIDs that look like 00??. This matches the system output and is less likely to collide with future WPIDs.
So go ahead with a PR.
The final issue is which kind of device is in which slot. Maybe the four descriptors added in March are just the wrong way around?
@pfps As I can remember, code for newer device WPIDs, ie
wpid = _strhex(n.data[2:3] + n.data[1:2])
return (for my EX100) 0x3F21/0x6512 and 0x3F22/0x6522 (for mouse and keyboard). You are right, make it output compatible with kernel is really good idea. I just missed it because of focused on exiting code. I will prepare the PR.
@pfps Hmm, we have a problem here. In device.py I set fake WPID during receiver init, because 27Mhz wpids present only in link notification
elif receiver.ex100_27mhz_wpid_fix:
# ex100 receiver, fill fake device_info with known wpid's
# accordingly to drivers/hid/hid-logitech-dj.c
# index 1 or 2 always mouse, index 3 always the keyboard,
# index 4 is used for an optional separate numpad
if number == 1: # mouse
self.wpid = '003F'
self._kind = _hidpp10.DEVICE_KIND[2]
elif number == 3: # keyboard
self.wpid = '0065'
self._kind = _hidpp10.DEVICE_KIND[1]
else: # unknown device number on EX100
_log.error('failed to set fake EX100 wpid for device %d of %s', number, receiver)
raise _base.NoSuchDevice(number=number, receiver=receiver, error='Unknown EX100 device')
but i can't figure what to do in case of 27 mhz receiver but with other devices
@pfps Ok we have two variants here.
solaar show
, but in solaar GUI we will se correct names@doctor64
I don't think that it is worth doing much to get correct information in Solaar show. If the UI is OK then I'm happy.
The code is rather confusing. My understanding is that new devices in the UI only show up because of notifications. (Solaar asks the receiver to generate notifications.) New devices in the CLI only show up because of enumeration (and thus don't have notifications). This leads to the possibility of changing the CLI to a notification-based setup - but there will have to be some determination that all the devices have reported in.
@doctor64
I don't know why but dmesg gave me this error:
dmesg: read kernel buffer failed: Operation not permitted
@pfps I have implemented function to get wpid from udev device path. Parsing looks little ugly, but work on my system and will be used only for old 27 MHz devices. Can you please look at PR #944 - don't understand whats wrong with pre-commit check?
@muzena Thank you. So, you have keyboard with wpid 0068 and mouse with wpid 0085 on receiver on usb 5-3. And keyboard with wpid 0056 anb mouse with wpid 0036 on receiver usb 1-9. Can you please send me names of keyboards and mouses? Just connect one of receivers and check logs for lines like input: Logitech Wireless Keyboard PID:0056 as /devices/pci0000:00/0000:00:01.2/0000:02:00.0/usb1/1-9/1-9:1.1/0003:046D:C517.0004/0003:046D:0056.0006/input/input26 where PID:0056 is device wpid and usb1/1-9/ is usb address?
@doctor64 Something is wrong, I compile and install your https://github.com/pwr-Solaar/Solaar/pull/944 patch "solaar show" command gave "Wireless Keyboard S510" wpid=0036 "dmesg | grep 'Logitech'" gave me "Logitech Wireless Mouse PID:0036"
@muzena Exactly. I see what in descriptors messed up wpids for keyboard and mouses. but can't determine which wpid match which device name. So you need to determine match between wpid in kernel logs and device names, and I will update descriptors
@muzena Or we can just use generic names like "Wireless keyboard" and "Wireless mouse"
@doctor64
I don't understand
Can you please send me names of keyboards and mouses?
How do you mean names of keyboards and mouses?
Names are shown in "solaar show"
@muzena Sorry, english not my native language. "solaar show" cant determine name of device (for old 27 mhz devices) so information what device with wpid A have name NameA should be provided in sources. You need to determine match between device wpid and device name. To do this connect one of receivers. Check kernel log's for wpid numbers and names of connected devices. Disconnect first receiver, connect second receiver. Check again for new wpid's and names. And I will update sources to provide correct names in Solaar.
@doctor64 I read those names from devices. Except "Wireless Mouse M30" it says it is an "Wireless Optical Mouse"
@muzena Yes, this that I mean. but i cannot determine, for example is wpid 0085 for mouse "Wireless Mouse M30" or for "LX5 Cordless Mouse".
Ok, I understand
@doctor64
These are generic names for both receivers:
Logitech Wireless Mouse
Logitech Wireless Keyboard
@muzena Yes, but is any physical marking on keyboard and mouse paired with first and second receiver?
@doctor64 Yes. You can see names up on "solaar show" in https://github.com/pwr-Solaar/Solaar/issues/716#issuecomment-687598949 Except for "Wireless Mouse M30" it says it is an "Wireless Optical Mouse"
@muzena I see names and wpids, but I canot determine which pair of keyboard/mouse names match witch pair of wpids. So, please, can yo do this steps. 1: Connect first receiver. 2: determine which mouse and keyboard operational, note physical names of operational keyboard and mouse. 3: run solaar show 4: disconnect first receiver, connect second receiver 5: determine which mouse and keyboard operational, note physical names of operational keyboard and mouse. 6: run again solaar show. 7: provide collected info here :)
@doctor64 I tested "solaar show" on 2 PC'S On each PC "solaar show" gave me different wipds for same devices.
EX100 Receiver 27 Mhz
Device path : /dev/hidraw1
USB id : 046d:c517
Serial : None
Has 2 paired device(s) out of a maximum of 4.
Notifications: wireless (0x000100)
1: Wireless Keyboard S510
Device path : /dev/hidraw2
USB id : 046d:0036
Codename : S510
Kind : mouse
Protocol : HID++ 1.0
Serial number: ?
The power switch is located on the (unknown).
Notifications: roller V, mouse extra buttons, battery status, roller H (0x3C0000).
Features: special buttons, scroll accel (0x420000)
Battery: good, discharging.
3: LX5 Cordless Mouse
Device path : /dev/hidraw3
USB id : 046d:0056
Codename : LX5
Kind : keyboard
Protocol : HID++ 1.0
Serial number: ?
The power switch is located on the (unknown).
Notifications: keyboard multimedia raw, battery status (0x110000).
Features: special buttons, scroll accel (0x420000)
Battery: good, discharging.
@muzena Thank you, i prepare change
@muzena Please test PR, it should work correctly now
@doctor64 Now works good. I tested on both PCs.
Fixed by #944
Information
uname -srmo
):Linux 5.5.9-050509-lowlatency x86_64 GNU/Linux
solaar show
: