Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Mar 1998 20:27:07 -0500
From:      Randall Hopper <rhh@ct.picker.com>
To:        Joao Carlos Mendes Luis <jonny@coppe.ufrj.br>, multimedia@FreeBSD.ORG
Cc:        stable@FreeBSD.ORG
Subject:   Re: Fxtv vs Stable
Message-ID:  <19980321202707.30581@ct.picker.com>
In-Reply-To: <199803210410.BAA22581@gaia.coppe.ufrj.br>; from Joao Carlos Mendes Luis on Sat, Mar 21, 1998 at 01:10:57AM -0300
References:  <199803210410.BAA22581@gaia.coppe.ufrj.br>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980321202707.30581>