Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#4566 closed defect (fixed)

Multirec merge: Backend gets stuck tuning channel

Reported by: Mark Buechler <Mark.Buechler@…> Owned by: danielk
Priority: minor Milestone: 0.21
Component: mythtv Version: head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

The backend can at times get stuck while tuning a channel. The attached logs show an example tuning 5330. The frontend after a few seconds shows the standard error while displaying video message and the backend hangs on:

2008-02-01 15:29:42.388 TVRec(5): SetFlags?(WaitingForRecPause?,) -> RunMainLoop?,CancelNextRecording?,WaitingForRecPause?,RecorderRunning?,

The backend at this point has to be kicked in order to use tuner 5 again. Backend, frontend and bt attached.

Attachments (13)

backend.txt (13.5 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backend log
frontend.txt (48.5 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Frontend log
bt.txt (44.8 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backtrace
log.txt (134.0 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backtraces and step.. look at the end of the file.
backend.2.txt (9.5 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backend to long along with 'log.txt'.
backend.3.txt (48.5 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Latest backend log
bt.2.txt (109.4 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Latest bt
bt.3.txt (48.8 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
02/09/08 backtrace
backend.4.txt (13.5 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
02/09/08 backend log
bt.4.txt (118.6 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backtrace - eit disabled
backend.5.txt (189.0 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Backend log - eit disabled
frontend.2.txt (162.6 KB) - added by Mark Buechler <Mark.Buechler@…> 12 years ago.
Frontend log - eit disabled
4566-dbg-v1.patch (430 bytes) - added by danielk 12 years ago.
potential fix

Download all attachments as: .zip

Change History (26)

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: backend.txt added

Backend log

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: frontend.txt added

Frontend log

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: bt.txt added

Backtrace

comment:1 Changed 12 years ago by danielk

Milestone: unknown0.21
Owner: changed from Isaac Richards to danielk
Status: newassigned

comment:2 Changed 12 years ago by danielk

Mark, can you try the latest SVN? Based on the logs, I believe [15760] may have fixed this...

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: log.txt added

Backtraces and step.. look at the end of the file.

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: backend.2.txt added

Backend to long along with 'log.txt'.

comment:3 Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Daniel, I will. I've gathered more info and attached it. If 15760 doesn't fix this bug, log.txt should be reveling. Look at the bottom of the file - thread 12 is the stuck thread.

  • Mark.

comment:4 Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Daniel, looking through that patch, I'm uncertain it fixes this issue. The frontend doesn't happily wait, it actually exits with the standard "error while displaying..." quite quickly (I suspect after the "quick" timeout). The backend, however, looks to be looping between SetChannel?(), WaitForEventThreadSleep?()and HasFlags?() within TVRec even after the frontend exits and even after it's restarted. The backed stays stuck until it's restarted.

I'll give it a try tonight anyway.

  • Mark.

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: backend.3.txt added

Latest backend log

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: bt.2.txt added

Latest bt

comment:5 Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Daniel, this is still an issue for me. This time, however, it looks like it cycling somewhere else. It's still stuck tuning but the frontend is, with this one, completely unusable since it keeps timing out on socket communications (quick).

  • Mark.

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: bt.3.txt added

02/09/08 backtrace

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: backend.4.txt added

02/09/08 backend log

comment:6 Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Added latest backtrace and backend log. This time it seems to be stuck in yet a third place.

  • Mark.

comment:7 Changed 12 years ago by danielk

Mark, does this happen when EIT is disabled?

I think maybe recent changes in the EIT handling may have caused the problem and the multirec code is either just an aggravating factor or a red herring.

comment:8 Changed 12 years ago by danielk

Status: assignedinfoneeded

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: bt.4.txt added

Backtrace - eit disabled

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: backend.5.txt added

Backend log - eit disabled

Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Attachment: frontend.2.txt added

Frontend log - eit disabled

comment:9 Changed 12 years ago by Mark Buechler <Mark.Buechler@…>

Added logs & bt as requested. It does indeed get stuck with all EIT disabled.

comment:10 Changed 12 years ago by danielk

Status: infoneededassigned

note: From tracing Mark did and discussed on #mythtv

It seems to be getting stuck in DRB::WaitForUsed?() after listeners should have been removed, probably because neither true=>request_pause nor false=>running are set when the last Listener on DVBStreamHandler() is removed, or some listener is not getting removed when it should be.

Changed 12 years ago by danielk

Attachment: 4566-dbg-v1.patch added

potential fix

comment:11 Changed 12 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [16058]) Fixes #4566. Makes sure that the DeviceReadBuffer? stops reading the dvb device when the DVBStreamHandler is stopped.

Before it was possible that the DRB never received the signal because the stream handler was waiting for the DRB to stop blocking before sending the signal and the DRB would only stop blocking if it recieved data on the file handle, or got the stop/paused signal. This change makes sure we send the stop signal to the DRB before we try to stop the stream handler so that shutdown does not depend on there being data in the DVB driver's buffers.

comment:12 Changed 12 years ago by anonymous

Could this be merged back into svn.

comment:13 in reply to:  12 Changed 12 years ago by anonymous

Replying to anonymous:

Could this be merged back into svn trunk.

Note: See TracTickets for help on using tickets.