From mbianchi@Foveal.com  Fri Feb  1 14:05:12 2002
From: mbianchi@Foveal.com (M Bianchi)
Date: Fri, 1 Feb 2002 09:05:12 -0500
Subject: [pxc] More generalized form of pxc_load
Message-ID: <20020201090512.A1866@Foveal.com>

--FL5UXtIhxfXey3p5
Content-Type: text/plain; charset=us-ascii

Folks,

I offer this more generalized version of the pxc_load proceedure to the
community.

I have Imagenation PX500, PX510, PX610, and PXC200L PCI framegrabbers in my
systems, and often more than one card at a time.  I wanted a means to
automatically detect and configure the cards found so, starting with px_load
and pxc_load, I created this shell script.
Running it in an  /etc/rc.d/init.d/*  file during boot configures just the
required /dev/px* files for the cards found.

The Usage message reads:

Usage:  framegrabber_load.sh [ -v ] { -l | -u }
Load or unload the kernel modules for the framegrabbers installed on the
system.  Creates the device files in  /dev  for the framegrabbers found.
Must be run as root.

One these flag arguments is required:
-l      load (or unload and reload) the framegrabber modules
-u      unload the framegrabber modules

Options:
-v      Verbose; announce successful load or unload.

Setup:
This command must be run in the directory where the kernel modules are present.
Kernel modules are named with the recognized device names followed by the
kernel version as reported by the  uname -r  command.  For example for a
PXC200 Imagenation board running on Linux kernel 2.2.12-16, the module file is
named  pxc200_2.2.12-16 .  The module is listed by lsmod(1) as  pxc200 .
If this device_kernel form of module file does not exist, then  <device>.o  is
tried.  If that does not exist, then either  pxc.o  (for the PXC200) or
 pxdrv.o  (for the PX500, PX510 or PX600) is tried.
Recognized Imagenation framegrabbers:  PXC200  PX500  PX510  PX600
Note: the PX610A is not supported.


The code is licensed under the GNU General Public License.
Comments, bug fixes and suggested improvements are welcome.

-- 
 Mike Bianchi
 Foveal Systems
 190 Loantaka Way
 Madison NJ  07940-1910

 +1 973 822-2085	Voice and Fax

 MBianchi@Foveal.com

 Create videos of auditorium presentations without a crew?
 Yes!
 http://www.AutoAuditorium.com

--FL5UXtIhxfXey3p5
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=framegrabber_load
Content-Transfer-Encoding: quoted-printable

#! /bin/sh
#                       Copyright (c) 2000 Foveal Systems
#	MBianchi@Foveal.com
#	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.

#	$Header: /usr/home/mbianchi/src/autoaud/5.0.aa/RCS/framegrabber_load.sh,v=
 5.3 2002/02/01 14:04:23 mbianchi Exp $

cmd=3D$( basename $0 )

function Echo {
	#	prints on stderr!
	echo >&2 "${cmd}: $@"
}

function Verbose {
	#	prints on stdout!
	case $1 in
	-f )
		file=3D$2
		shift 2
		echo "$@" >>${file}
	esac
	if [ ${verbose} ]
	then
		echo "${cmd}:  $@"
	fi
}

function Usage {
	echo >&2 '=07'
	if [ $# -gt 0 ]
	then
		Echo "$@"
	fi
	echo >&2 "Usage:  ${cmd} [ -v ] { -l | -u }
Load or unload the kernel modules for the framegrabbers installed on the
system.  Creates the device files in  /dev  for the framegrabbers found.
Must be run as root.

One these flag arguments is required:
-l	load (or unload and reload) the framegrabber modules
-u	unload the framegrabber modules

Options:
-v	Verbose; announce successful load or unload.

Setup:
This command must be run in the directory where the kernel modules are pres=
ent.
Kernel modules are named with the recognized device names followed by the
kernel version as reported by the  uname -r  command.  For example for a
PXC200 Imagenation board running on Linux kernel 2.2.12-16, the module file=
 is
named  pxc200_2.2.12-16 .  The module is listed by lsmod(1) as  pxc200 .
If this device_kernel form of module filename does not exist, then  <device=
>.o
is tried.  If that does not exist, then either  pxc.o  (for the PXC200) or
 pxdrv.o  (for the PX500, PX510 or PX600) is tried.
Recognized Imagenation framegrabbers:  PXC200  PX500  PX510  PX600
Note: the PX610A is not supported.
"
	exit 255
}

badoption=3Dneed_required_option
unload=3D
verbose=3D
while getopts :vlu option
do
	case ${option} in
	l )
		load=3Dload
		badoption=3D
		;;
	u )
		unload=3Dunload
		badoption=3D
		;;
	v )
		verbose=3Dverbose
		;;
	'?' )
		Echo "invalid option -${OPTARG}"
		badoption=3Dbadoption
		;;
	* )
		Echo "oops!  unimplimented option -${option}"
		badoption=3Dbadoption
	esac
done
shift $( expr ${OPTIND} - 1 )

if [ -n "${badoption}"  -o  $# -gt 0 ]
then
	Usage "Unexpected arguments:  $*"
fi

if [ -n "${load}"  -a  -n "${unload}" ]
then
	Usage "Cannot specify both -l and -u options."
fi

eval $( id  |  sed 's/(.*//' )
if [ "${uid}" !=3D 0 ]
then
	Usage "Must be run as root."
fi


function MakeDevice {
	dev_filename=3D$1
	major=3D$2
	max_minor=3D$3
	index=3D$4

	for j in \
		' MINOR=3D0	TYPE=3D		' \
		' MINOR=3D16	TYPE=3Dpgm	' \
		' MINOR=3D32	TYPE=3Dctl	' \
		' MINOR=3D48	TYPE=3DH		' \
		' MINOR=3D64	TYPE=3DHpgm	' \
		' MINOR=3D80	TYPE=3Dppm	' \
		' MINOR=3D96	TYPE=3Drgb	' \
		' MINOR=3D112	TYPE=3Dbgr	' \
		' MINOR=3D128	TYPE=3DHppm	' \
		' MINOR=3D144	TYPE=3DHrgb	'
	do
		eval ${j}

		if [ ${MINOR} -gt ${max_minor} ]
		then
			return
		fi

		file=3D${dev_filename}${index}${TYPE}
		let MINOR+=3D${index}

		rm -f ${file}
		mknod ${file} c ${major} ${MINOR}  &&
			chmod go+w ${file}
	done
}

exitcode=3D0
found_device=3D0

#	DEVICE		the device name found in /proc/devices
#	DEV_FILENAME	the root of the device filename, starts with  /dev/
#	BOARDID		the string for the board found in /proc/pci
#	MAX_MINOR	the maximum minor device number base supported.
#			E.g.	/dev/px0Hpgm is minor device 64
#				/dev/px1Hpgm is minor device 65, etc.
#	Maybe someday ...
#	  DEVICE=3Dpx610A
#	  DEV_FILENAME=3D/dev/px
#	  BOARDID=3D"Multimedia controller:.*\<SAA7146\>"
#	  MAX_MINOR=3D64

for i in \
	' DEVICE=3Dpxc200
	  DEV_FILENAME=3D/dev/pxc
	  BOARDID=3D"Multimedia video controller:.*\<Bt848\>"
	  MAX_MINOR=3D144
	  DEFAULT_DOT_O_FILE=3Dpxc.o
	' \
	' DEVICE=3Dpx500
	  DEV_FILENAME=3D/dev/px
	  BOARDID=3D"Multimedia video controller:.*\<SAA7116\>"
	  MAX_MINOR=3D64
	  DEFAULT_DOT_O_FILE=3Dpxdrv.o
	'
do
	eval ${i}

	device_count=3D$( lspci  |  grep -ic "${BOARDID}" )
	if [ ${device_count} -le 0 ]
	then
		continue
	fi

	module_file=3D${DEVICE}_$( uname -r )
	dot_o_file=3D${DEVICE}.o

	/sbin/rmmod  ${DEVICE}  2>/dev/null
	rm -f ${DEV_FILENAME}*
	if [ ${unload} ]
	then
		continue
	fi

	if [ -s ${module_file} ]
	then
		:
	elif [ -s ${dot_o_file} ]
	then
		module_file=3D${dot_o_file}
	elif [ -s ${DEFAULT_DOT_O_FILE} ]
	then
		module_file=3D${DEFAULT_DOT_O_FILE}
	else
		Echo "$(pwd):
  No file  ${module_file} ,  ${dot_o_file} , or  ${DEFAULT_DOT_O_FILE}
  Need module for \"${BOARDID}\"."
		exitcode=3D1
		continue
	fi

	found_device=3D1
	insmod_cmd=3D"/sbin/insmod  --force  --name=3D${DEVICE}  ${module_file}"
	if ${insmod_cmd}
	then
		Verbose Loaded module ${module_file} for ${DEVICE}.
		major=3D$( grep "${DEVICE}" /proc/devices  |  awk '{print $1}' )
		while [ ${device_count} -gt 0 ]
		do
			let device_count-=3D1
			MakeDevice ${DEV_FILENAME} ${major} ${MAX_MINOR} \
								${device_count}
			Verbose Created ${DEV_FILENAME}${device_count}
		done
	else
		Verbose "insmod(1) failed:
	${insmod_cmd}"
		exitcode=3D2
	fi
done

if [ ${found_device} =3D 0 ]
then
	Verbose No devices found.
fi

exit ${exitcode}

--FL5UXtIhxfXey3p5--

From rubini@gnu.org  Fri Feb  1 14:12:57 2002
From: rubini@gnu.org (Alessandro Rubini)
Date: Fri, 1 Feb 2002 15:12:57 +0100
Subject: [pxc] More generalized form of pxc_load
Message-ID: <20020201151257.A12303@morgana.systemy.it>

> I offer this more generalized version of the pxc_load proceedure to the
> community. [...]

I'll add it in contrib/ for the pxc200 and will talk about it in the
documents.

However, I have a problem: there is no support for passing arguments
to insmod.

I often use
	./pxc_load major=0
or
	./pxc_load pll=0,1 buffer=2
or similar stuff.

Besides that, looks a good script, worth including.

/alessandro

From mbianchi@Foveal.com  Fri Feb  1 14:22:12 2002
From: mbianchi@Foveal.com (M Bianchi)
Date: Fri, 1 Feb 2002 09:22:12 -0500
Subject: [pxc] More generalized form of pxc_load
In-Reply-To: <20020201151257.A12303@morgana.systemy.it>
References: <20020201151257.A12303@morgana.systemy.it>
Message-ID: <20020201092212.B2301@Foveal.com>

On Fri, Feb 01, 2002 at 03:12:57PM +0100, Alessandro Rubini wrote:
> However, I have a problem: there is no support for passing arguments
> to insmod.
> 
> I often use
> 	./pxc_load major=0
> or
> 	./pxc_load pll=0,1 buffer=2
> or similar stuff.

I'll add that to the script and repost.

> Besides that, looks a good script, worth including.

Thanks.

-- 
 Mike Bianchi
 Foveal Systems
 190 Loantaka Way
 Madison NJ  07940-1910

 +1 973 822-2085	Voice and Fax

 MBianchi@Foveal.com

 Create videos of auditorium presentations without a crew?
 Yes!
 http://www.AutoAuditorium.com

From mbianchi@Foveal.com  Sun Feb 10 19:55:36 2002
From: mbianchi@Foveal.com (M Bianchi)
Date: Sun, 10 Feb 2002 14:55:36 -0500
Subject: [pxc] More generalized form of pxc_load, improved.
Message-ID: <20020210145535.A4689@Foveal.com>

--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii

Alessandro made some suggestions to the previous version of framegrabber_load:

	there is no support for passing arguments to insmod.
	I often use
		./pxc_load major=0
	or
		./pxc_load pll=0,1 buffer=2
	or similar stuff.

This version has the following Usage message ...

Usage:  framegrabber_load [ options ] { -l | -u } [[sym=value] ...]
Load or unload the kernel modules for the framegrabbers installed on the
system.  Creates the device files in  /dev  for the framegrabbers found.
Must be run as root.

One these flag arguments is required:
-l      load (or unload and reload) the framegrabber modules
-u      unload the framegrabber modules

options:
-v              Verbose; announce successful load or unload.
-i flag         Flag option to be set to insmod(1).  E.g.  -i --verbose
                adds the verbose option to the insmod call.
sym=value       Additional arguments to insmod(1)

Setup:
This command must be run in the directory where the kernel modules are present.
Kernel modules are named with the recognized device names followed by the
kernel version as reported by the  uname -r  command.  For example for a
PXC200 Imagenation board running on Linux kernel 2.2.12-16, the module file is
named  pxc200_2.2.12-16 .  The module is listed by lsmod(1) as  pxc200 .
If this device_kernel form of module filename does not exist, then  <device>.o
is tried.  If that does not exist, then either  pxc.o  (for the PXC200) or
 pxdrv.o  (for the PX500, PX510 or PX600) is tried.
Recognized Imagenation framegrabbers:  PXC200  PX500  PX510  PX600
Note: the PX610A is not supported.

--
 Mike Bianchi
 Foveal Systems
 190 Loantaka Way
 Madison NJ  07940-1910

 +1 973 822-2085	Voice and Fax

 MBianchi@Foveal.com

 Create videos of auditorium presentations without a crew?
 Yes!
 http://www.AutoAuditorium.com

--xHFwDpU9dbj6ez1V
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=framegrabber_load
Content-Transfer-Encoding: quoted-printable

#! /bin/sh
#                       Copyright (c) 2000 Foveal Systems
#	MBianchi@Foveal.com
#	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.

#	$Header: /usr/home/mbianchi/src/autoaud/5.0.aa/RCS/framegrabber_load.sh,v=
 5.4 2002/02/10 19:48:05 mbianchi Exp $

cmd=3D$( basename $0 )

function Stderr {
	echo >&2 "${cmd}: $@"
}

function Verbose {
	#	prints on stdout!
	case $1 in
	-f )
		file=3D$2
		shift 2
		echo "$@" >>${file}
	esac
	if [ ${verbose} ]
	then
		echo "${cmd}:  $@"
	fi
}

function Usage {
	echo >&2 '=07'
	if [ $# -gt 0 ]
	then
		Stderr "$@"
	fi
	echo >&2 "Usage:  ${cmd} [ options ] { -l | -u } [[sym=3Dvalue] ...]
Load or unload the kernel modules for the framegrabbers installed on the
system.  Creates the device files in  /dev  for the framegrabbers found.
Must be run as root.

One these flag arguments is required:
-l	load (or unload and reload) the framegrabber modules
-u	unload the framegrabber modules

options:
-v		Verbose; announce successful load or unload.
-i flag		Flag option to be set to insmod(1).  E.g.  -i --verbose
		adds the verbose option to the insmod call.
sym=3Dvalue	Additional arguments to insmod(1)

Setup:
This command must be run in the directory where the kernel modules are pres=
ent.
Kernel modules are named with the recognized device names followed by the
kernel version as reported by the  uname -r  command.  For example for a
PXC200 Imagenation board running on Linux kernel 2.2.12-16, the module file=
 is
named  pxc200_2.2.12-16 .  The module is listed by lsmod(1) as  pxc200 .
If this device_kernel form of module filename does not exist, then  <device=
>.o
is tried.  If that does not exist, then either  pxc.o  (for the PXC200) or
 pxdrv.o  (for the PX500, PX510 or PX600) is tried.
Recognized Imagenation framegrabbers:  PXC200  PX500  PX510  PX600
Note: the PX610A is not supported.
"
	exit 255
}

if [ $# -lt 1 ]
then
	Usage
fi

badoption=3D"Need required option:  either -l or -u"
insmod_options=3D
load=3D
unload=3D
verbose=3D
while getopts :i:luv option
do
	case ${option} in
	i )
		insmod_options=3D"${insmod_options} ${OPTARG}"
		break;
		;;
	l )
		load=3Dload
		badoption=3D
		;;
	u )
		unload=3Dunload
		badoption=3D
		;;
	v )
		verbose=3Dverbose
		;;
	'?' )
		Usage "invalid option -${OPTARG}"
		;;
	* )
		Usage "oops!  unimplimented option -${option}"
	esac
done
shift $( expr ${OPTIND} - 1 )

if [ -n "${load}"  -a  -n "${unload}" ]
then
	Usage "Cannot specify both -l and -u options."
elif [ -n "${badoption}" ]
then
	Usage "${badoption}  $*"
fi

insmod_symbols=3D"$*"

eval $( id  |  sed 's/(.*//' )
if [ "${uid}" !=3D 0 ]
then
	Usage "Must be run as root."
fi


function MakeDevice {
	dev_filename=3D$1
	major=3D$2
	max_minor=3D$3
	index=3D$4

	for j in \
		' MINOR=3D0	TYPE=3D		' \
		' MINOR=3D16	TYPE=3Dpgm	' \
		' MINOR=3D32	TYPE=3Dctl	' \
		' MINOR=3D48	TYPE=3DH		' \
		' MINOR=3D64	TYPE=3DHpgm	' \
		' MINOR=3D80	TYPE=3Dppm	' \
		' MINOR=3D96	TYPE=3Drgb	' \
		' MINOR=3D112	TYPE=3Dbgr	' \
		' MINOR=3D128	TYPE=3DHppm	' \
		' MINOR=3D144	TYPE=3DHrgb	'
	do
		eval ${j}

		if [ ${MINOR} -gt ${max_minor} ]
		then
			return
		fi

		file=3D${dev_filename}${index}${TYPE}
		let MINOR+=3D${index}

		rm -f ${file}
		mknod ${file} c ${major} ${MINOR}  &&
			chmod go+w ${file}
	done
}

exitcode=3D0
found_device=3D0

#	DEVICE		the device name found in /proc/devices
#	DEV_FILENAME	the root of the device filename, starts with  /dev/
#	BOARDID		the string for the board found in lscpi(8)
#	MAX_MINOR	the maximum minor device number base supported.
#			E.g.	/dev/px0Hpgm is minor device 64
#				/dev/px1Hpgm is minor device 65, etc.
#	Maybe someday ...
#	  DEVICE=3Dpx610A
#	  DEV_FILENAME=3D/dev/px
#	  BOARDID=3D"Multimedia controller:.*\<SAA7146\>"
#	  MAX_MINOR=3D64

for i in \
	' DEVICE=3Dpxc200
	  DEV_FILENAME=3D/dev/pxc
	  BOARDID=3D"Multimedia video controller:.*\<Bt848\>"
	  MAX_MINOR=3D144
	  DEFAULT_DOT_O_FILE=3Dpxc.o
	' \
	' DEVICE=3Dpx500
	  DEV_FILENAME=3D/dev/px
	  BOARDID=3D"Multimedia video controller:.*\<SAA7116\>"
	  MAX_MINOR=3D64
	  DEFAULT_DOT_O_FILE=3Dpxdrv.o
	'
do
	eval ${i}

	device_count=3D$( lspci  |  grep -ic "${BOARDID}" )
	if [ ${device_count} -le 0 ]
	then
		continue
	fi

	module_file=3D${DEVICE}_$( uname -r )
	dot_o_file=3D${DEVICE}.o

	rm -f ${DEV_FILENAME}*
	if [ ${unload} ]
	then
		Verbose "/sbin/rmmod ${DEVICE}"
		/sbin/rmmod ${DEVICE}
		let "exitcode =3D ${exitcode} + $?"
		found_device=3D1
		continue
	fi
	/sbin/rmmod ${DEVICE} 2>/dev/null

	if [ -s ${module_file} ]
	then
		:
	elif [ -s ${dot_o_file} ]
	then
		module_file=3D${dot_o_file}
	elif [ -s ${DEFAULT_DOT_O_FILE} ]
	then
		module_file=3D${DEFAULT_DOT_O_FILE}
	else
		Stderr "$(pwd):
  No file  ${module_file} ,  ${dot_o_file} , or  ${DEFAULT_DOT_O_FILE}
  Need module for \"${BOARDID}\"."
		exitcode=3D1
		continue
	fi

	found_device=3D1
	insmod_cmd=3D"/sbin/insmod --force --name=3D${DEVICE} ${insmod_options} ${=
module_file} ${insmod_symbols}"
	Verbose "${insmod_cmd}"
	if ${insmod_cmd}
	then
		Verbose Loaded module ${module_file} for ${DEVICE}.
		major=3D$( grep "${DEVICE}" /proc/devices  |  awk '{print $1}' )
		while [ ${device_count} -gt 0 ]
		do
			let device_count-=3D1
			MakeDevice ${DEV_FILENAME} ${major} ${MAX_MINOR} \
								${device_count}
			Verbose Created ${DEV_FILENAME}${device_count}
		done
	else
		Verbose "insmod(1) failed:
	${insmod_cmd}"
		exitcode=3D2
	fi
done

if [ ${found_device} =3D 0 ]
then
	Verbose No devices found.
fi

exit ${exitcode}

--xHFwDpU9dbj6ez1V--

From marius@tbs.co.za  Wed Feb 20 07:30:32 2002
From: marius@tbs.co.za (Marius van Wyk)
Date: Wed, 20 Feb 2002 09:30:32 +0200
Subject: [pxc] Kernel messages...
In-Reply-To: <Pine.LNX.4.33.0112141112450.12845-100000@talgo.uvigo.es>
Message-ID: <DFEDKGKKKACFBAIPODKOGEOCCAAA.marius@tbs.co.za>

This is a multi-part message in MIME format.

------=_NextPart_000_0001_01C1B9F1.3E1ED730
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

I seem to be getting a lot of these:

I'm using Mandrake 8.1 on an AMD K6 (linux 2.4.8-26mdk)

I'm using the pxc 0.81 drivers.

I'm using the buffer method (similar to demo_mmap.c) of capturing, but I am also opening and closing the pxc0 and pxc0rgb
alternatly.

I've been running with these errors for awhile, but feel uneasy...

Should I worry? If so, how can I fix these? (What am I perhaps doing wrongo?)

Regards,
Marius

-----------
Feb 20 09:18:17 babel kernel: pxc200: Unexpected IRQ 0x1e00100c, IP 0x022ea92c 4 times
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 02: hsync
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:18:17 babel kernel: pxc200: lockup detected
Feb 20 09:18:17 babel kernel: pxc200: serious error (1 times), restart
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 11: RISC irq
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 18: opcode error
Feb 20 09:18:18 babel kernel: pxc200: Unexpected IRQ 0x3e00100c, IP 0x0137492c 5 times
Feb 20 09:18:18 babel kernel: pxc200:     irq bit 02: hsync
Feb 20 09:18:18 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:18 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:18:19 babel kernel: pxc200: Unexpected IRQ 0x3e00100c, IP 0x022ea92c 1 times
Feb 20 09:18:19 babel kernel: pxc200:     irq bit 02: hsync
Feb 20 09:18:19 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:19 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:18:19 babel kernel: pxc200: lockup detected
Feb 20 09:18:19 babel kernel: pxc200: serious error (1 times), restart
Feb 20 09:18:19 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:19 babel kernel: pxc200:     irq bit 11: RISC irq
Feb 20 09:18:19 babel kernel: pxc200:     irq bit 18: opcode error
Feb 20 09:18:20 babel kernel: pxc200: Unexpected IRQ 0x5e001008, IP 0x022ea92c 5 times
Feb 20 09:18:20 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:20 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:18:21 babel kernel: pxc200: Unexpected IRQ 0x5e00100c, IP 0x022ea92c 1 times
Feb 20 09:18:21 babel kernel: pxc200:     irq bit 02: hsync
Feb 20 09:18:21 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:21 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:18:21 babel kernel: pxc200: lockup detected
Feb 20 09:18:21 babel kernel: pxc200: serious error (1 times), restart
Feb 20 09:18:21 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:21 babel kernel: pxc200:     irq bit 11: RISC irq
Feb 20 09:18:21 babel kernel: pxc200:     irq bit 18: opcode error
Feb 20 09:18:22 babel kernel: pxc200: Unexpected IRQ 0x7e001008, IP 0x0137492c 4 times
Feb 20 09:18:22 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:22 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:18:24 babel kernel: pxc200: Unexpected IRQ 0x7e00100c, IP 0x022ea92c 2 times
Feb 20 09:18:24 babel kernel: pxc200:     irq bit 02: hsync
Feb 20 09:18:24 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:24 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:18:26 babel kernel: pxc200: Unexpected IRQ 0x7e00100c, IP 0x0137492c 1 times
Feb 20 09:18:26 babel kernel: pxc200:     irq bit 02: hsync
Feb 20 09:18:26 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:26 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:18:28 babel kernel: pxc200: Unexpected IRQ 0x7e00100c, IP 0x0137492c 1 times
Feb 20 09:18:28 babel kernel: pxc200:     irq bit 02: hsync
Feb 20 09:18:28 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:28 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:18:29 babel kernel: pxc200: Unexpected IRQ 0x7e001008, IP 0x0137492c 1 times
Feb 20 09:18:29 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:29 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:18:30 babel kernel: pxc200: Unexpected IRQ 0x7e00100c, IP 0x0137492c 1 times
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 02: hsync
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:18:30 babel kernel: pxc200: lockup detected
Feb 20 09:18:30 babel kernel: pxc200: serious error (1 times), restart
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 02: hsync
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 11: RISC irq
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 18: opcode error
Feb 20 09:18:31 babel kernel: pxc200: Unexpected IRQ 0x9e00100c, IP 0x022ea92c 3 times
Feb 20 09:18:31 babel kernel: pxc200:     irq bit 02: hsync
Feb 20 09:18:31 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:18:31 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data
Feb 20 09:21:26 babel kernel: pxc200: Unexpected IRQ 0x9e00100c, IP 0x0299f92c 1 times
Feb 20 09:21:26 babel kernel: pxc200:     irq bit 02: hsync
Feb 20 09:21:26 babel kernel: pxc200:     irq bit 03: overflow
Feb 20 09:21:26 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data

------=_NextPart_000_0001_01C1B9F1.3E1ED730
Content-Type: text/plain;
	name="messages.txt"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="messages.txt"

Feb 20 09:18:17 babel kernel: pxc200: Unexpected IRQ 0x1e00100c, IP =
0x022ea92c 4 times=0A=
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 02: hsync=0A=
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:18:17 babel kernel: pxc200: lockup detected=0A=
Feb 20 09:18:17 babel kernel: pxc200: serious error (1 times), restart=0A=
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 11: RISC irq=0A=
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:18:17 babel kernel: pxc200:     irq bit 18: opcode error=0A=
Feb 20 09:18:18 babel kernel: pxc200: Unexpected IRQ 0x3e00100c, IP =
0x0137492c 5 times=0A=
Feb 20 09:18:18 babel kernel: pxc200:     irq bit 02: hsync=0A=
Feb 20 09:18:18 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:18 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:18:19 babel kernel: pxc200: Unexpected IRQ 0x3e00100c, IP =
0x022ea92c 1 times=0A=
Feb 20 09:18:19 babel kernel: pxc200:     irq bit 02: hsync=0A=
Feb 20 09:18:19 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:19 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:18:19 babel kernel: pxc200: lockup detected=0A=
Feb 20 09:18:19 babel kernel: pxc200: serious error (1 times), restart=0A=
Feb 20 09:18:19 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:19 babel kernel: pxc200:     irq bit 11: RISC irq=0A=
Feb 20 09:18:19 babel kernel: pxc200:     irq bit 18: opcode error=0A=
Feb 20 09:18:20 babel kernel: pxc200: Unexpected IRQ 0x5e001008, IP =
0x022ea92c 5 times=0A=
Feb 20 09:18:20 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:20 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:18:21 babel kernel: pxc200: Unexpected IRQ 0x5e00100c, IP =
0x022ea92c 1 times=0A=
Feb 20 09:18:21 babel kernel: pxc200:     irq bit 02: hsync=0A=
Feb 20 09:18:21 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:21 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:18:21 babel kernel: pxc200: lockup detected=0A=
Feb 20 09:18:21 babel kernel: pxc200: serious error (1 times), restart=0A=
Feb 20 09:18:21 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:21 babel kernel: pxc200:     irq bit 11: RISC irq=0A=
Feb 20 09:18:21 babel kernel: pxc200:     irq bit 18: opcode error=0A=
Feb 20 09:18:22 babel kernel: pxc200: Unexpected IRQ 0x7e001008, IP =
0x0137492c 4 times=0A=
Feb 20 09:18:22 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:22 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:18:24 babel kernel: pxc200: Unexpected IRQ 0x7e00100c, IP =
0x022ea92c 2 times=0A=
Feb 20 09:18:24 babel kernel: pxc200:     irq bit 02: hsync=0A=
Feb 20 09:18:24 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:24 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:18:26 babel kernel: pxc200: Unexpected IRQ 0x7e00100c, IP =
0x0137492c 1 times=0A=
Feb 20 09:18:26 babel kernel: pxc200:     irq bit 02: hsync=0A=
Feb 20 09:18:26 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:26 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:18:28 babel kernel: pxc200: Unexpected IRQ 0x7e00100c, IP =
0x0137492c 1 times=0A=
Feb 20 09:18:28 babel kernel: pxc200:     irq bit 02: hsync=0A=
Feb 20 09:18:28 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:28 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:18:29 babel kernel: pxc200: Unexpected IRQ 0x7e001008, IP =
0x0137492c 1 times=0A=
Feb 20 09:18:29 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:29 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:18:30 babel kernel: pxc200: Unexpected IRQ 0x7e00100c, IP =
0x0137492c 1 times=0A=
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 02: hsync=0A=
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:18:30 babel kernel: pxc200: lockup detected=0A=
Feb 20 09:18:30 babel kernel: pxc200: serious error (1 times), restart=0A=
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 02: hsync=0A=
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 11: RISC irq=0A=
Feb 20 09:18:30 babel kernel: pxc200:     irq bit 18: opcode error=0A=
Feb 20 09:18:31 babel kernel: pxc200: Unexpected IRQ 0x9e00100c, IP =
0x022ea92c 3 times=0A=
Feb 20 09:18:31 babel kernel: pxc200:     irq bit 02: hsync=0A=
Feb 20 09:18:31 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:18:31 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=
Feb 20 09:21:26 babel kernel: pxc200: Unexpected IRQ 0x9e00100c, IP =
0x0299f92c 1 times=0A=
Feb 20 09:21:26 babel kernel: pxc200:     irq bit 02: hsync=0A=
Feb 20 09:21:26 babel kernel: pxc200:     irq bit 03: overflow=0A=
Feb 20 09:21:26 babel kernel: pxc200:     irq bit 12: fifo overrun, drop =
data=0A=

------=_NextPart_000_0001_01C1B9F1.3E1ED730--


From rubini@gnu.org  Wed Feb 20 11:38:39 2002
From: rubini@gnu.org (Alessandro Rubini)
Date: Wed, 20 Feb 2002 12:38:39 +0100
Subject: [pxc] Kernel messages...
In-Reply-To: <DFEDKGKKKACFBAIPODKOGEOCCAAA.marius@tbs.co.za>
References: <DFEDKGKKKACFBAIPODKOGEOCCAAA.marius@tbs.co.za>
Message-ID: <20020220123839.A20585@morgana.systemy.it>

Hello.

> I've been running with these errors for awhile, but feel uneasy...

This stuff is occurring only of some of my systems and only sometimes.
I haven't been able to track it down.

I didn't want to just ignore the issue, so I changed the reporting to
be both more informative and less demanding on the logs (it logs only
once a second, detailing the error bits for this event and the number
of unexpected interrupts it got during the last second).

What happens is that the device sends an interrupt with error bits set
(and possibly with no interesting bits set).  The meaning of those
bits is detailed in the 848/878 data sheets.

> Feb 20 09:18:17 babel kernel: pxc200:     irq bit 02: hsync

hsync isn't relevant, because it happens duting normal operation.

> Feb 20 09:18:17 babel kernel: pxc200:     irq bit 03: overflow

This is an overflow in pixel data (brighter than white), IIRC.

> Feb 20 09:18:17 babel kernel: pxc200:     irq bit 12: fifo overrun, drop data

This is bad. It means some pixel data is lost, as the 8?8 fifo has
been overrun before the DMA controller could save data to memory. When
this happens you should have partial lines on your image, but
sometimes I see no real problem in the image -- and I don't understand
why.

> Feb 20 09:18:17 babel kernel: pxc200:     irq bit 11: RISC irq

This is the good interrupt. It's only reported when it happens together
with bad interrupt bits.

> Feb 20 09:18:17 babel kernel: pxc200:     irq bit 18: opcode error

This is very bad. Looks like the DMA operations to read the program
failed.



Summary: it looks like the device can't keep up with the DMA flow that
is required for proper operation. This happened once to me on a 486,
and I could really get no useful image on that computer. Therefore I
stopped using it for testing frame grabber drivers.

But sometimes it also happens on a production computer where there is
no artifact in the acquired images. I really can't tell what is going
on.

/alessandro

From rubini@gnu.org  Mon Feb 25 10:52:31 2002
From: rubini@gnu.org (Alessandro Rubini)
Date: Mon, 25 Feb 2002 11:52:31 +0100
Subject: [pxc] Re: Unsynced Images.
Message-ID: <20020225115231.A16022@morgana.systemy.it>

[Marius' post, that I quote, has not been approved by mailman
 because it's too big. If someone is interested, I placed
 the attached image in ftp://arcana.linux.it/private/unsynched.png ]


> I just though I'd show you a picture and get your opinions. I've
> just completed the support for full/interlaced frames in my
> applications, and something has become more aparent. It seems that
> the Generic Bt878 card that I am using does not seem to sync to the
> propper field. This picture is acquired using mmap, and I have used
> both the 0.80 and 0.81 drivers, with the same result.

> It seems to swap the fields about 50% of the time.

Very strange. I never got the same problem. I'll look better and will
send you some code/patch to try and help diagnosing the problem.

> Acording to your documentation, it will always start capture on the
> first field (for capturing single fields to avoid jitter), and I
> asume it the same with frames.  (PS My single fields do not seem to
> do this, resulting in constant jitter)

I remember this. It's in my queue. Hope to have time next week, I'm sorry
I can't looks at it earlier.
 
> What can I do to minimise this? Is there a way I can check what
> field I'm grabbing?

It's written in the interrupt status flag. You might try to print
it when the buffer is committed, to check whether the hardware is
mistaking one field for the other or if there's a bug.

Since it doesn't happen always (in high res), I think it's a problem
with the specific camera you are using.

BTW: I'll try with both PXC200 and plain-878 device.

/alessandro

> ------=_NextPart_000_0000_01C1BDD4.FC367BB0
> Content-Type: image/png;
> 	name="unsynched.png"

[skipped]

Please note that being it compressed, it's not so apparent whether the
fields are swapped or not (I assume yes, but it's not clearly visible
in the picture)

/alessandro

