From 2a3699c7aea27b7c2c464e29e0b75b4f433f2d5a Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 1 Mar 2006 03:34:54 -0300 Subject: Added make qconfig option to allow testing v4l/dvb menus From: Mauro Carvalho Chehab - make qconfig option were added. - This will generate a menu with v4l/dvb Kconfig menus at the beginning of the menus and the kernel menus at the end. Kernel menus shoudn't be touched. - .config is then generated after quiting. - Curently, .config is not used by Makefile proccess but it is a good candidate to be a replacement of Make.config file. With a good .config file, compilation should be faster. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_kconfig.pl | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 v4l/scripts/make_kconfig.pl (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_kconfig.pl b/v4l/scripts/make_kconfig.pl new file mode 100755 index 000000000..f612e83db --- /dev/null +++ b/v4l/scripts/make_kconfig.pl @@ -0,0 +1,37 @@ +#!/usr/bin/perl +use FileHandle; + +my $KDIR=shift; +my $ARCH=shift; + +sub open_kconfig($$) { + my ($dir,$file)=@_; + my $in = new FileHandle; + +print "opening $file\n"; + open $in,"$file"; + while (<$in>) { + if (m;^\s*source[\s\"]+drivers/media/(video|dvb)/Kconfig;) { + next; + } + if (m|^\s*source[\s\"]+([^\n\s\"]+)[\n\s\"]|) { + open_kconfig($dir,"$dir/$1"); + next; + } + s/^main(menu\s\"[^\"]+)/\1 - DON'T CHANGE IT!/; + print OUT $_; + } + close $in; +} + +open OUT,">Kconfig.kern"; +open_kconfig($KDIR,"$KDIR/arch/$ARCH/Kconfig"); +print OUT "endmenu\n"; +close OUT; + +open OUT,">Kconfig"; +print OUT "mainmenu \"V4L/DVB menu\"\n"; +open_kconfig ("../linux","../linux/drivers/media/video/Kconfig"); +open_kconfig ("../linux","../linux/drivers/media/dvb/Kconfig"); +print OUT "source Kconfig.kern\n"; +close OUT; -- cgit v1.2.3 From 35a54ae2e849cf4044175555a43dc4d6d9a3431f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 8 Mar 2006 10:59:03 -0300 Subject: Added a script to make easier to import patches sent by email From: Mauro Carvalho Chehab This script is capable to mass import patches on a mbox file, test for it, allow comment editing and applying it. This script requires: 1) git, since it uses gitimport to break a mbox into patches; 2) hg mailqueue. It is easier to manage patches using mq, allowing to work with the patches before applying to the tree. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/hghead.pl | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100755 v4l/scripts/hghead.pl (limited to 'v4l/scripts') diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl new file mode 100755 index 000000000..d0f657c08 --- /dev/null +++ b/v4l/scripts/hghead.pl @@ -0,0 +1,143 @@ +#!/usr/bin/perl +use strict; +use Date::Parse; + +################################################################# +# analyse diffs + +my $in = shift; +my $line; +my $subject; +my $from=0; +my $sub_ok=0; +my $init=0; +my $num=0; +my $maint_ok=0; +my $noblank=1; +my $maintainer_name=$ENV{CHANGE_LOG_NAME}; +my $maintainer_email=$ENV{CHANGE_LOG_EMAIL_ADDRESS}; +my $from=""; +my $body=""; +my $signed=""; + +open IN, "<$in"; + +while ($line = ) { + if ($line =~ m/Index.*/) { + last; + } + if ($line =~ m/^diff .*/) { + last; + } + if ($line =~ m/^\-\-\- .*/) { + last; + } + if ($line =~ m/^\-\-\-.*/) { + last; + } + if ($line =~ m/^\+\+\+ .*/) { + last; + } + + if ($line =~ m/^Date:\s*(.*)/) { + my $time = str2time($1); +# my $timestr = gmtime($time); + + if ($time) { + print "# Date: $time\n"; + } + next; + } + if ($line =~ m/^From:/) { + if ($line =~ m/^From:[\s\"]*([^\"]*)[\s\"]*<(.*)>/) { + if ($1 eq "") { + next; + } + my $name=$1; + my $email=$2; + $name =~ s/\s+$//; + $email =~ s/\s+$//; + $from= "From: $name <$email>\n"; + next; + } + print "Bad formed author\n"; + die; + } + + if ($line =~ m/^Subject:\s*(.*)\n/) { + $subject=$1; + next; + } + + if ($line =~ m;^ .*\/.*\| *[0-9]*;) { + next; + } + if ($line =~m/\d+\s*file.* changed, /) { + next; + } + + if ($line =~ m/^Signed-off-by:.*/) { + $noblank=1; + if ($line =~ m/$maintainer_name/) { + $maint_ok=1; + } + + $signed="$signed$line"; + next; + } + if ($line =~ m/^Acked-by:.*/) { + print $line; + next; + } + + if ($line =~ m/^[a-zA-Z\-]*:/) { + if ($line =~ m/Changeset:\s*(.*)\n/) { + $num=$1; + } + print "# $line"; + next; + } + + if ($line =~ m|^(V4L\/DVB\s*\(.+\)\s*:.*)\n|) { + $subject=$1; + $line="\n"; + } + + if ($sub_ok == 0) { + $sub_ok=1; + substr( $subject, 0, 1 ) = uc (substr ($subject, 0, 1)); + if ($subject =~ m|V4L\/DVB\s*(.+)|) { + print "$1\n\n"; + } else { + print "$subject\n\n"; + } + if ($line =~ m/^\n/) { + next; + } + } + + if ($noblank) { + if ($line =~ m/^\n/) { + next; + } + } + if (!$init) { + $init=1; + $noblank=0; + } + $body="$body$line"; +} +close IN; + +if ($from eq "") { + print "Bad formed author\n"; + die; +} +if (!$maint_ok) { + $signed=$signed."Signed-off-by: $maintainer_name <$maintainer_email>\n"; +} +$body=~s/\n+$//; +$body=~s/^\n+$//; + +print "$from\n$body\n\n$signed"; + -- cgit v1.2.3 From f780713336a2db00609e7bb63648fbd96c5a856d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 8 Mar 2006 11:53:44 -0300 Subject: Fixed a small bug at hghead.pl From: Mauro Carvalho Chehab Commiter name were not preserved by mailimport at the way it was. Now, commiter name will be the HGUSER, and from: line will be included at commit message, preserving both commiter and patch authors. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/hghead.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl index d0f657c08..c495abc8b 100755 --- a/v4l/scripts/hghead.pl +++ b/v4l/scripts/hghead.pl @@ -107,9 +107,7 @@ while ($line = ) { $sub_ok=1; substr( $subject, 0, 1 ) = uc (substr ($subject, 0, 1)); if ($subject =~ m|V4L\/DVB\s*(.+)|) { - print "$1\n\n"; - } else { - print "$subject\n\n"; + $subject=$1; } if ($line =~ m/^\n/) { next; @@ -139,5 +137,7 @@ if (!$maint_ok) { $body=~s/\n+$//; $body=~s/^\n+$//; -print "$from\n$body\n\n$signed"; +# First from is used by hg to recognize commiter name +print "From: $maintainer_name <$maintainer_email>\n"; +print "$subject\n$from\n$body\n\n$signed"; -- cgit v1.2.3 From 68b04a8f962798f66d06663c1b28d127d2023329 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 10 Mar 2006 12:40:10 -0300 Subject: Creates a virtual video device driver From: Mauro Carvalho Chehab The Virtual Video Device Driver (aka vivi) is a device that can be used to: 1) test core v4l functionalities; 2) be a prototype for newer development. Vivi were developed using the best practices for v4l driver. When loaded, it provides a video device that generates a standard color bar, with a timestamp placed at top left corner. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/insmod.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/insmod.sh b/v4l/scripts/insmod.sh index bf22a69ce..e4ebb1494 100755 --- a/v4l/scripts/insmod.sh +++ b/v4l/scripts/insmod.sh @@ -122,6 +122,8 @@ case "$1" in insmod ./saa6752hs.ko insmod ./em28xx.ko + insmod ./vivi.ko + echo ;; debug) @@ -232,6 +234,7 @@ case "$1" in insmod ./saa6752hs.ko insmod ./em28xx.ko + insmod ./vivi.ko echo ;; unload) @@ -246,7 +249,7 @@ case "$1" in # video4linux cards rmmod cx88-alsa cx88-blackbird cx88-dvb cx88-vp3054-i2c cx8802 cx8800 \ cx88xx saa7134-oss saa7134-alsa saa7134-empress saa7134-dvb \ - saa7134 dvb-bt8xx dst_ca dst bt878 bttv em28xx + saa7134 dvb-bt8xx dst_ca dst bt878 bttv em28xx vivi # frontends rmmod dib3000mb dib3000mc dib3000_common nxt200x ves1x93 \ -- cgit v1.2.3 From 02474d0a0181592ab0ce78cc5b536b76d23a4799 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 10 Mar 2006 14:20:58 -0300 Subject: Added better handling for errors at mailscript From: Mauro Carvalho Chehab Now, it checks if author have signed its own patch. Also, prints better error messages. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/hghead.pl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl index c495abc8b..5c5e63f1f 100755 --- a/v4l/scripts/hghead.pl +++ b/v4l/scripts/hghead.pl @@ -19,6 +19,7 @@ my $maintainer_email=$ENV{CHANGE_LOG_EMAIL_ADDRESS}; my $from=""; my $body=""; my $signed=""; +my $fromname=""; open IN, "<$in"; @@ -57,10 +58,11 @@ while ($line = ) { my $email=$2; $name =~ s/\s+$//; $email =~ s/\s+$//; - $from= "From: $name <$email>\n"; + $fromname="$name <$email>"; + $from= "From: $fromname\n"; next; } - print "Bad formed author\n"; + print "Bad: author line have a wrong syntax\n"; die; } @@ -86,7 +88,7 @@ while ($line = ) { next; } if ($line =~ m/^Acked-by:.*/) { - print $line; + $signed="$signed$line"; next; } @@ -128,12 +130,19 @@ while ($line = ) { close IN; if ($from eq "") { - print "Bad formed author\n"; + print "Bad: author doesn't exist!\n"; die; } + if (!$maint_ok) { $signed=$signed."Signed-off-by: $maintainer_name <$maintainer_email>\n"; } + +if (!$signed =~ m/$from/) { + print "Bad: Author didn't signed his patch!\n"; + die; +} + $body=~s/\n+$//; $body=~s/^\n+$//; -- cgit v1.2.3 From 1254c4a78ff6728e02609f72002c87783b1a610e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 10 Mar 2006 15:20:59 -0300 Subject: Some fixes and improvements at mailimport From: Mauro Carvalho Chehab hg mq were offering some troubles, because it seems to be also updated at master site. So, now, default is not to use it. Several validations added. Also improved output log by separating subject from from: line. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/hghead.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl index 5c5e63f1f..ddaef0767 100755 --- a/v4l/scripts/hghead.pl +++ b/v4l/scripts/hghead.pl @@ -66,7 +66,7 @@ while ($line = ) { die; } - if ($line =~ m/^Subject:\s*(.*)\n/) { + if ($line =~ m/^Subject:\s*(.*\n)/) { $subject=$1; next; } @@ -100,7 +100,7 @@ while ($line = ) { next; } - if ($line =~ m|^(V4L\/DVB\s*\(.+\)\s*:.*)\n|) { + if ($line =~ m|^(V4L\/DVB\s*\(.+\)\s*:.*\n)|) { $subject=$1; $line="\n"; } @@ -147,6 +147,6 @@ $body=~s/\n+$//; $body=~s/^\n+$//; # First from is used by hg to recognize commiter name -print "From: $maintainer_name <$maintainer_email>\n"; +print "#Committer: $maintainer_name <$maintainer_email>\n"; print "$subject\n$from\n$body\n\n$signed"; -- cgit v1.2.3 From 67e573775c79f80861b483d28faefa6159450d6f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 14 Mar 2006 12:15:21 -0300 Subject: Merging mrec tree From: Mauro Carvalho Chehab merge: Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/usbaudio_setup.sh | 106 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100755 v4l/scripts/usbaudio_setup.sh (limited to 'v4l/scripts') diff --git a/v4l/scripts/usbaudio_setup.sh b/v4l/scripts/usbaudio_setup.sh new file mode 100755 index 000000000..66fdd23df --- /dev/null +++ b/v4l/scripts/usbaudio_setup.sh @@ -0,0 +1,106 @@ +#!/bin/bash +# +# Copyright (C) 2006 Markus Rechberger +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# + +which /usr/bin/dialog >/dev/null +if [ "0" != "$?" ]; then +echo "this tool requires \"dialog\" (http://hightek.org/dialog/)" +exit 1 +fi +uid=`id -u` +if [ "0" != "$uid" ]; then +echo "this tool must be run as root, you can disable this message by editing the script but only do that unless you know what you're doing!" +exit 1 +fi +which gcc > /dev/null +if [ "0" != "$?" ]; then +echo "this tool won't work unless you install gcc" +exit 1 +fi +test -f ossid +if [ "0" != "$?" ]; then +cat > ossid.c <<_EOF +#include +#include +#include +#include +#include +#include + +int main(int argc, char **argv){ + int fd; + struct mixer_info *info; + fd=open(argv[1],O_RDONLY); + if(fd>=0){ + info=malloc(sizeof(struct mixer_info)); + ioctl(fd,SOUND_MIXER_INFO,info); + printf("%c \"%s %s\"\n",(argv[1][strlen(argv[1])-1]=='p')?'0':(argv[1][strlen(argv[1])-1]+1),info->name,info->id); + free(info); + close(fd); + } else { + return 1; + } + return 0; +} +_EOF +gcc ossid.c -o ossid +rm ossid.c +fi + +test -f /proc/asound/cards +if [ "0" != "$?" ]; then +dialog --title "Welcome" --backtitle "Empia Sound Configuration" \ +--msgbox "Your system doesn't support ALSA, please have a look at \ +www.alsa-project.org and set it up properly \ + + +Press any key to continue... " 11 50 +exit 1; +fi + +dialog --title "Welcome" --backtitle "Empia Sound Configuration" \ +--msgbox "This tool was written to ease up sound configuration for +* Terratec Hybrid XS +* Terratec Cinergy 250 USB 2.0 +* Hauppauge HVR 900 +* and possible others :) + +first select an usb audio source, as target choose your soundcard +Press any key to continue... " 13 60 + +ls /dev/dsp* | while read a; do ./ossid $a; done | xargs dialog --menu "Choose your TV Audio source:" 12 60 5 2>/tmp/em2880_source.$$ +ls /dev/dsp* | while read a; do ./ossid $a; done | xargs dialog --menu "Choose your output soundcard device:" 12 60 5 2>/tmp/em2880_dst.$$ + +source=`egrep '^[0-9p]' /tmp/em2880_source.$$` +dst=`egrep '^[0-9p]' /tmp/em2880_dst.$$` + +echo "playing $source to $dst"; +if [ "$source" = "0" ]; then + device="/dev/dsp" +else + device="/dev/dsp`expr $source - 1`" +fi + +if [ "$dst" = "0" ]; then + device2="/dev/dsp" +else + device2="/dev/dsp`expr $source - 1`" +fi +clear +echo "Using command: sox -r 48000 -w -c 2 -t ossdsp $device -t ossdsp $device2" +sox -r 48000 -w -c 2 -t ossdsp $device -t ossdsp $device2 -- cgit v1.2.3