GoXLR-on-Linux / goxlr-utility

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

Shutdown action can load a profile not only a color profile #65

Closed Dreamtrailtv closed 1 year ago

Dreamtrailtv commented 1 year ago

For me there would be a use case when I turn off my computer that my GoXLR then switches to a profile where I can continue to route the line in and console input to my line out via fader. e.g. for my TV.

The GoXLR routes audio when the computer is off, but I want it to automatically switch to the profile I set and then switch back to the last one I used the next time I boot the system.

FrostyCoolSlug commented 1 year ago

I'll definitely look into this, it's a little tricky though..

For context, the shutdown behaviours are essencially a list of API commands that are executed (in sequence) when an 'Exit' signal is received in the daemon.

When issuing a LoadProfile command, the name of the profile you're loading gets stored to the utilities config so that on startup, that profile name is retrieved and loaded as expected.

So the current behaviour, if you loaded a full profile on Shutdown, on startup it would reload that profile, and not the original one.

It might be possible to tweak the API commands, or add a new command which allows a startup 'override' profile, or not persist the name change on load, but I'll need to do some looking :)

FrostyCoolSlug commented 1 year ago

Did some hefty code tweaking, but this will be available in 0.12.0, the code was already written in such a way that I could choose not to write the profile change to the config, while still maintaining all functionality, so a little shuffling and tweaking as I was able to get it done. The UI now looks like this:

image

The 'Shutdown' profiles will be 'transiently' loaded without being persisted, so that when the util starts back up it'll load the original profiles.

The colour option is still there, in case you're in a position where you'd ALSO like for all the lights to turn off without the profile being effected.

If you're able to compile and test the current dev-0.12.0 branch, I'd appreciate it just so I know it's working as expected, otherwise it'll be released soonish :)

Dreamtrailtv commented 1 year ago

I have tested it, but the selected profile does not load correctly on Windows. I would like that when I shut down my pc for example the led lighting goes off and I can hear the tv sound on my speakers. (my tv is connected via optical)

FrostyCoolSlug commented 1 year ago

Could you please clarify on the 'not loads correctly' aspect? Which parts are loading correctly and which parts aren't? I'll need to double check, but I believe optical is an input and not an output.. Do you have two profiles when loaded independantly (without shutting down your PC) the behaviour is correct, but when exiting the util it doesn't correctly load the profile?

If the profiles work separately, could you please provide the specific profiles, so I can run some tests and work out why it's not functioning correctly.

It should be noted, that the utility for the most part can only achieve the same functionality as the official app, while we're able to provide things like APIs (and in a few cases, extra software based features) we're still ultimately limited to what the drivers, firmware and hardware can provide. If the offical app cannot route audio out through the optical cable, then neither can we, and unfortunately there's nothing we can do to fix that.

Thanks.

Dreamtrailtv commented 1 year ago

i used a profile in the official app that i loaded manually before shutdown it's routing the optical port to the line out output and it worked after powering off the pc. But I can't test it right now because of #76. The problem with loading the profiles on shutdown is that the colors, faders and settings don't change when I use the shutdown button in the web interface.

FrostyCoolSlug commented 1 year ago

Curious that it doesn't work if shutdown from the web interface, as a test, could you try shutting down from the tray icon?

Dreamtrailtv commented 1 year ago

I tried the update mentioned in #76 and then found that my profile did not work in the new version. After creating a new one, it now works via the button in the web interface and I also tested the tray menu which also works. But unfortunately after startup it does not load the previous profile but keeps the shutdown profile.

FrostyCoolSlug commented 1 year ago

Thanks, could you please send me the original profile, there's probably something loading incorrectly there which may be a bug in general that needs fixing.

FrostyCoolSlug commented 1 year ago

Correction on the goxlr-client --status-json command, please run dev-0.12.0 client, not the default installed one.

Dreamtrailtv commented 1 year ago

Thanks, could you please send me the original profile, there's probably something loading incorrectly there which may be a bug in general that needs fixing.

PC Off_old.goxlr.txt

Dreamtrailtv commented 1 year ago

Correction on the goxlr-client --status-json command, please run dev-0.12.0 client, not the default installed one.

status-json.txt

FrostyCoolSlug commented 1 year ago

Unfortunately, the profile is attached at as .txt file, which doesn't match the .goxlr format of the files.. From what I can tell it's a corrupt zip file, which might be what's causing the problems. Could you let me know the official app version that was used to format that file?

FrostyCoolSlug commented 1 year ago

Also, if you're running the 0.12.0 daemon, could you run it with --log-level debug mode while triggering the shutdown, I need to see where the phase 1 / 2 shutdown sections are processing. hopefully I'll be able to analyse why the shutdown profile being set active for startup.

Dreamtrailtv commented 1 year ago

Unfortunately, the profile is attached at as .txt file, which doesn't match the .goxlr format of the files.. From what I can tell it's a corrupt zip file, which might be what's causing the problems. Could you let me know the official app version that was used to format that file?

I just appended the .txt to the end of the filename because Github only allowed me this FileType. I created this profile in the GoXLR Utility Version 0.10.2.

Dreamtrailtv commented 1 year ago

Also, if you're running the 0.12.0 daemon, could you run it with --log-level debug mode while triggering the shutdown, I need to see where the phase 1 / 2 shutdown sections are processing. hopefully I'll be able to analyse why the shutdown profile being set active for startup.

Where can I find the log files in Windows?

FrostyCoolSlug commented 1 year ago

If you build the Daemon in debug mode (without --release), it'll launch in a console window and output the logs there (not ideal at the moment, it's being worked on),

You should be able to then run it in via a command prompt or in power shell and fetch the logs from there.

Dreamtrailtv commented 1 year ago

If you build the Daemon in debug mode (without --release), it'll launch in a console window and output the logs there (not ideal at the moment, it's being worked on),

You should be able to then run it in via a command prompt or in power shell and fetch the logs from there.

debuglog.txt

FrostyCoolSlug commented 1 year ago

I noticed the profiles are loading from your D: drive, have you reconfigured the util to find profiles in other directories?

FrostyCoolSlug commented 1 year ago

Also, could you provide the settings.json file, it should be in %AppData% (either local or roaming, can't remember which right now) GoXLR-Utility

Dreamtrailtv commented 1 year ago

settings.json.txt I just added .txt to upload

Dreamtrailtv commented 1 year ago

I noticed the profiles are loading from your D: drive, have you reconfigured the util to find profiles in other directories?

My folder for the GoXLR profiles is on D:, because I store them in OneDrive

FrostyCoolSlug commented 1 year ago

Thanks, I think I've found the issue, I've pushed 69f79893, could you give that a test please?

Dreamtrailtv commented 1 year ago

Thanks, I think I've found the issue, I've pushed 69f7989, could you give that a test please?

Works now. Thanks for that 😊

Dreamtrailtv commented 1 year ago

Thanks, I think I've found the issue, I've pushed 69f7989, could you give that a test please?

Works now. Thanks for that 😊