From owner-freebsd-stable Sat Mar 21 17:28:22 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id RAA09427 for freebsd-stable-outgoing; Sat, 21 Mar 1998 17:28:22 -0800 (PST) (envelope-from owner-freebsd-stable@FreeBSD.ORG) Received: from whqvax.picker.com (whqvax.picker.com [144.54.1.1]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id RAA09362; Sat, 21 Mar 1998 17:28:07 -0800 (PST) (envelope-from rhh@ct.picker.com) Received: from ct.picker.com by whqvax.picker.com with SMTP; Sat, 21 Mar 1998 20:27:32 -0500 (EST) Received: from elmer.ct.picker.com by ct.picker.com (4.1/SMI-4.1) id AA10581; Sat, 21 Mar 98 20:27:31 EST Received: by elmer.ct.picker.com (SMI-8.6/SMI-SVR4) id UAA11551; Sat, 21 Mar 1998 20:27:07 -0500 Message-Id: <19980321202707.30581@ct.picker.com> Date: Sat, 21 Mar 1998 20:27:07 -0500 From: Randall Hopper To: Joao Carlos Mendes Luis , multimedia@FreeBSD.ORG Cc: stable@FreeBSD.ORG Subject: Re: Fxtv vs Stable Mail-Followup-To: Joao Carlos Mendes Luis , multimedia@FreeBSD.ORG, stable@FreeBSD.ORG References: <199803210410.BAA22581@gaia.coppe.ufrj.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1i In-Reply-To: <199803210410.BAA22581@gaia.coppe.ufrj.br>; from Joao Carlos Mendes Luis on Sat, Mar 21, 1998 at 01:10:57AM -0300 Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk Joao Carlos Mendes Luis: | With the last patches to stable's mmap, fxtv cannot anymore be run |by normal users. The problem seems to be a mmap() with an (I think) |unneeded MAP_WRITE at tvcapture.c. If it's really unnecessary, it's |a patch candidate for 2.2.6-RELEASE. | | Randal, what do you say ? | |PS: I have first tried to chmod a+rw /dev/bktr0 and /dev/tuner0 but this |did not work. Should it be that way ? I hadn't heard the details on the mmap change. Fxtv I believe only reads from the buffer except when starting a capture for which temporal decimation is enabled. At that time, it clears out the driver buffer so that you don't see a stale last frame from the last capture up until the first frame of the requested capture finally comes along. Could be all we need is a driver update that provides an ioctl to clear out the first N bytes of the driver buffer. Then Fxtv would only need to mmap() in read-only mode. I'm not running stable, but if you want to verify this, make these two tweaks to tvcapture.c and see if Fxtv works again when not running as root: 1) Comment out the "|PROT_WRITE" in: c->drv_buf = (TV_UINT8 *) mmap( (caddr_t)0, MAX_MMAP_BUF_SIZE, PROT_READ|PROT_WRITE, 0, c->fd, (off_t)0 ); 2) Comment out these few lines: /* If TDEC is on, may be a while before old trash gets written on */ if ( c->fps != c->fps_max ) memset( c->drv_buf, '\0', g.w * g.h * c->pix_geom_list[ c->pix_geom_idx ].Bpp ); Thanks, Randall To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message