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

Problem with G500s #7

Open
ghost opened this issue Jun 29, 2020 · 9 comments
Open

Problem with G500s #7

ghost opened this issue Jun 29, 2020 · 9 comments

Comments

@ghost
Copy link

ghost commented Jun 29, 2020

It is not directly an issue but I dont know where I could ask, since my ratbag issue is open for months and the manjaro forum also does not really help...
I use manjaro and I have a problem with my G500s (should be quite simular to the G500). Neither ratbag nor solaar seem to recognize the mouse correctly or be able to configure it. Additionally the mouse sometimes uses its in memory profile and sometimes some standard profile. I am not yet familar enough with the xinput and what als there might be involved to debug this further but was hoping that you with your experience could maybe help me getting a bit forward.

@cvuchener
Copy link
Owner

I don't know about the ratbag issue, and, as far as I know, solaar does not do anything with the G500 (it is for unifying devices). You can try my tools if you want something else but they are more complex to use than ratbag.

Additionally the mouse sometimes uses its in memory profile and sometimes some standard profile.

The mouse can fallback to a default profile if something is wrong in the on-board memory, but it should be consistent. You must be changing something with the mouse if it switches from one to the other.

@ghost
Copy link
Author

ghost commented Jun 29, 2020

thank you for your fast reply!!!
This woulde be the ratbag issue libratbag/libratbag#938 (If you are interested)

The only thing which might be the reason for the profile change is, when my gf boots into the windows (dual boot). But if the on board profle is active, reboots of the linux does not change the effect (the memory profile stays active). If I reboot into windows again and than reboot into linux the fallback is activted. And than again for multible reboots of the linux.
Are there some logs I can check to find the reason why the one and why the other case happens? Because I fear that even if I get ratbag solarr or your tool running, this problem might destroy this.
I only want to have a stable dpi and change the keypress settings of all buttons...

@cvuchener
Copy link
Owner

The g500 has a persistent on-board memory for storing profiles and macros. All other kind of state is lost on reset.

Since ratbag is crashing during commit, it may write partial data, then later logitech gaming software on windows tries to fix it.

@ghost
Copy link
Author

ghost commented Jul 1, 2020

Ah ok I think I understand. So there is something happening on the mouse which makes the mouse activate its fallback profile. But is there no diagnosis I can run? I tried with xinput and ratbagctl to find a difference in the way the mouse was detected. Can your tools deliver deeper logs on that?
I think I change to Razer since there the Linux support looks much better

@cvuchener
Copy link
Owner

No there is no diagnostics that will tell you why the profile failed to load. But rewriting the profile memory should be enough to fix these issues. Use logitech software on Windows since you have access to it.

If you really want to dig into this, you could make memory dump from your mouse and send it to me, I could have a look. I don't know if ratbag can do it. With my tools you can do something like this:

i=0
while sudo ./src/tools/hidpp10-dump-page /dev/hidrawX -d0 $i; do i=$((i+1)); done > g500s_memory.bin
echo $i

/dev/hidrawX should be the hidraw device for the mouse (hidpp-list-devices can help you with that, you may need to add sudo in front of the command). It reads all memory until it cannot, so it is expected to end with an error ("Invalid param value"). When it prints $i at the end it should be 19 if everything went as expected (that's what I get on my g500s). You may replace g500s_memory.bin with whatever filename you prefer.

If you made the effort of compiling my tools, you can also try sudo ./src/tools/hidpp-persistent-profiles /dev/hidrawX -d0 read, it should print the profile from your mouse in a XML format. sudo ./src/tools/hidpp10-active-profile /dev/hidrawX -d0 current will tell you what profile is in use (should be 0).

About changing your mouse, I cannot speak about Razer specifically but, as far as I know, it is the same for all brands. Mice work out of the box as it is standard HID protocol, but official configuration tools don't exists on Linux. All such tools are made by users who hacked some kind of support of varying quality.

@ghost
Copy link
Author

ghost commented Jul 1, 2020

Thank you! Your help is highly appreciated!
Unfortunately I dont get it to compile.

Scanning dependencies of target hidpp
[  1%] Building CXX object src/libhidpp/CMakeFiles/hidpp.dir/hidpp/Device.cpp.o
In Datei, eingebunden von /home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.cpp:19:
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.h:46:8: Fehler: »string« in Namensbereich »std« bezeichnet keinen Typ
   46 |   std::string _msg;
      |        ^~~~~~
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.h:25:1: Anmerkung: »std::string« ist im Header »<string>« definiert; haben Sie vergessen, »#include <string>« zu schreiben?
   24 | #include <tuple>
  +++ |+#include <string>
   25 | 
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.h:83:7: Fehler: »string« in Namensbereich »std« bezeichnet keinen Typ
   83 |  std::string name () const;
      |       ^~~~~~
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.h:83:2: Anmerkung: »std::string« ist im Header »<string>« definiert; haben Sie vergessen, »#include <string>« zu schreiben?
   83 |  std::string name () const;
      |  ^~~
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.h:100:7: Fehler: »string« in Namensbereich »std« bezeichnet keinen Typ
  100 |  std::string _name;
      |       ^~~~~~
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.h:100:2: Anmerkung: »std::string« ist im Header »<string>« definiert; haben Sie vergessen, »#include <string>« zu schreiben?
  100 |  std::string _name;
      |  ^~~
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.cpp: In Konstruktor »HIDPP::Device::InvalidProtocolVersion::InvalidProtocolVersion(const std::tuple<unsigned int, unsigned int>&)«:
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.cpp:38:2: Fehler: »_msg« wurde in diesem Gültigkeitsbereich nicht definiert
   38 |  _msg = ss.str ();
      |  ^~~~
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.cpp: In Elementfunktion »virtual const char* HIDPP::Device::InvalidProtocolVersion::what() const«:
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.cpp:43:9: Fehler: »_msg« wurde in diesem Gültigkeitsbereich nicht definiert
   43 |  return _msg.c_str ();
      |         ^~~~
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.cpp: In Konstruktor »HIDPP::Device::Device(HIDPP::Dispatcher*, HIDPP::DeviceIndex)«:
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.cpp:60:4: Fehler: »_name« wurde in diesem Gültigkeitsbereich nicht deklariert; meinten Sie »rename«?
   60 |    _name = ireceiver.getDeviceName (device_index - 1);
      |    ^~~~~
      |    rename
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.cpp:74:3: Fehler: »_name« wurde in diesem Gültigkeitsbereich nicht deklariert; meinten Sie »rename«?
   74 |   _name = _dispatcher->name ();
      |   ^~~~~
      |   rename
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.cpp: Im globalen Gültigkeitsbereich:
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.cpp:109:13: Fehler: keine Deklaration passt zu »std::string HIDPP::Device::name() const«
  109 | std::string Device::name () const
      |             ^~~~~~
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.cpp:109:13: Anmerkung: keine Funktionen namens »std::string HIDPP::Device::name() const«
In Datei, eingebunden von /home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.cpp:19:
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Device.h:36:7: Anmerkung: »class HIDPP::Device« hier definiert
   36 | class Device
      |       ^~~~~~
make[2]: *** [src/libhidpp/CMakeFiles/hidpp.dir/build.make:187: src/libhidpp/CMakeFiles/hidpp.dir/hidpp/Device.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:190: src/libhidpp/CMakeFiles/hidpp.dir/all] Fehler 2
make: *** [Makefile:150: all] Fehler 2

If I insert "#include string" into Device.h I get the following:

make
Scanning dependencies of target hidpp
[  1%] Building CXX object src/libhidpp/CMakeFiles/hidpp.dir/hidpp/Device.cpp.o
[  2%] Building CXX object src/libhidpp/CMakeFiles/hidpp.dir/hidpp/Report.cpp.o
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Report.cpp: In statischer Elementfunktion »static std::size_t HIDPP::Report::parameterLength(HIDPP::Report::Type)«:
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Report.cpp:329:14: Fehler: »logic_error« ist kein Element von »std«
  329 |   throw std::logic_error ("Invalid type");
      |              ^~~~~~~~~~~
/home/woife/Downloads/hidpp-master/src/libhidpp/hidpp/Report.cpp:331:1: Warnung: Kontrollfluss erreicht Ende von Nicht-void-Funktion [-Wreturn-type]
  331 | }
      | ^
make[2]: *** [src/libhidpp/CMakeFiles/hidpp.dir/build.make:200: src/libhidpp/CMakeFiles/hidpp.dir/hidpp/Report.cpp.o] Fehler 1
make[1]: *** [CMakeFiles/Makefile2:190: src/libhidpp/CMakeFiles/hidpp.dir/all] Fehler 2
make: *** [Makefile:150: all] Fehler 2

@cvuchener
Copy link
Owner

Sorry for the missing includes. Add #include <stdexcept> somewhere at the beginning of Report.cpp.

@ghost
Copy link
Author

ghost commented Jul 2, 2020

No problem! There where some others. I dumped already the case where the profile is not acitve as soon as the second case appears I dump it as well for comparison.
The active profile is shown as 0 in this case as expected but the xml output tool is not in my build directory even though it has completely compiled :/

@cvuchener
Copy link
Owner

the xml output tool is not in my build directory even though it has completely compiled :/

I forgot it is not compiled if tinyxml2 is missing. Make sure you have the development package for tinyxml2 installed, re-run cmake (checking the output to be sure tinyxml2 is found), then it should build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant