On Wed, 2008-09-17 at 11:36 -0700, Randall J. Parr wrote:
> Andy Walls wrote:

> > There are a number of things which could be going wrong.  Non of which
> > are easy to diagnose.
> >
> > As a quick work-around please see if this works:
> >
> >     # ivtvctl -d /dev/video1 --reset 2
> >     # v4l2-ctl -d /dev/video1 -i2
> >     # v4l2-ctl -d /dev/video1 -i0
> >
> > That should reset the CX28543 broadcast decoder on the second half of
> > the card, try to reload it's firmware, and re-setup all it's registers.
> > I also added the other commands to go to Composite 1 and back to tuner,
> > just to make sure the chip and driver are is set up right for tuner
> > input.
> >
> >
> > Regards,
> > Andy
> >   
> 
> First, thank you for the extremely cogent analysis.
> 
> I tried to reset the decoder but my version of ivtvctl does not support 
> the --reset option.
> I have ivtvctl version 1.0.3 on 2.6.24-19 Ubuntu 8.04 kernel

Well, the 1.1.0 version of ivtv and ivtvctl does support the '--reset n'
option.  Since your kernel has a 1.1.0 version of the driver, you may
just want tp update to the version of the ivtv-utils that match your
kernel:

http://www.ivtvdriver.org/index.php/Download



> I did not see a similar option in v4l2-ctl.

It's sn ivtv (and cx18) private ioctl() call.  v4l2-ctl won't let you
execute it.

> Is there additional utilities I need or an alternate way to achieve this?
> I do have the libvideo-ivtv-perl package installed.

Yes.  I have attached a small C program that will perform the private
reset ioctl().


Regards,
Andy


> Thanks
> R.Parr

/*
 * ivtvreset.c - issue an ivtv or cx18 internal reset ioctl
 *
 * Copyright (C) 2008 Andy Walls
 *
 * 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Author: Andy Walls <[EMAIL PROTECTED]>
 *
 * Compile: gcc -Wall -O2 -o ivtvreset ivtvreset.c
 *
 * Invoke:  ./ivtvreset -d /dev/video1  -i -b
 *
 */

#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/videodev2.h>

#define VIDIOC_INT_RESET            	_IOW ('d', 102, __u32)

struct parsed_args
{
	char *devpath;
	__u32 device_mask;
};

int parse_args (int argc, char **argv, struct parsed_args *args)
{
	int c, retval;

	args->devpath = "/dev/video";
	args->device_mask = 0;
	retval = 0;
	while ((c = getopt(argc, argv, "d:ib")) != -1)
	{
		switch (c)
		{
			case 'd':
				args->devpath = optarg;
				break;
			case 'i':
				args->device_mask |= 1; /* IR microcontroller */
				break;
			case 'b':
				args->device_mask |= 2; /* broadcast decoder */
				break;
			default:
				fprintf (stderr, "Usage:\nivtvreset [-d videodev] [-i] [-b]\n");
				retval = -1;
				break;
		}
	}
	return retval;
}

int main (int argc, char **argv)
{
	int fd;
	struct parsed_args args;

	if (parse_args(argc, argv, &args) < 0)
		exit(1);
	
	if ((fd = open(args.devpath, O_RDWR)) < 0)
	{
		perror("open");
		fprintf(stderr, "Unable to open video control device: %s\n",
		        args.devpath);
		exit(2);
	}

	if (ioctl(fd, VIDIOC_INT_RESET, &args.device_mask) < 0)
	{
		perror ("ioctl");
		fprintf (stderr, "Can't issue private command on device %s\n",
		         args.devpath);
		exit(3);
	}
	close(fd);

	exit(0);
}
_______________________________________________
ivtv-users mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-users

Reply via email to