1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'MediaPortal 1 Plugins' started by Rick164, April 24, 2016.

  1. Rick164
    • Super User

    Rick164 Super User

    Joined:
    January 7, 2006
    Messages:
    1,302
    Ratings:
    +1,135 / 0
    Home Country:
    Netherlands Netherlands
    Show System Specs
    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.





    [​IMG]


    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: August 22, 2016
    • Like Like x 6
    • Great Idea! Great Idea! x 2
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. joEhSuper
    • Premium Supporter

    joEhSuper MP Donator

    Joined:
    June 2, 2011
    Messages:
    503
    Ratings:
    +167 / 2
    Home Country:
    Austria Austria
    Show System Specs
    Is it right, that the mean difference between Audio Switcher and ARC (AudioRendererChancer) is, that your Audio Switcher "has" a context menu?
     
  4. Rick164
    • Super User

    Rick164 Super User

    Joined:
    January 7, 2006
    Messages:
    1,302
    Ratings:
    +1,135 / 0
    Home Country:
    Netherlands Netherlands
    Show System Specs
    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.
     
    • Thank You! Thank You! x 1
    • Informative Informative x 1
  5. Rick164
    • Super User

    Rick164 Super User

    Joined:
    January 7, 2006
    Messages:
    1,302
    Ratings:
    +1,135 / 0
    Home Country:
    Netherlands Netherlands
    Show System Specs
    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
     
    • Thank You! Thank You! x 1
  6. Rick164
    • Super User

    Rick164 Super User

    Joined:
    January 7, 2006
    Messages:
    1,302
    Ratings:
    +1,135 / 0
    Home Country:
    Netherlands Netherlands
    Show System Specs
  7. Rick164
    • Super User

    Rick164 Super User

    Joined:
    January 7, 2006
    Messages:
    1,302
    Ratings:
    +1,135 / 0
    Home Country:
    Netherlands Netherlands
    Show System Specs
    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: August 8, 2016
    • Thank You! Thank You! x 3
  8. Rick164
    • Super User

    Rick164 Super User

    Joined:
    January 7, 2006
    Messages:
    1,302
    Ratings:
    +1,135 / 0
    Home Country:
    Netherlands Netherlands
    Show System Specs
    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.
     
    • Like Like x 2
  9. Rick164
    • Super User

    Rick164 Super User

    Joined:
    January 7, 2006
    Messages:
    1,302
    Ratings:
    +1,135 / 0
    Home Country:
    Netherlands Netherlands
    Show System Specs
    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: August 26, 2016
    • Like Like x 2
    • Thank You! Thank You! x 1
  10. Rick164
    • Super User

    Rick164 Super User

    Joined:
    January 7, 2006
    Messages:
    1,302
    Ratings:
    +1,135 / 0
    Home Country:
    Netherlands Netherlands
    Show System Specs
    1.1.3.5 was just released which improves overall performance as the AudioSwitcher library now does everything much faster (async tasks) :)
     
    Last edited: October 29, 2016
    • Like Like x 1
  11. druid9
    • Premium Supporter

    druid9 MP Donator

    Joined:
    December 31, 2006
    Messages:
    255
    Ratings:
    +9 / 0
    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
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Like Us On Facebook

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!