1 2 Previous Next 23 Replies Latest reply on Jun 30, 2020 1:30 PM by MiMenl

    Audio Volume control using UEM + set default other then 100%

    SummaCollege Enthusiast

      A few of our VDI users are complaining about UEM not saving there adjusted audio volume. I have not yet found a way to save this using UEM, is this even possible?

       

      Besides that, the same users are also complaining about the default volume level being set to 100% every morning (floating desktops). Does someone have any tips about changing this in our golden image?

        • 1. Re: Audio Volume control using UEM + set default other then 100%
          DEMdev Master
          VMware Employees

          Hi SummaCollege,

           

          These settings don't live in the registry or elsewhere in the user profile, at least not in a way that can be easily managed with UEM.

           

          What's been suggested on the forum and in some blog posts, is using some third-party tool that can save and restore sound settings to/from a file, and then use UEM to run that tool at logon and logoff, and also to persist and restore the tool's settings file.

           

          One such tool is http://www.nirsoft.net/utils/sound_volume_view.html, which supports /SaveProfile and /LoadProfile arguments. If you create a UEM logon task (be sure to keep it at the default After profile archive import setting) to run Your/Path/To/SoundVolumeView.exe /LoadProfile "%LOCALAPPDATA%\SoundProfile.spr", create a UEM logoff task (set to Before profile archive export) with ... /SaveProfile ..., and create a Flex config file with [IncludeFiles] <LocalAppData>\SoundProfile.spr, that should do the trick.

          • 2. Re: Audio Volume control using UEM + set default other then 100%
            SummaCollege Enthusiast

            Thx UEMdev!

             

            I tried this and your solution seems to work fine, but i am not allowed to use these kind of 3th party tools from our security officer and team manager. If it's not possible using oem vendor tools then that's a fact and we (and our users) have to deal with it. I don't necessarily agree with them but it's something i can't change (at least not yet )

            • 3. Re: Audio Volume control using UEM + set default other then 100%
              SummaCollege Enthusiast

              DEMdev

              Have found another (untested by me) possible solution at the following website: audio - Windows 10 registry setting for volume control - Super User

               

              It's a Powershell script that you can use as a loginscript.

              The last line is the only part you would need to edit to change volume levels.

              For example [audio]::Volume = 0.5 or [audio]::Volume = 0.75 for 50% or 75%, respectively.

              You can also mute or un-mute the speakers with [audio]::Mute = $true or [audio]::Mute = $false

              Save this as a .ps1 file and use Group Policy to set it as a login script.

               

              Add-Type -TypeDefinition @'

              using System.Runtime.InteropServices;
              [Guid("5CDF2C82-841E-4546-9722-0CF74078229A"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
              interface IAudioEndpointVolume {
                // f(), g(), ... are unused COM method slots. Define these if you care
                int f(); int g(); int h(); int i();
                int SetMasterVolumeLevelScalar(float fLevel, System.Guid pguidEventContext);
                int j();
                int GetMasterVolumeLevelScalar(out float pfLevel);
                int k(); int l(); int m(); int n();
                int SetMute([MarshalAs(UnmanagedType.Bool)] bool bMute, System.Guid pguidEventContext);
                int GetMute(out bool pbMute);
              }
              [Guid("D666063F-1587-4E43-81F1-B948E807363F"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
              interface IMMDevice {
                int Activate(ref System.Guid id, int clsCtx, int activationParams, out IAudioEndpointVolume aev);
              }
              [Guid("A95664D2-9614-4F35-A746-DE8DB63617E6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
              interface IMMDeviceEnumerator {
                int f(); // Unused
                int GetDefaultAudioEndpoint(int dataFlow, int role, out IMMDevice endpoint);
              }
              [ComImport, Guid("BCDE0395-E52F-467C-8E3D-C4579291692E")] class MMDeviceEnumeratorComObject { }
              public class Audio {
                static IAudioEndpointVolume Vol() {
                var enumerator = new MMDeviceEnumeratorComObject() as IMMDeviceEnumerator;
                IMMDevice dev = null;
                Marshal.ThrowExceptionForHR(enumerator.GetDefaultAudioEndpoint(/*eRender*/ 0, /*eMultimedia*/ 1, out dev));
                IAudioEndpointVolume epv = null;
                var epvid = typeof(IAudioEndpointVolume).GUID;
                Marshal.ThrowExceptionForHR(dev.Activate(ref epvid, /*CLSCTX_ALL*/ 23, 0, out epv));
                return epv;
                }
                public static float Volume {
                get {float v = -1; Marshal.ThrowExceptionForHR(Vol().GetMasterVolumeLevelScalar(out v)); return v;}
                set {Marshal.ThrowExceptionForHR(Vol().SetMasterVolumeLevelScalar(value, System.Guid.Empty));}
                }
                public static bool Mute {
                get { bool mute; Marshal.ThrowExceptionForHR(Vol().GetMute(out mute)); return mute; }
                set { Marshal.ThrowExceptionForHR(Vol().SetMute(value, System.Guid.Empty)); }
                }
              }

              '@

              [audio]::Volume = 0.25

              • 4. Re: Audio Volume control using UEM + set default other then 100%
                LukaszDziwisz Enthusiast

                I have noticed that if you RDP to your master image and set the volume to any desired level it will always revert back to 100 but if you Direct Connect to your image through Horizon Client it will retain whatever volume you set on your image and every new session/new clone will retain that level

                1 person found this helpful
                • 5. Re: Audio Volume control using UEM + set default other then 100%
                  FlowDE Novice

                  Hello DEMdev,

                   

                  it looks like the tool works fine but i can't choose a USB Mircrophone per default and also the Volume of those USB Device won't get saved whit the 3rd Party tool. Do you got a solution for externel Devices like Philips Speech Mike 3

                   

                  Greetings

                  Justin

                  • 6. Re: Audio Volume control using UEM + set default other then 100%
                    FlowDE Novice

                    Hello, everybody,

                     

                    no one has had the problem with the USB mike yet?

                     

                    Regards

                    Justin

                    • 7. Re: Audio Volume control using UEM + set default other then 100%
                      DEMdev Master
                      VMware Employees

                      Hi Justin,

                       

                      I just tried this with my USB headset, and it seems to work just fine:

                      1. I saved the current settings with SoundVolumeView.exe using the /SaveProfile argument.
                      2. I made note of the current volume, and then changed it.
                      3. Loaded the settings using the /LoadProfile argument, and validated that the volume was correctly restored to the value I saw in step #2.
                      • 8. Re: Audio Volume control using UEM + set default other then 100%
                        FlowDE Novice

                        Hi DEMdev,

                         

                        thank your for your reply.

                         

                        the configurations looks like:

                         

                        Logontask

                        C:\Windows\xxx\Sound\SoundVolumeView.exe /LoadProfile "%Appdata%\SoundProfile.spr"

                        Run task: After profile archive import (No Conditions)

                         

                        Logofftask

                        C:\Windows\xxx\Sound\SoundVolumeView.exe /SaveProfile "%Appdata%\SoundProfile.spr"

                        Run task: Before profile archive import (No Conditions)

                         

                        i prefer to save the exe maybe in the same location as the Soundprofile.spr because we got a large environment whit alot of vcenters.

                         

                        The Speechmike is via USB-Redirection available.

                         

                        I just tested the settings again.

                        For the VMware Virtual Audio DevTap the volume is saved, also it remains selected as default device.(It looks like there are problems with the USB redirection.)

                         

                         

                        For the Speechmike the volume is not saved, also the audio in device of the Speechmike is not set as default.

                        • 9. Re: Audio Volume control using UEM + set default other then 100%
                          DEMdev Master
                          VMware Employees

                          Hi FlowDE,

                           

                          Just to make sure: in addition to those logon and logoff tasks, you have also created a Flex config file to capture that "%Appdata%\SoundProfile.spr" file, right?

                          • 10. Re: Audio Volume control using UEM + set default other then 100%
                            FlowDE Novice

                            Hello UEMdev,

                             

                             

                            no i didn't make any exceptions in the Flexconfig file, because the file is saved in Appdata Roaming, the profiles are saved. The file also changes the timestamp and the volume is saved as described for the VMware Virtual Audio Dev TAP device.

                             

                             

                            Therefore i dont need to change  that, right?

                             

                            Greetings

                            Justin

                            • 11. Re: Audio Volume control using UEM + set default other then 100%
                              DEMdev Master
                              VMware Employees

                              Hi Justin,

                               

                              Depending on your setup, files in AppData\Roaming might be persisted via other mechanisms than DEM/UEM, of course. I didn't previously pick up on the fact that the volume for another device was kept correctly, sorry.

                               

                              I'm wondering whether USB redirection might be playing a role in this. Not based on any experience, so...

                               

                              Is the volume of your USB device restored correctly if you manually run that C:\Windows\xxx\Sound\SoundVolumeView.exe /LoadProfile "%Appdata%\SoundProfile.spr" command after the user has logged on?

                              If you compare the output of two "%Appdata%\SoundProfile.spr" files from two different sessions, do they look the same? Or could it be the case that the USB device maybe gets a different ID in subsequent sessions, so the settings don't match up? Again, just guessing here...

                              • 12. Re: Audio Volume control using UEM + set default other then 100%
                                FlowDE Novice

                                Hello, Demdev,

                                 

                                thanks for your feedback. I could have thought of that myself, when manually loading / saving the profile the settings are loaded correctly. And also you are right that the Item-ID of the USB device changes.

                                 

                                Is there a solution for this?

                                 

                                 

                                Greeting

                                Justin

                                • 13. Re: Audio Volume control using UEM + set default other then 100%
                                  DEMdev Master
                                  VMware Employees

                                  Hi Justin,

                                   

                                  Happy to hear that we seem to be making progress!

                                   

                                  If manually loading the settings works correctly, I guess that the changes in USB device IDs don't really matter.

                                   

                                  I'd suggest to try changing your logon task to a shortcut in Explorer's Startup folder:


                                  Make sure not to check the Run asynchronously check box.

                                  • 14. Re: Audio Volume control using UEM + set default other then 100%
                                    FlowDE Novice

                                    Hello, Demdev,

                                     

                                    I'm sorry, maybe I didn't say it right.

                                    Saving / loading in the same session works, but as soon as a new machine is available (instant clone technology) manual loading does not work anymore because the ID of the USB device has changed. Thats just my assumption.

                                     

                                     

                                    Regards

                                    Justin

                                    1 2 Previous Next