Stereo Sound on 5.1 Speaker Setup (4 Viewers)

ajs

Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,371
    Kyiv
    Home Country
    Ukraine Ukraine
    Hmmmm .. I set in Windows 5.1 in LAV bitstream and all (TuneIn, Flac 2.0, Flac 5.1, mp3, DTS etc) work fine with my Pio AVR.:coffee:
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Correct! But that has to be configured in the AV Receiver!
    No, it doesn't have to be. That's your preference. Sometimes you don't have a choice.

    That's why I want PCM 2.0 to my AVR and not PCM 2.0 integrated in a PCM 5.1 signal.
    We understand what you want. No need to explain again and again. ;)

    The best would be if MediaPortal would send PCM 2.0 as PCM 2.0 and not packaged in a PCM 5.1 stream if Windows Speaker Config is set to 5.1...
    No program can do this. There are only workarounds. For example, the PCM could be encoded with a format that can be bit-streamed. In MP you might be able to achieve this with codec settings, MPAR and/or post-processing.

    Wouldn't it be possible to bypass the Windows Speaker Setup (optionally) ?
    No, this is impossible.


    If you do some research you'll find that Microsoft have intentionally not provided APIs for changing certain audio settings. Apparently this is because they think that only people (not programs like MP) should be able to change those settings. There's no official API for changing the default audio device, speaker setup etc.. Programs that want to change those settings must resort to reverse engineering Windows, using undocumented interfaces, and/or automation scripts (which simulate user activity). You'll find various programs and scripts that can change various audio settings with keyboard shortcuts etc.. Why don't you try one of them?
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    The only way I know of for players to dynamically override the Windows speaker settings is by using an audio renderer that supports WASAPI Exclusive mode output e.g. MPAR or ReClock. Using WASAPI Exclusive mode means it bypasses the Windows audio mixer, but I don't use WASAPI myself so I can't tell you how to set it up.

    Non-bitstream audio from all sources/players on the PC goes via the Windows audio mixer, which automatically re-samples and down-mixes the sources as necessary to match the final output speaker setting and sample rate. Because compressed bitstreams e.g. Dolby & DTS can't be mixed and resampled, they bypass the mixer and are sent unchanged to the output.

    As for working around some of the mixer 'problems' for MP, one way is set up LAV audio decoder to bitstream Dolby & DTS streams, then enable enable 'Mixing' in LAV like this - https://forum.team-mediaportal.com/...ching-or-recording.135736/page-2#post-1206737 - to handle everything else, so stereo is sent untouched but decoded (in LAV) multi-channel audio gets mixed to DPL II.

    Note that you have to set your Windows speaker settings to Stereo and set the AVR to decode DPL II to surround (I use DPL II Cinema mode) for this trick to work. It also means other multi-channel sources in the PC will get downmixed to stereo by Windows mixer.
     

    Snoopy87

    Portal Pro
    August 12, 2012
    470
    167
    Home Country
    Germany Germany
    Thanks guys! I will play around with all those suggestions.

    Today I set up MPAR and disabled lip sync in LAV Filter. Now audio/video is 99,9% synchron. AND even though I set up 5.1 in Windows Speaker Setup stereo on TV channels where sent as stereo channels and not as 5.1! :)

    So for now:
    - TV is working correct
    - Movies working correct
    - 5.1 in WebBrowser is working correct
    - RadioTime is not using LAV Filter and not MPAR, so Internet Radio is sent as 5.1 PCM

    Does a plugin developer has acces to MPAR? So that I can ask the developer of this plugin to use the MediaPortal Configuration?

    @mm:
    "No, it doesn't have to be. That's your preference. Sometimes you don't have a choice."

    No! It IS the only correct way to handle this and most of us want to use this because it is the correct way. Of Course there might be a few users who don't want this or can't use this, but its a very small amount and of course there could be options to configure everything to fits their needs. 99,9% of AVR users never want to handle, change or mix up audio by the source. They want that the AVR handles everything. But of course there are a very small amount of users how have for example very, very old AVRs and they want to handle some audio formats or channel configurations by the source. That's ok, cause I don't say that there should be no options for them ;-) I just said which one is the default one ;-)
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Does a plugin developer has acces to MPAR?
    MPAR is a standard DirectShow/DirectSound audio renderer. Any program or plugin can use it if they're using DirectShow/DirectSound. If they're not using DirectShow/DirectSound then they won't have access to it.

    No! It IS the only correct way to handle this...
    Upmixing does not have to be done by the AVR. I understand that you prefer to use AVR upmixing because you think it's better. However it's not the only way to upmix. That's why I said it's your preference.
    [Don't bother responding. Arguing is a waste of time.]
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    15,492
    10,371
    Kyiv
    Home Country
    Ukraine Ukraine
    TuneIn plugin only streamed to MP. Plays sound MP itself.

    --
    WBR, Andrew J.Swan
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    RadioTime is not using LAV Filter and not MPAR, so Internet Radio is sent as 5.1 PCM
    I checked the RadioTime code here:
    https://github.com/puenktchen/RadioTime/tree/master/RadioTimePlugin

    It looks like RadioTime uses the default MP player. If I'm right, you have options.

    OPTION 1
    By default MP uses BASS for audio streams.
    You can configure BASS to upmix stereo to 5.1 or other:
    https://www.team-mediaportal.com/wi...sic+Configuration#MusicConfiguration-Upmixing

    OPTION 2
    You can configure MP to use WASAPI (I think it is BASS WASAPI) for audio streams.
    https://www.team-mediaportal.com/wi...nfiguration#MusicConfiguration-PlayerSettings

    You can enable WASAPI exclusive mode, then configure the speaker setup:
    https://www.team-mediaportal.com/wi...Music+Configuration#MusicConfiguration-WASAPI

    OPTION 3
    You can configure MP to use DirectShow/DirectSound ("Internal dshow player") for audio streams:
    https://www.team-mediaportal.com/wi...nfiguration#MusicConfiguration-PlayerSettings

    The codec that will be used is determined based on DirectShow merit. You can configure LAV audio merit to be very high so that it is used:
    https://forum.team-mediaportal.com/threads/ac3-filter-for-music-playing.133267/

    ...and then enable LAV upmixing.

    OPTION 4
    You can configure MP to use DirectShow/DirectSound ("Internal dshow player") for audio streams:
    https://www.team-mediaportal.com/wi...nfiguration#MusicConfiguration-PlayerSettings

    If it is possible (again I say: IF - I don't know if it is possible) to select MPAR as the sound device, you can use LAV (see option 3) + MPAR just as you do for video and TV.


    P.S. Using MPAR for TV streams is not recommended. It often causes problems.
     
    Last edited:

    Snoopy87

    Portal Pro
    August 12, 2012
    470
    167
    Home Country
    Germany Germany
    Thanks! I will try your options! :)

    But I'm a little bit confused... you are talking about upmixing?! I don't want to upmix my signal. I want to set 5.1 in Windows Speaker Setup (so that 5.1 is working everywhere) and I want to PCM 2.0 send as PCM 2.0 and not packaged in a PCM 5.1 signal. I don't want to upmix PCM 2.0 to PCM 5.1. I will try if this can be done with your suggested options :)
     

    joecrow

    Test Group
  • Team MediaPortal
  • August 9, 2012
    2,528
    1,880
    Home Country
    Germany Germany
    I'm confused too, particularly with respect to some recomendations regarding bitstreaming, which I always thought was a no no in conjunction with MPAR.:confused:
    @Snoopy87 My setup is quite similar to yours, even the same GPU, except I have a Denon AVR, and I share your wish on how it should work. I don't want to hijack this thread but will continue to monitor it so please keep posting your progress.(y)
     

    Stéphane Lenclud

    Retired Team Member
  • Premium Supporter
  • April 29, 2013
    2,576
    1,294
    Home Country
    Germany Germany
    I want to PCM 2.0 send as PCM 2.0 and not packaged in a PCM 5.1 signal
    That should be the default behavior so stereo sources should only play through your left and right speakers while all other speakers remain quiet, unless if your AVR does some upmixing of its own.
    However many users like myself would rather make use of more or all speakers even when playing stereo sources, that's called upmixing.
    Thus music which are typically stereo sources will play through all my surround speakers and make use of my subwoofer for a better room coverage.
    Please note that contrary to what you seem to imply earlier upmixing a digital audio signal by your computer, be it through software or "hardware" sound card means, does not have to be worst than what your AVR could do. On the contrary, your computer has most likely much more processing power than your AVR. Therefore providing that we could link processing power with the quality of the output signal your computer should be able to do a much better job than your AVR.
     

    Users who are viewing this thread

    Top Bottom