MP2 - V2.1 PIP + LAV audio bistream issues (1 Viewer)

Status
Not open for further replies.

Alberto83

Portal Pro
August 7, 2012
336
108
Home Country
Italy Italy
MePo: 2.1 Final
Audio Codec: All using Lav Audio: 0.69.0.42-git | Bitstream checked for all formats available.
Video Codec: All using Lav Video: 0.69.0.42-git
Audio Renderer: Default DirectSound Device.
Prefer multichannel audio streams: NO.

I found a problem when using LAV Audio bitstreaming in conjunction with the PIP feature, but I can't really say it's a bug, more a way bitstream works.
When you start PIP, you actually start a second player with its instances of LAV Audio and LAV Video codecs (at least that is what is happening on my PCs).

Everything works fine until one of your track is supported by LAV audio for bitstreaming and LAV is configured to bitstream.
In this configuration, the first audio track with DD or DTS chosen takes precedence and starts bitstreaming to the AMP. There's no way to switch to the other player tracks but stop the current bitstreaming instance first.

I think this happens because both player actually streams one of their track to LAV Audio, and when bitstream is enabled, it immediately pass it to the amp.
Let me make an example for you to reproduce the issue:
Requisites: Have LAVAudio codec with DD bitstream enabled.
  • Tune a channel with simple MPEG2 Tracks. We'll call this player1
  • Tune a second channel (or a movie) with ONLY Dolby Digital Tracks available on PIP. We'll call this player2
Result: Your amp should now be playing the first DD track available from the player2, and not the original track from the player1. You can't switch back to any other track of player1 until you stop the playback of the DD track on player2, either by choosing an MPEG2 track or stopping the player completely.

This happens on both my MePo 2.1 final installations, with two different amps connected, so I think it's not an hardware problem (of the amp) or the pc, but more a configuration issue or an issue by design. The problem stops the very moment I disable bitstreaming (obviously).

Can some of you with bitstreaming enabed reproduce this issue, or it's an issue with my configuration?
Is it possible to configure MePo to always reproduce one audio track only and disable the others completely, before they go to the LAV audio codec?
 

ge2301

Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,705
    3,491
    Stuttgart
    Home Country
    Germany Germany
    MePo: 2.1 Final
    Audio Codec: All using Lav Audio: 0.69.0.42-git | Bitstream checked for all formats available.
    Video Codec: All using Lav Video: 0.69.0.42-git
    Audio Renderer: Default DirectSound Device.
    Prefer multichannel audio streams: NO.

    I found a problem when using LAV Audio bitstreaming in conjunction with the PIP feature, but I can't really say it's a bug, more a way bitstream works.
    When you start PIP, you actually start a second player with its instances of LAV Audio and LAV Video codecs (at least that is what is happening on my PCs).

    Everything works fine until one of your track is supported by LAV audio for bitstreaming and LAV is configured to bitstream.
    In this configuration, the first audio track with DD or DTS chosen takes precedence and starts bitstreaming to the AMP. There's no way to switch to the other player tracks but stop the current bitstreaming instance first.

    I think this happens because both player actually streams one of their track to LAV Audio, and when bitstream is enabled, it immediately pass it to the amp.
    Let me make an example for you to reproduce the issue:
    Requisites: Have LAVAudio codec with DD bitstream enabled.
    • Tune a channel with simple MPEG2 Tracks. We'll call this player1
    • Tune a second channel (or a movie) with ONLY Dolby Digital Tracks available on PIP. We'll call this player2
    Result: Your amp should now be playing the first DD track available from the player2, and not the original track from the player1. You can't switch back to any other track of player1 until you stop the playback of the DD track on player2, either by choosing an MPEG2 track or stopping the player completely.

    This happens on both my MePo 2.1 final installations, with two different amps connected, so I think it's not an hardware problem (of the amp) or the pc, but more a configuration issue or an issue by design. The problem stops the very moment I disable bitstreaming (obviously).

    Can some of you with bitstreaming enabed reproduce this issue, or it's an issue with my configuration?
    Is it possible to configure MePo to always reproduce one audio track only and disable the others completely, before they go to the LAV audio codec?
    Good finding. My HTPC in living room was on, so I gave a quick try. I can reproduce the mentioned situation.
     

    Alberto83

    Portal Pro
    August 7, 2012
    336
    108
    Home Country
    Italy Italy
    I think we should move this to the Bug Reports section, even if it's not really a bug.
    Maybe it can be solved by allowing only one track to be sent to the LAV Audio codec.
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Note - I'm not an MP2 user, so this is a general comment/analysis...

    This is almost certainly caused by the way Windows sound mixer operates (which is between the audio renderers and the output).

    If multiple audio streams are all decoded (PCM) audio, then it can mix them together. If one of the streams is 'bitstreamed' it can only be sent directly to the audio output (other audio streams cannot be mixed with it), so it presumably overrides all the other streams. This is also the reason there is no volume control for bitstreamed audio.

    If you have a PiP situation (with bitstreamed PiP audio) and open up Windows 'volume mixer' (right click on the speaker icon in the systray), are there two active inputs (volume sliders) from MP2?

    If there are and you mute the 'bitstreamed' input (click on the speaker icon at the bottom of the relevant volume slider), do you then hear the main audio stream?
     

    Alberto83

    Portal Pro
    August 7, 2012
    336
    108
    Home Country
    Italy Italy
    I can't check right now, because i'm not at home, but when I come back i'll have a look.

    I don't think the problem is the Windows Sound mixer itself but the fact that two LAV Audio instances exists. As far as I know (but I might be wrong), the bitstreamed stream should go directly to the amp untouched, so it shouldn't even go through the sound mixer. EDIT: or if it goes, it doesn't touch it at all.
    When two streams exists, only the first one goes out, the second is lost somewhere. Indeed, when you pause or stop the current playing bitstream, you have to pause an play the second stream in order to get the sound.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    I'm afraid that switching audio streams can not be done in bit stream mode easily.

    Currently we only switch between audio streams in mixer mode, which is controlled by Windows. With LAV using bitstream (I guess it does this exclusively on device), we probably would need to "detach" the audio renderer before switching to another stream. Not sure how this could work, i.e. if the graph can continue playback if there is no audio renderer attached (a/v sync is done there).

    In short, I see no quick solution to this behavior.
     

    Alberto83

    Portal Pro
    August 7, 2012
    336
    108
    Home Country
    Italy Italy
    Ignore my last comment. It HAS to go through the sound mixer. Sorry.
     

    Alberto83

    Portal Pro
    August 7, 2012
    336
    108
    Home Country
    Italy Italy
    @morpheus_xx it should still use the system mixer. I think i heart system sounds and notification while watching movies and tv channels. I'm gonna check this evening.
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Not sure how this could work, i.e. if the graph can continue playback if there is no audio renderer attached (a/v sync is done there).

    TsReader.ax can't handle video-only playback so I assume you need a functional audio renderer in the graph for TV playback to work.
     

    Alberto83

    Portal Pro
    August 7, 2012
    336
    108
    Home Country
    Italy Italy
    I can confirm what Morpheus says. The bitstream is exclusive indeed, and when it plays NO other sound gets out but the stream itself. Not even system sounds. And it should be this way, since the bistream has to remain untouched.
    There's no information of the stream in the volume mixer, so it is bypassed completely. You can only mute the whole playback device.
    Since I'm using the PIP feature mainly for TV I'll change the graph for ts files not to use LAV audio with graphedit, and this will fix it.

    Question, I have really few notions about DirectShow Filters and how they work, so I really don't know if this can be an actual solution: is it possibile to develop a very simple stream mixer to place before the LAV Audio codec in the graph chain to control from mediacenter which stream to send to the codec?
    It's not something urgent, but i think bitstreaming will become popular for movies since PCM is not really a good choice to stream latest object based audio formats like Atmos or DTS:X, considering the position of the ceiling speakers are available only to the AVR.

    Edited few times to correct typos.
     
    Last edited:
    Status
    Not open for further replies.

    Users who are viewing this thread

    Top Bottom