lx-s / WinMute

WinMute lets you automatically mute your PC volume on certain events (e. g. Screensaver, Workstation Lock, Shutdown, etc.).
BSD 3-Clause "New" or "Revised" License
168 stars 6 forks source link

Lock screen from screensaver #4

Closed blarg3891 closed 2 years ago

blarg3891 commented 3 years ago

Love the app. Thought it would work this way. I have "Screen Saver Settings" set to "On resume, display logon screen." This effectively locks the screen. For some reason though, during my testing, sound was still coming through when the screen locked this way. When I lock the screen with windows+L sound is muted. Not sure if the login state is somehow different in this scenario... Anyway, I saw the beta release that allows to lock during specific times so I'll take a look at this. I'm mostly concerned about muting during the nighttime hours.

lx-s commented 3 years ago

I'll check this - maybe the screen-lock signal get's lost when "screensaver ends" and "workstation locks" happen right after another.

lx-s commented 3 years ago

So, I have verified your bug and have to rework my "already muted" detection a bit, since the timing of the events "screensaver starts, screen gets locked, screensaver stops, screen gets unlocked" is not always in perfect order.

Also I could verify why sometimes the sound does not get muted, when your screensaver starts and added it to the README: https://github.com/lx-s/WinMute#known-issues

Unfortunately I have to postpone the fix for this problem to a later time, since I am not sure yet how to overcome this issue. Screensaver detection is really wonky on Windows. For now, you should make sure, that the foremost Window is your desktop or a 64-bit application (or 32-bit). Sorry for that inconvenience. :/

blarg3891 commented 3 years ago

I'll look forward to it one day in the future :)

lx-s commented 3 years ago

I had an idea and implemented it. Good news: In my tests, WinMute now mutes when the screensaver starts regardless whether the top window belongs to a 64bit or 32bit process. Bad news: Everything got a bit uglier (screensaver detection is really a mess on Windows) and I'll postpone the 1.6 release a bit more.

Attached you'll find the current beta, if you want to try. WinMute_1.6.0_beta6.zip

blarg3891 commented 3 years ago

Wow, awesome. I will test it out.

lx-s commented 3 years ago

Fixed in version 1.6.0

blarg3891 commented 3 years ago

So, this seems to sometimes work but it has been inconsistent. I'm not sure how or why, but sometimes i come back to my computer and its still muted after logging in, or i'll hear noises coming from my speakers after screen is locked. I tested this with quite hours enabled and disabled to make sure that wasnt part of the issue, but it remained unstable. Again, I know there is complexity here so it may be impossible to fix... I'm also not sure if somehow rebooting my computer might resolve the issue as I don't reboot very often either. Is there a way to see a logfile of mutes/unmutes maybe it may help troubleshoot.

lx-s commented 3 years ago

Hrmpf! I’ll add logs in the coming days and get back to you. Sorry :/

lx-s commented 3 years ago

Just want to check-in that I've not forgotten adding logs. There's just a lot going on currently and I haven't found the time to add this (albeit it's not a huge task). I'll get back to you within the next two weeks though.

Sorry for keeping you waiting :/

blarg3891 commented 3 years ago

Ah no worries. I appreciate it :)

Byron S

On Thu, Feb 11, 2021 at 4:29 AM Alexander Steinhöfer < notifications@github.com> wrote:

Just want to check-in that I've not forgotten adding logs. There's just a lot going on currently and I haven't found the time to add this (albeit it's not a huge task). I'll get back to you within the next two weeks though.

Sorry for keeping you waiting :/

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lx-s/WinMute/issues/4#issuecomment-777308981, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKUGGIQ3UW36Y4Y3JXLMCLLS6OPN5ANCNFSM4THX7I5A .

lx-s commented 3 years ago

Welp. Finally: WinMute_1.6.1_WithLog.zip

The logfile is named WinMute.log and is created in your Temp-Directory (just press Windows-Key + R, enter %TEMP% and press Return).

Thanks for your help and your patience

blarg3891 commented 3 years ago

oh sweet. I will get this loaded and let you know what i find !!

Byron S

On Wed, Mar 31, 2021 at 5:50 AM Alexander Steinhöfer < @.***> wrote:

Welp. Finally: WinMute_1.6.1_WithLog.zip https://github.com/lx-s/WinMute/files/6235604/WinMute_1.6.1_WithLog.zip

The logfile is named WinMute.log and is created in your Temp-Directory (just press Windows-Key + R, enter %TEMP% and press Return).

Thanks for your help and your patience

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lx-s/WinMute/issues/4#issuecomment-810934860, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKUGGISEIVYZBFBX4Q2OH3LTGLV67ANCNFSM4THX7I5A .

blarg3891 commented 3 years ago

I'm continuing to test. I noticed that the log seems to be incorrectly displaying the mute status. See below.

When workstation locks, it should say "Mute: On" not "Mute: Off" right? It seems like Quiet hours displays this correctly.

I do believe that Mute is working thus far, I think it's just the log that's displaying wrong??

[2021-03-31 11:13:20] Mute: Off | Workstation Lock [2021-03-31 11:13:33] Mute: Off | Workstation Unlock [2021-03-31 12:16:40] Mute: Off | Workstation Lock [2021-03-31 12:27:17] Mute: Off | Workstation Unlock [2021-03-31 12:27:56] Mute: Off | Workstation Lock [2021-03-31 14:49:25] Mute: Off | Workstation Unlock [2021-03-31 19:21:09] Mute: Off | Workstation Lock [2021-03-31 20:00:00] Mute: On | Quiet Hours started [2021-03-31 21:59:43] Mute: On | Quiet hours have already started [2021-04-01 10:56:38] Mute: Off | Workstation Unlock [2021-04-01 14:59:18] Mute: Off | Workstation Lock [2021-04-01 16:40:38] Mute: Off | Workstation Unlock [2021-04-01 18:07:56] Mute: Off | Workstation Lock [2021-04-01 20:00:00] Mute: On | Quiet Hours started [2021-04-01 23:40:03] Mute: On | Quiet hours have already started [2021-04-02 11:12:08] Mute: Off | Workstation Lock [2021-04-02 12:09:17] Mute: Off | Workstation Unlock [2021-04-02 13:59:42] Mute: Off | Workstation Lock [2021-04-02 14:18:45] Mute: Off | Workstation Unlock [2021-04-02 16:43:18] Mute: Off | Workstation Lock [2021-04-02 17:31:03] Mute: Off | Workstation Unlock [2021-04-02 17:51:35] Mute: Off | Workstation Lock [2021-04-02 19:32:13] Mute: Off | Workstation Unlock

Byron S

On Wed, Mar 31, 2021 at 6:12 AM Byron Levy @.***> wrote:

oh sweet. I will get this loaded and let you know what i find !!

Byron S

On Wed, Mar 31, 2021 at 5:50 AM Alexander Steinhöfer < @.***> wrote:

Welp. Finally: WinMute_1.6.1_WithLog.zip https://github.com/lx-s/WinMute/files/6235604/WinMute_1.6.1_WithLog.zip

The logfile is named WinMute.log and is created in your Temp-Directory (just press Windows-Key + R, enter %TEMP% and press Return).

Thanks for your help and your patience

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lx-s/WinMute/issues/4#issuecomment-810934860, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKUGGISEIVYZBFBX4Q2OH3LTGLV67ANCNFSM4THX7I5A .

lx-s commented 3 years ago

Ah yes... this bug was sponsored by copy-and-paste-errors.

Here is a new build: WinMute_1.6.1_WithLog2.zip

Thanks :)

blarg3891 commented 3 years ago

Hehe, I know this sponsor well.

Thanks,

Byron S

On Sat, Apr 3, 2021 at 7:44 AM Alexander Steinhöfer < @.***> wrote:

Ah yes... this bug was sponsored by copy-and-paste-errors.

Here is a new build: WinMute_1.6.1_WithLog2.zip https://github.com/lx-s/WinMute/files/6252492/WinMute_1.6.1_WithLog2.zip

Thanks :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lx-s/WinMute/issues/4#issuecomment-812853936, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKUGGIWSJMXXGXKIFBE44TLTG35QTANCNFSM4THX7I5A .

blarg3891 commented 3 years ago

So I have noticed one bug so far. First few days I had "quiet hours" set, everything else checked.

On Sat, Apr 3, 2021 at 10:36 AM Byron Levy @.***> wrote:

Hehe, I know this sponsor well.

Thanks,

Byron S

On Sat, Apr 3, 2021 at 7:44 AM Alexander Steinhöfer < @.***> wrote:

Ah yes... this bug was sponsored by copy-and-paste-errors.

Here is a new build: WinMute_1.6.1_WithLog2.zip https://github.com/lx-s/WinMute/files/6252492/WinMute_1.6.1_WithLog2.zip

Thanks :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lx-s/WinMute/issues/4#issuecomment-812853936, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKUGGIWSJMXXGXKIFBE44TLTG35QTANCNFSM4THX7I5A .

blarg3891 commented 3 years ago

Sorry did not finish my message. So it was set with quiet hours and everything seemed to work okay,

I disabled quiet hours yesterday. Today I noticed that it was not logging mute on/off upon locking/unlocking though I forgot to test if it was actually muting before I restarted the executable. If I manually muted in the menu it did log that, just wasnt logging upon locking/unlocking. Thought that was weird. After restarting the executable, things were working again.

I'm continuing to test without quiet hours enabled to see if this works automatically, consistently.

[image: image.png]

Thanks,

Byron S

On Tue, Apr 6, 2021 at 4:54 PM Byron Levy @.***> wrote:

So I have noticed one bug so far. First few days I had "quiet hours" set, everything else checked.

On Sat, Apr 3, 2021 at 10:36 AM Byron Levy @.***> wrote:

Hehe, I know this sponsor well.

Thanks,

Byron S

On Sat, Apr 3, 2021 at 7:44 AM Alexander Steinhöfer < @.***> wrote:

Ah yes... this bug was sponsored by copy-and-paste-errors.

Here is a new build: WinMute_1.6.1_WithLog2.zip https://github.com/lx-s/WinMute/files/6252492/WinMute_1.6.1_WithLog2.zip

Thanks :)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lx-s/WinMute/issues/4#issuecomment-812853936, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKUGGIWSJMXXGXKIFBE44TLTG35QTANCNFSM4THX7I5A .

lx-s commented 3 years ago

The image didn't work unfortunately.

But your text does :) I have an idea what might be the problem:

When more than one mute event happens within/interleaved with one another it's hard to keep track of the "state-stack" and if I should unmute or not (e.g. quiet-hours->screensaver-starts->screensaver-stops->workstation gets locked->quiet hours end->workstation gets unlocked). I guess that logik gets confused during some event combinations.

I will rethink my approach how to handle this more straightforward and hopefully less bug prone.

blarg3891 commented 3 years ago

Awesome. My plan is to leave quiet mode disabled anyway since my computer locks automatically after 15 minutes. So far I have not had any issues arise in this release and in this state. I have it set on my wife's computer as well and things seem to be working pretty well thus far.

You accept donations?

Thanks,

Byron S

On Tue, Apr 13, 2021 at 1:16 PM Alexander Steinhöfer < @.***> wrote:

The image didn't work unfortunately.

But your text does :) I have an idea what might be the problem:

When more than one mute event happens within/interleaved with one another it's hard to keep track of the "state-stack" and if I should unmute or not (e.g. quiet-hours->screensaver-starts->screensaver-stops->workstation gets locked->quiet hours end->workstation gets unlocked). I guess that logik gets confused during some event combinations.

I will rethink my approach how to handle this more straightforward and hopefully less bug prone.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lx-s/WinMute/issues/4#issuecomment-818905454, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKUGGIV2PX4B7RZ4N3Q4WBDTIR37PANCNFSM4THX7I5A .

lx-s commented 3 years ago

You accept donations?

Uh. Wow :) I feel really honored.

I have to check what that would mean for my taxes, as the Germany government tends to make such things more troublesome than it's worth most of the time, but I think it would work. I'll get back to you on that.

Even if it doesn't pan out: Your offer alone is greatly appreciated!

blarg3891 commented 3 years ago

Sure. I like to give back for things that I use and nice people that support them.

Byron S

On Fri, Apr 16, 2021 at 7:12 AM Alexander Steinhöfer < @.***> wrote:

You accept donations?

Uh. Wow :) I feel really honored.

I have to check what that would mean for my taxes, as the Germany government tends to make such things more troublesome than it's worth most of the time, but I think it would work. I'll get back to you on that.

Even if it doesn't pan out: Your offer alone is greatly appreciated!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lx-s/WinMute/issues/4#issuecomment-821102424, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKUGGIUFXVS5MQLYUYC3WQTTJALRBANCNFSM4THX7I5A .

blarg3891 commented 3 years ago

Okay so it finally happened. Yesterday at 11:23pm was the last time that winmute would automatically manage muting. When I woke up i heard noises and verified that my computer was indeed locked. I tested manual mute from within program which worked as you can see in this log. My guess is that if I restart the application it will again work. Based on the log dates, I believe that everything has been working as expected since 4/06. I do not restart my computer very often but I did restart yesterday midday. I have your application in the startup folder and it did start automatically and was working throughout the day. The real question is what happened after 11:23 that caused winmute to bork.

A note, I do not have quiet time enabled, relying solely on lock unlock of machine. Please let me know if you would like me to test anything else in this state.

[2021-04-16 12:20:45] Mute: On | Workstation Lock [2021-04-16 13:27:15] Mute: Off | Workstation Unlock [2021-04-16 14:03:17] Mute: On | Workstation Lock [2021-04-17 10:43:47] Mute: Off | Workstation Unlock [2021-04-17 11:03:44] Mute: On | Workstation Lock [2021-04-17 18:45:54] Mute: Off | Workstation Unlock [2021-04-17 22:08:46] Mute: On | Workstation Lock [2021-04-18 07:47:01] Mute: Off | Workstation Unlock [2021-04-18 09:53:06] Mute: On | Workstation Lock [2021-04-18 11:23:18] Mute: Off | Workstation Unlock [2021-04-19 08:19:07] Mute: On | Manual per Menu [2021-04-19 08:19:22] Mute: Off | Manual per Menu

Thanks!

Byron S

On Fri, Apr 16, 2021 at 7:49 AM Byron Levy @.***> wrote:

Sure. I like to give back for things that I use and nice people that support them.

Byron S

On Fri, Apr 16, 2021 at 7:12 AM Alexander Steinhöfer < @.***> wrote:

You accept donations?

Uh. Wow :) I feel really honored.

I have to check what that would mean for my taxes, as the Germany government tends to make such things more troublesome than it's worth most of the time, but I think it would work. I'll get back to you on that.

Even if it doesn't pan out: Your offer alone is greatly appreciated!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lx-s/WinMute/issues/4#issuecomment-821102424, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKUGGIUFXVS5MQLYUYC3WQTTJALRBANCNFSM4THX7I5A .

blarg3891 commented 3 years ago

Found another possible bug, not sure how it can be fixed though. I rdp'ed into my computer and the task manager icon disappeared after logging in locally again even though winmute process was still running. At this point the volume remained muted and did not unmute. I had to restart winmute to resolve the issue.

I have tested this a few times and its always this way.

Byron S

On Mon, Apr 19, 2021 at 8:29 AM Byron Levy @.***> wrote:

Okay so it finally happened. Yesterday at 11:23pm was the last time that winmute would automatically manage muting. When I woke up i heard noises and verified that my computer was indeed locked. I tested manual mute from within program which worked as you can see in this log. My guess is that if I restart the application it will again work. Based on the log dates, I believe that everything has been working as expected since 4/06. I do not restart my computer very often but I did restart yesterday midday. I have your application in the startup folder and it did start automatically and was working throughout the day. The real question is what happened after 11:23 that caused winmute to bork.

A note, I do not have quiet time enabled, relying solely on lock unlock of machine. Please let me know if you would like me to test anything else in this state.

[2021-04-16 12:20:45] Mute: On | Workstation Lock [2021-04-16 13:27:15] Mute: Off | Workstation Unlock [2021-04-16 14:03:17] Mute: On | Workstation Lock [2021-04-17 10:43:47] Mute: Off | Workstation Unlock [2021-04-17 11:03:44] Mute: On | Workstation Lock [2021-04-17 18:45:54] Mute: Off | Workstation Unlock [2021-04-17 22:08:46] Mute: On | Workstation Lock [2021-04-18 07:47:01] Mute: Off | Workstation Unlock [2021-04-18 09:53:06] Mute: On | Workstation Lock [2021-04-18 11:23:18] Mute: Off | Workstation Unlock [2021-04-19 08:19:07] Mute: On | Manual per Menu [2021-04-19 08:19:22] Mute: Off | Manual per Menu

Thanks!

Byron S

On Fri, Apr 16, 2021 at 7:49 AM Byron Levy @.***> wrote:

Sure. I like to give back for things that I use and nice people that support them.

Byron S

On Fri, Apr 16, 2021 at 7:12 AM Alexander Steinhöfer < @.***> wrote:

You accept donations?

Uh. Wow :) I feel really honored.

I have to check what that would mean for my taxes, as the Germany government tends to make such things more troublesome than it's worth most of the time, but I think it would work. I'll get back to you on that.

Even if it doesn't pan out: Your offer alone is greatly appreciated!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lx-s/WinMute/issues/4#issuecomment-821102424, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKUGGIUFXVS5MQLYUYC3WQTTJALRBANCNFSM4THX7I5A .

lx-s commented 2 years ago

Hopefully all this timing related problems are now fixed with the 1.9-pre-release: https://github.com/lx-s/WinMute/releases :)

lx-s commented 2 years ago

Closing this issue. Just reopen if this still happens with 2.0!