The little non-definitive guide to video WASAPI (1 Viewer)

Alberto83

Test Group
  • Team MediaPortal
  • August 7, 2012
    336
    108
    Italy Italy
    I switched to MePo 2 with the release of MePo 2.1.1, and in the last months I focused on learning the program and fine tuning it for my needs.

    One of the most difficult task was to configure WASAPI for video, or better, to find the right audio renderer to use, since MPAR doesn't work very well with MP2 for some reasons. The difficulties I had was that the MP audio renderer seems not to release the exclusive control of the audio device once a video is closed, causing the next video to get stuck in "loading" indefinitely.

    I put up this little guide based on my findings for those who wants WASAPI for their video player too. This guide works with 2.1.1, 2.1.2, and 2.1.3 versions. It will probably work with future version either, but those are the only one I currently tested.

    In this first post I'll explain what you'll get with WASAPI for video, and what you'll lose. I'll post more in the next days, mostly because I need to take screenshot and actually write the rest.

    Why would you want WASAPI for video? There are few advantages and few issues.
    1. You can send untouched PCM to the AVR that you can later process with Dolby Prologic and other spatial algorithm directly in the AVR. If you have configured Windows in 5.1 mode, its audio renderer has the bad habit of adding silent channels to stereo tracks, sending to the AVR a fake 5.1 stream that you won't be able to process with Pro Logic successfully. Now, some of you might think Dolby Prologic is bad. Maybe, but I found that it does a very good job in making the voice clearer. I'm not a native English speaker, and most stereo tracks have a terrible volume for speech, which is essential for me.
    2. You can send PCM at full rate when available (192kHz/24bit) through HDMI.
    3. You can still send bitstreaming for proprietary codec. This is specifically important for object based codecs like DTS:X or Atmos. As far as I know, for now the AVR is the best block in the chain to process those codecs, since it's the only one who knows the real positioning of your speakers.
      As a bonus, you can see those little fancy lights lit based on the codec you're bitstreaming, if you really mind.
    Why would you hate WASAPI for video?
    1. WASAPI requires exclusive control of the audio device. Forget any other sound output than the video you're playing. NO windows sounds, no skin sounds. Just plain audio sound from the video stream.
    2. It breaks PIP. Obviously, PIP is an entire new player instance, and both player instances can't have exclusive control over one single audio device. You'll receive an ugly error message if you try to start a second video. That unless they can send one of the two streams to a null audio renderer, which I don't think it's even possible.
    3. I had some issues with Live TV and WASAPI from a remote client. The voice seems to go out of sync after a few minutes. I'm still investigating this issue since it seems to be completely random for now.

    If you're ok with all the drawbacks, and you want to try it, keep reading.
    This is what you'll need:
    1. For the WASAPI part, an audio renderer. I tried some of them, and my choice went with ReClock. It has a pretty extensive interface with enough options to fine tune your system, without being too much invasive. It has a wonderful option where you can limit its scope to single programs, excellent if you use your system for other uses than only MePo 2 (Like I do for one of my remote clients).
    2. NB: You'll still use LAV Audio and LAV video (or your favorite choice) as audio and video codecs.
    3. To send full rate 192kHz/24bit audio, a good HDMI driver for your graphic card. Now, while this seems trivial, I found that with Intel integrated video card, it's not at all. I had to downgrade my Intel HDMI Audio Device driver to version 6.16 to make it work. The good side of this, is I haven't missed any feature, and everything is still working after 4 months. I haven't tried with Nvidia or ATI simply because I don't have one, so if anyone of you wants to try and give his feedback on this, I'm here. To test if your driver is ready for 192/24 follow this procedure (on windows 10, windows 8 and windows 7 might differ):
      1. Right click your sound icon in the task bar and chose "recording device".
      2. Double click your HDMI output to open the properties pane.
      3. Go to supported formats and see if you have 192.0 kHz under sample rates. Check it.
      4. Go do the advanced tab, and select 24bit, 192 kHz (studio quality) on default format, and test it. This will test your output device to see if it can actually play the format. If you can't hear anything, either your HDMI driver can't send it, or your audio device can't play it.
    For example, my sound bar in my kitchen (Samsung HW-J355) can play 96.0/24bit but not 192/24bit even if my device driver support it.
    In my living room instead, my Onkyo NR-TX646 was certified for 192/24 but my intel HDMI driver wasn't able to pass it through until I downgraded it.

    Unfortunately this is a trial and error thing. Best way to understand if it's your driver or your audio device, is to check the specs in your amp. If they say it supports PCM 192/24, you're very likely to have issues with your driver.


    In the next part we will install and configure ReClock and MePo 2 to output PCM 192/24 to your AVR.


    I hope you enjoyed the reading.
     

    Alberto83

    Test Group
  • Team MediaPortal
  • August 7, 2012
    336
    108
    Italy Italy
    If you followed the procedure to determine which bitrate is compatible with both you AVR and driver, you're good to go and you can keep reading. Otherwise, you definitely should check compatibility first and know exactly which bitrate is working with your system. We're gonna add another piece of software in the graph chain for video playback that will obviously introduce a new layer of complexity, so we better be prepared to know exactly which bitrate works and which does not.

    As said earlier, we need basically one software to configure WASAPI on our system. My software of choice is ReClock from RedFox. You can download it here from the site developer's page.
    Sadly, it seems the software is discontinued, but really, there's nothing more that they can add to this great plugin.
    Download and install ReClock. Then open its property page. The installer should add a new link on your desktop "configure ReClock".

    Configure the Audio Settings software as in the picture below.
    ReClock General Settings.PNG
    Audio Settings TAB:
    Audio Interfaces to use for:
    For Bitstreaming enabled and PCM WASAPI, configure WASAPI Exclusive on PCM sources and leave Bitstream to default DirectSound. This will allow to take exclusive control of the audio device for every PCM stream but still use LAV Audio filter for bistreaming (and thus have your fancy leds on your AVR lit).

    Devices to use with

    This pane allows you to bypass the windows mixer default device. This is useful if you have multiple playback devices connected to your HTPC. Since modifying this is dependent from your specific configuration, I might cover it in future posts, based on specific needs. For the purpose of this article, leave them to Default Device as in figure.

    PCM Output:
    This is the tricky part. Here you have to change your Sampling Rate to the Maximum allowed sampling rate you found earlier while playing with your AVR and your drivers. In the screenshot above, my sample rate is 192kHz, which means everything will be played to 192kHz, and those signal with lower sampling rates WILL be resampled to 192.
    Now, if you use an HDMI connection to your AVR, you might need to chose 24 bit padded to 32 as format. This is due to the fact that some AVR only accept 24bit as padded 32bit signals. (like mine).
    You probably need some trial and error here.
    If you're using an optical connection, you can totally use 24 bit int.
    For quality, use Best Sync Interpolation first, and eventually change it to lower until it plays the sound correctly.
    A word of warning. Do not flag "set matching speaker configuration". We want stereo sources to be sent as stereo to the AVR this make Dolby Prologic effective.

    Bitstream:
    Flag Accept Bitstream Formats (not recommended). This will allow bitstreaming bypass.
    Check Disable Media Speed Correction with bistream audio (recommended), since we're already correcting A/V sync in the LAV audio filter.

    Video Settings TAB:
    Uncheck built in estimator for both media files and DVD if needed. Leave the rest untouched.

    Advanced Settings TAB:
    Uncheck ALL VSYNC corrections, and check "Force ReClock to be loaded instead of Default Renderers"

    "Application for which reclock is allowed to replace the default renderer"
    Check "Only load reclock and show application dialog for defined application", then click Add.
    Navigate to "C:\Program Files (x86)\Team MediaPortal\MP2-Client" and then select MP2-Client.exe, then for the new entry select "Load Always".
    Reclock Advanced Settings.PNG
    NB: If you find some stuttering during playback, you can later check "Give High CPU priority to player".

    Done. Reclock is configured, you can now try it by opening Mediaportal.

    Fire up mediaportal 2, go to settings -> Players -> Codecs -> Audio Codecs.
    Chose Audio Renderer, and select "Reclock audio render" from the list.

    You should be able now to play videos with stereo tracks and send real stereo signals to your AVR even if your windows mixer is configured as a 5.1 system. Test it with multiple sources and check that bitstreaming works correctly, for every format, especially DTS:X and Atmos, and the HD sources.

    In the next post i'll address specific issues with specific drivers and configurations.

    Is anyone of you using reclock? If yes, which settings are you using?
     
    Last edited:

    Alberto83

    Test Group
  • Team MediaPortal
  • August 7, 2012
    336
    108
    Italy Italy
    The Intel HDMI Audio Problem:
    There's a known and notorious issue with newest Intel HDMI audio interface and PCM 192kHz/24bit streaming. The short story is it just does not work, no matter what you try to do.
    The best way to deal with it is to downgrade the files with an older version, provided as attachment to this post.

    ----
    Disclaimer: This post is intended for those who uses HDMI with an Intel graphics card and want to send PCM 192kHz/24bit to the AVR. Everyone else can skip this part.
    Downgrading to older drivers didn't broke any feature on my client, but I have a 1080p television, thus I cannot say if it works for 4K nor if it breaks the HDCP 2.2 chain. To my knowledge, HDCP should be hardware coded, so either you have it or you have not. Further tests with someone with a 4K TV might be needed.

    -----

    Unzip the drivers in a folder on your desktop.
    Open Computer Management with administrative privileges (Hit Start + R, write compmgmt.msc at the run prompt and press enter).
    Navigate to Device Manager, and double click "Intel® Display Audio" under "Sound, video and game controllers".
    Intel_Update0.PNG
    Go do the "Driver" tab from the hardware properties window and click "Update driver".
    Intel_Update1.PNG
    Select "Browse my computer for driver software" under the Update Driver window. Browse to the folder you just unzip your drivers in your desktop, then click "Let me pick from a list of available drivers on my computer".
    Intel_Update2.PNG Intel_Update3.PNG
    Chose 6.16.0.3200 [2017], then hit next. A new driver should install, and it may prompt you that you have newer drivers installed. Just click yes to install the older ones and wait until it completes.
    Intel_Update4.PNG Intel_Update5.PNG

    You should now be able to stream PCM 192/24 to your AVR using reclock!
     

    Attachments

    Last edited:

    ge2301

    MP2 Design
  • Team MediaPortal
  • January 11, 2014
    6,703
    2,416
    Stuttgart
    Germany Germany
    Country flag
    Nice and interesting summary of a topic that probably many of us dealed with.
    Generally our Wiki is really weak here, many options and their background are not explained. So we need such investigations and updates in Wiki out of the community!
     

    Alberto83

    Test Group
  • Team MediaPortal
  • August 7, 2012
    336
    108
    Italy Italy
    Thank you. Maybe once completed, the topic could be linked in the wiki.
     

    Alberto83

    Test Group
  • Team MediaPortal
  • August 7, 2012
    336
    108
    Italy Italy
    yeah, I explained myself badly and chose my words poorly.
    I meant i can totally write this and other articles back to the wiki too. ;)
     

    Alberto83

    Test Group
  • Team MediaPortal
  • August 7, 2012
    336
    108
    Italy Italy
    Updated the second post with the configuration guide for ReClock.
    If anyone has questions or uses different settings, i'd really like to know and eventually add it to the guide.
     

    Alberto83

    Test Group
  • Team MediaPortal
  • August 7, 2012
    336
    108
    Italy Italy
    Updated with the guide to install an Intel HDMI audio Device that can stream 192kHz/24bit.

    If you have any question, feel free to reply here.
     

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

    Top Bottom