From owner-freebsd-multimedia@FreeBSD.ORG Tue Apr 17 17:30:46 2007 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 065FF16A400; Tue, 17 Apr 2007 17:30:46 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (gate.funkthat.com [69.17.45.168]) by mx1.freebsd.org (Postfix) with ESMTP id C6FEA13C4B0; Tue, 17 Apr 2007 17:30:45 +0000 (UTC) (envelope-from jmg@hydrogen.funkthat.com) Received: from hydrogen.funkthat.com (6ddi3jujlojgptbx@localhost.funkthat.com [127.0.0.1]) by hydrogen.funkthat.com (8.13.6/8.13.3) with ESMTP id l3HHUixE037614; Tue, 17 Apr 2007 10:30:44 -0700 (PDT) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.13.6/8.13.3/Submit) id l3HHUiW4037613; Tue, 17 Apr 2007 10:30:44 -0700 (PDT) (envelope-from jmg) Date: Tue, 17 Apr 2007 10:30:44 -0700 From: John-Mark Gurney To: usleepless@gmail.com Message-ID: <20070417173044.GC73385@funkthat.com> Mail-Followup-To: usleepless@gmail.com, Greg 'groggy' Lehey , freebsd-multimedia@freebsd.org References: <20070416055055.GC1593@wantadilla.lemis.com> <20070416212605.GV73385@funkthat.com> <20070417001817.GZ73385@funkthat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD 5.4-RELEASE-p6 i386 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html Cc: Greg 'groggy' Lehey , freebsd-multimedia@freebsd.org Subject: Re: pvrxxx, linux code and modules X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: John-Mark Gurney List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2007 17:30:46 -0000 usleepless@gmail.com wrote this message on Tue, Apr 17, 2007 at 08:47 +0200: > On 4/17/07, John-Mark Gurney wrote: > >usleepless@gmail.com wrote this message on Tue, Apr 17, 2007 at 00:51 > >+0200: > >> On 4/16/07, John-Mark Gurney wrote: > >> >Greg 'groggy' Lehey wrote this message on Mon, Apr 16, 2007 at 15:20 > >+0930: > >> >> - I need to understand better how tuners work. I've been thinking of > >> >> writing a document on the subject, something that people could use > >> >> for help when writing drivers. If you know of anything, even > >> >> partial or badly laid out, please let me know. > >> > > >> >Just to reiterate, tuner code really should be located in userland.. > >> >it's not time sensitive, and can't corrupted state of the kernel.. > >> > > >> >As for tuners, most/all of them communicate through the i2c bus... > >> >The tuner is programed w/ the frequency to tune, and depending upon > >> >the range of frequence will turn on/off various transistors to change > >> >some of the analog curcuit behavior... > >> > > >> >My HDTV device drive does all the tuning from userland... > >> > >> which driver is this? > > > >The DViCO FusionHDTV 5 Lite driver: > >http://www.freebsd.org/news/status/report-2006-10-2006-12.html#Bt878-Audio-Driver-(aka-FusionHDTV-5-Lite-driver) > > > >I have two tuners working in my system at home. > > how does one build this driver? where can i fetch it? Fetch the files from p4: http://perforce.freebsd.org/fileSearch.cgi?FSPC=%2F%2Fdepot%2Fuser%2Fjmg%2Fbktrau%2F...&ignore=GO%21 Put the dev and modules files in their place in a sys tree, and build module. You have to build bktr w/ BKTR_USE_FREEBSD_SMBUS and BKTR_GPIO_ACCESS options. Load the modules along w/ iic, build the program in capture, and run it like: ./bktrautest 56 foo.ts I haven't updated my box in a while, but they are known to work w/ a -current as of last November. One main reason I haven't imported the driver is I haven't decided what to do w/ the capture program. Though if someone started using the bktrau driver to capture audio directly on their bt878 cards, there'd be a good reason to import it. :) > >> >It was > >> >a lot easier to get it working using userland than having to constantly > >> >load/unload kernel modules, and risk crashing the machine... > >> > >> you are absolutely spot on about this. it's that i did build upon > >> pvr250 which had the tuner in kernel space, so i didn't think about > >> it. otherwise i might have been influenced by the linux source, and i > >> would have implemented in kernel space as well :-) > >> > >> but considering V4L(2), which has to support ioctl's changing the > >> frequency, how could this work from userland? > > > >Kill the V4L(2) API? :) I have thought about doing a cdev bridge to > >userland.. Effectively FUSE, but for cdev's instead of file systems... > >This would put most/all the logic in userland, and w/ some mmapping > >magic, can have similar/same performance for high speed devices like > >bktr... > > well, i am certainly not gonna kill the v4l(2) API since i intend to > use the pvrxxx cards with mythtv. I ment manage to get a sane userland based API that the Linux folk start to use too... W/ the userland cdev, we could create our own userland API, and then plug a V4L front end on top of it... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."