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

Rick164

Super User
  • Team MediaPortal
  • Super User
  • January 7, 2006
    1,335
    1,005
    Netherlands Netherlands
    Country flag
    Introduction

    This allows you to easily change your active Windows audio (playback) device using a context menu which you can show by mapping it to a remote key, the current remote keys mappable are:

    Red
    Green
    Blue
    Yellow
    DVD menu
    Subpage Up / Down

    Also has a a few optional features:

    - Set default playback device on startup
    - LAV audio bit streaming on a per device basis (default off in settings)
    - Set LAV audio delay via context menu (default off in settings)


    Installation

    https://www.team-mediaportal.com/extensions/audio-switcher

    Usage

    First select the remote key you want to use from the AudioSwitcher configuration:

    audioSwitcherSetup001.png


    audioswitchersetup002.PNG



    Once selecting a remote key you need to make sure AudioSwitcher can use it first as Mediaportal by default reserves all special buttons (no pass-thru), it depends on the Remote you use but here's the example for the MCE remote and the Red button.

    - Go to Mediaportal configuration -> Remote And Input Devices section -> Mapping , now for the No condition area select Remote Red Button as the action.




    Optionally you can also map a keyboard key to the remote key like so:

    audioSwitcherSetup003.PNG



    Now start Mediaportal and press the remote key or keyboard key you setup in the above steps, this will bring up a new context menu menu where you can select the playback device (current one gets highlighted):

    audioSwitcherSetup004.PNG


    audioSwitcherSetup005.PNG




    Advanced features

    Bitstream settings per device

    Version 1.1.0 and up optionally supports managing the LAV audio bit stream setting per device, this allows you to specifiy which codecs your device supports and updates the LAV audio bitstream config if needed.
    This is also applied if a startup device is specified in AudioSwitcher.

    audioswitchersetup001.PNG


    LAV audio delay

    Version 1.1.3 and up optionally supports managing the LAV audio delay via the context menu, you will need to enable this setting like in the below example and afterwards new audio delay settings will be listed in the Audio Switcher context menu.
    For negative delays you can add a minus(-) sign before the delay, it will get validated afterwards so you don''t have to worry about setting invalid ones.

    LAVAudioDelay.png



    Source


    The source is located on Github:

    https://github.com/RickDB/MP1-AudioSwitcher

    Credits

    - AudioSwitcher for making an amazing and simple to use Audio API
     
    Last edited:

    joEhSuper

    MP Donator
  • Premium Supporter
  • June 2, 2011
    760
    322
    Austria Austria
    Country flag
    Is it right, that the mean difference between Audio Switcher and ARC (AudioRendererChancer) is, that your Audio Switcher "has" a context menu?
     

    Rick164

    Super User
  • Team MediaPortal
  • Super User
  • January 7, 2006
    1,335
    1,005
    Netherlands Netherlands
    Country flag
    Correct this is meant for easily changing the current Windows audio device thru a context menu and doesn't re-attach any graphs and recommended only when no playback is active :) , so long as Mediaportal is set to use the Default direct sound device this will work.
    Also it uses a different external library (AudioSwitcher) instead of any built-in Mediaportal functions.

    Had this problem with a new Logitech headset for a while where whenever I wanted to use it would mean minimizing Mediaportal -> change default audio device -> re-open Mediaportal as its usb audio device would always be on so no dynamic switching like you have with Bluetooth audio for instance.
     

    Rick164

    Super User
  • Team MediaPortal
  • Super User
  • January 7, 2006
    1,335
    1,005
    Netherlands Netherlands
    Country flag
    Noticed that you can live switch the audio device in some cases, tried PCM 2.0 - 5.1 / DTS without problems but it depends on a specific Mediaportal setting:

    audioSwitcher_settings.png
     

    Rick164

    Super User
  • Team MediaPortal
  • Super User
  • January 7, 2006
    1,335
    1,005
    Netherlands Netherlands
    Country flag
    New version is out (1.1.0) and has a few new features:

    - Added LAV audio bit stream per device, this allows toggling bit streaming on / off depending device
    - Added option to set a default playback device on start up
    - Additional context menu item to toggle LAV bit streaming manually (has setting to always show)

    Reasoning behind this is that not all devices support bitstreaming so if LAV has bitstreaming enabled the device would not get any audio.
    So you can set a few predefined devices and select which codec it supports for bitstreaming if any.

    LAV manages it settings in registry completely so basically what it does is just update those on the fly :)

    audioswitchersbitstreametup001-png.PNG


    // Update

    Uploaded 1.1.1 release which simplifies the manual bitstream toggle a bit and makes it work in all cases.
     
    Last edited:

    Rick164

    Super User
  • Team MediaPortal
  • Super User
  • January 7, 2006
    1,335
    1,005
    Netherlands Netherlands
    Country flag
    1.1.2 release adds a workaround for a AudioSwitcher API bug which affects some HDMI AVR audio setups, basically if it detects this bug it forcefully reloads the device list.
     

    Rick164

    Super User
  • Team MediaPortal
  • Super User
  • January 7, 2006
    1,335
    1,005
    Netherlands Netherlands
    Country flag
    1.1.3 was just released:

    - Added LAV audio delay options to context menu, not shown by default and can be enabled in settings.
    - Can add audio delays while video is playing and it will optionally restart the video where it left off.
    - Reads back current bitstream and audio delay settings directly from LAV registry keys and no longer relies on possible old values if for instance changed outside of Mediaportal.

    While it's a bit outside of the scope of this plugin the ability to control audio delays is lacking right now in Mediaportal because you can only add audio delays via ffdshow which is outdated and pretty much replaced by LAV filters nowadays, new features are optional of course and left the audio delay options off per default.

    Also it will read all LAV settings directly so any changes done externally or by other plugins will be read back upon opening the context menu :)
     
    Last edited:

    Rick164

    Super User
  • Team MediaPortal
  • Super User
  • January 7, 2006
    1,335
    1,005
    Netherlands Netherlands
    Country flag
    1.1.3.5 was just released which improves overall performance as the AudioSwitcher library now does everything much faster (async tasks) :)
     
    Last edited:

    druid9

    MP Donator
  • Premium Supporter
  • December 31, 2006
    255
    9
    60
    Country flag
    can't seem to get this to work, maybe skin related (Titanius), or the fact I am using EventGhost with Message plugin. Don't get the popup dialogue even using keyboard.

    Will post logs in the morning
     

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

    OP Similar threads Forum Replies Date
    Stephen O'Kane [SOLVED] TV Stream stuttering - both Video and Audio Watch / Listen Media 14
    M.Hulot MP plays in Internal Blu-ray-Player-mode always first audio stream not the one I chosen in settings General Support 1
    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
    Similar threads

























    Top Bottom