[Approved] Fix for stuttering/corrupted streaming of live tv (4 Viewers)

disaster123

MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: Fix for stuttering/corrupted streaming of live tv

    as far as i know => NO. SMB is just not supposed to be used for streaming stuff.
     

    mylle

    Portal Pro
    April 14, 2005
    574
    66
    Denmark
    Home Country
    Denmark Denmark
    Re: AW: Fix for stuttering/corrupted streaming of live tv

    as far as i know => NO. SMB is just not supposed to be used for streaming stuff.

    To bad. I agree that RTSP in MP is buggy and it also take 2-3 times as long to change channels.

    UNC channelswitching = 0,3 sek
    RTSP channelswithing = close to 1 second.

    regards
    Jacob
     

    miroslav22

    Development Group Member
  • Premium Supporter
  • September 4, 2009
    703
    460
    Warwick
    Home Country
    United Kingdom United Kingdom
    Live tv requires a high number of time critical read/write operations per second. You need to remember that SMB is simply not designed to be used this way.

    I recognise there are problems with RTSP but we will get round to fixing them in due course. I'd investigate myself but here in the UK AFAIK there are no channels that trigger the video/audio switching problem. (If anyone knows of one please let me know)
     

    Jay_UK

    Test Group
  • Team MediaPortal
  • October 6, 2009
    1,780
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Hi there,

    If people are experiencing this issue on XP, then its not SMB2 caching.

    You can try disabling the cache settings:

    sc config lanmanworkstation depend= bowser/mrxsmb10/nsi
    sc config mrxsmb20 start= disabled

    Note there's an extra " " (space) after the "=" sign.

    To enable back SMB 2.0 for Windows Vista or Windows Server 2008 systems that are the “client” systems run the following commands:

    sc config lanmanworkstation depend= bowser/mrxsmb10/mrxsmb20/nsi
    sc config mrxsmb20 start= auto

    There are also some registry settings to play with: :D

    Registry values

    All listed settings are in the following registry location:

    Key: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanWorkStation\Parameters

    Value type: REG_*
    Value name: <name of value>
    Default: <value if note present>

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: AllowGuestAuthWhenSigningRequired
    Default: FALSE

    Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled
    Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled

    When a Server Message Block (SMB) version 1 client establishes a non-guest session or a non-anonymous session with a server, the client enables security signatures for the server. Later sessions then inherit the security signature sequence that is already established.

    To improve security, Windows Server 2008 and Windows Vista SP1 prevent server authenticated connections from being maliciously downgraded to a guest session or to an anonymous session. However, this improved security does not address the scenario that is described in the "Symptoms" section (Event ID: 1058).

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: FileInfoCacheLifetime
    Default: 10 (seconds)

    Used for increasing network file system performance.
    The caches are consistent when changes are made by the client, but if changes are made from another client, they may not be reflected until the cache times out.

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: FileNotFoundCacheLifetime
    Default: 5 (seconds)

    Used for increasing network file system performance. The caches are consistent when changes are made by the client, but if changes are made from another client, they may not be reflected until the cache times out.

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: DirectoryCacheLifetime
    Default: 10 (seconds)

    Used for increasing network file system performance. The caches are consistent when changes are made by the client, but if changes are made from another client, they may not be reflected until the cache times out.

    ==============================================================================
    Vista, 2008, ...

    Value type: REG_DWORD
    Value name: DisableBandwidthThrottling
    Default: FALSE

    Performance Tuning Guidelines for Windows Server 2008.
    Performance Tuning Guidelines for Windows Server 2008

    The default is 0. This setting is available starting with Windows Server 2008 SP2. By default, the SMB redirector throttles throughput across high-latency network connections in some cases to avoid network-related timeouts. Setting this registry value to 1 disables this throttling, enabling higher file transfer throughput over high-latency network connections.

    ==============================================================================
    Windows 2003, ...

    Value type: REG_DWORD
    Value name: DisableByteRangeLockingOnReadOnlyFiles
    Default: FALSE

    How To Improve Windows 2003 File Server Performance
    How To Improve Windows 2003 File Server Performance

    ==============================================================================
    Windows 2003, ...

    Value type: REG_DWORD
    Value name: ExtendedSessTimeout
    Default: 1000 (seconds)

    Value type: REG_MULTI_SZ
    Value name: ServersWithExtendedSessTimeout
    Default: <null>

    May be useful in high latency networks.

    Controls the time-out period that the client uses when sending requests to a server listed in ServersWithExtendedSessTimeout. The default is value is 1000 (or 16.67 minutes). You can increase this value on all Windows 2003 and later systems.

    ==============================================================================
    Windows 2003, ...

    Value type: REG_DWORD
    Value name: NoDeleteOnClose
    Default: FALSE

    You cannot modify or delete files on an OS/2 Warp 4-based server that uses the HPFS file system
    You cannot modify or delete files on an OS/2 Warp 4-based server that uses the HPFS file system

    ==============================================================================
    Windows 2003, ...

    Value type: REG_DWORD
    Value name: ScavengerTimeLimit
    Default: 0 (seconds)

    How To Improve Windows 2003 File Server Performance
    How To Improve Windows 2003 File Server Performance

    You may experience delays of between 10 and 60 seconds when you use UNC paths to access files that are stored on a remote SMB server on a multihomed Windows Server 2003-based computer
    You may experience delays of between 10 and 60 seconds when you use UNC paths to access files that are stored on a remote SMB server on a multihomed Windows Server 2003-based computer

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: EnableCachingOnWriteOnlyOpens
    Default: FALSE

    Write only files are not cacheable; note that this setting is not recommended due to possible side effects.
    Use SetFilePointer(...) and SetEndOfFile(...) instead.

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: EnableDownLevelLogOff
    Default: FALSE

    Net3101 Error on OS/2 Server Because of SessionSetup SMB
    Net3101 Error on OS/2 Server Because of SessionSetup SMB

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: EnablePlainTextPassword
    Default: FALSE

    Unencrypted Passwords May Cause SP3 to Fail to Connect to SMB Servers
    Unencrypted Passwords May Cause SP3 to Fail to Connect to SMB Servers

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: EnableSecuritySignature
    Default: TRUE

    Value type: REG_DWORD
    Value name: RequireSecuritySignature
    Default: FALSE

    Overview of Server Message Block signing
    Overview of Server Message Block signing

    Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled
    Group Policy settings are not applied on member computers that are running Windows Server 2008 or Windows Vista SP1 when certain SMB signing policies are enabled

    Server Message Block communication between a client-side SMB component and a server-side SMB component is not completed if the SMB signing settings are mismatched in Group Policy or in the registry
    Server Message Block communication between a client-side SMB component and a server-side SMB component is not completed if the SMB signing settings are mismatched in Group Policy or in the registry

    ==============================================================================
    Windows 2000, ...

    Value type: REG_DWORD
    Value name: OffLineFileTimeoutIntervalInSeconds
    Default: 1000

    Remote Storage and Windows 2000
    Remote Storage and Windows 2000


    Thanks,

    J. :D
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: Re: Fix for stuttering/corrupted streaming of live tv

    Live tv requires a high number of time critical read/write operations per second. You need to remember that SMB is simply not designed to be used this way.

    I recognise there are problems with RTSP but we will get round to fixing them in due course. I'd investigate myself but here in the UK AFAIK there are no channels that trigger the video/audio switching problem. (If anyone knows of one please let me know)

    You just need a channel with MPEG audio and one channel with MPEG audio AND AC3 and tick the option prefer AC3 in tv client. Then switch between those channels. You can also use a H.264 channel and an SD MPEG channel but in this case the hang occurs less often than the one with the audio.
     

    miroslav22

    Development Group Member
  • Premium Supporter
  • September 4, 2009
    703
    460
    Warwick
    Home Country
    United Kingdom United Kingdom
    Ah right, apologies I misunderstood the problem. I thought it was when a channel changed audio/video format from program to program.

    So I just need a channel with both AC3/MPEG audio and one with just MPEG?

    Where does the hang occur? Is it in streaming server or in tsreader on the client?
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: Re: Fix for stuttering/corrupted streaming of live tv

    Ah right, apologies I misunderstood the problem. I thought it was when a channel changed audio/video format from program to program.

    So I just need a channel with both AC3/MPEG audio and one with just MPEG?

    Where does the hang occur? Is it in streaming server or in tsreader on the client?

    right - that's the easiest way. But you need some channel changes to trigger it. The problem is - that Tsreader or Streamingserver doesn't know where it was and start at the wrong point.

    An example - should be correct as far as i can remember:
    Watch Channel 1 - doing channel change - now tsreader AND/OR streamingserver are sometimes at the pos. BEFORE the channel change has happened - as it knows only about keyframes - this keyframe can be before the channel changes and now you get stuck. Streamingserver sends then again this change to tsreader it starts again on the old key frame - LOOP!...
     

    Jay_UK

    Test Group
  • Team MediaPortal
  • October 6, 2009
    1,780
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Miroslav22,

    Try BBC HD, I believe this has two steams (one with commentary, one without).

    Thanks,

    J.
     

    arion_p

    Retired Team Member
  • Premium Supporter
  • February 7, 2007
    3,367
    1,642
    Athens
    Home Country
    Greece Greece
    Regarding SMB caching, all I can think of is to try the following:
    1. Change TSWriter sot that before writing to a file it gets an exclusive (write) lock to the range it will write, do the write, then release the lock. Also it might be beneficial to try to combine all the writes in to the TSBuffer file in a single write (otherwise other processes may see partial writes).
    2. Change TSReader so that before reading from a file it gets a shared (read) lock to the range it will read from.

    I do not know if the above will help but it is worth a try.
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: Fix for stuttering/corrupted streaming of live tv

    arion_p
    At least for me - it could also be solved by just using ONE single buffer file. My stuttering always starts after the ts file changes - so i'm still not sure if it is really the caching.

    When i set the filesize to 1000MB i can watch stutterfree until the 1000MB are reached...
     

    Users who are viewing this thread

    Top Bottom