Audio Switcher - easily change audio device via context menu (using remote key) (1 Viewer)

Virtual

Portal Member
January 6, 2017
22
12
42
Italy Italy
lI don't have 21 playback audio device ... only 5 (3 active - all are 2 channels devices, 2 disabled)!
upload_2017-1-6_17-21-36.png


I have tried with DefaultWide skin, it's the same ... if I change the audio device the movie play with the new device but the volume still attached with the old device ... I have tried with audio mp3 (bass player in the mp configuration) and the music still play on the old device too as the volume control!
Maybe this can help you to understand or reproduce the problem on your system ... I hope ...
 

Virtual

Portal Member
January 6, 2017
22
12
42
Italy Italy
In the v3 version ... do you leave the following lines of code to re-initialize the master volume (mixer) in MP? :)

  1. VolumeHandler.Dispose();
  2. VolumeHandler.CreateInstance();
 

Rick164

Super User
  • Team MediaPortal
  • Super User
  • January 7, 2006
    1,335
    1,005
    Netherlands Netherlands
    Country flag
    Removed those but will play around with a few things now :)
    Figure it can be a few things:

    - Mediaportal only attaches OSD and skin sounds once on startup to a single device (even if it changes)
    - Library crashing something in Mediaportal internally but trying to rule that out atm by using their app.

    For the 21 devices I'll forward that to AudioSwitcher library dev as that definitely looks odd.
     

    Virtual

    Portal Member
    January 6, 2017
    22
    12
    42
    Italy Italy
    If this can help ... in the v3 version the skin sound follow correctly the new audio device ... it's only the volume control that doesn't refresh with the new audio device ... if you want to re-add the 2 lines of code I can try the "v4" to see if it works in my htpc ... otherwise I will try your next version (i think that the workaround to set the same volume value to all devices can solve the "volume control problem" if the MP do not permit to change the audio device and re-attach the volume control). :)
     

    Rick164

    Super User
  • Team MediaPortal
  • Super User
  • January 7, 2006
    1,335
    1,005
    Netherlands Netherlands
    Country flag
    @Virtual Could you try the following:

    - Disable AudioSwitcher plugin in Mediaportal configuration completely.
    - Install AudioSwitcher app:

    http://audioswit.ch/download/latest

    - Start Mediaportal and make it windowed (alt+enter)
    - Check OSD + sound and make sure it works.
    - Now switch to other device from AudioSwitcher app
    - Check OSD + sound and should stop working
    - Revert back to one that worked

    So far I can confirm it's an error in the plugin as the app works fine (doesn't break OSD or volume control), not sure where the difference is as it should make the same kind of API calls.
    Gonna dig further and let you know :)

    However while it doesn't break the volume control like before it always sticks with the audio device Mediaportal started with like you noticed.
     
    Last edited:

    Rick164

    Super User
  • Team MediaPortal
  • Super User
  • January 7, 2006
    1,335
    1,005
    Netherlands Netherlands
    Country flag
    Ok added re-spawn of volume handler and for now and made it non-threaded as the combination of both definitely didn't play well, this means during audio device overview loading and setting the playback device the UI will shortly "hang" depending on how many devices you have.

    Make sure to set it to Master Volume in Mediaportal configuration, also disabled some startup things in plugin for testing purposes and if this solves it for you as well will cleanup a few things and push new release out.
     

    Attachments

    Virtual

    Portal Member
    January 6, 2017
    22
    12
    42
    Italy Italy
    The app works like the plugin ... the audio device switch correctly to the new device and the movie "sounds" with the new device.
    only the mediaportal internal volume remains attached to the old device ... if I use the "windows 10 volume bar", it works correctly with the default device ... but if i use the mediaportal volume, it changes the volume on the "old" device (i can see it on windows 10 playback devices > properties > level)
    Works all as expected except the mediaportal internal volume control the remains attached to the old default audio device (plugin or app, no differences)
     

    Rick164

    Super User
  • Team MediaPortal
  • Super User
  • January 7, 2006
    1,335
    1,005
    Netherlands Netherlands
    Country flag
    Yeah it's because the volume handler doesn't respawn internally, V4 will force that and while looking in Windows systray can see it changing volume for the correct device depending on what I chose from the AudioSwitcher plugin in Mediaportal.
    GUI sounds I'm not sure yet how that works but volume control does so long as it's set to master volume.

    Snippet of we do now with some extra delays:

    Code:
        private void SetPlaybackDevice(CoreAudioDevice device)
        {
          try
          {
            Log.Debug($"Audio Switcher - setting default playback device to: {device.FullName}");
            device.SetAsDefault();
             Log.Debug($"Devices audio connected: {GUIGraphicsContext.DeviceAudioConnected}");
    
            if (Settings.LAVbitstreamPerDevice)
            {
              SetLavBitstreamSettings(device.FullName);
            }
    
            Log.Debug("Resetting volume control");
            Thread.Sleep(1000);
            VolumeHandler.Dispose();
            Thread.Sleep(1000);
            VolumeHandler.CreateInstance();
            Log.Debug("Volume control reset");
    
          }
          catch (Exception ex)
          {
            Log.Error("Error occured during SetPlaybackDevice()");
            Log.Error(ex.Message);
          }
        }
     

    Virtual

    Portal Member
    January 6, 2017
    22
    12
    42
    Italy Italy
    upload_2017-1-6_18-32-14.png


    I change the audio device, set master volume in the configuration and disabled all plugins.
    As you can see, windows show it correctly but MP still use the old device only for the volume control ... in the printscreen you can see that I have set the volume at high level but the default device in windows (device selected via plugin and used correctly when I start a movie) remains at 20%.
    I don't know why MP doesn't release the old device for its internal volume control :(
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    Golf4 TV-Records werden als Audio-Files importiert ? Allgemeines Support- und Diskussionsforum 0
    W [solved] Incorrect audio being reported Moving Pictures 4
    404 [solved] Live TV...video and audio freeze General Support 20
    ninja 12 Audio dropouts with Dolby / DTS watch/edit Videos 12
    bta489 [solved] DVB-T2 Recordings: Sometimes no Audio after muxing with mkvmerge Tools and other software 2
    T [solved] MP2 Switch off visualisation when listening to audio....PLEASE!!! General 23
    azzuro [fixed] [WIP MP2.3] - Audio files not imported to MP MediaPortal 2 18
    S Remote button to change audio and subtitle on / off General 10
    F Audio render and font error in my logs General Support 2
    R [solved] Command / Shortcut for changing subtitles or audio Archive 5
    K Multichannel audio and subtitles for TV not properly supported General Support 4
    Glith Audio out of sync after pause. Rewind 15sec gets it into sync again. MediaPortal 1 Talk 0
    C ARC Audio Renderer Changer: wo kann man es konfigurieren? Video & DVD 15
    joecrow No Audio after MP Start/Resume from Sleep General Support 0
    C Ability to browse videos and audio by folder General 2
    Lichloathe Offline audio content General 9
    G How best to get cover art for tracks to show up on the Audio Menu (Latest Added, Unplayed)? General 9
    Ralph Holmes Wrong audio source in TV General 1
    CyberSimian [Proposal] Audio description MediaPortal 1 10
    ge2301 [fixed] [MP2-807] Problem when switching player in PiP mode with audio files MediaPortal 2 32
    cladinshadows85 [solved] Audio playing mutiple times over video and crashing General 8
    H Live TV info OSD not displaying number of audio channels General Support 3
    T Moving Pictures...seem to have 'lost' ability to display Movie info. (eg Resolution/Audio) Moving Pictures 2
    N [fixed] [MP2-786] Cannot play audio playlist with >=1000 entries 2.2 Archive 36
    B Media info shows audio is 5.1 MP shows 2.0 Watch / Listen Media 2
    Similar threads

























    Top Bottom