Melvin-Abraham / Google-Assistant-Unofficial-Desktop-Client

A cross-platform unofficial Google Assistant Client for Desktop (powered by Google Assistant SDK)
Apache License 2.0
3.6k stars 401 forks source link

Prevents System Sleep #249

Closed mdrichardson closed 3 years ago

mdrichardson commented 3 years ago

Describe the bug

When running, even when not "active", Google Assistant prevents the system from sleeping.

To Reproduce Steps to reproduce the behavior:

  1. Run Google Assistant
  2. After any amount of time, with Google Assistant minimized to tray, open Powershell and run powercfg.exe -requests

You will likely see:

image

An audio stream is currently in use

  1. Quit Google Assistant
  2. Open Powershell and run powercfg.exe -requests

You'll see that the audio stream is no longer in use:

image

Expected behavior

The audio stream should only be active while Google Assistant is shown. If using a "Listen for 'Hey Google'" type of feature (which I don't see exists?), it should not prevent computer from sleeping.

Desktop (please complete the following information):

Additional context

I searched to see if there were any issues or PRs related to this and didn't see any. If this has been fixed, please let me know and I'll build from source and report back.

Notes

None of the settings in the current build seem to affect the output of powercfg.exe -requests. I tried disabling all the audio/mic options and ran into the same issues.

I've also tried using variations of powercfg -REQUESTSOVERRIDE DRIVER "USB\VID_046D&PID_082D&MI_02\8&82b3bcc&0&0002" SYSTEM DISPLAY AWAYMODE as a workaround, but that hasn't seem to have helped.

im-coder-lg commented 3 years ago

Well, it happened for me too, and it is due to GAUDC running. Why not try opening the settings menu and toggle off the "Always Close to tray" button? It closes GAUDC and the mic thing doesn't run. The only downfall is that you always got to click the shortcut or the taskbar icon to run it.

im-coder-lg commented 3 years ago

And your command:powercfg -REQUESTSOVERRIDE DRIVER "USB\VID_046D&PID_082D&MI_02\8&82b3bcc&0&0002" SYSTEM DISPLAY AWAYMODE can not run because Assistant's SDK needs mic on forever but it doesn't store your voice, et Cetra, in fact, it doesn't listen to them too.

im-coder-lg commented 3 years ago

If the problem is solved, you can close the issue

mdrichardson commented 3 years ago

Why not try opening the settings menu and toggle off the "Always Close to tray" button?

Ideally, I can always use only the hotkey to enable GAUDC to listen. Disabling closing to tray means that I have to re-open the app and then use the hotkey.

And your command...can not run

Oh yeah, I figured that was why. The real issue is that GAUDC really shouldn't need the mic on if/when it isn't listening, which would be pretty much any time it's minimized to the tray.

If/when the "Hey Google" listening is implemented, it would be great if there were an option to always listen, but still allow the computer to sleep. Or at least a way to disable the "Hey Google" listening so that the computer can sleep.

im-coder-lg commented 3 years ago

Well, I am also experiencing this and all of us must wait for the next release or code update, until then we got to wait

im-coder-lg commented 3 years ago

And if you try the npm version too, first it won't show but afterwards it is. We need to wait for a new release

Melvin-Abraham commented 3 years ago

@mdrichardson @coder-lg Duplicate of #30

This issue has already been reported and has been fixed. For bug details, refer https://github.com/Melvin-Abraham/Google-Assistant-Unofficial-Desktop-Client/issues/30#issuecomment-718846607

The fix will be available in the next release of this app. Till then if you want to test it, you can clone this repo and run it locally (see How to build?).

Melvin-Abraham commented 3 years ago

Closing as resolved

im-coder-lg commented 3 years ago

@Melvin-Abraham I cloned it locally, on my PC and started it. First, it doesn't show the mic usage in Powershell and at first it didn't show but afterwards, it did. I will try again and check it.

mdrichardson commented 3 years ago

Just wanted to confirm that this is, indeed, fixed if you build from the repo.

Note: After sending GAUDC back to the system tray, it seems to hold onto the mic for 20-30 seconds. After which, powercfg.exe -requests shows that it is no longer in use. Totally fine by me.

im-coder-lg commented 3 years ago

Will try.

im-coder-lg commented 3 years ago

Thanks!:)

im-coder-lg commented 3 years ago

It worked, like after 30 seconds, it was not showing in powercfg. Thanks a lot!