Opened 14 years ago

Closed 14 years ago

Last modified 19 months ago

#154 closed defect (fixed)

mythconverg.cardinput.startchan being written as NULL

Reported by: blammo.doh@… Owned by: danielk
Priority: minor Milestone: 0.19
Component: mythtv Version: 0.18.1
Severity: medium Keywords: dvb startchan
Cc: Ticket locked: no

Description

Summary: When attempting to use a frontend to view LiveTV and sourcing from a DVB backend, sometimes a frontend gets confused and leaves an empty value in mythconverg.cardinput.startchan.

From that point on, that capture card is un-usable for LiveTV. Anything scheduled works fine, but any attempts at liveTV fail.

Workaround: Force the value in SQL back to something other than NULL, and stop/start mythbackend, and stop/start mythfrontend

How to repeat:

mysql> select cardinputid,cardid,tunechan,startchan from cardinput;
+-------------+--------+----------+-----------+
| cardinputid | cardid | tunechan | startchan |
+-------------+--------+----------+-----------+
| 1 | 1 | 15 | 15 |
| 2 | 2 | 15_1 | 15_1 |
| 3 | 3 | 15_1 | 15_1 |
+-------------+--------+----------+-----------+
3 rows in set (0.00 sec)

Choose "LIVETV" on a frontend that is somehow confused about what LiveTV means (and this issue stays after stop/start frontend. The frontend will black screen then back to the menu.

2005-07-12 02:22:14.709 Changing from None to WatchingLiveTV
2005-07-12 02:22:14.746 DVB#0 Recorder: Card opened successfully (using TS mode).
2005-07-12 02:22:14.748 DVB#0 ERROR - No PIDS set, please correct your channel setup.
2005-07-12 02:22:15.749 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:16.751 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:17.753 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:18.755 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:19.756 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:20.758 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:21.760 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:22.762 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:23.764 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:24.766 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:25.767 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:26.769 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:27.771 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:28.773 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:29.775 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:29.777 Couldn't read data from the capture card in 15
seconds. Stopping.

2005-07-12 02:22:29.807 Changing from WatchingLiveTV to None
2005-07-12 02:22:30.777 DVB#0 WARNING - No data from card in 1 second.
2005-07-12 02:22:30.778 Closing DVB recorder

The PID's aren't actually missing, and if you correct the issue in SQL, stop and start the backend in question, stop and start the frontend, then you can view LiveTV again.

A query of the table shows:

mysql> select cardinputid,cardid,tunechan,startchan from cardinput;
+-------------+--------+----------+-----------+
| cardinputid | cardid | tunechan | startchan |
+-------------+--------+----------+-----------+
| 1 | 1 | 15 | 15 |
| 2 | 2 | 15_1 | 15_1 |
| 3 | 3 | 15_1 | |
+-------------+--------+----------+-----------+
3 rows in set (0.00 sec)

Notice the absence of "startchan"

If we can't solve what's creating the issue (which, unfortunately, I don't have enough logs to help with) there needs to be some logic to check for null startchan. Any value other than a numeric, or numeric_numeric should be invalid, and take "tunechan" instead.

Change History (3)

comment:1 Changed 14 years ago by myth-dev@…

I think I might be getting the same problem, i've lived with it for a while as i don't watch live tv, but i have a new frontend which i seem to be doing a lot of live tv so i started to investigate...
I cannot watch livetv if i restart the backend, it times out and returns to the menu, i can fix this by scheduling recordings on all three encoders at once, then shut one down and i can watch live tv...
I tracked the socket close down to libmyth/util.c
2005-07-23 00:53:43.214 ReadStringList? timeout (quick).

Thats as far as I got, i'm leaving for a boogie in a few hours for the weekend, hope it helps...

                 _   _      __                 _                 _ 
 _ __ ___  _   _| |_| |__  / _|_ __ ___  _ __ | |_ ___ _ __   __| |
| '_ ` _ \| | | | __| '_ \| |_| '__/ _ \| '_ \| __/ _ \ '_ \ / _` |
| | | | | | |_| | |_| | | |  _| | | (_) | | | | ||  __/ | | | (_| |
|_| |_| |_|\__, |\__|_| |_|_| |_|  \___/|_| |_|\__\___|_| |_|\__,_|
           |___/                 

tail -f /var/log/mythtv/mythfrontend
DisplaResX: Unable to XRRgetScreenInfo
Xlib:  extension "RANDR" missing on display ":0.0".
DisplaResX: Unable to XRRgetScreenInfo
2005-07-23 00:53:07.164 Switching to square mode (blue)
2005-07-23 00:53:07.611 Joystick disabled.
2005-07-23 00:53:07.672 Registering Internal as a media playback plugin.
2005-07-23 00:53:07.681 Registering MythDVD DVD Media Handler as a media handler
2005-07-23 00:53:08.657 Registering MythMusic Media Handler as a media handler
2005-07-23 00:53:08.724 New DB connection, total: 2
SIP listening on IP Address 192.168.1.69:5060 NAT address 192.168.1.69
SIP: Cannot register; proxy, username or password not set
2005-07-23 00:53:18.897 Connecting to backend server: 192.168.1.219:6543 (try 1 of 5)
2005-07-23 00:53:18.920 Attempting to change from None to WatchingLiveTV
2005-07-23 00:53:18.928 Using protocol version 18
2005-07-23 00:53:20.071 taking too long to be allowed to read..
2005-07-23 00:53:22.829 Opening audio device '/dev/sound/dsp'.
2005-07-23 00:53:22.829 Opening OSS audio device '/dev/sound/dsp'.
2005-07-23 00:53:23.213 Changing from None to WatchingLiveTV
2005-07-23 00:53:23.241 Realtime priority would require SUID as root.
2005-07-23 00:53:23.356 Video timing method: USleep with busy wait
2005-07-23 00:53:23.952 prebuffering pause
2005-07-23 00:53:25.438 Prebuffer wait timed out 10 times.
...
2005-07-23 00:53:41.771 Prebuffer wait timed out 10 times.
2005-07-23 00:53:43.214 ReadStringList timeout (quick).
Remote encoder not responding.
2005-07-23 00:53:43.255 Prebuffer wait timed out 10 times.

                 _   _     _                _                  _
 _ __ ___  _   _| |_| |__ | |__   __ _  ___| | _____ _ __   __| |
| '_ ` _ \| | | | __| '_ \| '_ \ / _` |/ __| |/ / _ \ '_ \ / _` |
| | | | | | |_| | |_| | | | |_) | (_| | (__|   <  __/ | | | (_| |
|_| |_| |_|\__, |\__|_| |_|_.__/ \__,_|\___|_|\_\___|_| |_|\__,_|
           |___/                 

tommy@vector ~ $ tail -f /var/log/mythtv/mythbackend
2005-07-23 00:55:14.875 JobQueue::GetJobsInQueue: Ignore 'Flag Commercials' Job for 1006 @ 20050722220000 in Finished state.
2005-07-23 00:55:35.092 read  <- 22 29      GET_NEXT_FREE_RECORDER[]:[]-1
2005-07-23 00:55:35.092 Getting next free recorder after : -1
2005-07-23 00:55:35.092 Checking card 1. Best card so far -1
2005-07-23 00:55:35.092 Checking card 2. Best card so far -1
2005-07-23 00:55:35.093 Checking card 3. Best card so far 3
2005-07-23 00:55:35.093 write -> 22 28      3[]:[]192.168.1.219[]:[]6543
2005-07-23 00:55:35.100 read  <- 24 21      MYTH_PROTO_VERSION 18
2005-07-23 00:55:35.100 write -> 24 13      ACCEPT[]:[]18
2005-07-23 00:55:35.106 read  <- 24 20      ANN Playback raven 0
2005-07-23 00:55:35.106 MainServer::HandleAnnounce Playback
2005-07-23 00:55:35.106 adding: raven as a client (events: 0)
2005-07-23 00:55:35.106 write -> 24 2       OK
2005-07-23 00:55:35.111 read  <- 24 44      QUERY_RECORDER 3[]:[]SETUP_RING_BUFFER[]:[]0
2005-07-23 00:55:35.112 write -> 24 104     ok[]:[]rbuf://192.168.1.219:6543/mnt/mythtv/livetv/ringbuf3.nuv[]...
2005-07-23 00:55:35.118 read  <- 27 20      ANN Playback raven 0
2005-07-23 00:55:35.118 MainServer::HandleAnnounce Playback
2005-07-23 00:55:35.118 adding: raven as a client (events: 0)
2005-07-23 00:55:35.118 write -> 27 2       OK
2005-07-23 00:55:35.123 read  <- 28 22      ANN RingBuffer raven 3
2005-07-23 00:55:35.123 adding: raven as a remote ringbuffer
2005-07-23 00:55:35.123 write -> 28 2       OK
2005-07-23 00:55:35.132 read  <- 24 33      QUERY_RECORDER 3[]:[]SPAWN_LIVETV
2005-07-23 00:55:35.135 Changing from None to WatchingLiveTV
2005-07-23 00:55:35.143 Using profile 'Live TV' to record
2005-07-23 00:55:35.175 write -> 24 2       ok
2005-07-23 00:55:35.180 read  <- 24 33      QUERY_RECORDER 3[]:[]IS_RECORDING
2005-07-23 00:55:35.180 write -> 24 1       1
2005-07-23 00:55:35.185 read  <- 24 33      QUERY_RECORDER 3[]:[]IS_RECORDING
2005-07-23 00:55:35.185 write -> 24 1       1
2005-07-23 00:55:35.190 read  <- 24 34      QUERY_RECORDER 3[]:[]GET_FRAMERATE
2005-07-23 00:55:35.190 write -> 24 5       29.97
2005-07-23 00:55:35.204 read  <- 24 37      QUERY_RECORDER 3[]:[]GET_PROGRAM_INFO
2005-07-23 00:55:35.205 write -> 24 91       []:[] []:[] []:[] []:[] []:[] []:[] []:[] []:[] []:[] []:[] []:[...
2005-07-23 00:55:35.212 read  <- 27 53      QUERY_RECORDER 3[]:[]REQUEST_BLOCK_RINGBUF[]:[]128000
2005-07-23 00:55:36.831 write -> 27 6       128000
2005-07-23 00:55:36.841 read  <- 27 66      QUERY_RECORDER 3[]:[]SEEK_RINGBUF[]:[]0[]:[]0[]:[]0[]:[]0[]:[]2048
....
2005-07-23 00:55:39.105 read  <- 27 53      QUERY_RECORDER 3[]:[]REQUEST_BLOCK_RINGBUF[]:[]128000
2005-07-23 00:55:39.420 read  <- 24 35      QUERY_RECORDER 3[]:[]GET_INPUT_NAME
2005-07-23 00:55:39.420 WriteStringList: Error, joined null string.
2005-07-23 00:55:40.840 write -> 27 6       128000
2005-07-23 00:55:40.854 read  <- 27 53      QUERY_RECORDER 3[]:[]REQUEST_BLOCK_RINGBUF[]:[]128000
2005-07-23 00:55:40.858 write -> 27 6       128000
....

comment:2 Changed 14 years ago by danielk

Milestone: 0.19
Owner: changed from Isaac Richards to danielk
Status: newassigned

The point of the check signal patch is to fix this and other problems.

The version from a couple weeks ago is at

http://www.cuymedia.net/patches/

There will be an update early next week.

comment:3 Changed 14 years ago by danielk

Resolution: fixed
Status: assignedclosed

(In [7062]) Closes #154.

Simple null/empty string check in StoreInputChannels?().

The major cause of this, a failing SwitchToInput?(), was fixed in [7060]. But this should prevent problems due to a failing tune at any other time.

Note: See TracTickets for help on using tickets.