diff options
Diffstat (limited to 'abs/core-testing/tweaker')
-rw-r--r-- | abs/core-testing/tweaker/PKGBUILD | 14 | ||||
-rwxr-xr-x | abs/core-testing/tweaker/bin/twk_audio.pl | 12 | ||||
-rwxr-xr-x | abs/core-testing/tweaker/bin/twk_cpu.pl | 31 | ||||
-rwxr-xr-x | abs/core-testing/tweaker/bin/twk_general.pl | 19 | ||||
-rwxr-xr-x | abs/core-testing/tweaker/bin/twk_tuners.pl | 40 | ||||
-rw-r--r-- | abs/core-testing/tweaker/fs/home/mythtv/.config/smplayer/smplayer.ini | 2 |
6 files changed, 77 insertions, 41 deletions
diff --git a/abs/core-testing/tweaker/PKGBUILD b/abs/core-testing/tweaker/PKGBUILD index ebd3ed4..43ca495 100644 --- a/abs/core-testing/tweaker/PKGBUILD +++ b/abs/core-testing/tweaker/PKGBUILD @@ -1,7 +1,7 @@ pkgname=tweaker pkgver=1 -pkgrel=38 -pkgdesc="" +pkgrel=48 +pkgdesc="applies tweaks to the baseline configuration and attempts to optimize settings for the hardware it finds" arch=('i686' 'x86_64') depends=('bash' 'perl' 'perl-dbi' 'perl-exception-class' 'perl-log-log4perl' 'perl-log-dispatch' 'perl-getopt-lucid' 'perl-list-member' 'perl-class-data-inheritable' 'perl-devel-stacktrace' 'perl-xml-twig') @@ -16,19 +16,18 @@ install=tweaker.install build() { TWEAKER_ROOT=usr/LH/tweaker mkdir -p $startdir/pkg/$TWEAKER_ROOT - mkdir -p $startdir/pkg/$TWEAKER_ROOT/{bin,fs,tcf} + mkdir -p $startdir/pkg/$TWEAKER_ROOT/{bin,fs,tcf} mkdir -p $startdir/pkg/etc/profile.d mkdir -p $startdir/pkg/usr/lib/perl5/vendor_perl/Tweaker/ cd $startdir # executables install -m0777 -D bin/* $startdir/pkg/$TWEAKER_ROOT/bin - # parallel root directory structure used for seeding configuration files -# install -m0777 -D fs/ $startdir/pkg/$TWEAKER_ROOT/fs - cp -rp fs $startdir/pkg/$TWEAKER_ROOT/ - chmod -R 0777 $startdir/pkg/$TWEAKER_ROOT/ + # Ensure shell variables are configured at start; ensure $TWEAKER_ROOT/bin is in $PATH + cp -rp fs $startdir/pkg/$TWEAKER_ROOT/ + chmod -R 0777 $startdir/pkg/$TWEAKER_ROOT/ # Tweaker configuration files install -m0555 -D tcf/* $startdir/pkg/$TWEAKER_ROOT/tcf @@ -37,7 +36,6 @@ build() { #install -m0755 log4perl.conf $startdir/pkg/etc/log4perl.conf install -m0755 log4perl.conf $startdir/pkg/$TWEAKER_ROOT - # Ensure shell variables are configured at start; ensure $TWEAKER_ROOT/bin is in $PATH install -m0755 tweaker.sh $startdir/pkg/etc/profile.d/tweaker.sh # Copy our tweaker Perl modules for general use diff --git a/abs/core-testing/tweaker/bin/twk_audio.pl b/abs/core-testing/tweaker/bin/twk_audio.pl index eec7992..47a2415 100755 --- a/abs/core-testing/tweaker/bin/twk_audio.pl +++ b/abs/core-testing/tweaker/bin/twk_audio.pl @@ -110,9 +110,9 @@ sub implement_option { sub edit_mplayer_conf { my($option) = @_; # delete any old entries that Tweaker made, relevant to this particular edit - my $delete_old_tweaker_edits = "[ -e $mplayer_conf ] && sed -i '/^.*a[o,c].*=.*#TWEAKER/d' $mplayer_conf"; + my $delete_old_tweaker_edits = "[ -e $mplayer_conf ] && sed -i '/^.*a[o,c,f].*=.*#TWEAKER/d' $mplayer_conf && sed -i '/^speed.*=.*#TWEAKER/d' $mplayer_conf"; # comment out old entries that some other process may have made - my $comment_out_external_edits = "[ -e $mplayer_conf ] && sed -i 's/^\\(a[o,c].*=.*\\)/#\\1/g' $mplayer_conf"; + my $comment_out_external_edits = "[ -e $mplayer_conf ] && sed -i 's/^\\(a[o,c,f].*=.*\\)/#\\1/g' $mplayer_conf && sed -i 's/^\\(speed.*=.*\\)/#\\1/g' $mplayer_conf"; my $command1; my $command2=""; ($card, $device) = poll_for_digital_output_device; @@ -160,6 +160,14 @@ sub implement_option { } } } + # for all options + $command2 = "echo -e 'af=scaletempo=stride=30:overlap=.50:search=10 #TWEAKER\nspeed=1.0 #TWEAKER' >> $mplayer_conf"; + if (my $error = execute_shell_command($command2)) { + $logger->error("ERROR: $error"); + $logger->error("ERROR: Unable to implement option $option."); + exit(-1); + } + $logger->info("Edited $mplayer_conf for $option audio."); } diff --git a/abs/core-testing/tweaker/bin/twk_cpu.pl b/abs/core-testing/tweaker/bin/twk_cpu.pl index 118bac1..8bddbe3 100755 --- a/abs/core-testing/tweaker/bin/twk_cpu.pl +++ b/abs/core-testing/tweaker/bin/twk_cpu.pl @@ -57,6 +57,36 @@ sub get_HDD_size { # #} +# Edit mplayer.conf to tell mplayer to drop video frames when necessary. This should do no harm +# on systems that don't need the option, and it should make video watchable on those that do. +sub edit_mplayer_conf { + use vars qw($mplayer_conf); + $mplayer_conf = "/etc/mplayer/mplayer.conf"; + + # delete any old entries that Tweaker made, relevant to this particular edit + my $delete_old_tweaker_edits = "[ -e $mplayer_conf ] && sed -i '/^.*hardframedrop.*=.*#TWEAKER/d' $mplayer_conf"; + # comment out old entries that some other process may have made + my $comment_out_external_edits = "[ -e $mplayer_conf ] && sed -i 's/^\\(hardframedrop.*=.*\\)/#\\1/g' $mplayer_conf"; + my $command1; + my $command2=""; + my $logger = get_logger('tweaker.script'); + + if (my $error = execute_shell_command("$delete_old_tweaker_edits && $comment_out_external_edits")) { + $logger->error("ERROR: $error"); + $logger->error("ERROR: Unable to implement option $option."); + exit(-1); + } + + $command2 = "echo -e 'hardframedrop=true #TWEAKER' >> $mplayer_conf"; + if (my $error = execute_shell_command($command2)) { + $logger->error("ERROR: $error"); + $logger->error("ERROR: Unable to implement option $option."); + exit(-1); + } + + $logger->info("Edited $mplayer_conf to drop video frames when CPU is overloaded."); +} + # Try to implement the given option. sub implement_option { my($option) = @_; @@ -106,6 +136,7 @@ sub implement_option { change_or_make_setting('OSDTheme', 'blootube-osd') || exit -1; change_or_make_setting('PlayBoxShading', '0') || exit -1; change_or_make_setting('PlaybackExitPrompt', '2') || exit -1; + edit_mplayer_conf(); } else { exit -1; } diff --git a/abs/core-testing/tweaker/bin/twk_general.pl b/abs/core-testing/tweaker/bin/twk_general.pl index 387920c..f181310 100755 --- a/abs/core-testing/tweaker/bin/twk_general.pl +++ b/abs/core-testing/tweaker/bin/twk_general.pl @@ -87,10 +87,8 @@ sub implement_option { # # better awareness of different video extensions # - change_or_make_entry("videotypes", [["playcommand", "mplayer-resumer.pl -fs -zoom -vc theora,fftheora, -vo xv %s"]], [["extension", "ogg"]]); - change_or_make_entry("videotypes", [["playcommand", "mplayer-resumer.pl -fs -zoom -vc theora,fftheora, -vo xv %s"]], [["extension", "theora"]]); - foreach my $video_ext ("mp2", "tp", "ts", "m2p", "nuv", "mkv") { - change_or_make_entry("videotypes", [["playcommand", "Internal"], ["f_ignore", "0"], ["use_default", "1"]], [["extension", $video_ext]]); + foreach my $video_ext ("mp2", "tp", "ts", "m2p", "nuv", "mkv", "ogg", "theora") { + change_or_make_entry("videotypes", [["playcommand", "Default"], ["f_ignore", "0"], ["use_default", "1"]], [["extension", $video_ext]]); } foreach my $non_video_ext ("jpg", "par2") { change_or_make_entry("videotypes", [["f_ignore", "1"]], [["extension", $non_video_ext]]); @@ -407,15 +405,18 @@ sub implement_option { change_or_make_setting('StartupSecsBeforeRecording', '120'); change_or_make_setting('TruncateDeletesSlowly', '1'); change_or_make_setting('UseOutputPictureControls', '1'); - change_or_make_setting('UserJob4', 'myth2mp3 -cut \"%DIR%\" \"%FILE%\"'); + change_or_make_setting('UserJob2', 'myth2x264 \"%DIR%/%FILE%\" \"%TITLE% - %SUBTITLE%\" \"%CHANID%\" \"%STARTTIME%\" \"%JOBID%\"'); + change_or_make_setting('UserJob3', 'myth2xvid \"%DIR%/%FILE%\" \"%TITLE% - %SUBTITLE%\" \"%CHANID%\" \"%STARTTIME%\" \"%JOBID%\"'); + change_or_make_setting('UserJob4', 'myth2mp3 \"%DIR%/%FILE%\" \"%TITLE% - %SUBTITLE%\" \"%CHANID%\" \"%STARTTIME%\"'); change_or_make_setting('UserJobDesc1', 'User Job #1'); - change_or_make_setting('UserJobDesc2', 'User Job #2'); - change_or_make_setting('UserJobDesc3', 'User Job #3'); + change_or_make_setting('UserJobDesc2', 'Transcode for iPod'); + change_or_make_setting('UserJobDesc3', 'Transcode to xvid'); change_or_make_setting('UserJobDesc4', 'Extract audio'); - change_or_make_setting('VCDPlayerCommand', 'mplayer vcd:\/\/ -cdrom-device %d -fs -zoom -vo xv -vf pp=lb'); + change_or_make_setting('UseOutputPictureControls','0'); # If this is set to '1' it can swap blue for red (and vice versa) on some nVidia GPUs + change_or_make_setting('VCDPlayerCommand', 'mplayer-wrapper.pl vcd:\/\/ -cdrom-device %d -fs -zoom'); change_or_make_setting('VideoArtworkDir', "$SQL_DirVideo/.covers"); change_or_make_setting('VideoBrowserNoDB', '1'); - change_or_make_setting('VideoDefaultPlayer', 'mplayer-resumer.pl -fs -zoom -vo xv %s'); + change_or_make_setting('VideoDefaultPlayer', 'mplayer-wrapper.pl -fs -zoom %s'); change_or_make_setting('VideoGalleryNoDB', '1'); change_or_make_setting('VideoStartupDir', $SQL_DirVideo); change_or_make_setting('VideoTreeNoDB', '1'); diff --git a/abs/core-testing/tweaker/bin/twk_tuners.pl b/abs/core-testing/tweaker/bin/twk_tuners.pl index f928ea7..22c6a23 100755 --- a/abs/core-testing/tweaker/bin/twk_tuners.pl +++ b/abs/core-testing/tweaker/bin/twk_tuners.pl @@ -105,9 +105,11 @@ my @capture_card_patterns = ( # [ "bt878-based frame grabbers", [".*0400.*109e.*036e.*", ".*0480.*109e.*0878.*"], # ["V4L", ["NTSC"]]], - ); + # USB patterns -# USB patterns + [ "Dvico Dual Digital 4 rev2", [".* 0fe9:db98 .*"], + ["DVB", ["DVB-T"]]], + ); # "Hauppauge Nova-T 500 Dual DVB-T" @@ -148,8 +150,8 @@ sub implement_option { if (connect_to_db("DBI:mysql:$dbconnectionstring")) { my $logger = get_logger('tweaker.script'); - # Get a list of all PCI devices for later processing - my @lspci = split('\n', execute_shell_command("lspci -mn")); + # Get a list of all PCI and USB devices for later processing + my @device_list = split('\n', execute_shell_command("lspci -mn ; lsusb")); # Iterate through the list of known tuner cards, then the list of known network tuners. # For each known tuner, configure a safe default for it if it's found. Set up @@ -338,22 +340,22 @@ sub implement_option { # Configure each supported tuner/capture device detected on the system. - # built-in, PCI, or PCI Express - $logger->debug("Processing local devices..."); - for my $pci_device (@lspci) { - $logger->debug("DEVICE: $pci_device"); + # built-in, PCI, PCI Express, or USB + $logger->debug("Processing built-in, PCI, PCI Express or USB devices..."); + for my $a_device (@device_list) { + $logger->debug("DEVICE: $a_device"); my $match=0; - for my $pci_device_data (@capture_card_patterns) { - $logger->debug("\tIs there a @$pci_device_data[0] at this location?"); + for my $device_data (@capture_card_patterns) { + $logger->debug("\tIs there a @$device_data[0] at this location?"); - for my $patterns (@$pci_device_data[1]) { + for my $patterns (@$device_data[1]) { for my $pattern (@$patterns) { if ($match) { next; } else { $logger->debug("\t\tPATTERN: $pattern"); - $match += ($pci_device =~ m/$pattern/i); + $match += ($a_device =~ m/$pattern/i); if ($match) { $global_device_count++; # 1-indexed @@ -364,10 +366,10 @@ sub implement_option { # The sub_types are used to populate the videosource table. # The device type and "best" sub_type are used to set the 'sourceid' field of the cardinput table. - for my $typeblock (@$pci_device_data[2]) { - my $pci_device_type = @$typeblock[0]; - $logger->debug("\t\tDEVICE TYPE: $pci_device_type"); # e.g. "DVB", "MPEG", etc. - $cardtypes{$pci_device_type}++; + for my $typeblock (@$device_data[2]) { + my $device_type = @$typeblock[0]; + $logger->debug("\t\tDEVICE TYPE: $device_type"); # e.g. "DVB", "MPEG", etc. + $cardtypes{$device_type}++; my $sourceid = -1; for my $sub_types (@$typeblock[1]) { for my $sub_type (@$sub_types) { @@ -387,7 +389,7 @@ sub implement_option { # # POPULATE capturecard table # - my $defaultinput = make_capturecard_SQL($global_device_count, $cardtypes{$pci_device_type}-1, $pci_device_type, -1); + my $defaultinput = make_capturecard_SQL($global_device_count, $cardtypes{$device_type}-1, $device_type, -1); # # POPULATE cardinput table @@ -457,10 +459,6 @@ sub implement_option { close(SHELL2); } # else: don't scan the internet! - # USB devices - $logger->debug("Processing USB devices..."); - $logger->debug("\t(no USB devices supported yet)"); - # Filesystem Tweaks for tuners # This only works with the Nova-T-500 card, but it doesn't hurt any other cards execute_shell_command("echo \"#switch on onboard amplifier on Nova-T-500 card\" > /etc/modprobe.d/dvb-usb-dib0700"); diff --git a/abs/core-testing/tweaker/fs/home/mythtv/.config/smplayer/smplayer.ini b/abs/core-testing/tweaker/fs/home/mythtv/.config/smplayer/smplayer.ini index 33439a7..9660607 100644 --- a/abs/core-testing/tweaker/fs/home/mythtv/.config/smplayer/smplayer.ini +++ b/abs/core-testing/tweaker/fs/home/mythtv/.config/smplayer/smplayer.ini @@ -330,7 +330,7 @@ reset_zoom=Shift+E auto_zoom=Shift+W zoom_169=Shift+A zoom_235=Shift+S -exit_fullscreen=Esc +exit_fullscreen= next_osd=O dec_contrast=1 inc_contrast=2 |