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
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:
EVR presenter and audio renderer source codes can be found from https://github.com/MediaPortal/MediaPortal-1/commits/EXP-Audio_Renderer-Pipeline
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.
- Bitstreaming (this will cause lot of the main, video playback related features not to work - so this is not on high priority)
- 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
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
- 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
EVR presenter and audio renderer source codes can be found from https://github.com/MediaPortal/MediaPortal-1/commits/EXP-Audio_Renderer-Pipeline
Last edited: