MediaPortal Audio Renderer (3 Viewers)

Status
Not open for further replies.

tourettes

Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Beta warning - Do not use if you aren't willing to take part into the beta testing!

    Please note that there is currently only WASAPI based renderer available so Windows XP is not supported OS.

    Benefits of audio renderer

    Audio renderer tries to combat few video playback related issues that almost all (all without Reclock) Windows based (other OSes most likely fall into this category as well) media players are affected. Also it provides WASAPI exclusive mode access to audio HW so the OS mixer is not part of the audio pipeline.

    Audio / Video clock drifting

    One of the basic issues that almost every sine PC has is the fact that audio and video clocks are based on the different HW crystals / time sources. Normaly this can be only over come by either dropping or inserting silence into the audio stream which causes pops & clics in audio stream or by dropping or repeating video frames which result juddering / non-smooth video playback.

    MediaPortal Audio renderer solves this (like Reclock as well) by adjusting the reference clock a bit and resampling the audio to match the result. This will slightly degenerate audio quality when ever the correction is done.

    Refresh rate and FPS mismatch

    Like Reclock, MediaPortal Audio renderer is able to speed up / down the playback speed of the media to make the media fps to match the dispay refresh rate or it's whole number multiplier.

    EVR presenter's vsync position

    EVR presenter is able to "steer" the audio renderer in such way that the video frame rendering is done on optimal vsync position. This is able to correct the random EVR mixer vsync position that is "selected" on streaming start (playback start, skip or resume from pause).

    Limitations of audio renderer

    Currently there are following limitations for MediaPortal Audio renderer

    • Bitstreaming (no point since resampling destroys the whole idea of bitstreaming) - includes all formats
    • Windows 7 (Vista most likely as well) audio decoder is not supporting AC3 with 3rd party applications (Dolby lisencing restirction - Microsoft MPEG-1/DD/AAC Audio Decoder (Windows))
    • Volume control is not working with WASAPI exclusive mode since it bypasses the OS audio mixer. Native volume control implementation will be added later.
    Future possibitilies of audio renderer

    • Bitstreaming (this will cause lot of the main, video playback related features not to work - so this is not on high priority)
    How to install

    • backup current dshowhelper.dll
    • copy the attached dshowhelper.dll over the old one
    • copy mpaudiorenderer.ax to some folder
    • use "regsvr32 mpaudiorenderer" to register the audio renderer
    • set "MediaPortal audio renderer" to be used in DVD / TV / My Videos as audio renderer
    Debug settings for audio renderer

    Following registry settings can be used to tweak / debug / troubleshoot the audio renderer's functionality. They are located in HKEY_CURRENT_USER\Software\Team MediaPortal\Audio Renderer

    AC3bitrate

    Bitrate setting for the AC3 encoding. Default value is 448 kbps, valid values are 192, 224, 256, 320, 384, 448, 512, 576, 640.

    AC3Encoding

    Setting for enabling the AC3 encoding. There are three possible values which are

    0 = disabled - no AC3 encoding is done
    1 = auto - AC3 encoding is done when ever needed (multichannel over SPDIF for example)
    2 = forced - AC3 encoding is done always (usually useful for testing purposes only)

    AudioDelay

    Delay audio for xxx ms, can be used to compensate delay introduced by display device (postprocessing in LCD for example). By default this is 0 ms. Amount is given in ms.

    DevicePeriod

    Device side buffer size, the samller the more often the audio renderer needs to write to the buffer. 500000 (50ms) by default.

    0 = default from the audio driver
    1 = minimum from the audio driver
    others -> user specified (default 500000 -> 50 ms)

    EnableSyncAdjustment
    Toggles between v-sync adjustments on / off. By default this is on. Use only for debugging purposes (like sync drifting).

    EnableTimestretching

    Enables all the audio renderer's special features to work (should be only disabled to check if some issue is also reporducible with it disabled). Enabled by default.

    ExpandMonoToStereo

    Expands all mono audio streams to stereo. This is on by default as many WASAPI drivers report mono to be supported while there are issues with the playback.

    ForceBitDepth

    Force some specific bit depth to be used (16, 24, 32). 0 lets the renderer itself to pick the best one.

    ForceChannelMixing

    0 = disabled
    1 = enabled / forced
    Force channel mixing can be used to up / downmix the audio stream to a specific channel count which is defined by the SpeakerConfig registry key.

    ForceSamplingRate

    0 = auto or one of following 22050, 32000, 44100, 48000, 88200, 96000, 192000. Causes all audio to be resampled to the specified sampling rate.

    HWBasedRefClock

    Toggles between the audio HW based reference clock and system time based reference clock. Audio HW based reference clock is the default value (1).

    LogDebug

    Set to 1 to enable some extra debug logging. To be changed to a bitmask in the future to allow more fine grained logging adjustment.

    LogSampleTimes

    For debugging only. When enabled, all audio incoming sample timestamps (and current stream time) is logged into the audiorenderer.log. Disabled by default.

    MaxBias

    Maximum allowed speed that the playback can reach, this value is divided with 10000 to get the real value. Default value is 11000 (1.1x) - 10% speed up at maximum.

    MinBias

    Minimum allowed speed for the playback, this value is divided with 10000 to get the real value. Default value is 9000 (0.9x) - 10% speed down at maximum.

    ReleaseDeviceOnStop

    A workaround required to be set 1 on older MP versions (they have bug with the graph release and it can cause / delay the release of WASAPI resources).

    ResamplingQuality

    0 = SRC_SINC_BEST_QUALITY
    1 = SRC_SINC_MEDIUM_QUALITY
    2 = SRC_SINC_FASTEST
    3 = SRC_ZERO_ORDER_HOLD
    4 = SRC_LINEAR (default)

    Use to change the audio sampling rate conversion quality. For more information: http://www.mega-nerd.com/SRC/api_misc.html#Converters

    SpeakerConfig

    For setting the speaker configuration. Use 3 for stereo and 63 for 5.1.

    4 KSAUDIO_SPEAKER_MONO
    3 KSAUDIO_SPEAKER_STEREO
    51 KSAUDIO_SPEAKER_QUAD
    263 KSAUDIO_SPEAKER_SURROUND
    63 KSAUDIO_SPEAKER_5POINT1
    255 KSAUDIO_SPEAKER_7POINT1

    WASAPIExclusive

    Uses WASAPI exclusive mode. Enabled by default.

    WASAPIPreferredDevice

    Audio end point device (where the audio is played). Check AudioRenderer.log for possible devices. If left empty it will use OS default which should be ok for most of the time.

    WASAPIUseEventMode

    Uses WASAPI event driven mode. Enabled by default (causes issues on some HW / drivers where no proper support is available.)

    How to configure audio codecs

    Recommended audio decoder is LAV (http://1f0.de/downloads/) as it is having the most comprehensive format support, it works well with all Blu-ray audio formats, MediaPortal Audio Rendere is tested mostly against LAV audio decoder and the decoder itself is really stable and actively developed.

    Generic audio decoder related settings:
    • All passthru settings must be disabled
    • AC3 encode should be disabled
    How to report a bug

    • Try to provide as clean logs as possible (for example if live tv causes issues, just after the last channel change if possible)
    • Provide information about the used sample media file (even better if you can provide a small piece of that file itself, but take care that you aren't violating copyright)
    • Provide system information about the audio chip & drives. Same for GPU
    • Provide AudioRenderer.log
    • Provide evr.log
    • Provide MediaPortal.log
    • Check with GraphEdit / GraphStudio that the audio renderer is really connected to the audio decoder in graph
    Source codes

    EVR presenter and audio renderer source codes can be found from https://github.com/MediaPortal/MediaPortal-1/commits/EXP-Audio_Renderer-Pipeline
     
    Last edited:

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Open Issues
    -
    Future Improvements
    • Volume control
    • User configurable buffer size (in time)
    • Dynamic buffer sizes (based on the user setting)
    • Create registry keys when the filter is registered
    • Property pages to allow configuring the settings with more ease
     
    Last edited:

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    MediaPortal Audio Renderer

    Version 1
    First test build.

    Version 2
    • Improved A/V sync on dynamic stream changes
    • Improved A/V sync on live tv
    • Create registry keys when the filter is registered
    • Property pages to allow configuring the settings with more ease
    • Some minor fixes
    Note: you need to re-register the mpaudiorenderer.ax to be able to access the filter property page.

    EVR Renderer

    For dshowhelper.dll please use attached one. You can also use the more experimental dshowhelper.dll's

    In case you are using the test build for native blu-ray playback support you need to use the dshowhelper.dll from that thread (https://forum.team-mediaportal.com/threads/native-blu-ray-support.102375/#post-808007)
    Version 1
    First test build.
     

    Attachments

    • mpaudiorenderer_v1.zip
      1.4 MB
    • mpaudiorenderer_v2.zip
      1.4 MB
    Last edited:

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Good to know

    If you are using MediaPortal 1.2.3 (or any older build) you need to enabled the graph cleanup workaround by setting ReleaseDeviceOnStop in registry to 1. This issue is not present in the native blu-ray test build.

    For live TV

    If you are using MediaPortal Audio Renderer for live TV then you need to use experimental TsReader.ax attached in this post or the experimental ones from https://forum.team-mediaportal.com/threads/experimental-tsreader-development.102693/#post-811296 . Make sure that you are using noStopMod54 or newer.
     

    Attachments

    • TsReader_MPAR_test_v53a.zip
      165.1 KB

    Lichloathe

    MP Donator
  • Premium Supporter
  • July 25, 2007
    198
    183
    Home Country
    Australia Australia
    As an avid reclock user, I'm looking forward to giving this go!
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    hi,
    To get registry setting, you must start MediaPortal Audio Renderer once (in MP / Graphstudio for ex)
    And then registry key will be created (also please fill value in decimal) like SpeakerConfig = 63 :p

    Enjoy :)
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    hi,
    To get registry setting, you must start MediaPortal Audio Renderer once (in MP / Graphstudio for ex)
    And then registry key will be created (also please fill value in decimal) like SpeakerConfig = 63 :p

    Enjoy :)

    Thanks for reminding me - it has been quite long time since I had a "clean" registry without the MPAR keys in there. I'll add registry key creation on the TODO list. It should be done when the filter gets registerred on the system.
     

    Sebastiii

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

    wouter1971

    MP Donator
  • Premium Supporter
  • November 19, 2008
    911
    143
    Purmerend, Holland
    Home Country
    Netherlands Netherlands
    If you are using MediaPortal Audio Renderer for live TV then you need to use experimental TsReader.ax attached in this post. Later on teh experimental TsReader builds will contain the required changes as well.

    Is the tsreader the Owlsroost version 50+new added code?
    newer dshowhelper.dll version like 92 is ok too?
     
    Status
    Not open for further replies.

    Users who are viewing this thread

    Top Bottom