[mythtv] Channel change time improvements

James Courtier-Dutton james.dutton at gmail.com
Sat Jun 26 20:18:38 UTC 2010


On 26 June 2010 16:24, Ed W <lists at wildgooses.com> wrote:
> On 22/06/2010 10:03, James Courtier-Dutton wrote:
>>
>> Hi,
>>
>> I have done some more work looking at the channel change time.
>> The main cause of the long channel change time is that myth deletes
>> all the C++ objects of the old channel, waits for them to all
>> disappear, and the creates new C++ objects for the new channel.
>> The delete takes at least 2 seconds to do.
>>
>
> Excellent debugging - why not submit a patch to at least instrument this?
>  At least that way it's now effectively documented and you have kind of
> spec'ed the solution even if it's not fixed?
>
> Good luck
>
> Ed W

I would not say that my current instrumentation is up to scratch for a patch.
Looking at the myth logs
Something like this co-insides with the channel change request:
2010-06-04 17:27:41.919 TVRec(1): HW Tuner: 1->1

Something like this co-insides with the first good video frame
displayed on the client PC.
2010-06-04 17:27:48.980 RecBase(1:/dev/dvb/adapter0/frontend0):
GetKeyframePositions(120,9223372036854775807,#2) out of 13

As you can see, this particular channel change took about 7 seconds.

So, the instrumentation is sort of already there, one just has to be
able to recognise which log message is the instrument point.

I am also starting to think that this "writing to a different
filename" for each recorded program might also be problematic.
If one wishes to record two programs one after the other, and the
start time of the second program is slightly off, the cut point will
probably be wrong and users will loose content. I think it would be
better to record to a single file for both programs and just keep a
offset value in the database to identify start and stop points for
each program. For example:
Program 1: Time: 10:00 to 11:00
Program 2: Time: 11:00 to 12:00
The database could store in the database offsets within the file that
correspond to:
Program 1: Time: 09:50 to 11:10
Program 2: Time: 10:50 to 12:10

If the start time of Program 2 actually started at 10:55, in the
current setup, they would loose the first 5 mins of the program.
In my suggested approach, this would not loose any content.

Kind Regards

James


More information about the mythtv-dev mailing list