User talk:Paulone

From MythTV Official Wiki
Jump to: navigation, search

Here are some tweaks I use to improve my Australian MythTV experience. Paul Andreassen (paulx@andreassen.com.au)

Easy changes

Enable ALSA

$ Mythfrontend
Utilities / Setup -> Setup -> General -> Next -> Next

  • Audio output device: change "/dev/dsp" to "ALSA:default"
  • Mixer Device: change "/dev/mixer" to "default"

Better scheduling

$ Mythfrontend
Utilities/Setup -> Setup -> TV Settings -> Recording Priorities -> Set Recording Priorities

  • Reschedule Higher Priorities: enabled this

Enable commercial flagging

$ Mythfrontend
Utilities/Setup -> Setup -> TV Settings -> General -> Next -> Next

  • Commercial Flag New Recordings: enable this
  • Commercial Skip Method: All Available Methods
  • Strict Commercial Detection: enable this

Strict is better because otherwise all white screens are detected as blanks.

Using commercial flagging

Utilities/Setup -> Setup -> TV Settings -> Playback -> Next -> Next -> Next -> Next -> Next -> Next

  • Automatically Skip Commercials: Off
  • Commercial Skip Auto-Rewind Amount: 1
  • Maximum commercial skip (in seconds): 900
  • Skip blank frames after commercials: disable this

When a commercial starts, press "End" or "Z". If it jumps to far press "Home" or "Q". The Auto-Rewind Amount should give you a quick flash of the last commercial to be sure you haven't missed any of your show.

Make most shows record to round minutes

$ Mythfrontend
Utilities/Setup -> Setup -> TV Settings -> General -> Next -> Next -> Next

  • Time to record before start of show (in seconds): 4

Enable realtime threads

chmod +s /usr/bin/mythfrontend

Enable RTC Video Sync

Which is a lot better than Busy Wait Video Sync.

echo "dev/rtc/max-user-freq=1024" >> /etc/sysctl.conf

Database changes

Change fast forward and reverse speeds

insert into settings (value,data) values ('FFRewSpeed0','10');
insert into settings (value,data) values ('FFRewSpeed1','20');
insert into settings (value,data) values ('FFRewSpeed2','40');
insert into settings (value,data) values ('FFRewSpeed3','60');
insert into settings (value,data) values ('FFRewSpeed4','90');
insert into settings (value,data) values ('FFRewSpeed5','120');
insert into settings (value,data) values ('FFRewSpeed6','160');
insert into settings (value,data) values ('FFRewSpeed7','200');

Handle non blanks

I had trouble with Channel 7 not having blanks between adds, so I tweaked the commercial flagger.

insert into settings (value,data) values ('CommDetectMaxCommLength','2147483647');

The default value was 125.

Patches

Change w

Changes "w" to toggle between "None" and "Fill". Change to the mythtv/ directory and 'patch -p1 < letterbox.diff'.

diff -ur mythtv-0.17.orig/libs/libmythtv/videooutbase.cpp mythtv-0.17/libs/libmythtv/videooutbase.cpp
--- mythtv-0.17.orig/libs/libmythtv/videooutbase.cpp    2005-02-28 23:45:52.208436152 +1000
+++ mythtv-0.17/libs/libmythtv/videooutbase.cpp 2005-03-01 00:22:59.914773312 +1000
@@ -721,7 +721,11 @@
 {
     if (letterboxMode == kLetterbox_Toggle)
     {
-        if (++letterbox >= kLetterbox_END)
+//        if (++letterbox >= kLetterbox_END)
+//            letterbox = kLetterbox_Off;
+        if (letterbox == kLetterbox_Off)
+            letterbox = kLetterbox_Fill;
+        else
             letterbox = kLetterbox_Off;
     }
     else

Run mythcommflag closer

Runs the mythcommflag closer to the recorded, which should free the file system buffer quicker. May cause prebuffer pauses. Change to the mythtv/ directory and 'patch -p1 < commflag-catchup.patch'

--- mythtv.orig/programs/mythcommflag/ClassicCommDetector.cpp   2006-09-15 16:58:59.091417800 +1000
+++ mythtv/programs/mythcommflag/ClassicCommDetector.cpp        2006-09-15 22:28:08.016124896 +1000
@@ -196,7 +196,7 @@ bool ClassicCommDetector::go()
     nvp->SetNullVideo();

     int secsSince = 0;
-    int requiredBuffer = 30;
+    int requiredBuffer = 10;
     int requiredHeadStart = requiredBuffer;
     bool wereRecording = stillRecording;

Improve scheduling

When there are conflicts, use the best candidates first instead of the worst. Change to the mythtv/ directory and 'patch -p1 < push_back.patch'

--- mythtv.orig/programs/mythbackend/scheduler.cpp      2006-09-29 21:48:05.691850960 +1000
+++ mythtv/programs/mythbackend/scheduler.cpp   2006-09-29 21:48:23.730108728 +1000
@@ -852,7 +852,7 @@ void Scheduler::SchedNewRecords(void)
             }
             else
             {
-                retrylist.push_front(p);
+                retrylist.push_back(p);
                 PrintRec(p, "  #");
                 PrintRec(*k, "     !");
             }

deb compiling

Add "deb-src http://www.debian-multimedia.org sid main" to /etc/apt/sources.list

apt-get update  
apt-cache showsrc mythtv
apt-get build-dep mythtv
apt-get source mythtv
cd mythtv-x.xx
chmod +x debian/rules
fakeroot debian/rules clean

Edit debian/rules and change "--tune=i486" to "--arch pentium3" for your platform or change "--tune=i486" to "--enable-proc-opt". Add any patches mention above.

dch -n
export MAKE='make -j4'
dpkg-buildpackage -rfakeroot -uc -nc
cd ..
su -c 'dpkg -i *.deb'

Testing mythcommflag

I'd suggest looking at mythtv/programs/mythcommflag/ClassicCommDetector.cpp and .h. This is the current commercial detection code and it uses blank frames, scene changes, logos, aspect ratio changes, and letterbox/pillarbox detection. The blank frame, scene change, and logo detection can be used individually or there is an 'ALL' method that uses all of the above combined.

Strict makes the checks for blank frames tighter and if you're using Blank-Frame detection (not ALL) then it makes the block lengths tighter. So instead of allowing anything between say 29.7 - 30.3 seconds to be marked as a commercial it might require it to be 29.9 - 30.1. For the ALL method, it only affects how dark a frame must be.

Execute these commands on a recording that has bad flagged commericals.

export DEBUGCOMMFLAG=1
nice mythcommflag -c 1002 -s 20050925223500 --verbose commflag --force --nopercentage > out.txt 2>&1

The most interesting information is at the bottom of the file.