[MP1-4838] Volume control no longer functions properly when changing audio device (2 Viewers)

Rick164

MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Added small tweaks for some of NAudio's shortcomings but is finally ready for review and testing in 1.17 :)
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Btw for 1.17 we can also remove the "Hide Windows Volume OSD" setting as that is no longer needed, kept it in but it really does nothing now as like before with AudioSwitcher the new library (NAudio) will not trigger that OSD.
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I have pushed the branch in MP1 repo along with NSIS and postbuild change :p
    Yep we could remove that option is not neede anymore (hide volume) :)
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Here for quick testing part before going back to work :p

    1- OSD is not working/displayed when no playback is running (so staying on GUI from MyVideo for ex)
    2- OSD didn't react when i change the Volume directly from windows speaker icon.
    3- OSD with + and - when something is played (sample AVI)

    This is a quick test so maybe i need to setup some option :p

    Edit : after an MP restart volume OSD works (+ and - and mute) but i can see only the mute OSD (on or off) if i just use - or + otherwise the volume mute off or on but no OSD displayed lol.

    upload_2017-1-11_13-39-31.png
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    1- OSD is not working/displayed when no playback is running (so staying on GUI from MyVideo for ex)

    That's odd, it should pick the default device on startup and return it when not playing, will test here in VM :)

    2- OSD didn't react when i change the Volume directly from windows speaker icon.

    Yeah that's normal behavior atm, Mediaportal is leading and used as dedicated volume control (overrules external)
    AudioSwitcher had some options for that and NAudio as well with event based changes (albiet a bit more obscure), could add that with some extra code but needs checks so we don't set volume double then :):

    That change basically:
    http://stackoverflow.com/a/31972775

    If volume change is from device used in Mediaportal it will trigger the Mediaportal OSD that way.

    Edit : after an MP restart volume OSD works (+ and - and mute) but i can see only the mute OSD (on or off) if i just use - or + otherwise the volume mute off or on but no OSD displayed lol.

    Could be device related but tested that part with Realtek and HDMI sources, does it show any volume change in windows sys tray?

    // Update

    Added external volume monitoring as well which will listen on the device Mediaportal started with or when it switches during playback events:

    https://github.com/RickDB/MediaPortal-1/commit/f25e95407585b841c2b4450927c2e75365e29252
     
    Last edited:

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    I was thinking before when moving volume MP react to it but maybe i'm wrong :p
    But if you can add this, it would be nice ofc :)

    Could be device related but tested that part with Realtek and HDMI sources, does it show any volume change in windows sys tray?

    // Update

    Added external volume monitoring as well which will listens on the device Mediaportal started with or when it switches during playback events:

    https://github.com/RickDB/MediaPortal-1/commit/f25e95407585b841c2b4450927c2e75365e29252

    Yes it react :) only OSD is not updated until i press + or - but i will retry when at home :p
    And thanks for adding it.

    Did you rebase your local branch against MP1 repo (if yes or no) can you add the commit about NSIS into yours ?
    Thanks again.
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Not re-based yet but only mixer.cs changes so should be clean merge :)
    Testing some things now and seeing a possible lock from the objects it had from the old code, will see if that is causing it.

    // Update

    Object lock seems to be obsolete now so removed that and pushed:

    https://github.com/RickDB/MediaPortal-1/commit/a71855cf69a112e4081aa916ea75377fc11bb18c

    For + and - not working it might be a device mismatch, once you're home we can test further on IRC with some added debug logging.
    During startup it will report the device used for volume control (default device):

    Code:
    [2017-01-11 15:31:57,737] [Log    ] [MPMain   ] [INFO ] - Mixer: default audio device: DENON-AVRHD-0 (NVIDIA High Definition Audio
    )


    I was thinking before when moving volume MP react to it but maybe i'm wrong :p

    Yeah not sure, never really used the volume handling of Mediaportal (all bitstreamed) but my brother does so will force him to be a tester :p

    Also just fixed a typo for mute (forgot to use value) :sleep: , for the brave few who want to test out latest build attached it.
     

    Attachments

    • Mediaportal_1_16_NAudio_003.zip
      1.7 MB
    Last edited:

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    That's better :)
    Only one issue is mute button i need to mute twice to have it muted or correctly displayed as muted on OSD :p

    Otherwise windows slider react correctly with OSD one on MP etc. :p
    Nice nice :)
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Yeah double mute should be fixed in latest commit, in rare cases can happen if you press it rapidly but might be NAudio issue (not sure yet) :)
     

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,948
    5,617
    France - IDF
    Home Country
    France France
    Hey, i have merged the branch, but yesterday morning,
    I have mp freeze when move windows audio slider. I have see an commit where can solve mp hang on this. I will update my setup

    Envoyé de mon P01MA en utilisant Tapatalk
     

    Users who are viewing this thread

    Top Bottom