Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solaar doesn't apply settings #855

Closed
lukasmichel opened this issue Jul 15, 2020 · 13 comments · Fixed by #856
Closed

solaar doesn't apply settings #855

lukasmichel opened this issue Jul 15, 2020 · 13 comments · Fixed by #856
Labels

Comments

@lukasmichel
Copy link
Contributor

Information

  • Solaar version (git describe --tags` if cloned from this repository): 1.0.2-66-gde0894b
  • Distribution: Arch Linux
  • Kernel version (ex. uname -srmo): Linux 5.7.8-arch1-1 x86_64 GNU/Linux
  • Output of solaar -d show:
Unifying Receiver
  Device path  : /dev/hidraw0
  USB id       : 046d:c52b
  Serial       : 28B295ED
    Firmware   : 24.11.B0036
    Bootloader : 02.09
    Other      : AA.AC
  Has 4 paired device(s) out of a maximum of 6.
  Notifications: wireless, software present (0x000900)
  Device activity counters: 1=95, 2=248
15:29:54,906     INFO [MainThread] logitech_receiver.receiver: <UnifyingReceiver(/dev/hidraw0,3)>: found new device 1 (4069)

  1: Wireless Mouse MX Master 2S
     Codename     : MX Master 2S
     Kind         : mouse
     Wireless PID : 4069
     Protocol     : HID++ 4.5
     Polling rate : 8 ms (125Hz)
     Serial number: 493D1134
        Bootloader: BOT 56.01.B0006
          Firmware: MPM 12.01.B0006
          Firmware: MPM 12.01.B0006
             Other: 
     The power switch is located on the base.
     Supports 32 HID++ 2.0 features:
         0: ROOT                   {0000}   
         1: FEATURE SET            {0001}   
         2: DEVICE FW VERSION      {0003}   
         3: DEVICE NAME            {0005}   
         4: WIRELESS DEVICE STATUS {1D4B}   
         5: RESET                  {0020}   
         6: CRYPTO ID              {0021}   
         7: BATTERY STATUS         {1000}   
         8: CONFIG DEVICE PROPS    {1806}   internal, hidden
         9: CHANGE HOST            {1814}   
        10: REPROG CONTROLS V4     {1B04}   
        11: ADJUSTABLE DPI         {2201}   
        12: VERTICAL SCROLLING     {2100}   
            Roller type: 3G
            Ratchet per turn: 24
            Scroll lines: 0
        13: SMART SHIFT            {2110}   
            Smart Shift: 12
        14: HIRES WHEEL            {2121}   
            Multiplier: 8
            Has invert
              Normal wheel motion
            Has ratchet switch
              Normal wheel mode
            Low resolution mode
            HID notification
            High Resolution Wheel Invert: False
            Wheel Resolution: False
        15: GESTURE 2              {6501}   
        16: DFUCONTROL SIGNED      {00C2}   
        17: unknown:1813           {1813}   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:18C0           {18C0}   internal, hidden
        23: unknown:1DF3           {1DF3}   internal, hidden
        24: unknown:1E00           {1E00}   hidden
        25: unknown:1EB0           {1EB0}   internal, hidden
        26: unknown:1803           {1803}   internal, hidden
        27: unknown:1861           {1861}   internal, hidden
        28: unknown:9001           {9001}   internal, hidden
        29: unknown:9200           {9200}   internal, hidden
        30: unknown:9202           {9202}   internal, hidden
        31: OOBSTATE               {1805}   internal, hidden
     Has 8 reprogrammable keys:
         0: Left Button               , default: Left Click                  => Left Button               
             mse, pos:0, group:1, gmask:1
         1: Right Button              , default: Right Click                 => Right Button              
             mse, pos:0, group:1, gmask:1
         2: Middle Button             , default: Mouse Middle Button         => Middle Button             
             mse, reprogrammable, divertable, pos:0, group:3, gmask:7
         3: Back Button               , default: Mouse Back Button           => Back Button               
             mse, reprogrammable, divertable, pos:0, group:2, gmask:3
         4: Forward Button            , default: Mouse Forward Button        => Forward Button            
             mse, reprogrammable, divertable, pos:0, group:2, gmask:3
         5: App Switch Gesture        , default: Gesture Button Navigation   => App Switch Gesture        
             mse, reprogrammable, divertable, pos:0, group:3, gmask:7
         6: Smart Shift               , default: Smart Shift                 => Smart Shift               
             mse, reprogrammable, divertable, pos:0, group:3, gmask:7
         7: Virtual Gesture Button    , default: Virtual Gesture Button      => Virtual Gesture Button    
             divertable, virtual, pos:0, group:4, gmask:0
     Battery: 50%, discharging, next level 20%.
15:29:56,816     INFO [MainThread] logitech_receiver.receiver: <UnifyingReceiver(/dev/hidraw0,3)>: found new device 2 (4072)

  2: Wireless Mobile Mouse MX Anywhere 2
     Codename     : MX Anywhere 2
     Kind         : mouse
     Wireless PID : 4072
     Protocol     : HID++ 4.5
     Polling rate : 8 ms (125Hz)
     Serial number: DDAE1933
        Bootloader: BOT 57.10.B0003
          Firmware: MPM 13.10.B0003
          Firmware: MPM 13.10.B0003
             Other: 
     The power switch is located on the base.
     Supports 28 HID++ 2.0 features:
         0: ROOT                   {0000}   
         1: FEATURE SET            {0001}   
         2: DEVICE FW VERSION      {0003}   
         3: DEVICE NAME            {0005}   
         4: WIRELESS DEVICE STATUS {1D4B}   
         5: RESET                  {0020}   
         6: CRYPTO ID              {0021}   
         7: BATTERY STATUS         {1000}   
         8: CONFIG DEVICE PROPS    {1806}   internal, hidden
         9: CHANGE HOST            {1814}   
        10: REPROG CONTROLS V4     {1B04}   
        11: ADJUSTABLE DPI         {2201}   
        12: VERTICAL SCROLLING     {2100}   
            Roller type: 3G
            Ratchet per turn: 24
            Scroll lines: 0
        13: HIRES WHEEL            {2121}   
            Multiplier: 8
            Has invert
              Normal wheel motion
            Has ratchet switch
              Normal wheel mode
            Low resolution mode
            HID notification
            High Resolution Wheel Invert: False
            Wheel Resolution: False
        14: DFUCONTROL SIGNED      {00C2}   
        15: unknown:1813           {1813}   internal, hidden
        16: unknown:1830           {1830}   internal, hidden
        17: unknown:1890           {1890}   internal, hidden
        18: unknown:1891           {1891}   internal, hidden
        19: unknown:18A1           {18A1}   internal, hidden
        20: unknown:18C0           {18C0}   internal, hidden
        21: unknown:1DF3           {1DF3}   internal, hidden
        22: unknown:1E00           {1E00}   hidden
        23: unknown:1EB0           {1EB0}   internal, hidden
        24: unknown:1803           {1803}   internal, hidden
        25: unknown:1861           {1861}   internal, hidden
        26: unknown:9001           {9001}   internal, hidden
        27: OOBSTATE               {1805}   internal, hidden
     Has 8 reprogrammable keys:
         0: Left Button               , default: Left Click                  => Left Button               
             mse, pos:0, group:1, gmask:1
         1: Right Button              , default: Right Click                 => Right Button              
             mse, pos:0, group:1, gmask:1
         2: Middle Button             , default: Gesture Button Navigation   => Middle Button             
             mse, reprogrammable, divertable, pos:0, group:2, gmask:11
         3: Back Button               , default: Mouse Back Button           => Back Button               
             mse, reprogrammable, divertable, pos:0, group:3, gmask:15
         4: Forward Button            , default: Mouse Forward Button        => Forward Button            
             mse, reprogrammable, divertable, pos:0, group:3, gmask:15
         5: Left Tilt                 , default: Mouse Scroll Left Button    => Left Tilt                 
             mse, reprogrammable, divertable, pos:0, group:3, gmask:15
         6: Right Tilt                , default: Mouse Scroll Right Button   => Right Tilt                
             mse, reprogrammable, divertable, pos:0, group:3, gmask:15
         7: Virtual Gesture Button    , default: Virtual Gesture Button      => Virtual Gesture Button    
             divertable, virtual, pos:0, group:4, gmask:0
     Battery: 90%, discharging, next level 50%.
15:29:59,190     INFO [MainThread] logitech_receiver.receiver: <UnifyingReceiver(/dev/hidraw0,3)>: found new device 3 (4024)

  3: Wireless Touch Keyboard K400
     Codename     : K400
     Kind         : keyboard
     Wireless PID : 4024
     Protocol     : HID++ 2.0
     Polling rate : 8 ms (125Hz)
     Serial number: 25CF31D9
     The power switch is located on the edge of top right corner.
     Battery: unknown (device is offline).
15:29:59,198     INFO [MainThread] logitech_receiver.receiver: <UnifyingReceiver(/dev/hidraw0,3)>: found new device 4 (101B)

  4: Marathon Mouse M705 (M-R0009)
     Codename     : M705 (M-R0009)
     Kind         : mouse
     Wireless PID : 101B
     Protocol     : HID++ 1.0
     Polling rate : 8 ms (125Hz)
     Serial number: 41629AAD
     The power switch is located on the base.
     Battery: unknown (device is offline).

Describe the bug
Since the implementation of the feature CHANGE_HOST in 5a4205d, solaar doesn't apply the persistent settings correctly to the mouse (tested with MX Master 2S and MX Anywhere 2) anymore, e.g. the DPI are not set correctly and button remappings are not executed. The GUI shows the correct values, but the mouse does not behave like when set with those values. When changing the settings from the GUI works fine.
Additionally, solaar takes longer to start up than before.There is a delay between showing the GUI and listing the devices, a delay after recognition of each devices and an additional delay until battery info is available.

To Reproduce
Steps to reproduce the behavior:

  1. Start solaar
  2. Notice that the GUI shows the correct settings but the mouse does not behave like it should with those settings

Screenshots
Screenshot of the solaar GUI
grafik

Additional context

  1. output of solaar -dd for g1c2b347 (the last working version): https://gist.github.com/lukasmichel/aa69434d6182685f854a532a3d2f1c17
  2. output of solaar -dd for gde0894b: https://gist.github.com/lukasmichel/a1686324925a49108e6d97deb42e8211
    Please note the delay after line 181 and line 330
    Other than that, I don't know where to look for the described bug.
@pfps
Copy link
Collaborator

pfps commented Jul 15, 2020

Line 177 is a CHANGE_HOST request to change hosts (hopefully to the current host). But it may be that any CHANGE_HOST request causes the device to try to change hosts, which may take a while, so some requests may be lost, which is causing the timeout and may be causing the other problems.
So definitely a bug. The solution is not to write the current value back to the device for CHANGE_HOST.

@pfps
Copy link
Collaborator

pfps commented Jul 15, 2020

PR #856 likely fixes this problem. Please give it a try.

To run PR #856, 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/856/head:pull_856
git checkout pull_856

To download a new version of the pull request, pull it into your branch for the request, as in:

git checkout pull_856
git pull origin pull/856/head:pull_856

@lukasmichel
Copy link
Contributor Author

That does the trick. No more timeouts and the settings are applied correctly to the devices.

I have a side-question on the CHANGE_HOST feature: As you see in my screenshot above, the Change Host choice is empty. This is still the case with PR #856. If I select the current host in the menu, the mouse reconnects and then again is in a state where the GUI shows correct settings but the mouse doesn't act like it. Is that expected behaviour?

@pfps
Copy link
Collaborator

pfps commented Jul 15, 2020

@lukasmichel No, that's not expected behaviour. The current value should show, but that may not be specific to CHANGE_HOST. I expect that the problem with selecting the current host is the same as the problem you encountered previously - changing to the current host causes the mouse to not respond for a while.

I'll see what can be done about both of these, but I may need your help to further diagnose the problems.

@lukasmichel
Copy link
Contributor Author

Sure, I can help with that.

@pfps
Copy link
Collaborator

pfps commented Jul 15, 2020

There is a new version of #856 that should fix the remaining problems reported here.

@lukasmichel
Copy link
Contributor Author

It's better than before, but not completely fixed. The current host is now selected on solaar startup and selecting it in the drop-down menu doesn't try to reconnect, so that's fine.
However, there still is a similar problem: If I try to connect to a host that is currently not available, the mouse switches back to the previouse host, which is good. However, in that case, the settings are again not applied to the mouse.

@lukasmichel
Copy link
Contributor Author

lukasmichel commented Jul 15, 2020

I just made a few more tests. It does not always happen that the settings are not applied in that scenario.
However, it can also happen when switching between two devices that are online. Again, not always, but sometimes. Maybe if one changes back and forth too fast, but I am not sure.
Output of solaar -dd for changing to a different host and back using solaar (only for one of the hosts):

20:43:30,635    DEBUG [AsyncUI] logitech_receiver.settings: change-host: settings write '1' to <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:30,635    DEBUG [AsyncUI] logitech_receiver.settings: change-host: settings prepare write(1) => b'\x01'
20:43:30,635    DEBUG [AsyncUI] logitech_receiver.base: (23) <= w[10 01 091A 010000]
20:43:30,861    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[10 01 4104 726940]
20:43:30,861     INFO [ReceiverListener:hidraw0] solaar.listener: Notification(1,41,04,726940) triggered new device <PairedDevice(1,4069,MX Master 2S,493D1134)> (mouse)
20:43:30,861     INFO [ReceiverListener:hidraw0] solaar.listener: status_changed <UnifyingReceiver(/dev/hidraw0,16)>: present, 4 paired devices. (0) 
20:43:30,862    DEBUG [ReceiverListener:hidraw0] logitech_receiver.notifications: <PairedDevice(1,4069,MX Master 2S,493D1134)>: eQUAD step 4 DJ connection notification: software=True, encrypted=True, link=False, payload=False
20:43:30,862    DEBUG [MainThread] solaar.ui: status changed: <UnifyingReceiver(/dev/hidraw0,16)> (NONE) None
20:43:30,862     INFO [ReceiverListener:hidraw0] solaar.listener: status_changed <PairedDevice(1,4069,MX Master 2S,493D1134)>: paired offline, {'BATTERY LEVEL': 50} (0) 
20:43:30,862    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:None = battery-good
20:43:30,863    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[20 01 4201 0000000000000000000000]
20:43:30,863    DEBUG [ReceiverListener:hidraw0] logitech_receiver.notifications: <PairedDevice(1,4069,MX Master 2S,493D1134)> (4.5) DJ notification Notification(1,42,01,0000000000000000000000)
20:43:30,863     INFO [ReceiverListener:hidraw0] logitech_receiver.notifications: <PairedDevice(1,4069,MX Master 2S,493D1134)>: ignoring DJ connection: Notification(1,42,01,0000000000000000000000)
20:43:30,864    DEBUG [MainThread] solaar.ui: status changed: <PairedDevice(1,4069,MX Master 2S,493D1134)> (NONE) None
20:43:30,864    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:None = battery-good
20:43:30,864    DEBUG [MainThread] solaar.ui.tray: picked device with lowest battery: ('/dev/hidraw0', 1, 'Wireless Mouse MX Master 2S', {'BATTERY LEVEL': 50})
20:43:30,864    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:None = battery-good
20:43:30,864    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:None = battery-good
20:43:30,865    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:None = battery-good
20:43:30,865    DEBUG [AsyncUI] logitech_receiver.settings: hires-smooth-invert: settings read False from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:30,866    DEBUG [AsyncUI] logitech_receiver.settings: hires-smooth-resolution: settings read True from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:30,866    DEBUG [AsyncUI] logitech_receiver.settings: dpi: settings read '3000' from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:30,866    DEBUG [AsyncUI] logitech_receiver.settings: smart-shift: settings read 12 from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:30,866    DEBUG [AsyncUI] logitech_receiver.settings: reprogrammable-keys: settings read {'195': 195, '196': 82, '80': 80, '81': 81, '82': 196, '83': 83, '86': 86} from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:30,866    DEBUG [AsyncUI] logitech_receiver.settings: change-host: settings read '1' from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,317    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[10 01 4104 B26940]
20:43:39,327     INFO [ReceiverListener:hidraw0] solaar.listener: Notification(1,41,04,B26940) triggered new device <PairedDevice(1,4069,MX Master 2S,493D1134)> (mouse)
20:43:39,327     INFO [ReceiverListener:hidraw0] solaar.listener: status_changed <UnifyingReceiver(/dev/hidraw0,16)>: present, 4 paired devices. (0) 
20:43:39,328    DEBUG [ReceiverListener:hidraw0] logitech_receiver.notifications: <PairedDevice(1,4069,MX Master 2S,493D1134)>: eQUAD step 4 DJ connection notification: software=True, encrypted=True, link=True, payload=True
20:43:39,328    DEBUG [ReceiverListener:hidraw0] logitech_receiver.status: <PairedDevice(1,4069,MX Master 2S,493D1134)> pushing device settings [<Setting([feature:toggle] MX Master 2S:hires-smooth-invert=False)>, <Setting([feature:toggle] MX Master 2S:hires-smooth-resolution=True)>, <Setting([feature:choice] MX Master 2S:dpi=3000)>, <Setting([feature:range] MX Master 2S:smart-shift=12)>, <Setting([feature:map choice] MX Master 2S:reprogrammable-keys={'195': 195, '196': 82, '80': 80, '81': 81, '82': 196, '83': 83, '86': 86})>, <Setting([feature:choice] MX Master 2S:change-host=1)>]
20:43:39,328    DEBUG [MainThread] solaar.ui: status changed: <UnifyingReceiver(/dev/hidraw0,16)> (NONE) None
20:43:39,328    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: hires-smooth-invert: apply False (<PairedDevice(1,4069,MX Master 2S,493D1134)>)
20:43:39,328    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: hires-smooth-invert: settings read False from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,328    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: hires-smooth-invert: settings write False to <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,329    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:None = battery-good
20:43:39,329     INFO [ReceiverListener:hidraw0] solaar.configuration: saved {'101B:41629AAD': {'_name': 'Marathon Mouse M705 (M-R0009)'}, '4024:25CF31D9': {'_name': 'Wireless Touch Keyboard K400', 'fn-swap': True, 'hi-res-scroll': False}, '4069:493D1134': {'_name': 'Wireless Mouse MX Master 2S', 'dpi': '3000', 'hires-smooth-invert': False, 'hires-smooth-resolution': True, 'reprogrammable-keys': {'195': 195, '196': 82, '80': 80, '81': 81, '82': 196, '83': 83, '86': 86}, 'smart-shift': 12}, '4072:DDAE1933': {'_name': 'MX Anywhere 2', 'dpi': '1600', 'hires-smooth-invert': False, 'hires-smooth-resolution': False, 'reprogrammable-keys': {'80': 80, '81': 81, '82': 82, '83': 83, '86': 86, '91': 91, '93': 93}}, '_version': '1.0.2'} to /home/lukas/.config/solaar/config.json
20:43:39,329    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[10 01 0E1C 000000]
20:43:39,341    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0700 32140000000000000000000000000000]
20:43:39,349    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0E1C 00000000000000000000000000000000]
20:43:39,349    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: hires-smooth-resolution: apply True (<PairedDevice(1,4069,MX Master 2S,493D1134)>)
20:43:39,349    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: hires-smooth-resolution: settings read True from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,349    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: hires-smooth-resolution: settings write True to <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,350     INFO [ReceiverListener:hidraw0] solaar.configuration: saved {'101B:41629AAD': {'_name': 'Marathon Mouse M705 (M-R0009)'}, '4024:25CF31D9': {'_name': 'Wireless Touch Keyboard K400', 'fn-swap': True, 'hi-res-scroll': False}, '4069:493D1134': {'_name': 'Wireless Mouse MX Master 2S', 'dpi': '3000', 'hires-smooth-invert': False, 'hires-smooth-resolution': True, 'reprogrammable-keys': {'195': 195, '196': 82, '80': 80, '81': 81, '82': 196, '83': 83, '86': 86}, 'smart-shift': 12}, '4072:DDAE1933': {'_name': 'MX Anywhere 2', 'dpi': '1600', 'hires-smooth-invert': False, 'hires-smooth-resolution': False, 'reprogrammable-keys': {'80': 80, '81': 81, '82': 82, '83': 83, '86': 86, '91': 91, '93': 93}}, '_version': '1.0.2'} to /home/lukas/.config/solaar/config.json
20:43:39,350    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[10 01 0E1F 000000]
20:43:39,357    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0710 0404C0280A0000000000000000000000]
20:43:39,365    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0E1F 00000000000000000000000000000000]
20:43:39,365    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: BooleanValidator: prepare_write(True, b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00') => 2
20:43:39,365    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: hires-smooth-resolution: settings prepare write(True) => 2
20:43:39,365    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[10 01 0E2E 020000]
20:43:39,373    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0001 0E000000000000000000000000000000]
20:43:39,381    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0E2E 02000000000000000000000000000000]
20:43:39,381    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: dpi: apply 3000 (<PairedDevice(1,4069,MX Master 2S,493D1134)>)
20:43:39,381    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: dpi: settings read '3000' from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,381    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: dpi: settings write '3000' to <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,382     INFO [ReceiverListener:hidraw0] solaar.configuration: saved {'101B:41629AAD': {'_name': 'Marathon Mouse M705 (M-R0009)'}, '4024:25CF31D9': {'_name': 'Wireless Touch Keyboard K400', 'fn-swap': True, 'hi-res-scroll': False}, '4069:493D1134': {'_name': 'Wireless Mouse MX Master 2S', 'dpi': '3000', 'hires-smooth-invert': False, 'hires-smooth-resolution': True, 'reprogrammable-keys': {'195': 195, '196': 82, '80': 80, '81': 81, '82': 196, '83': 83, '86': 86}, 'smart-shift': 12}, '4072:DDAE1933': {'_name': 'MX Anywhere 2', 'dpi': '1600', 'hires-smooth-invert': False, 'hires-smooth-resolution': False, 'reprogrammable-keys': {'80': 80, '81': 81, '82': 82, '83': 83, '86': 86, '91': 91, '93': 93}}, '_version': '1.0.2'} to /home/lukas/.config/solaar/config.json
20:43:39,382    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: dpi: settings prepare write(3000) => b'\x00\x0b\xb8'
20:43:39,382    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[10 01 0B3C 000BB8]
20:43:39,389    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0E20 02000000000000000000000000000000]
20:43:39,397    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0B3C 000BB800000000000000000000000000]
20:43:39,397    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: smart-shift: apply 12 (<PairedDevice(1,4069,MX Master 2S,493D1134)>)
20:43:39,397    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: smart-shift: settings read 12 from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,397    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: smart-shift: settings write 12 to <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,398     INFO [ReceiverListener:hidraw0] solaar.configuration: saved {'101B:41629AAD': {'_name': 'Marathon Mouse M705 (M-R0009)'}, '4024:25CF31D9': {'_name': 'Wireless Touch Keyboard K400', 'fn-swap': True, 'hi-res-scroll': False}, '4069:493D1134': {'_name': 'Wireless Mouse MX Master 2S', 'dpi': '3000', 'hires-smooth-invert': False, 'hires-smooth-resolution': True, 'reprogrammable-keys': {'195': 195, '196': 82, '80': 80, '81': 81, '82': 196, '83': 83, '86': 86}, 'smart-shift': 12}, '4072:DDAE1933': {'_name': 'MX Anywhere 2', 'dpi': '1600', 'hires-smooth-invert': False, 'hires-smooth-resolution': False, 'reprogrammable-keys': {'80': 80, '81': 81, '82': 82, '83': 83, '86': 86, '91': 91, '93': 93}}, '_version': '1.0.2'} to /home/lukas/.config/solaar/config.json
20:43:39,398    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: smart-shift: settings prepare write(12) => b'\x0c'
20:43:39,398    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[10 01 0D18 020C0C]
20:43:39,405    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0001 0E000000000000000000000000000000]
20:43:39,413    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0D18 020C0C00000000000000000000000000]
20:43:39,413    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: reprogrammable-keys: apply {'195': 195, '196': 82, '80': 80, '81': 81, '82': 196, '83': 83, '86': 86} (<PairedDevice(1,4069,MX Master 2S,493D1134)>)
20:43:39,413    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: reprogrammable-keys: settings read {'195': 195, '196': 82, '80': 80, '81': 81, '82': 196, '83': 83, '86': 86} from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,413    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: reprogrammable-keys: settings write {'195': 195, '196': 82, '80': 80, '81': 81, '82': 196, '83': 83, '86': 86} to <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,419     INFO [ReceiverListener:hidraw0] solaar.configuration: saved {'101B:41629AAD': {'_name': 'Marathon Mouse M705 (M-R0009)'}, '4024:25CF31D9': {'_name': 'Wireless Touch Keyboard K400', 'fn-swap': True, 'hi-res-scroll': False}, '4069:493D1134': {'_name': 'Wireless Mouse MX Master 2S', 'dpi': '3000', 'hires-smooth-invert': False, 'hires-smooth-resolution': True, 'reprogrammable-keys': {'195': 195, '196': 82, '80': 80, '81': 81, '82': 196, '83': 83, '86': 86}, 'smart-shift': 12}, '4072:DDAE1933': {'_name': 'MX Anywhere 2', 'dpi': '1600', 'hires-smooth-invert': False, 'hires-smooth-resolution': False, 'reprogrammable-keys': {'80': 80, '81': 81, '82': 82, '83': 83, '86': 86, '91': 91, '93': 93}}, '_version': '1.0.2'} to /home/lukas/.config/solaar/config.json
20:43:39,419    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: reprogrammable-keys: settings prepare map write(195,195) => b'\x00\x00\xc3'
20:43:39,419    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[11 01 0A39 00C30000C30000000000000000000000]
20:43:39,423    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0E00 080C0000000000000000000000000000]
20:43:39,439    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0A39 00000000000000000000000000000000]
20:43:39,439    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: reprogrammable-keys: settings prepare map write(196,82) => b'\x00\x00R'
20:43:39,439    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[11 01 0A3A 00C40000520000000000000000000000]
20:43:39,455    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0A3A 00000000000000000000000000000000]
20:43:39,455    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: reprogrammable-keys: settings prepare map write(80,80) => b'\x00\x00P'
20:43:39,455    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[11 01 0A3A 00500000500000000000000000000000]
20:43:39,471    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0A3A 00000000000000000000000000000000]
20:43:39,471    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: reprogrammable-keys: settings prepare map write(81,81) => b'\x00\x00Q'
20:43:39,471    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[11 01 0A3D 00510000510000000000000000000000]
20:43:39,487    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0A3D 00000000000000000000000000000000]
20:43:39,487    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: reprogrammable-keys: settings prepare map write(82,196) => b'\x00\x00\xc4'
20:43:39,487    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[11 01 0A3A 00520000C40000000000000000000000]
20:43:39,503    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0A3A 00000000000000000000000000000000]
20:43:39,503    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: reprogrammable-keys: settings prepare map write(83,83) => b'\x00\x00S'
20:43:39,503    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[11 01 0A3A 00530000530000000000000000000000]
20:43:39,519    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0A3A 00000000000000000000000000000000]
20:43:39,519    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: reprogrammable-keys: settings prepare map write(86,86) => b'\x00\x00V'
20:43:39,519    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[11 01 0A3C 00560000560000000000000000000000]
20:43:39,535    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0A3C 00000000000000000000000000000000]
20:43:39,535    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: change-host: apply 1 (<PairedDevice(1,4069,MX Master 2S,493D1134)>)
20:43:39,535    DEBUG [ReceiverListener:hidraw0] logitech_receiver.settings: change-host: settings read '1' from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,535    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[10 01 090F 000000]
20:43:39,551    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 090F 03000100000000000000000000000000]
20:43:39,551     INFO [ReceiverListener:hidraw0] solaar.listener: status_changed <PairedDevice(1,4069,MX Master 2S,493D1134)>: paired online, {'BATTERY LEVEL': 50, 'LINK ENCRYPTED': True} (0) 
20:43:39,551    DEBUG [ReceiverListener:hidraw0] logitech_receiver.notifications: <PairedDevice(1,4069,MX Master 2S,493D1134)> (4.5) DJ notification Notification(1,42,00,0000000000000000000000)
20:43:39,551    DEBUG [MainThread] solaar.ui: status changed: <PairedDevice(1,4069,MX Master 2S,493D1134)> (NONE) None
20:43:39,552     INFO [ReceiverListener:hidraw0] logitech_receiver.notifications: <PairedDevice(1,4069,MX Master 2S,493D1134)>: ignoring DJ connection: Notification(1,42,00,0000000000000000000000)
20:43:39,552    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:None = battery-good
20:43:39,552    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) <= w[10 01 011E 040000]
20:43:39,552    DEBUG [MainThread] solaar.ui.tray: picked device with lowest battery: ('/dev/hidraw0', 1, 'Wireless Mouse MX Master 2S', {'BATTERY LEVEL': 50, 'LINK ENCRYPTED': True})
20:43:39,552    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:None = battery-good
20:43:39,552    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:None = battery-good
20:43:39,552    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:None = battery-good
20:43:39,553    DEBUG [AsyncUI] logitech_receiver.settings: hires-smooth-invert: settings read False from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,553    DEBUG [AsyncUI] logitech_receiver.settings: hires-smooth-resolution: settings read True from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,553    DEBUG [AsyncUI] logitech_receiver.settings: dpi: settings read '3000' from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,553    DEBUG [AsyncUI] logitech_receiver.settings: smart-shift: settings read 12 from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,553    DEBUG [AsyncUI] logitech_receiver.settings: reprogrammable-keys: settings read {'195': 195, '196': 82, '80': 80, '81': 81, '82': 196, '83': 83, '86': 86} from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,553    DEBUG [AsyncUI] logitech_receiver.settings: change-host: settings read NamedInt(0, '1:ARCH-Desktop') from <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,554    DEBUG [AsyncUI] logitech_receiver.settings: change-host: settings write '0' to <PairedDevice(1,4069,MX Master 2S,493D1134)>
20:43:39,554    DEBUG [AsyncUI] logitech_receiver.settings: change-host: settings prepare write(0) => b'\x00'
20:43:39,554    DEBUG [AsyncUI] logitech_receiver.base: (23) <= w[10 01 091E 000000]
20:43:39,567    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 011E 1D4B0000000000000000000000000000]
20:43:39,567    DEBUG [ReceiverListener:hidraw0] logitech_receiver.notifications: wireless status: Notification(1,04,00,01010100000000000000000000000000)
20:43:39,567     INFO [ReceiverListener:hidraw0] solaar.listener: status_changed <PairedDevice(1,4069,MX Master 2S,493D1134)>: paired online, {'BATTERY LEVEL': 50, 'LINK ENCRYPTED': True} (1) powered on
20:43:39,568    DEBUG [ReceiverListener:hidraw0] logitech_receiver.status: <PairedDevice(1,4069,MX Master 2S,493D1134)>: battery 50, discharging
20:43:39,568     INFO [ReceiverListener:hidraw0] solaar.listener: status_changed <PairedDevice(1,4069,MX Master 2S,493D1134)>: paired online, {'BATTERY LEVEL': 50, 'LINK ENCRYPTED': True, 'BATTERY STATUS': NamedInt(0, 'discharging'), 'BATTERY NEXT LEVEL': 20, 'BATTERY CHARGING': False, 'ERROR': None} (0) 
20:43:39,568  WARNING [ReceiverListener:hidraw0] logitech_receiver.notifications: <PairedDevice(1,4069,MX Master 2S,493D1134)>: unknown BATTERY Notification(1,07,10,0404C0280A0000000000000000000000)
20:43:39,568  WARNING [ReceiverListener:hidraw0] logitech_receiver.notifications: <PairedDevice(1,4069,MX Master 2S,493D1134)>: unknown WHEEL Notification(1,0E,20,02000000000000000000000000000000)
20:43:39,568     INFO [ReceiverListener:hidraw0] logitech_receiver.notifications: <PairedDevice(1,4069,MX Master 2S,493D1134)>: WHEEL: res: 0 periods: 8 delta V:3072
20:43:39,576    DEBUG [MainThread] solaar.ui: status changed: <PairedDevice(1,4069,MX Master 2S,493D1134)> (NOTIFICATION) powered on
20:43:39,576    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:False = battery-good
20:43:39,576    DEBUG [MainThread] solaar.ui.tray: picked device with lowest battery: ('/dev/hidraw0', 1, 'Wireless Mouse MX Master 2S', {'BATTERY LEVEL': 50, 'LINK ENCRYPTED': True, 'BATTERY STATUS': NamedInt(0, 'discharging'), 'BATTERY NEXT LEVEL': 20, 'BATTERY CHARGING': False, 'ERROR': None})
20:43:39,576    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:False = battery-good
20:43:39,576    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:False = battery-good
20:43:39,576    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:False = battery-good
20:43:39,612    DEBUG [MainThread] solaar.ui: status changed: <PairedDevice(1,4069,MX Master 2S,493D1134)> (NONE) None
20:43:39,612    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:False = battery-good
20:43:39,612    DEBUG [MainThread] solaar.ui.tray: picked device with lowest battery: ('/dev/hidraw0', 1, 'Wireless Mouse MX Master 2S', {'BATTERY LEVEL': 50, 'LINK ENCRYPTED': True, 'BATTERY STATUS': NamedInt(0, 'discharging'), 'BATTERY NEXT LEVEL': 20, 'BATTERY CHARGING': False, 'ERROR': None})
20:43:39,612    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:False = battery-good
20:43:39,613    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:False = battery-good
20:43:39,613    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:False = battery-good
20:43:39,765    DEBUG [ReceiverListener:hidraw0] logitech_receiver.base: (16) => r[11 01 0400 01010100000000000000000000000000]
20:43:39,765    DEBUG [ReceiverListener:hidraw0] logitech_receiver.notifications: wireless status: Notification(1,04,00,01010100000000000000000000000000)
20:43:39,765     INFO [ReceiverListener:hidraw0] solaar.listener: status_changed <PairedDevice(1,4069,MX Master 2S,493D1134)>: paired online, {'BATTERY LEVEL': 50, 'LINK ENCRYPTED': True, 'BATTERY STATUS': NamedInt(0, 'discharging'), 'BATTERY NEXT LEVEL': 20, 'BATTERY CHARGING': False, 'ERROR': None} (1) powered on
20:43:39,766    DEBUG [MainThread] solaar.ui: status changed: <PairedDevice(1,4069,MX Master 2S,493D1134)> (NOTIFICATION) powered on
20:43:39,766    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:False = battery-good
20:43:39,766    DEBUG [MainThread] solaar.ui.tray: picked device with lowest battery: ('/dev/hidraw0', 1, 'Wireless Mouse MX Master 2S', {'BATTERY LEVEL': 50, 'LINK ENCRYPTED': True, 'BATTERY STATUS': NamedInt(0, 'discharging'), 'BATTERY NEXT LEVEL': 20, 'BATTERY CHARGING': False, 'ERROR': None})
20:43:39,766    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:False = battery-good
20:43:39,766    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:False = battery-good
20:43:39,767    DEBUG [MainThread] solaar.ui.icons: battery icon for 50:False = battery-good
20:43:39,789    ERROR [MainThread] solaar.ui.notify: showing <Notify.Notification object at 0x7fe490b383c0 (NotifyNotification at 0x55e23cb20b20)>
Traceback (most recent call last):
  File "/home/lukas/Documents/solaar/lib/solaar/ui/notify.py", line 137, in show
    n.show()
gi.repository.GLib.GError: g-io-error-quark: GDBus.Error:org.freedesktop.Notifications.Error.ExcessNotificationGeneration: Created too many similar notifications in quick succession (36)

@pfps
Copy link
Collaborator

pfps commented Jul 15, 2020

This exposes a problem with the underlying model of settings in Solaar that needs a slight upgrade to keep track of the device value and the Solaar value so that the device value is not written too often. I'll work on a fix.

@pfps
Copy link
Collaborator

pfps commented Jul 15, 2020

It turns out that there was a simple fix (or at least that what it looks like to me). Please try out the newest version of PR #856

The problem was that the Solaar GUI had the "other host" value for CHANGE_HOST and when the "this host" value was read from the device the GUI wrote it back, which may have been causing problems.

But there is a situation that still might be problematic. If you switch back and forth too fast, the receiver may not notice that the mouse was disconnected and that its values might have changed. After each host switch away and back there should be a debug line like Notification(1,41,04,B26940) triggered new device followed by reads from and writes to the device to ensure that it is in the state that Solaar wants it to be in. The only fix for that would be to always read values from the device, but that's not a good idea.

@pfps
Copy link
Collaborator

pfps commented Jul 16, 2020

@lukasmichel Have you had a chance to test the latest version of the PR?

@lukasmichel
Copy link
Contributor Author

I just tested it. Everything looks fine. Changing between two hosts in quick succession is fine and trying to change to an offline host also works now. I also saw the debug line you mentioned above in the debug output.

@pfps
Copy link
Collaborator

pfps commented Jul 16, 2020

Excellent, thanks.

@pfps pfps closed this as completed in #856 Jul 16, 2020
@lukasmichel lukasmichel mentioned this issue Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants