dlprows / FocusVolumeControl

Stream Deck+ plugin for controlling the focused application's volume
MIT License
5 stars 1 forks source link

Locked in fallback #14

Open penguinairlines opened 1 month ago

penguinairlines commented 1 month ago

I'm not seeing a template for issues, and I was hoping to get a pointer to some logs, since I consider myself to be reasonably technical. Please let me know if I how I can help triage this issue.

I've seen some others with a similar issue, but it's hard to say if my issue is the same as theirs given the lack of description or responsiveness.

Configuration

OS Windows 10 22H2 19045.4894. Plugin Focused Application Volume v1.3.0. "Focused App Volume" dial function is configured with no title, a fallback for System Sounds, and 2 Overrides. I've also tried configuring a new dial function with no custom configuration, which presents the same issue.

Issue

The issue presents in the following symptoms:

Expected behavior

When I originally installed the function, it behaved as expected (which I very much appreciate! Many thanks to the maintainer for creating this plugin!):

penguinairlines commented 1 month ago

Honestly I'm thinking it's not the plugin, but something to do with the Stream Deck software. I just downloaded "Win Tools [BarRaider], App Volume Adjust, which has a "Current Focused Window" configuration giving me the exact same behavior.

Any idea how to solve issues with the core application? Or where to go to ask for help?

dlprows commented 1 month ago

if the plugin flashes red when you try to interact with it, that typically indicates an issue in the stream deck software that I can't do anything about.

It is also possible that it could be the app crashing, in which case the logs could maybe have information about why it crashed, but i basically have a try/catch statements around everything. so unfortunately it's probably something in elgato's side of things

the logs are at %appdata%\Elgato\StreamDeck\Plugins\com.dlprows.focusvolumecontrol.sdPlugin\pluginlog.log

penguinairlines commented 1 month ago

Thank you

This log is very noisy, generating almost 30 log events per minute, each with 5 lines. It's repeating something like this.

2024-10-02 14:20:59.6163|ERROR|FocusVolumeControl|1|Exception on Tick:
 System.NullReferenceException: Object reference not set to an instance of an object.
   at FocusVolumeControl.AudioHelpers.AudioHelper.FindSession(List`1 processes) in C:\sd\FocusVolumeControlPlugin\src\FocusVolumeControl\AudioHelpers\AudioHelper.cs:line 66
   at FocusVolumeControl.AudioHelpers.AudioHelper.GetActiveSession(FallbackBehavior fallbackBehavior) in C:\sd\FocusVolumeControlPlugin\src\FocusVolumeControl\AudioHelpers\AudioHelper.cs:line 134
   at FocusVolumeControl.DialAction.<OnTick>d__13.MoveNext() in C:\sd\FocusVolumeControlPlugin\src\FocusVolumeControl\DialAction.cs:line 186

It's not clear to me whether this falls into the plugin or Elgato (my instincts are still saying Elgato), but I'm curious if you can get a sense of what's going on based on this log snippet.

I'm not familiar with C:\sd\, is that some language-specific reference? I do not have a directory sd on filesystem C:\.

dlprows commented 1 month ago

c:\sd\ just happens to be where i have the code checked out on my computer. i've seen lots of times where stack traces use the symbols for the machine it was built on. i think its just a thing c# does

It looks like that area of the code is trying to iterate over the audio sessions for a particular output device, but it was unable to get the audio session enumerator. I don't really know what could cause that to happen.

I can try throwing some additional error handling on it so that if it fails to get the session enumerator for a particular device, it still tries the other devices. I'm not sure exactly what kind of effect that would have. If its unable to get the session enumerator for the audio device you're actually using, then basically everything the plugin does will fail. But if its just failing to get the session enumerator for an audio device that isn't actually being used, then it should be fine to ignore it.

dlprows commented 1 month ago

https://github.com/dlprows/FocusVolumeControl/releases/tag/v1.3.1_beta

this is a prerelease with the extra error handling that you could try

penguinairlines commented 1 month ago

Well... maybe that did something? Now both your plugin and BarRaider's App Volume Adjust are working (detecting Brave, Discord, etc.). I validated the version at 1.3.1

Wanting more of an A-B test, I uninstalled the plugin, and re-installed it from the elgato store, validated version 1.3.0, and see that I have the issue again. Immediately after, installed the 1.3.1 beta from executable, and it's working again.

I think you found the right spot!