[mythtv-users] Playback problem -- random short pauses

Mark Boyum circushair at gmail.com
Mon Oct 3 18:36:28 UTC 2011


On Sat, Oct 1, 2011 at 6:15 PM, Josu Lazkano <josu.lazkano at gmail.com> wrote:
> 2011/10/2 Josu Lazkano <josu.lazkano at gmail.com>:
>> 2011/10/1 Steven Adeff <adeffs.mythtv at gmail.com>:
>>> On Thu, Sep 29, 2011 at 6:29 PM, Jason Lewis <jasonblewis at gmail.com> wrote:
>>>> On 30/09/11 7:02 AM, Steven Adeff wrote:
>>>>> On Thu, Sep 29, 2011 at 3:59 PM, Steven Adeff <adeffs.mythtv at gmail.com> wrote:
>>>>>> On Thu, Sep 29, 2011 at 1:09 PM, Dan Wilga
>>>>>> <mythtv-users2 at dwilga-linux1.amherst.edu> wrote:
>>>>>>> On 9/29/11 12:18 PM, Mark Boyum wrote:
>>>>>>>> nice -n 19 mythpreviewgen.real $1 $2 $3 $4 $5 $6 $7 $8
>>>>>>>>
>>>>>>> Assuming the shell that runs this script is bash, you can change that
>>>>>>> last line to:
>>>>>>>
>>>>>>>   nice -n 19 mythpreviewgen.real $*
>>>>>>>
>>>>>>> That way, any number of parameters will always be passed along.
>>>>>>>
>>>>>>> --
>>>>>>> Dan Wilga                                                        "Ook."
>>>>>> so,
>>>>>>
>>>>>> #!/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
>>>>>>
>>>>>> nice -n 19 mythpreviewgen.real $*
>>>>>>
>>>>> doesn't work for me,
>>>>> Preview Error: Encountered problems running '/usr/bin/mythpreviewgen
>>>>> --size 0x0 --chanid 8901 --starttime 20110928205900 --outfile
>>>>> "/media/myth/2/tv/8901_20110928205900.mpg.png"  > /dev/null'
>>>>>
>>>>>
>>>>>
>>>> Actually, I  believe the best practice way to achieve this is to use "$@"
>>>>
>>>> "The difference between $@ and $*: Unquoted (don't do this!), none at
>>>> all: both equal $1 $2, with double quotes, "$@"
>>>>                expands each element as an argument: "$1" "$2" ...,
>>>> while "$*" expands to all elements merged into one argument:
>>>> "$1c$2c..."  (where c is the first character of IFS). You almost always
>>>> want "$@". The same goes for arrays: "${myarray[@]}"
>>>>
>>>> That may solve the issue.
>>>>
>>>> Further info here: http://stefaanlippens.net/node/85
>>>>
>>>> Jason
>>>
>>> I tried with just the $1 $2...
>>> and all that happens is mythpreviewgen.real doesn't run correctly and
>>> never creates a preview image. could perhaps be because it's running
>>> bash and not dash?
>>>
>>> going to try it with /bin/sh and see what happens...
>>>
>>>
>>>
>>> --
>>> Steve
>>> http://www.mythtv.org/wiki/User:Steveadeff
>>> Before you ask, read the FAQ!
>>> http://www.mythtv.org/wiki/index.php/Frequently_Asked_Questions
>>> then search the Wiki, and this list,
>>> http://www.gossamer-threads.com/lists/mythtv/
>>> Mailinglist etiquette -
>>> http://www.mythtv.org/wiki/index.php/Mailing_List_etiquette
>>> _______________________________________________
>>> mythtv-users mailing list
>>> mythtv-users at mythtv.org
>>> http://www.mythtv.org/mailman/listinfo/mythtv-users
>>>
>>
>> Hello, thanks for the script, I try it with this:
>>
>> $ cat /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
>>
>> nice -n 19 /usr/bin/mythpreviewgen.real $@
>>
>>
>> I have verbose to all and this the frontend output on the first 20 sec
>> of a program change (2011-10-01 11:39):
>>
>> http://dl.dropbox.com/u/1541853/mythpreviewgen.log
>>
>> I am still getting short pauses on playback, I will check more time.
>>
>> Thanks and regards.
>>
>> --
>> Josu Lazkano
>>
>
> Hello again, I take a screenshot for my htop:
> http://dl.dropbox.com/u/1541853/htop.png
>
> There is a /usr/bin/mythpreviewgen.real with 37% of CPU. The PRI value
> is 39. Is this working? Sorry for my newby questions, it the first
> time I use nice().
>
> Best regards.
>
> --
> Josu Lazkano

I'm no expert but my understanding is that even if you "nice"
something it will take as much CPU as it can without interfering with
other higher priority processes.
-Mark


More information about the mythtv-users mailing list