Experimental TsReader development (1 Viewer)

Owlsroost

Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Re: AW: Experimental TsReader development

    I'm running now noStopMod actual git

    Do you mean the binary from Git (v39), or one you built from the current sources ?

    noStopMod TsReader still prints a lot of Buffers : A/V lines which the 1.2.2 version does not but everything seems to be fine.

    Line like this :

    Code:
    20-12-2011 23:51:54.942 [1f8c]Buffers : A/V = 7/26, A last : 1115.630, V Last : 1116.040, ADur : 120.000 ms, ASlp : 10 ms

    are just for debug info every 5 seconds, they don't indicate problems :) (I'll probably remove them later)

    Tony
     

    wouter1971

    MP Donator
  • Premium Supporter
  • November 19, 2008
    911
    143
    Purmerend, Holland
    Home Country
    Netherlands Netherlands
    Tony, tested more, all fine....BUT, i have issues again with mpaudiorenderer, not on LiveTV but only with playback of recordings. Audio keeps going out of sync a 2-3 times in half an hour. Stepping back -15 is the solution. But bad for WAF :) If i use directsound instead of mpaudiorenderer there's no issue.

    So it's definetly in mpaudiorenderer, but i need mpaudiorenderer to get AC3 encoding for s/pdif (delay configured of 130ms). ffdshow is used and because of mpaudiorenderer passthrough must be disabled.
    Is there a solution within tsreader possible or should we stop using mpaudiorenderer for LiveTV?

    Edit: Workaround found, stopped using mpaudiorenderer for LiveTV and using MPA decoder to decode to s/pdif now. AC3 on HD channels working now. Audio delay configured on receiver.
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Tony, tested more, all fine....BUT, i have issues again with mpaudiorenderer, not on LiveTV but only with playback of recordings. Audio keeps going out of sync a 2-3 times in half an hour. Stepping back -15 is the solution. But bad for WAF :) If i use directsound instead of mpaudiorenderer there's no issue.

    So it's definetly in mpaudiorenderer, but i need mpaudiorenderer to get AC3 encoding for s/pdif (delay configured of 130ms). ffdshow is used and because of mpaudiorenderer passthrough must be disabled.
    Is there a solution within tsreader possible or should we stop using mpaudiorenderer for LiveTV?

    Edit: Workaround found, stopped using mpaudiorenderer for LiveTV and using MPA decoder to decode to s/pdif now. AC3 on HD channels working now. Audio delay configured on receiver.

    Good :)

    I've not looked at the code, but (from your info) it looks like MP Audio Renderer will drop late samples, but sometimes doesn't stall/wait for early samples - which is why (I suspect) you get the audio ahead of the video when it goes out of sync.

    Tony
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Tony, tested more, all fine....BUT, i have issues again with mpaudiorenderer, not on LiveTV but only with playback of recordings. Audio keeps going out of sync a 2-3 times in half an hour. Stepping back -15 is the solution. But bad for WAF :) If i use directsound instead of mpaudiorenderer there's no issue.

    So it's definetly in mpaudiorenderer, but i need mpaudiorenderer to get AC3 encoding for s/pdif (delay configured of 130ms). ffdshow is used and because of mpaudiorenderer passthrough must be disabled.
    Is there a solution within tsreader possible or should we stop using mpaudiorenderer for LiveTV?

    Edit: Workaround found, stopped using mpaudiorenderer for LiveTV and using MPA decoder to decode to s/pdif now. AC3 on HD channels working now. Audio delay configured on receiver.

    Good :)

    I've not looked at the code, but (from your info) it looks like MP Audio Renderer will drop late samples, but sometimes doesn't stall/wait for early samples - which is why (I suspect) you get the audio ahead of the video when it goes out of sync.

    MP audio renderer's sample dropping logic can be found from: https://github.com/MediaPortal/Medi...ync/audio renderer/source/MpAudioRenderer.cpp (CMPAudioRenderer::confused:cheduleSample)

    Is TsReader flushing the downstream on discontinuity? DeliverBeginFlush(), DeliverEndFlush(), DeliverNewSegment() - althou the new segment probably isnt used by the audio renderer.

    LogSampleTimes registry setting can be enabled to allow audio renderer to log more details on the incoming samples.
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    MP audio renderer's sample dropping logic can be found from: https://github.com/MediaPortal/Medi...ync/audio renderer/source/MpAudioRenderer.cpp (CMPAudioRenderer::confused:cheduleSample)

    Is TsReader flushing the downstream on discontinuity? DeliverBeginFlush(), DeliverEndFlush(), DeliverNewSegment() - althou the new segment probably isnt used by the audio renderer.

    LogSampleTimes registry setting can be enabled to allow audio renderer to log more details on the incoming samples.

    TsReader has never flushed downstream on discontinuities - it risks turning a minor glitch into a much bigger upset (and I've never managed to get it to work without running into lockup problems, even from a separate thread in TsReader - I tried it a while ago for another reason). Also default direct sound renderer doesn't need it.

    The scheduling code looks OK to me, but a thought occurs - is this is scheduling samples to be put into a downstream render queue ? If so, how long (in time) is the queue ?

    If the timestamp jump/gap is smaller than the queue length, then waiting for a future render time will just empty the queue a little, without delaying the time when the audio sample is actually presented to the outside world ?

    Tony
     

    mylle

    Portal Pro
    April 14, 2005
    574
    66
    Denmark
    Home Country
    Denmark Denmark
    Just for information too, MP 1.2.2 (custom build) + Dshowhelper 0.92 + TSreader 39 + LAV 0.42-45-gbd824b1 (0.43 Rc) Work very fine. Congratulation to you Owlsroost to made the first MP functionality better and better ;-)

    Just wanted to say that this combination works VERY well for me also. Have tried all your tsreader version but it was not until i tried the combination with dshowhelper_v0092_part_dwm that it started working well.

    lav video 0.42
    lavaudio 0.42
    tsreader 39
    dshowhelper 92 part dwm

    @owlsroost
    Thanks for all your great work!

    regards
    mylle
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    TsReader has never flushed downstream on discontinuities - it risks turning a minor glitch into a much bigger upset (and I've never managed to get it to work without running into lockup problems, even from a separate thread in TsReader - I tried it a while ago for another reason). Also default direct sound renderer doesn't need it.

    Flushing might not be mandatory, but it might help keeping the renderer's in sync (dropped data could be happening only on the one stream - and definitely wont be same amount of gap on both streams).

    But I'm not 100% sure if it is really needed. Probably it is better not to flush since it would cause much bigger wholes in the timeline (all queued data in decoders and renderers would be dropped).

    The scheduling code looks OK to me, but a thought occurs - is this is scheduling samples to be put into a downstream render queue ? If so, how long (in time) is the queue ?

    If the timestamp jump/gap is smaller than the queue length, then waiting for a future render time will just empty the queue a little, without delaying the time when the audio sample is actually presented to the outside world ?

    Cannot remember what defines the queue lenght (or how it even works :)) - would be good if someone could continue the audio renderer work (as he would be pretty much in the same situation than I as it has been over a year when I have last looked into that code).

    What comes to discontinuity handling, the old TsReader has worked with short discontinues at least. I have one .ts file that is having hundreds of different types of dropped data gaps - audio renderer is passing that "reference" without any issues. So the assumption about short gaps causing the renderer queue to behave badly is probably wrong. It must be something else.

    A log with the sample timestamps would reduce the quessing a lot :)
     

    Users who are viewing this thread

    Top Bottom