[mythtv-users] Mythcommflag is off by one

Jon Boehm boehm100 at comcast.net
Wed Sep 26 19:23:35 UTC 2007

Jon Boehm wrote:
> Chris Pinkham wrote:
>> * On Mon Sep 24, 2007 at 06:07:37PM -0500, Craig Huff wrote:
>>> Don't think I have run transcode.  Yet. ;-)
>>> So, how would you recommend fixing them?
>> You'd want this:
>> ionice -n 7 nice -n 20 mythcommflag -j %JOBID% -V %VERBOSELEVEL%
>> That would run the normal JobQueue's normal mythcommflag
>> command with the preceeding nice and ionice.  The JobQueue will
>> already nice jobs if you set the JobQueue CPU usage setting to
>> LOW, and mythcommflag will go a step beyond that and will sleep a
>> little every frame when set to this LOW value, so your "nice"
>> isn't really required.  The JobQueue does use a nice(17) though,
>> so your 20 is a little better but unless you set the CPU usage
>> setting to LOW, mythcommflag will still run full-bore when it can.
>> People with software encoders have seen issues even when running
>> niced, so when set to LOW, the flagger will sleep a little between
>> each frame to be extra-nice. :)
> Chris,
> Thanks for this explanation.  I found it very helpful.  I've always 
> wondered why one mythcommflag job only take 25% of the cpu when NOTHING 
> else is happening on the system.  I plan on changing my JobQueueCPU from 
> (0, LOW) to (1, MEDIUM) or (2, HIGH), since I don't have software 
> encoders in order to get rid of the pause between each frame.
> One question though, doesn't the mythbackend job need to be run as root 
> for the ionice and nice commands to execute in this fashion? Unless you 
> edited your /etc/sudoers file to allow ionice and nice for your 
> mythbackend user.  Do I have this incorrect?
> Thanks,
> Jon

Well I just tried it remotely and it seems to work without running as 
root.  Not sure how, but I'm not complaining.  FYI the least favorable 
nice value is 19 not 20, but your command works. Nice must see the 20 
and change it to 19 because top report the NI value as 19.

We will see how this works tonight, when I'm recording 2 hidef shows at 
once while viewing one without xvmc on a 3.2G P4. Using Chris's 
mythcommflag command and JobQueueCPU set to 2.  I give ~%40 chance of 
working correctly.  I seems too good to be true.  I expect glitches, 
pauses, and pixelation while playing back a ~20 min time delayed show.

I'll report back tomorrow,

More information about the mythtv-users mailing list