Opened 13 years ago
Closed 13 years ago
#9780 closed Bug Report - Hang/Deadlock (Fixed)
Network Remote Control Interface breaks DVD playback
Reported by: | Owned by: | markk | |
---|---|---|---|
Priority: | major | Milestone: | 0.24.1 |
Component: | MythTV - DVD Playback | Version: | 0.24-fixes |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
We use our Android phones as remote controls using the mythmote app that uses the Network Remote Control Interface. DVD's with still frames hang mythfrontend when using this method. If you attempt to play the same DVD using a keyboard with mythmote disconnected the DVD plays fine.
Attachments (2)
Change History (9)
Changed 13 years ago by
Attachment: | mythfrontend.log added |
---|
comment:1 Changed 13 years ago by
Status: | new → infoneeded_new |
---|
I can't reproduce this with master. I'll need the full output of mythfrontend -v playback and a backtrace from the deadlocked frontend.
Changed 13 years ago by
Attachment: | mythfrontend_full.txt added |
---|
mythfrontend log of attempted DVD playback with mythmote with -v playback
comment:2 Changed 13 years ago by
Can you tell me how to get a backtrace please. The instructions at (http://www.mythtv.org/wiki/Debugging#Basic_Backtrace) look to only be for crashes, not hangs.
comment:3 Changed 13 years ago by
I had an email from the mythmote developer over night and it appears that turning off the 'Status Update Interval' in mythmote prevents the MythTV hang. I assume that a 'Status Update' shouldn't cause Mythtv to hang so I'll leave this issue open but it's probably more a bug with the remote control interface rather than DVD playback.
comment:4 follow-up: 6 Changed 13 years ago by
The status update Dave is referring to is a "query location" command sent from mythmote. By default mythmote sends the query location command every 5 seconds to keep track of the connection state. Any recommendations from the mythtv team on a better solution less prone to hanging the frontend? Maybe "query time" or "query version"?
comment:5 Changed 13 years ago by
DVDRingBuffer: Unlock the ring buffer when waiting on state changes.
The DVD ringbuffer does not use the read ahead thread and hence holding the writelock during safe_read is not strictly necessary (see RingBuffer::ReadPriv?). DVDRingBuffer::safe_read can also hold that lock for tens of seconds when, for example, displaying a still frame (the dvd device simply returns specific events, but not data, until it is told to skip the still frame).
Under normal operation this is not a problem but events received from external sources (such as network control) can trigger code that tries to lock the ringbuffer from the main UI thread (e.g. RingBuffer::GetFilename?). The lock is not obtained, event processing in the main thread is blocked and the wait state in the ringbuffer thread is not cleared - and the frontend deadlocks as a result.
The solution is to release the lock while sleeping within DVDRingBuffer::safe_read to allow other threads to obtain the lock temporarily. I've also added a warning message should the read ahead thread be running in the DVD ringbuffer.
Refs #9780
Branch: master Changeset: fd5e33a69b630aa9c0b94a8c2dd7693f02726316
comment:6 Changed 13 years ago by
Replying to tom8oe@…:
Any recommendations from the mythtv team on a better solution less prone to hanging the frontend? Maybe "query time" or "query version"?
This should be fixed in master - it would be helpful if someone else could test - and I'll backport in a few days if it proves to be a stable fix.
comment:7 Changed 13 years ago by
Milestone: | unknown → 0.24.1 |
---|---|
Resolution: | → Fixed |
Status: | infoneeded_new → closed |
Fixed in 4dec7cf2c709b3a17c99
mythfrontend log of attempted DVD playback with mythmote