[mythtv-users] Mythpreviewgen

Josu Lazkano josu.lazkano at gmail.com
Fri Oct 14 16:42:20 UTC 2011


2011/10/14 John Pilkington <J.Pilk at tesco.net>:
> On 14/10/11 15:29, Josu Lazkano wrote:
>> 2011/9/22 Michael T. Dean<mtdean at thirdcontact.com>:
>>> On 09/21/2011 09:24 AM, Josu Lazkano wrote:
>>>> Hello again, I notice that mythpreviewgen is executed on program
>>>> change and on channel change in LiveTV, it taken more than 50% of CPU
>>>> usage and it generate lots of playback stops.
>>>>
>>>> I read about the nice(), but it must be executed as root thi way: nice
>>>> -n 17 /usr/bin/mythpreviewgen
>>>
>>> Any unprivileged user should be allowed to nice his/her own processes.
>>> It's only "un-nicing" (raising priority) beyond a certain limit
>>> (RLIMIT_NICE, which is typically) that requires privileges.
>>>
>>>> But I don't know where to put this code. Need I to change the source
>>>> code and compile it?
>>>
>>> Yes, you would need to change the source to make it automatic.
>>>
>>>>    I never compile MythTT, I just use the
>>>> debian-multimedia repository. I think this will be the cause of all my
>>>> playback problems, I will appreciate any help.
>>>>
>>>> Thanks and best regards.
>>>>
>>>
>>> However, you can instead just make a wrapper script called
>>> mythpreviewgen and have it nice and/or ionice itself and then call the
>>> actual mythpreviewgen binary.
>>>
>>> Mike
>>> _______________________________________________
>>> mythtv-users mailing list
>>> mythtv-users at mythtv.org
>>> http://www.mythtv.org/mailman/listinfo/mythtv-users
>>>
>>
>> Hello, thanks for your help, I create two scripts, one with nice() and
>> the other with ionice():
>>
>> #!/bin/bash
>> nice -n 19 mythpreviewgen.real $@
>>
>> #!/bin/bash
>> ionice -c2 -n7 mythpreviewgen.real $@
>>
>> But it is getting same little stops on playback, this the first 10
>> second of program change (with ionice script):
>> http://dl.dropbox.com/u/1541853/mythpreview2.log
>>
>> Maybe it is related to sql, but I don't know what else to try.
>>
>> Thanks and best regards.
>>
> I don't recall seeing the 'random pauses' but I thought I would try the
> wrapper script.  It works ok - but I don't know if it would cure your
> problem.
>
> /usr/bin/mythpreviewgen
> ------------------------
> #!/bin/bash
>
> # Script to reduce CPU impact of preview generation at the end of a
> recording.
> # mv /usr/bin/mythpreviewgen to /usr/bin/mythpreviewgen.real
> # copy this script to /usr/bin/mythpreviewgen and make it executable,
> # chmod 755 /usr/bin/mythpreviewgen
> # http://www.gossamer-threads.com/lists/mythtv/users/492811#492811
>
> ionice -c3 nice mythpreviewgen.real  "$@"
>
> ------------------------------------
> HTH
>
> John P
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://www.mythtv.org/mailman/listinfo/mythtv-users
>

Thanks John, I try your script and the stop is more little than other times:

#!/bin/bash
ionice -c3 nice mythpreviewgen.real "$@"

Then I try to comment all the code (so there is no mythpreviewgen.ral
execution):

#!/bin/bash
#ionice -c3 nice mythpreviewgen.real "$@"

And the little stop continue, so I am thinking that mythpreviegen is
not my problem. I know that on program change there are lot of thing
happening as archive the livetv record with different name...

Would be a mysql issue?

Sorry all questions, but I don't know what else try.

Thanks and best regards.

-- 
Josu Lazkano


More information about the mythtv-users mailing list