[mythtv] myth protocol specific questions

Mudit Wahal mwahal at gmail.com
Fri Jun 17 16:00:58 UTC 2005


Hi all,

As mentioned earlier, I'm trying to write a frontend client which can
be invoked from within a program or via a script. Thanks to Isaac, I
think I've narrowed it down to a working prototype.

Here is my list of events I'm sending to the backend

 1. MYTH_PROTO_VERSION 17
 2. ANN Playback mythtvbe 0
 3. GET_NEXT_FREE_RECORDER[]:[]-1
 4. QUERY_RECORDER 1[]:[]SETUP_RING_BUFFER[]:[]0
 5. QUERY_RECORDER 1[]:[]SPAWN_LIVETV
 6. QUERY_RECORDER 1[]:[]GET_PROGRAM_INFO
 7. QUERY_RECORDER 1[]:[]PAUSE
 8. QUERY_RECORDER 1[]:[]CHANGE_CHANNEL[]:[]0
 9. QUERY_RECORDER 1[]:[]GET_PROGRAM_INFO
10. QUERY_RECORDER 1[]:[]STOP_LIVETV
11. QUERY_RECORDER 1[]:[]DONE_RINGBUF


The program works fine when all 11 steps are executed in the order. No
more double announces/sockets/etc. No warning messages from the
backend.

I looked at the code briefly, Ann playback open a playback socket. You
need to have the pbs (playbacksocket) to send the get next free
recorded query and subsequent requests to setup the liveTV.

But if I break from any step between 5 and 10, the connection at the
backend closes while leaving the recorded still in liveTV mode.

I checked the function MainServer::endConnection. Its checking for
playbacksocket, file transfers and ringbuffers in that order. It
returns after it finds an open socket and closes it.

Since the ringbuffer is being handled in the end, and the TVstate is
checked only in the ringbuffer (kState_WatchingLiveTV), its not even
being reached. As the playback is found first in this function, and
the socket is closed, leaving recorded still in kState_WatchingLiveTV
state. Subsequent calls to get next free recorded always fail.

If I call ANN Ringbuffer after calling ANN Playback, I get a warning
from backend, "client trying to open another socket" (or something
like that).

This is off latest CVS (updated last night).

backend logs
=========
2005-06-17 08:49:51.678 DVB#0 DVB signal 67ad | snr ed57 | ber    0 | unc    0
2005-06-17 08:49:51.678 DVB#0 Status: LOCK.
2005-06-17 08:49:51.678 DVB#0 Multiplex Locked
2005-06-17 08:49:51.730 MainServer::endConnection closing socket main function
2005-06-17 08:49:51.730 MainServer::endConnection stopping playback
list socket closing
2005-06-17 08:49:52.710 DVB#0 Successfully tuned to channel 20_1.
Unable to write to client socket, as it's no longer there
2005-06-17 08:49:52.711 DVB#0 Data read from DMX - This is for
debugging with transform.c
==========

Thanks
Mudit


More information about the mythtv-dev mailing list