Opened 19 years ago
Closed 19 years ago
#2552 closed patch (fixed)
livetv, SwitchToProgram(), resets readahead buffer size to 4000KB
| Reported by: | jwestfall | Owned by: | danielk |
|---|---|---|---|
| Priority: | minor | Milestone: | 0.21 |
| Component: | mythtv | Version: | head |
| Severity: | medium | Keywords: | |
| Cc: | Ticket locked: | no |
Description
When livetv auto-switches to the next file it calls ringbuffer->OpenFile() which resets the size of the readahead buffer back to the default of 4000KB. This is causing a number of glitches, especially with HD content.
2006-10-08 13:46:08.327 detectInterlace(Detect Scan, Interlaced Scan, 29.97, 1088) ->Interlaced Scan
2006-10-08 13:46:08.327 AFD: Looking for decoder for MPEG2VIDEO
2006-10-08 13:46:08.327 AFD: Opened codec 0xb096d00, id(MPEG2VIDEO) type(Video)
2006-10-08 13:46:08.327 AFD: Stream #1, has id 0x2049 codec id AC3, type Audio, bitrate 384000 at 0x0xae68d10
2006-10-08 13:46:08.327 AFD: Looking for decoder for AC3
2006-10-08 13:46:08.328 AFD: Opened codec 0x8994dc0, id(AC3) type(Audio)
2006-10-08 13:46:08.333 NVP: Waiting for prebuffer.. 3 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2006-10-08 13:46:08.344 RingBuf(myth://10.0.0.125:6543/1107_20061008134732.mpg): CalcReadAheadThresh(39195 KB)
-> threshhold(1691 KB) min read(32 KB) blk size(512 KB)
...
2006-10-08 13:58:40.925 LiveTVChain(live-mythfrontend-2006-10-08T11:07:06): SwitchTo(7)
2006-10-08 13:58:40.926 LiveTVChain(live-mythfrontend-2006-10-08T11:07:06): Entry@7: '1107_20061008140000'
2006-10-08 13:58:40.952 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(1519KB) vfl(29) frh(9) ne:0
2006-10-08 13:58:40.986 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(1486KB) vfl(29) frh(9) ne:0
2006-10-08 13:58:41.018 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(1420KB) vfl(29) frh(8) ne:0
2006-10-08 13:58:41.052 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(1355KB) vfl(29) frh(8) ne:0
2006-10-08 13:58:41.115 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(1322KB) vfl(28) frh(8) ne:0
2006-10-08 13:58:41.139 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(1256KB) vfl(28) frh(7) ne:0
2006-10-08 13:58:41.163 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(1158KB) vfl(28) frh(7) ne:0
2006-10-08 13:58:41.217 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(994KB) vfl(28) frh(6) ne:0
2006-10-08 13:58:41.249 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(929KB) vfl(28) frh(5) ne:0
2006-10-08 13:58:41.279 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(863KB) vfl(28) frh(5) ne:0
2006-10-08 13:58:41.321 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(830KB) vfl(28) frh(5) ne:0
2006-10-08 13:58:41.350 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(798KB) vfl(28) frh(4) ne:0
2006-10-08 13:58:41.378 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(798KB) vfl(28) frh(4) ne:0
2006-10-08 13:58:41.418 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(732KB) vfl(28) frh(4) ne:1
2006-10-08 13:58:41.418 SwitchToProgram(void)
2006-10-08 13:58:41.449 RingBuf(myth://10.0.0.125:6543/1107_20061008134732.mpg): OpenFile(myth://10.0.0.125:6543/1107_200
61008140000.mpg, 10)
2006-10-08 13:58:41.467 RingBuf(myth://10.0.0.125:6543/1107_20061008140000.mpg): CalcReadAheadThresh(4000 KB)
-> threshhold(402 KB) min read(32 KB) blk size(64 KB)
Attachments (2)
Change History (6)
by , 19 years ago
| Attachment: | livetv-readahead.diff added |
|---|
comment:1 by , 19 years ago
| Owner: | changed from to |
|---|
by , 19 years ago
| Attachment: | 2552-v1.patch added |
|---|
comment:2 by , 19 years ago
| Milestone: | unknown → 0.21 |
|---|
Jim can you test the attached patch and tell me if it fixes the problem for you?
The problem with your patch is that it doesn't handle rate changes between files. The '2552-v1.patch' patch should handle these by querying the decoder for the actual raw bitrate. But I'm not sure if this handles jumping back and forth between two programs in LiveTV correctly.
comment:3 by , 19 years ago
working good for me.
thanks
2006-10-21 10:00:03.007 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(908KB) vfl(30) frh(5) ne:0
2006-10-21 10:00:03.040 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(842KB) vfl(30) frh(5) ne:0
2006-10-21 10:00:03.061 NVP: IsReallyNearEnd() br(4899KB) fps(29) sz(744KB) vfl(30) frh(4) ne:1
2006-10-21 10:00:03.061 SwitchToProgram(void)
2006-10-21 10:00:03.083 RingBuf(/tv/1111_20061021095251.mpg): OpenFile(myth://10.0.0.125:6543/1111_20061021100000.mpg, 10)
2006-10-21 10:00:03.098 RingBuf(myth://10.0.0.125:6543/1111_20061021100000.mpg): CalcReadAheadThresh(4000 KB)
-> threshhold(402 KB) min read(32 KB) blk size(64 KB)
2006-10-21 10:00:03.098 TMP DEBUG -- UpdateRawBitrate(39195)
2006-10-21 10:00:03.098 RingBuf(myth://10.0.0.125:6543/1111_20061021100000.mpg): CalcReadAheadThresh(39195 KB)
-> threshhold(1691 KB) min read(32 KB) blk size(512 KB)
comment:4 by , 19 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
(In [11616]) Fixes #2552. Sets the proper bitrate in the RingBuffer after it is reset by an OpenFile.
We add a GetRawBitrate() method to DecoderBase which returns the current estimated bitrate of the video if played at normal speed, and add calls in the NVP which calls RingBuffer::UpdateRawBitrate() with this value shortly after either of the two OpenFile calls in the NVP.
This should resolve some of the issues with prebuffer pauses after a LiveTV program change with HDTV streams on slower frontends.

Better fix..