[mythtv] LiveTV playback stops at end of shows

Chris Bagwell chris at cnpbagwell.com
Thu Feb 23 15:03:06 UTC 2006


> It's a duplicate.  Someone that this is still happening to with current SVN 
> needs to either add some extra debugging to the RingBuffer::ReadAheadThread() 
> function to see why it's not ever reading data from the new file, or hop onto 
> IRC (#mythtv, irc.freenode.net) and help debug it there.

If I'm on the right track, I think my problem is only a duplicate of people
that are taking the "local" file code path.

By putting in some extra logging, I think that the frontend is switching
correctly to the new file and reading data from it.  After reading a little
data, something is requesting a Seek() operation and RingBuffer::safe_read()
starts returning 0 bytes from that point on.

I am suspecting the Seek() causing the problem but haven't proved anything yet.
Possible causes: 1) ReadAhead thread is doing a read() on fd2 while another
thread requests a seek() and corrupting some file descriptor data.
2) The value passed to seek() is invalid and it seeks past the end of file
which causes EOF condition.

Hopefully, this helps others pinpoint the problem faster... I'll continue to
look into it as time permits.

Logs below to help show what I've found. snipped lots that I though wasn't useful.

2006-02-22 22:00:06.944 RingBuf(/mnt/store//1004_20060222215122.mpg): OpenFile(myth://127.0.0.1:6543/1004_20060222220000.mpg, 10)
2006-02-22 22:00:06.951 RingBuffer::ReadAheadThread(): 1 0 1
2006-02-22 22:00:06.959 RingBuffer::ReadAheadThread(): 1 0 1
2006-02-22 22:00:06.970 RingBuffer::ReadAheadThread(): 0 0 1
2006-02-22 22:00:06.970 RingBuffer::ReadAheadThread(): after totfree = 2445447 readblocksize = 131072 commserr = 0
2006-02-22 22:00:06.970 RingBuffer::safe_read(fd ...): 0 0 131072
2006-02-22 22:00:06.992 RingBuffer::safe_read(fd ...): ret= 131072
2006-02-22 22:00:06.994 RingBuffer::ReadAheadThread(): ret = 131072 internalreadpos = 340936412
2006-02-22 22:00:07.327 FileChangedCallback
2006-02-22 22:00:07.367 RingBuffer::ReadAheadThread(): 1 0 0
2006-02-22 22:00:07.369 Resyncing position map. posmapStarted = 0 livetv(1) watchingRec(1)
2006-02-22 22:00:07.376 RingBuffer::ReadAheadThread(): 0 0 1
2006-02-22 22:00:07.377 Position map filled from DB to: 6
2006-02-22 22:00:07.377 SyncPositionMap watchingrecording, from DB: 6 entries
2006-02-22 22:00:07.392 Filling position map from 7 to 9
2006-02-22 22:00:07.400 Position map filled from Encoder to: 9
2006-02-22 22:00:07.401 SyncPositionMap watchingrecording total: 9 entries
2006-02-22 22:00:07.401 SyncPositionMap, new totframes: 135, new length: 4, posMap size: 9
2006-02-22 22:00:07.415 RingBuffer::ReadFromBuf(): readaheadpaused 0 stopreads 0 count 32768
2006-02-22 22:00:07.415 RingBuffer::ReadFromBuf(): avail 2588672 ateof 0 count 32768
2006-02-22 22:00:07.428 RingBuffer::ReadAheadThread(): 0 0 0
2006-02-22 22:00:07.451 RingBuffer::ReadFromBuf(): readaheadpaused 0 stopreads 0 count 32768
2006-02-22 22:00:07.452 RingBuffer::ReadFromBuf(): avail 2555904 ateof 0 count 32768
'video_output' mean = '33940.80', std. dev. = '11683.32', fps = '29.46'
2006-02-22 22:00:07.485 RingBuffer::ReadAheadThread(): 0 0 0
2006-02-22 22:00:07.491 RingBuffer::ReadFromBuf(): readaheadpaused 0 stopreads 0 count 32768
2006-02-22 22:00:07.491 RingBuffer::ReadFromBuf(): avail 2523136 ateof 0 count 32768
2006-02-22 22:00:07.519 RingBuffer::ReadFromBuf(): readaheadpaused 0 stopreads 0 count 32768
2006-02-22 22:00:07.519 RingBuffer::ReadFromBuf(): avail 2490368 ateof 0 count 32768
2006-02-22 22:00:07.540 RingBuffer::ReadAheadThread(): 0 0 0
2006-02-22 22:00:07.541 RingBuffer::ReadAheadThread(): after totfree = 163839 readblocksize = 131072 commserr = 0
2006-02-22 22:00:07.541 RingBuffer::safe_read(fd ...): 0 0 131072
2006-02-22 22:00:07.543 RingBuffer::safe_read(fd ...): ret= 131072
2006-02-22 22:00:07.543 RingBuffer::ReadAheadThread(): ret = 131072 internalread:
2006-02-22 22:00:08.195 RingBuffer::ReadAheadThread(): 0 0 0
2006-02-22 22:00:08.195 RingBuffer::ReadAheadThread(): after totfree = 163839 readblocksize = 131072 commserr = 0
2006-02-22 22:00:08.195 RingBuffer::safe_read(fd ...): 0 0 131072
2006-02-22 22:00:08.196 RingBuffer::safe_read(fd ...): ret= 131072
2006-02-22 22:00:08.197 RingBuffer::ReadAheadThread(): ret = 131072 internalreadpos = 343938916
2006-02-22 22:00:08.197 RingBuffer::ReadAheadThread(): stopreads = 0 setswitchtonext = 0 ignoreliveeof = 0
2006-02-22 22:00:08.199 RingBuffer::ReadAheadThread(): 0 0 0
2006-02-22 22:00:08.227 RingBuffer::ReadFromBuf(): readaheadpaused 0 stopreads 0 count 32768
2006-02-22 22:00:08.228 RingBuffer::ReadFromBuf(): avail 2588672 ateof 0 count 32768
2006-02-22 22:00:08.251 RingBuffer::ReadAheadThread(): 0 0 0
2006-02-22 22:00:08.295 RingBuffer::ReadFromBuf(): readaheadpaused 0 stopreads 0 count 32768
2006-02-22 22:00:08.295 RingBuffer::ReadFromBuf(): avail 2555904 ateof 0 count 32768
2006-02-22 22:00:08.305 RingBuffer::ReadAheadThread(): 0 0 0

[ 0 0 0 = pausereadthread writemode readaheadpaused; printed at top of while(readaheadrunning) loop]

2006-02-22 22:00:08.317 RingBuffer::Seek(): whence 0 readpost 610440 ret 341417424 readaheadrunning 1

[ Seek() seems to be called without ReadAhead being paused which seems dangerous. ]

2006-02-22 22:00:08.318 RingBuffer::ReadFromBuf(): readaheadpaused 0 stopreads 0 count 32768
2006-02-22 22:00:08.318 RingBuffer::ReadFromBuf(): after readsallowed 0 stopreads 0
2006-02-22 22:00:08.359 RingBuffer::ReadAheadThread(): after totfree = 2621439 readblocksize = 131072 commserr = 0
2006-02-22 22:00:08.359 RingBuffer::safe_read(fd ...): 0 0 131072
2006-02-22 22:00:08.359 RingBuffer::safe_read(fd ...): ret= 0
2006-02-22 22:00:08.423 RingBuffer::safe_read(fd ...): ret= 0
2006-02-22 22:00:08.487 RingBuffer::safe_read(fd ...): ret= 0
2006-02-22 22:00:08.551 RingBuffer::safe_read(fd ...): ret= 0
2006-02-22 22:00:08.615 RingBuffer::safe_read(fd ...): ret= 0
2006-02-22 22:00:08.679 RingBuffer::safe_read(fd ...): ret= 0

[ no more data is returned from safe_read until the file is closed and reopened
 by exiting and reentering LiveTV ]




More information about the mythtv-dev mailing list