Closed Svenum closed 9 months ago
Here is the output of solaar -ddd
Somehow the config value for onboard_profiles
was set to an invalid number, 0x01ff. And then solaar show
complained about an illegal value, almost certainly because this number is out of bounds. This check is done as an unrecoverable assertion - it should probably be done as a recoverable error message.
The question is how did this value get in the configuration data. I expect that the device provided the value at some time and the solution to the problem is to filter out this kind of response. Sector 0xff and 0x1ff are values that point to a definitely illegal sector.
The other problem is that it should be possible to recover from an illegal value. Right now Solaar locks a setting when an error occurs. This results in an unrecoverable loop if the error is the result of an illegal value. I think the right solution is to put up the error icon but not lock the setting.
Sounds right to me
The funny thing is that I manually set the onboard_profiles to an illegal value for my G502 and started up Solaar. What happened was as expected - Solaar refused to apply this value but didn't put the setting in an error state. The difference may be that the G915 replies with this "illegal" value in response to a read request.
The solution to the failed assertion was not to change it to an error message but instead catch the exception in solaar show
. Please download PR #2255 and try solaar show
. It should show full information about the G915 and complain if it encounters an invalid value.
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 #2255, 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/2255/head:pull_2255
git checkout pull_2255
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_2255
git fetch origin pull/2255/head
git reset --hard FETCH_HEAD
Here is the output of solaar show
. This now seems right to me but the option in the ui still dont work.
That is as expected, the PR doesn't yet have the necessary changes to the GUI code.
As a bonus, the PR shows an unexpected response for report_rate corrected.
The response for onboard profiles is even more unusual than I expected. Please post the results of solaar -ddd show G915
so that I can see exactly what is going on.
Also provide a current dump of the profile data for the G915.
PR #2255 should allow changes to settings even when an error occurs.
The remaining issue is just how the 0x1ff value was picked up. Post what values Solaar shows as possible choices for the setting.
solaar -ddd show G915
:
profile dump:
PR #2255 should allow changes to settings even when an error occurs.
The remaining issue is just how the 0x1ff value was picked up. Post what values Solaar shows as possible choices for the setting.
Seems to work now. But I am not able to switch the profile via the m keys. I created a rule for that: rules.yaml:
%YAML 1.3
---
- Rule:
- Key: [M1, pressed]
- Set:
- null
- onboard_profiles
- 0x1
- Rule:
- Key: [M2, pressed]
- Set:
- null
- onboard_profiles
- 0x2
- Rule:
- Key: [M3, pressed]
- Set:
- null
- onboard_profiles
- 0x3
The solaar show
for the G915 shows 3 sectors, all enabled. But then it shows that profile 4 is the current one. This is illegal according to the documentation I have. But you should now be able to change this value. Give the current version of the PR a try.
And if I change the report rate of the mouse I get this error, but it seams to work fine in the gui:
Traceback (most recent call last):
File "/nix/store/3gg338dscaw5qj8h2c6qnlkjrw1zis2m-solaar-flake-1.1.10/lib/python3.10/site-packages/solaar/ui/config_panel.py", line 55, in _do_write
v = setting.write(v)
File "/nix/store/3gg338dscaw5qj8h2c6qnlkjrw1zis2m-solaar-flake-1.1.10/lib/python3.10/site-packages/logitech_receiver/settings.py", line 332, in write
reply = self._rw.write(self._device, data_bytes)
File "/nix/store/3gg338dscaw5qj8h2c6qnlkjrw1zis2m-solaar-flake-1.1.10/lib/python3.10/site-packages/logitech_receiver/settings.py", line 794, in write
reply = device.feature_request(
File "/nix/store/3gg338dscaw5qj8h2c6qnlkjrw1zis2m-solaar-flake-1.1.10/lib/python3.10/site-packages/logitech_receiver/device.py", line 483, in feature_request
return _hidpp20.feature_request(self, feature, function, *params, no_reply=no_reply)
File "/nix/store/3gg338dscaw5qj8h2c6qnlkjrw1zis2m-solaar-flake-1.1.10/lib/python3.10/site-packages/logitech_receiver/hidpp20.py", line 1612, in feature_request
return device.request((feature_index << 8) + (function & 0xFF), *params, no_reply=no_reply)
File "/nix/store/3gg338dscaw5qj8h2c6qnlkjrw1zis2m-solaar-flake-1.1.10/lib/python3.10/site-packages/logitech_receiver/device.py", line 471, in request
return _base.request(
File "/nix/store/3gg338dscaw5qj8h2c6qnlkjrw1zis2m-solaar-flake-1.1.10/lib/python3.10/site-packages/logitech_receiver/base.py", line 460, in request
raise _hidpp20.FeatureCallError(number=devnumber, request=request_id, error=error, params=params)
logitech_receiver.hidpp20.FeatureCallError: {'number': 1, 'request': 2860, 'error': 2, 'params': b'\x01'}
For the rules, did you divert the M-keys? Run Solaar as solaar -ddd
and post the output around the time you press the M-keys.
For the rules, did you divert the M-keys? Run Solaar as
solaar -ddd
and post the output around the time you press the M-keys.
here is the output:
2024-02-10 14:57:16,368,368 DEBUG [ReceiverListener:hidraw4] logitech_receiver.base: (11) => r[11 01 1500 01FF0000000000000000000000000000]
2024-02-10 14:57:16,369,369 DEBUG [ReceiverListener:hidraw4] logitech_receiver.notifications: <Device(1,407C,G915 WIRELESS RGB MECHANICAL GAMING KEYBOARD,A502B0E1)>: notification for feature ONBOARD PROFILES, report 0, data 01FF0000000000000000000000000000
2024-02-10 14:57:16,369,369 DEBUG [MainThread] solaar.ui.config_panel: on <Device(1,407C,G915 WIRELESS RGB MECHANICAL GAMING KEYBOARD,A502B0E1)> changing setting <Setting([feature:choice] G915 KEYBOARD:onboard_profiles=1)> to [511]
2024-02-10 14:57:16,369,369 DEBUG [MainThread] logitech_receiver.diversion: evaluating rules on Notification(11,1,15,00,01FF0000000000000000000000000000)
2024-02-10 14:57:16,369,369 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Rule(/home/sven/.config/solaar/rules.yaml)[Rule(/home/sven/.config/solaar/rules.yaml)[Rule[Key: M1 (pressed), Set: None onboard_profiles 1], Rule[Key: M2 (pressed), Set: None onboard_profiles 2], Rule[Key: M3 (pressed), Set: None onboard_profiles 3]]], Rule[Rule[Rule[Key: Brightness Down (pressed), KeyPress: XF86_MonBrightnessDown click], Rule[Key: Brightness Up (pressed), KeyPress: XF86_MonBrightnessUp click]]]]
2024-02-10 14:57:16,369,369 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule(/home/sven/.config/solaar/rules.yaml)[Rule(/home/sven/.config/solaar/rules.yaml)[Rule[Key: M1 (pressed), Set: None onboard_profiles 1], Rule[Key: M2 (pressed), Set: None onboard_profiles 2], Rule[Key: M3 (pressed), Set: None onboard_profiles 3]]]
2024-02-10 14:57:16,369,369 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule(/home/sven/.config/solaar/rules.yaml)[Rule[Key: M1 (pressed), Set: None onboard_profiles 1], Rule[Key: M2 (pressed), Set: None onboard_profiles 2], Rule[Key: M3 (pressed), Set: None onboard_profiles 3]]
2024-02-10 14:57:16,369,369 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Key: M1 (pressed), Set: None onboard_profiles 1]
2024-02-10 14:57:16,370,370 DEBUG [MainThread] logitech_receiver.diversion: evaluate condition: Key: M1 (pressed)
2024-02-10 14:57:16,370,370 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Key: M2 (pressed), Set: None onboard_profiles 2]
2024-02-10 14:57:16,370,370 DEBUG [MainThread] logitech_receiver.diversion: evaluate condition: Key: M2 (pressed)
2024-02-10 14:57:16,370,370 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Key: M3 (pressed), Set: None onboard_profiles 3]
2024-02-10 14:57:16,370,370 DEBUG [MainThread] logitech_receiver.diversion: evaluate condition: Key: M3 (pressed)
2024-02-10 14:57:16,370,370 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Rule[Rule[Key: Brightness Down (pressed), KeyPress: XF86_MonBrightnessDown click], Rule[Key: Brightness Up (pressed), KeyPress: XF86_MonBrightnessUp click]]]
2024-02-10 14:57:16,370,370 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Rule[Key: Brightness Down (pressed), KeyPress: XF86_MonBrightnessDown click], Rule[Key: Brightness Up (pressed), KeyPress: XF86_MonBrightnessUp click]]
2024-02-10 14:57:16,370,370 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Key: Brightness Down (pressed), KeyPress: XF86_MonBrightnessDown click]
2024-02-10 14:57:16,370,370 DEBUG [MainThread] logitech_receiver.diversion: evaluate condition: Key: Brightness Down (pressed)
2024-02-10 14:57:16,370,370 DEBUG [MainThread] logitech_receiver.diversion: evaluate rule: Rule[Key: Brightness Up (pressed), KeyPress: XF86_MonBrightnessUp click]
2024-02-10 14:57:16,370,370 DEBUG [MainThread] logitech_receiver.diversion: evaluate condition: Key: Brightness Up (pressed)
If profiles are on, you can't change the report rate is controlled by the profile and can't be changed using the setting. I'll add an enhancement issue to lock the report rate when profiles are active.
Somehow the rules conditions aren't evaluating to true.
PR #2255 should allow changes to settings even when an error occurs. The remaining issue is just how the 0x1ff value was picked up. Post what values Solaar shows as possible choices for the setting.
Seems to work now. But I am not able to switch the profile via the m keys. I created a rule for that: rules.yaml:
%YAML 1.3 --- - Rule: - Key: [M1, pressed] - Set: - null - onboard_profiles - 0x1 - Rule: - Key: [M2, pressed] - Set: - null - onboard_profiles - 0x2 - Rule: - Key: [M3, pressed] - Set: - null - onboard_profiles - 0x3
maybe is this nice to have as a "Built-in rule"
Probably too specific for a built-in rule. The remaining built-in rules are there mostly as examples.
Somehow the rules conditions aren't evaluating to true.
If I turn on the "Divert G Keys" setting it works
That validates an assumption. I'll change the setting label and tooltip accordingly.
I still don't know why the "illegal" value is being produced by the G915. But Solaar should now be able to recover from it so if things are working fine for you I don't think there is anything more to be done here.
I'm also not sure what the button values are for in the profiles, but that's also something that I don't think needs to be addressed.
I think they are for the G Keys. You can map them usually to anything you want
That makes sense. If there are 8 then they would be for the G and M keys. If 9, then for G and M and MR keys.
Information
solaar --version
orgit describe --tags
if cloned from this repository): solaar 1.1.11rc1uname -srmo
):Linux 6.7.2 x86_64 GNU/Linux
solaar show
:~/.config/solaar/config.yaml
(or~/.config/solaar/config.json
if~/.config/solaar/config.yaml
not present):output of
solaar profiles G915
:Describe the bug I try to make the Onboard Profile setting editable and then comes the error above and I dont see any Profile available To Reproduce Steps to reproduce the behavior:
Screenshots
Additional context Yesterday it works some how with your version of the last PR. I dont know what I have changed. The mouse "G502" works as expected.