Modify
Warning Please read the Ticket HowTo before creating or commenting on a ticket. Failure to do so may cause your ticket to be rejected or result in a slower response.

Opened 20 months ago

Closed 19 months ago

#11026 closed Bug Report - General (fixed)

mythpreviewgen is run with too high a scheduling priority; causes stuttering playback

Reported by: O Lupton <oliverlupton@…> Owned by: wagnerrp
Priority: minor Milestone: 0.27
Component: MythTV - Mythpreviewgen Version: 0.25-fixes
Severity: medium Keywords: mythpreviewgen, nice, ionice
Cc: Ticket locked: no

Description

mythpreviewgen seems to be run by default with too high a cpu/io scheduling priority. This causes stuttering playback (particularly for HD content) if a preview is generated in the background (for example, storing a bookmark in the recording you are watching updates the preview and makes the playback stutter).

For the moment I am working around this by moving mythpreviewgen to mythpreviewgen.real and putting this script in its place:

$ cat bin/mythpreviewgen 
#!/bin/bash
ionice -c 2 -n 7 nice -n 19 /usr/bin/mythpreviewgen.real --seconds 250 "$@"
exit

(this is less annoying, but the --seconds parameter is there because I can't find another way of telling Myth how far too seek)

It would be neater if MythTV could automatically reduce the priority of the mythpreviewgen process.

This seems to have been mentioned on the mailing list in the past, but I couldn't find any tickets relating to it - apologies if I missed one.

Attachments (1)

11026_1.patch (6.8 KB) - added by wagnerrp 20 months ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 20 months ago by J.Pilk@…

My mythcutprojectx script calls mythpreviewgen with ionice -c3, (idle). I use it regularly and I haven't noticed stuttering; but recently danielk pointed out that ionice only works with the default 'cfp' scheduler, whereas I have for years used 'escalator=deadline' when booting the kernel. I use ionice -c3 in several other places too, but wonder if I ought to be using something else. It certainly doesn't deliver on this quote from 'man ionice' : "The impact of an idle I/O process on normal system activity should be zero."

comment:2 Changed 20 months ago by wagnerrp

  • Milestone changed from unknown to 0.27
  • Owner set to wagnerrp
  • Status changed from new to accepted

comment:3 Changed 20 months ago by wagnerrp

The attached patch converts the preview generator to the new MythSystem? syntax, and uses it to apply the 'nice' and 'ionice' values internally. It has been compile tested, but not runtime tested.

Changed 20 months ago by wagnerrp

comment:4 Changed 20 months ago by managementboy@…

have been testing the patch for 2 weeks, no problem

comment:5 Changed 19 months ago by Raymond Wagner <rwagner@…>

In ecfa569b5df0ce761cda08a211f31b9cfc3ca1fd/mythtv:

Add mechanism to MythSystem? for log argument passthrough.

This adds the kMSPropagateLogs bit to the flags accepted by MythSystem?,
for use with MythTV binaries. If enabled, it will automatically append
the necessary command line logging arguments, as a String or StringList?,
which ever is appropriate.

Refs #11026

comment:6 Changed 19 months ago by Raymond Wagner <rwagner@…>

  • Resolution set to fixed
  • Status changed from accepted to closed

In 1efa59b1c619013ee35b54bea6a9efecbec3b19f/mythtv:

Convert previewgenerator to MythSystem? and apply nice settings.

This converts the calls that run the Preview Generator externally from
the old myth_system help function to the new MythSystem? class. This
change is necessary to apply nice and ionice values to the external
task, to prevent it from interfering with other, more time sensitive
tasks.

Fixes #11026

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.