Operating System Hide Windows volume OSD (1 Viewer)

Marcus Venturi

MP Donator
  • Premium Supporter
  • March 23, 2012
    614
    745
    56
    Home Country
    Germany Germany
    There is something wrong with the audio code itself.

    In VolumeHandler.cs the CreateInstance() medhod has the following statement:

    if (GUIGraphicsContext.DeviceAudioConnected > 0)
    {
    ...
    }

    The if-case is not entered, because GUIGraphicsContext.DeviceAudioConnected is 0 at that time.

    It is initialized later (at least on my PC).

    Therefore always the VolumeHandlerCustom is created, which is wrong, because I have selected the Vista/Win7 volume handler.

    In the base constructor of VolumeHandler there is the same comparision that prevents the

    VolumeOSD.HideOSD();

    from being called. If I jump there manually, the Volume OSD is hidden on my PC.

    @Sebastiii : Can you reproduce this behavior? Does this happen only on my PC?

    Looks like the Scale setting in the configuration is irrelevant, always the custom volume handler is taken.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Argh, the code seems to be very messy. I don't like code like this. :(

    @Sebastiii
    Why do we have the "if (GUIGraphicsContext.DeviceAudioConnected > 0)" checks?
    Is it to avoid initialising/using the "_mixer" object, or...?

    Why is the code sometimes checking whether the volume is 19660500 instead of checking DeviceAudioConnected?
    https://github.com/MediaPortal/Medi...l/Core/DShowNET/Helper/DirectShowUtil.cs#L945

    In general it seems like the Mixer and MasterVolumeHandler classes were designed to handle the situation when no audio end-point is available, so I don't understand why the "wrapping checks" - "if (...)" - are needed.

    <sigh>
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    That's why i try to put review in Jira lol but not so much dev look into it :p :) (i know that it's not easy) and my coding style is not really nice :)
    About the 19660500, it's a workaround and i remember needed it but i can't remember why exactly. But if you can help us on this, it could be really nice.
    Thanks in advance.
     

    Marcus Venturi

    MP Donator
  • Premium Supporter
  • March 23, 2012
    614
    745
    56
    Home Country
    Germany Germany
    OK, I debugged the code and found the reason for the error.

    If fails, because at the the begin of MediaPortal.OnStartup() the ProcessPlugins are loaded and started.

    In my case the start code of the UPnP renderer plugin has an access to the VolumeHandler to get the current volume.
    Therefore an instance of the VolumeHandler is created long before the audio devices are registered in the OnStartup().

    This leads to an incorrect initialization of the VolumeHandler as DeviceAudioConnected is zero at that time..

    A quick solution could be to load the plugins after init of the audio devices.

    @mm1352000 , @Sebastiii : What do you think?
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I think it could be ok but i'm not sure, i'm just trying to debug it and DeviceAudioConnected was '24' on my side, so i didn't trigger the value of '0' but i didn't test a lot too lol
     

    Marcus Venturi

    MP Donator
  • Premium Supporter
  • March 23, 2012
    614
    745
    56
    Home Country
    Germany Germany
    Just install the UPnP renderer plugin, then you should be able to reproduce the problem...[DOUBLEPOST=1452706493][/DOUBLEPOST]To be able to go on I disabled the UPnP renderer for the moment.

    @regeszter : I have built the code from your branch and the volume OSD is hidden. For me your code works on Windows 10 Pro. Can you explain me in detail what goes wrong?
     
    Last edited:

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    So just need to move those 2 lines later in OnStartup()

    C#:
        PluginManager.LoadProcessPlugins();
        PluginManager.StartProcessPlugins();
     

    Users who are viewing this thread

    Top Bottom