Audio Switcher - easily change audio device via context menu (using remote key) (2 Viewers)

Rick164

MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Eventghost message plugin has its own HID config section I believe, in its own plugin configuration you have to override the button you want to map (same as in one of the steps):

    upload_2014-5-25_16-8-8-png.151019
     
    Last edited:

    Virtual

    Portal Member
    January 6, 2017
    22
    12
    46
    Home Country
    Italy Italy
    Hi.

    I have installed MP v1.16 on a new PC with W10 x64 and I found your great plugin so I tried it.
    It works well except one thing ... when I switch audio to another device, I lost the volume functionality ... the volume OSD appears but it doesn't work anymore (the same occurs to the GUI sound but I can use MP without it ... but the volume control is important for me).
    If I switch back to the original audio device (the default device when I loaded MP), the GUI sound and the volume return to work correctly.

    Can you help me? I miss something in the config or the plugin doesn't re-initialize GUI sound / volume control?

    I tried to config the volume as wave or master volume but it make no difference.

    Thanks in advance.
    Andrea
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Hi,

    Volume control not showing up is a weird one, in code we only switch the device externally (via AudioSwitcher library) and change nothing in Mediaportal itself.
    It might be a bug in Mediaportal which doesn't allow for live switching for the OSD hook, if you post logs will take a look :)

    @Sebastiii any ideas on how we hook the OSD right now and if that can affect if the users does switch to a new primary audio device?
     
    Last edited:

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    Hi :)

    MP count audio device up and down but the init is done on MP start so it can be related to this if i'm not wrong, we maybe change MP code to handle such (not sure how too lol).
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Thanks, added these lines to code right after changing of device for testing:

    Code:
    VolumeHandler.Dispose();
    VolumeHandler.CreateInstance();

    But that doesn't seem to help, best guess would be audio devices connected doesn't update on its own:

    https://github.com/MediaPortal/Medi...cfc8/mediaportal/Core/Player/VolumeHandler.cs

    // Update

    Remains working here with public release even when switching back and forth audio devices, makes me think it's that hide volume OSD toggle we have in settings.

    @Virtual

    Could you re-test with the following settings:

    osd.PNG


    osd_2.PNG
     
    Last edited:

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Can replicate the problem with volume OSD, the moment we call the used library in a particular way the OSD stops working however only as a plugin.
    When I do the same externally via their app it keeps working, need to test is some more and will push new version hopefully today.

    @Virtual

    Attached early test build, it will delay loading AudioSwitcher's initial startup by 15s to no conflict with Mediaportal as that looks like the cause.
    What worked without issues here:

    - Switch from HDMI -> Headset
    - Switch from Realtek analog -> HDMI

    Will make the startup delay configure-able but if you could confirm this fixes it (with previously posted settings) will push new release out afterwards.
     

    Attachments

    • AudioSwitcher_1.1.3.6.mpe1
      150.8 KB
    Last edited:

    Virtual

    Portal Member
    January 6, 2017
    22
    12
    46
    Home Country
    Italy Italy
    Hi.

    This is my settings for the test:

    1 - start playing a video
    2 - change the audio device
    3 - change the volume (the OSD appares on the screen but the volume don't change)

    External test from the log ... if I change the audio device, the MP volume remains attached to the original device because if I press up / down from the remote I can see the volume (on the windows 10 playback device window) that follow the MP volume.

    Now I will try your attached file
     

    Attachments

    • Untitled.png
      Untitled.png
      40.1 KB
    • Untitled2.png
      Untitled2.png
      36.4 KB

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    Looks like we need to set log level a bit higher as I'm seeing no AudioSwitcher entries.
    Btw does the problem only occur if you switch while a video is playing?

    As I just tested while playing as well (hdmi <--> analog set) and kept working :)

    log_level.PNG
     
    Last edited:

    Virtual

    Portal Member
    January 6, 2017
    22
    12
    46
    Home Country
    Italy Italy
    Hi
    With the new release the volume control doesn't work anymore ... I can ear the GUI sound when I press up / down but the volume level doesn't change (and the OSD don't show up on the screen).
    This happen in the GUI or when I watch a movie ...
    I can change the audio device but the volume doesn't work.

    PS. I attach the only mediaportal.log ... previously I used the watchdog functionality to create the log files.
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    That's odd, can't see any errors which makes me wonder what is the cause.
    The volume handler is spawning so that works, since we don't touch that from plugin it must be something else then.

    Could you try with different skin perhaps in case it's something specific to that (tested with StreamedMP here), also would need log level set to debug as otherwise we get no AudioSwitcher log entries :)
     

    Users who are viewing this thread

    Top Bottom