kurikaesu / userspace-tablet-driver-daemon

Linux device drivers for non-wacom (XP-Pen, Huion, Gaomon) graphics tablets and pen displays
GNU General Public License v3.0
62 stars 16 forks source link

Configuration file is overwritten with default values #54

Open jbigler opened 2 years ago

jbigler commented 2 years ago

I haven't been able to determine what the cause is, but many times (though not always) when starting the daemon it overwrites the ~/.local/share/userspace_tablet_driver_daemon/driver.cfg with default values. If I stop the daemon, restore the settings file and start the daemon manually again it usually works fine. Right now I have it launching from .xprofile.

kurikaesu commented 2 years ago

Hmmn that is very weird. Is there any way you can set up the launch parameters so that it will pipe the console output to a log file somewhere? I'm curious to know why it is deciding to reset to default.

jbigler commented 2 years ago

Since I've started logging the console output I haven't experience the problem. Nice little Heisenbug. I'll let you know if it occurs under observation.

jbigler commented 2 years ago

I will attach a log file I created. You'll notice sometimes the daemon says it could not claim the interface or device, but that doesn't seem to delete the configuration. On line 240 of the log file it just pops up a message that there is no existing config file and creates a new one. tablet-driver.log

kurikaesu commented 2 years ago

Hmm, thanks for the log. I wonder if the reason why the config is being recreated is because the existing config is broken or half written and can't be deserialised correctly.

I'll have to look into this deeper when I can get my Linux computer hooked up to a monitor and keyboard. Might be able to do that tomorrow evening.

kurikaesu commented 2 years ago

I've made a small change to flush the config file when writing and also emit a message to know that it has done so. If you could pull the latest code and run it while logging the output again, we can see if it is indeed being able to write out the whole file or not.

jbigler commented 2 years ago

userspace.log Sorry for the delay, I recently moved and it took a little while to get my computer set up again. Here is an attached log file from the updated build with several instances of creating a new configuration file instead of using the existing file.

kurikaesu commented 2 years ago

Thanks Jeff, I am very curious to see why its getting a parse error on this line: https://github.com/kurikaesu/userspace-tablet-driver-daemon/blob/main/src/event_handler.cpp#L109

I'll need to make a small change there to print out what kind of parsing error it is but I currently don't have a Linux machine to write/test the code on. Might take me a little bit of time to get a dev machine set up again as I'm currently shuffling around my computers/servers here at home.