Volume control in kiosk mode

Cosma Tassinari 1 Reputation point
2020-12-29T09:27:44.79+00:00

I'm setting up a medical device based on Windows 10 Enterprise LTSC, version 1809, OS build 17763.107

It's set in Kiosk mode, so that when Windows starts it automatically launches a custom win32 software.
Now, in this software we would like to control the audio volume, the programmer tried a couple of different approaches, but none of them seems to work.

I noticed that even if I try to regulate the volume with the buttons on the physical keyboard (which in normal use wouldn't be connected to the machine) it doesn't change. I can ear the sounds, but I'm unable to control the volume

When I run explorer.exe, and the shell pops up, the volume starts to work, both with physical buttons and inside the sw.

So it seems to me that without the default shell Windows 10 is unable to control the volume.

How can I solve this?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,560 questions
{count} votes

5 answers

Sort by: Most helpful
  1. Sean Liming 4,506 Reputation points
    2021-01-06T15:50:43+00:00

    Assigned access has some issues. one of which is the lack of printing support. It appears you have found others. The fact that the application is running above the lock screen and not fully logged into the account means there is limited access to some items. I recommend traying Shell Launcher to launch the application as the shell rather than using assigned access.

    1 person found this answer helpful.
    0 comments No comments

  2. Sean Liming 4,506 Reputation points
    2020-12-29T17:22:04.017+00:00

    Below is a PowerShell script I found and used to set the audio volume without the volume interface. Maybe this might provide some ideas:

    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.5
    
    0 comments No comments

  3. AliceYang-MSFT 2,081 Reputation points
    2020-12-30T09:02:25.557+00:00

    Hi,

    Thank you for the detailed information you provided and solutions you attempted.

    I think we need do more to narrow down the root cause.

    • Switch out of the kiosk mode and run the custom win32 app on the device to check volume control function
      1. If works, we can say kiosk mode is the culprit. But I tested on my Windows 10 Enterprise, version 2004. I can control volume in Kiosk mode with physical keyboard, so I suppose kiosk mode isn’t the reason why volume control fails.
      2. If fails, something might be wrong with the device or the custom win32 app.
    • Run another app on the device and check whether volume control works
      1. If works, the custom win32 app needs to be changed to enable volume control
      2. If fails, the device might doesn’t support volume control. We can contact the manufacturer for assistance.

    Please note that Kiosk mode only supports specific apps. It might be difficult to let your custom app work fine in this mode.


    If the Answer is helpful, please click "Accept Answer" and upvote it. Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  4. AliceYang-MSFT 2,081 Reputation points
    2021-01-05T09:43:23.613+00:00

    Hi,

    It seems that there is something wrong between the custom software and kiosk mode.

    I'm not sure whether it could solve the problem. But if the programmer could create a hotkey to control volume in the software, it might be possible to control the volume through keyboard when the software runs on the machine. After the volume is OK, disconnect the keyboard from the machine.

    Sorry again that I couldn't provide a solution for this issue. You may want to contact Microsoft Support for business for help.

    Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.

    ----------

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  5. Cosma Tassinari 1 Reputation point
    2021-01-06T07:47:44.243+00:00

    Thank you for trying to help, but again, it's not the software, because when in kiosk mode, neither the physical volume keys on the keyboard work...

    0 comments No comments