zocker-160 / keyboard-center

Application for mapping macro keys on Logitech keyboards
GNU General Public License v3.0
65 stars 2 forks source link

openRGB process not closing on exit #40

Closed HekTheLastSavior closed 1 year ago

HekTheLastSavior commented 1 year ago

hey hope all is well. is it possible to kill the openrgb process then executing again after restarting keyboard center... maybe giving a few seconds delay between the two. it will help fix my issue when my laptop wakes up and I need to do this process manually in order to get it to work,

thank you !!

zocker-160 commented 1 year ago

Which part of the application stops working after you wake from sleep?

In the UI you can select File > Force restart driver, which does completely reset the keyboard and the mappings but does also restart openRGB in case it was started internally.

I know that openRGB itself is a bit tricky as it doesn't always survive a sleep / wake up cycle and gets hung up. Currently I am sending a SIGINT signal to the OpenRGB process, if that is not enough, I could look into upping that to a SIGKILL.

EDIT: the same function can also be reached by right clicking the tray icon and selecting "Force Restart".

HekTheLastSavior commented 1 year ago

I'm aware of the force restart and I use it all the time.

But now I'm using openrgb and I have to exit from keyboard-center, killall -9 openrgb then wait like 5-10 seconds before opening keyboard-center and everything work accordingly

zocker-160 commented 1 year ago

Are you running an instance of OpenRGB separately? Is that instance getting hung up when you wake from sleep?

HekTheLastSavior commented 1 year ago

not running a separate instance. when the laptop resume from sleeping keyboard-center is active but not working so I need to force restart it . I need to exit keyboard-center in order to kill openrgb that keyboard-center forked.

zocker-160 commented 1 year ago

The G-Keys do not work anymore after you wake from sleep?

Could you share the log file after you woke from sleep and triggered a force restart? It should reset the openrgb subprocess as well.

If not, then there is a bug somewhere or it gets hung up in a deadlock while waiting for the subprocess to end.

HekTheLastSavior commented 1 year ago

G-keys stops working after the pc wake up. we already had a discussion about this a while back and we couldn't figure out the problem.

regarding openrgb it's process is still available after closing keyboard-center. And do note that's I'm not running it myself.

zocker-160 commented 1 year ago

we already had a discussion about this a while back and we couldn't figure out the problem.

Yes I remember now and I think that is why I added the reset option, but it clearly does not work as it should, so I wonder why it does not reset properly.

I would guess that it gets stuck at either deleting BGService or stopping openRGB server... in the log.

regarding openrgb it's process is still available after closing keyboard-center. And do note that's I'm not running it myself.

That also should not be happening, as I am triggering a stop of the subprocess, but it is possible, that it turns into a zombie.

EDIT: If we don't manage to figure this out, I think a workaround would be to stop before you go to sleep, so that it does not hang up itself in the first place.

HekTheLastSavior commented 1 year ago

I'll try to remember to do that, but I put my laptop to sleep multiple time per day. thanks anyways and keep up the good work

zocker-160 commented 1 year ago

yeah I know it is not great, but there is not really much I can do, since the device connection does not seem to resume correctly and running kill to get rid of the openrgb zombie would require root.

HekTheLastSavior commented 1 year ago

The G-Keys do not work anymore after you wake from sleep? nope they are not operational after the wake up.

I closed keyboard-center before sleeping and on wakeup I run it , it worked fine but still I need to kill the openrgb process before starting. it persist. so technically it's the same as I was doing.

regarding the log there's nothing informative in it regarding the issue, but what I noticed is if I unplugged they keyboard and plugged it back it works sometimes without restarting keyboard-center.

zocker-160 commented 1 year ago

I can actually reproduce the issue with openrgb background process not closing, I will look into it.

zocker-160 commented 1 year ago

Found the issue, it was a bug in the check process logic.

As for going to sleep and waking up, I need to investigate, if the system is sending process signals when waking up again.

If yes I could hook into those and automatically trigger a reset, although I personally cannot reproduce the issue, I can sleep and wake up many times and it keeps working.

EDIT: bad news, there does not seem to be any signal sent when going to sleep or waking up, was hoping for SIGCONT but sadly nothing :(

zocker-160 commented 1 year ago

fix is available now as 1.0.2

HekTheLastSavior commented 1 year ago

no worries with the sleep issue... thank you for your prompt update and help solving the issue. kudos !!