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

Rick164

MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    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.

    upload_2014-5-25_16-8-8-png.151019



    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
    1,008
    580
    Home Country
    Austria Austria
    Is it right, that the mean difference between Audio Switcher and ARC (AudioRendererChancer) is, that your Audio Switcher "has" a context menu?
     

    Rick164

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    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

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    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

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    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

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    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

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    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

    MP Donator
  • Premium Supporter
  • January 7, 2006
    1,335
    1,005
    Home Country
    Netherlands Netherlands
    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
    63
    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

    Top Bottom