[mythtv] libcmyth failing to receive HD stream

Stuart Morgan stuart at tase.co.uk
Sun Feb 22 13:01:05 UTC 2009

On Saturday 21 February 2009 23:39:54 Chase Douglas wrote:
> I'm working on a separate frontend project using libcmyth and I've
> been able to generate and play a live tv SD stream from an IVTV card.
> A few times I've been able to generate and play an HD stream from a
> pcHDTV-5500 card. However, usually the HD stream playback doesn't
> work. The frontend keeps requesting bytes (as low as 1 byte), and the
> backend keeps returning 0.
> My guess as to why I'm seeing this only on HD streams is that the SD
> stream from the IVTV card is "always on". There's no lag time between
> starting a recording and the recording file being available apart from
> the backend processes creating the recording. However, a digital
> recording has to first tune and lock on to the signal before the
> recording actually starts. I am guessing that my frontend is missing
> some step between spawning live tv and beginning to request bytes of
> the stream. I see the following in the backend log:
> 2009-02-21 17:10:46.739 Preview Error: Previewer file '/home/mythtv/
> recordings/1840_20090221171043.mpg' is not valid.
> 2009-02-21 17:10:46.740 Preview Error: Run() file not local: '/home/
> mythtv/recordings/1840_20090221171043.mpg'
> 2009-02-21 17:10:46.746 Preview Error: Preview process not ok.
>                          fileinfo(/home/mythtv/recordings/
> 1840_20090221171043.mpg.png) exists: 0 readable: 0 size: 0
> 2009-02-21 17:10:51.531 RingBuf(/home/mythtv/recordings/
> 1840_20090221171043.mpg): Invalid file (fd -1) when opening '/home/
> mythtv/recordings/1840_20090221171043.mpg'.
> 2009-02-21 17:10:51.567 MainServer::HandleAnnounce Playback
> 2009-02-21 17:10:51.568 adding: mythtv as a client (events: 0)
> 2009-02-21 17:10:51.580 RingBuf(/home/mythtv/recordings/
> 1840_20090221171043.mpg) Error: Invalid file descriptor in 'safe_read()'
> --- last line repeating indefinitely ---
> I've run a tcpdump of a MythTV frontend to see what messages it sends
> back and forth. I see it send on a control port:
> ANN Playback
> QUERY_RECORDER IS_RECORDING (backend returns 1)
> *QUERY_RECORDER IS_RECORDING (backend returns 1)
> *QUERY_CHECKFILE (backend returns 1 and filename)
> *QUERY_CHECKFILE (backend returns 1 and filename)
> Then a new control port and the video streaming port are spawned and I
> see:
> ANN Playback
> ANN FileTransfer (on the streaming port)
> And from then on things progress as one would expect, with the new
> control port requesting blocks and the new streaming port receiving
> the blocks. My frontend using libcmyth leaves out any of the messages
> I've starred (*) above. Which, if any, of these messages are required?
> Does this explain why I'm having issues with the digital stream, or am
> I missing something? Is there something on the event connection, which
> I'm not really listening to, that is salient?

I'm guessing (really just a guess) you need QUERY_CHECKFILE() to check that 
the file you are trying to read from has been created before you attempt 
Stuart Morgan

More information about the mythtv-dev mailing list