GoXLR-on-Linux / goxlr-utility

An unofficial GoXLR App replacement for Linux, Windows and MacOS
MIT License
635 stars 36 forks source link

Recover from Computer Standby #127

Closed PeterTaylorTX closed 7 months ago

PeterTaylorTX commented 9 months ago

If the computer is placed in standby mode. When the computer wakes, the GoXLR is not connected to the app. You can reactivate the device by manually opening the software and changing the profile (Selecting the current profile also works)

It would be good if it could auto-reactivate the last active profile when resuming from OS standby mode *Tested with Windows 11

FrostyCoolSlug commented 9 months ago

Could you let me know what version you are running and provide a log file please? (Should be able to right click on the tray, open path, logs).

FrostyCoolSlug commented 9 months ago

Also, just to make a quick assumption here, are you running a GoXLR Mini, and is it being powered off when your PC goes into standby?

PeterTaylorTX commented 9 months ago

Yes it does indeed power down when the PC enters standby

Hardware: GoXLR Mini Software v0.12.6

Logs goxlr-daemon.log

FrostyCoolSlug commented 9 months ago

Thanks,

This is a tricky one, from Windows perspective (and the perspective of the util), there's no indication the device has been powered off during standby, along with no way to ask the hardware about its configured state, everything simply comes back as if it wasn't changed.

For the full sized device, or a devices plugged into a port that's powered while the computer is off, this obviously isn't a problem, but for others it is. I'll do some testing of the official app to see how it behaves in this scenario (although I believe it errors), but I'm not sure this is an easy fix.

PeterTaylorTX commented 9 months ago

The official app had the same issue, however with the official app the only way I found to correct it was to fully close the app and reopen it. This app can recover by changing profiles, so already significantly better

FrostyCoolSlug commented 8 months ago

I've been doing more testing on this, from what I can see the device handle does get dropped in the util, but standard error recovery kicks in (which is why you're able to reload the profile on wake, the handle is recovered).

The problem is, that there are many reasons why the handle can disappear temporarily, a small USB hiccup, and internal issue, etc. The recovery code is there to allow the utility to continue to function once these issues are resolved. Performing a device 'reset' when the handle is successfully recovered would be an overshot.

I have some more testing I can do, I can look into hooking a check into the Windows PnP handler, to see if it flags the device as 'disconnected' and 'reconnected', but this issue is, unfortunately, heavily leaning towards 'Can't Fix'.

PeterTaylorTX commented 8 months ago

Since a workaround is to open the app, right-click, refresh, and then double-click on a profile. this resets the system and recovers. Would it be possible to add a change profile option to the Windows Tray Icon Context Menu? This could solve the issue in a convenient way.

i.e. Right Click Icon > Profiles > "select profile"

FrostyCoolSlug commented 8 months ago

The tray menu is currently intentionally vague, because it needs to have cross platform support. Unfortunately I'm currently not sure how easy it is to add a 'dynamic' menu to any of the outputs (the menus are specifically generated at startup, it does raise some difficulties after data is loaded).

I did reach out to TC-Helicon to ask them whether the GoXLR has a command to determine the current state of the device, with the hopes that I can reload the latest profile state on an S3/S4 restore, but unfortunately their answer was a very clear 'no'.

PeterTaylorTX commented 8 months ago

No Worries, thank you for investigating the issue

FrostyCoolSlug commented 7 months ago

I'm going to reopen this, because I have an idea..

Windows sends an 'event' to apps to let them know it's come back from sleep, it might be possible to add an option into the util to essentially force a settings "reload" on wake, which would spark the GoXLR back to life in this scenario.

FrostyCoolSlug commented 7 months ago

Can you please grab the Windows artifact at the bottom of this build, install it, and in the UI go System -> Power Actions, there should be an option under 'Wake' to 'Reload Settings'. This should make the util restore the GoXLR settings when the PC wakes up.

Let me know whether it works, or if there are any problems :)

Thanks.

PeterTaylorTX commented 7 months ago

I've just given this a test and it works great. It successfully restores the profile and initialises the GoXLR after resuming from a sleep state

Thank You for looking into this.