[mythtv] NEW version of mythroku available for download - sd and hdfine in protocol 31, hd stutters in protocol 32. Help/advice needed to fix this.

Maclaren, James M maclaren at tulane.edu
Mon Jan 1 23:49:20 UTC 2007


Probably helpful to show the whole routine

 

 

/*

 * cmyth_file_request_block(cmyth_file_t file, unsigned long len)

 * 

 * Scope: PUBLIC

 *

 * Description

 *

 * Request a file data block of a certain size, and return when the

 * block has been transfered.

 *

 * Return Value:

 *

 * Sucess: number of bytes transfered

 *

 * Failure: an int containing -errno

 */

int

cmyth_file_request_block(cmyth_file_t file, unsigned long len)

{

        int err, count;

        int r;

        long c, ret;

        char msg[256];

 

        if (!file) {

                cmyth_dbgn(CMYTH_DBG_ERROR, "%s: no connection\n",

                          __FUNCTION__);

                return -EINVAL;

        }

 

        pthread_mutex_lock(&mutex);

 

        snprintf(msg, sizeof(msg),

                 "QUERY_FILETRANSFER %ld[]:[]REQUEST_BLOCK[]:[]%ld",

                 file->file_id, len);

 

        if ((err = cmyth_send_message(file->file_control, msg)) < 0) {

                cmyth_dbgn(CMYTH_DBG_ERROR,

                          "%s: cmyth_send_message() failed (%d)\n",

                          __FUNCTION__, err);

                ret = err;

                goto out;

        }

 

        if ((count=cmyth_rcv_length(file->file_control)) < 0) {

                cmyth_dbgn(CMYTH_DBG_ERROR,

                          "%s: cmyth_rcv_length() failed (%d)\n",

                          __FUNCTION__, count);

                ret = count;

                goto out;

        }

        if ((r=cmyth_rcv_long(file->file_control, &err, &c, count)) < 0)
{

                cmyth_dbgn(CMYTH_DBG_ERROR,

                          "%s: cmyth_rcv_long() failed (%d)\n",

                          __FUNCTION__, r);

                ret = err;

                goto out;

        }

 

        file->file_pos += c;

        ret = c;

 

    out:

        pthread_mutex_unlock(&mutex);

 

        return ret;

}

 

 

________________________________

From: mythtv-dev-bounces at mythtv.org
[mailto:mythtv-dev-bounces at mythtv.org] On Behalf Of Maclaren, James M
Sent: Monday, January 01, 2007 5:45 PM
To: mythtv-dev at mythtv.org
Subject: [mythtv] NEW version of mythroku available for download - sd
and hdfine in protocol 31,hd stutters in protocol 32. Help/advice needed
to fix this.

 

I have updated mythroku to handle protocols 31 & 32.  Please feel free
to download from members.cox.net/jm_maclaren.   SD recordings play back
fine, but two users tells me that HD playback stutters but only on
protocol 32.  The same recordings play fine through upnp and the
application MPlay.   Im running 0.20-fixes and have no problems.  The
roku's mpeg decoder has a buffer size that the code sets and a number of
buffers.  I have set those values as in applications that play network
hd streams file using upnp.  When playback is initiated a sequence is
sent to the mythbackend to request data using the following code segment

 

        snprintf(msg, sizeof(msg),

                 "QUERY_FILETRANSFER %ld[]:[]REQUEST_BLOCK[]:[]%ld",

                 file->file_id, len);

          

        if ((err = cmyth_send_message(file->file_control, msg)) < 0) {

                cmyth_dbgn(CMYTH_DBG_ERROR,

                          "%s: cmyth_send_message() failed (%d)\n",

                          __FUNCTION__, err);

                ret = err;

                goto out;

        }

 

Where this block is called until the total number of bytes received
equals the roku's set buffer size.  The parameter len is set higher up
in mythroku to be 0x8000. I doubled it and the code runs, multiplying by
3 causes the program to hang, as does any bigger value.  If any of the
developers can give me guidance on what len should be ideally I would be
grateful or what has changed in going from 31 to 32 that might have
caused the problem.

 

Hopefully I have been reasonably clear and that someone with a deeper
knowledge of mythtv than me (not too hard!) can help.  If this is
insufficient information I can post more.

Thanks!

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-dev/attachments/20070101/cf920dad/attachment.htm 


More information about the mythtv-dev mailing list