New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Application volume is always set to 100 (for Flyleaf and all other windows applications started when Flyleaf running) #54
Comments
Well nice catch, thanks! Fixed it based on the process id which is more accurate solution. Thanks! (By the way by default the application session volume will start from the previous state) |
Seems to work like a charm now, thanks for the quick fix! Is there going to be a release with this fix in it? If so, I can urge the other repo to update to the latest to include the fix :) |
As this is not urgent I will postpone it on v3.2 which will have a lot of changes. |
Describe the bug
Originally found in Race Control( robvdpol/RaceControl#195 and robvdpol/RaceControl#196), traced back to Flyleaf.
This bug has two sides to it.
With Windows Volume Mixer you can set the volume level for each individual application.
Problem 1:
When you set Flyleaf's volume in the mixer to something and reopen Flyleaf, the volume is always set back to 100.
Problem 2:
When Flyleaf is open the above problem also occurs for every other application you open which uses the same sound source.
This only happens to applications which get start after Flyleaf was started, so applications which were already running do not get reset.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The expected behaviour is that the default behaviour for set volumes for the different application in the volume mixer do not get affected by Flyleaf.
Screenshots
Start situation:
After reproduction:
Additional context
Upon investigation in the code the problems occurs in AudioMaster.cs in the OnSessionCreated delegate:
Flyleaf/FlyleafLib/AudioMaster.cs
Lines 115 to 123 in 5981a5b
Here the volume will always be set to 1 (100);
Flyleaf/FlyleafLib/AudioMaster.cs
Line 120 in 5981a5b
Once Flyleaf is running every new audio session will be caught by NAudio. This causes problem 2.
You can test this by setting a breakpoint in the above function and starting a any new application (which uses audio) while it is debugging.
I feel like it is not necessary to set the volume here since the default volume for windows applications will be set to 100 anyway.
A different way to fix this is to not handle the audio events which are not coming from Flyleaf (or applications which implement Flyleaf), but I think not setting the volume to 1 is way simpler for now.
The text was updated successfully, but these errors were encountered: