From owner-freebsd-multimedia@FreeBSD.ORG Wed Apr 14 17:47:09 2010 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1173C106564A for ; Wed, 14 Apr 2010 17:47:09 +0000 (UTC) (envelope-from nox@jelal.kn-bremen.de) Received: from smtp.kn-bremen.de (gelbbaer.kn-bremen.de [78.46.108.116]) by mx1.freebsd.org (Postfix) with ESMTP id 8287C8FC21 for ; Wed, 14 Apr 2010 17:47:08 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 230AC1E00162; Wed, 14 Apr 2010 19:47:07 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.3/8.14.3) with ESMTP id o3EHgwqb057195; Wed, 14 Apr 2010 19:42:58 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.3/8.14.3/Submit) id o3EHgwP2057194; Wed, 14 Apr 2010 19:42:58 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Wed, 14 Apr 2010 19:42:58 +0200 To: Juergen Lock Message-ID: <20100414174258.GA56963@triton8.kn-bremen.de> References: <201004122153.o3CLrRkE007918@triton8.kn-bremen.de> <20100413204240.GA83649@triton8.kn-bremen.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100413204240.GA83649@triton8.kn-bremen.de> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-multimedia@freebsd.org, christophe LE ROUX Subject: w_scan and szap-s2 ports for testing (was: Re: Webcamd : Can it support dvb-s/dvb-s2 usb devices ?) X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 17:47:09 -0000 I have now made ports for w_scan and szap-s2: http://people.freebsd.org/~nox/dvb/w_scan.shar http://people.freebsd.org/~nox/dvb/szap_s2.shar I also added a temporary workaround to the w_scan port that defaults to assuming DVB API 5.0 if the FE_GET_PROPERTY ioctl is defined wrong like it is the current multimedia/v4l_compat port, see further down in the quoted message below for an explanation. Enjoy, :) Juergen On Tue, Apr 13, 2010 at 10:42:40PM +0200, Juergen Lock wrote: > On Mon, Apr 12, 2010 at 11:53:27PM +0200, Juergen Lock wrote: > > In article <201003311322.56988.hselasky@c2i.net> you write: > > >On Wednesday 31 March 2010 10:26:09 christophe LE ROUX wrote: > > >> Hello, > > >> > > > > > >Hi, > > Hi! > > > > > >> As i can read on some web pages, webcamd can support webcam and dvb-t > > >> devices who have a linux driver. > > >> What about dvb-s (or dvbs2) usb devices ? > > > > > >Yes, many are supported, but some are not. Please see the main Makefile in > > >webcamd. > > > > > >> i think about Tevii S650 ( or S660 ) with ds3000.c linux driver, Pinacle > > >> PCTV 452e Sat HDTV Pro USB with pctv452e.c linux driver or Technotrend > > >> Connect S2-3600 HDTV-S2 USB ( with pctv452e.c linux driver too ). > > >> > > >> Another question, > > >> If webcamd can support these usb devices, can i use mythtv port with ? > > > > > >I have not tried this yet. If mythtv uses the linux DVB header files, then > > >yes. > > > > For the OP (and other readers:) I haven't tried mythtv yet but after > > some hacking and a longer debugging session on #bsdusb I got a PCTV 452e > > Sat HDTV Pro USB working using szap-s2, > > > > http://www.linuxtv.org/wiki/index.php/Szap-s2 > > > > checked out from hg and built by: > > > > gmake INCLUDE=-I/usr/local/include > > > > and the CFT mplayer port (looks like it still isn't committed), > > > > http://lists.freebsd.org/pipermail/freebsd-multimedia/2010-January/010784.html > > > > pointed at the dvr0 device: > > > > mplayer -demuxer lavf -cache 8192 /dev/dvb/adapter0/dvr0 > > > > kaffeine worked too but the version in ports doesn't yet know dvb-s2, > > (and even on Linux where I have a newer kaffeine it still has audio > > issues on the hd channels.) vlc's builtin dvb support was useless with > > this tuner (and caused us lots of useless debugging looking for a problem > > in webcamd because vlc behaved like it got a corrupted stream...), > > what does `work' is pointing vlc at /dev/dvb/adapter0/dvr0 together > > with szap-s2 like mplayer, but vlc used too much cpu on hd channels so > > they weren't really watchable. (unlike mplayer which played 1080i > > just fine using ~85% of one core and only xv on xorg's radeon driver > > on a PhenomII cpu...) > > > > About szap-s2: I ran it similar to this: > > > > ./szap-s2 -V -n 6 -p -t > > > > and on some hd channels I need -b too or mplayer would get no audio. > > > > -t is a new option I just added to pass teletext thru (vlc can display > > it, this needs -V because the teletext pid is only in the VDR channel.conf > > format), that patch I put here: > > > > http://people.freebsd.org/~nox/szap-s2-teletext.patch > > > > hps now has updated the webcamd svn to use only the pctv452e driver > > out of the s2-liplianin repo that I originally used entirely in place > > of the linuxtv.org one (for some reason the pctv452e-related drivers > > are still missing in upstream Linux) and I just tested that svn version > > today: > > > > http://www.selasky.org/hans_petter/video4bsd/ > > > > I haven't tried building w_scan on FreeBSD yet > > > > http://www.linuxtv.org/wiki/index.php/W_scan > > > > but hps said he only needed to fix include paths - you need it if you > > don't have a channels.conf yet, I took mine from Linux with some > > updates off the web. kaffeine can scan too, but as I said this > > version doesn't know dvb-s2, and also it uses its own channel list > > format. > > > > Oh and a poor man's way of recording is to use szap-s2 and then > > cat /dev/dvb/adapter0/dvr0 to a file... (you probably can play it > > with mplayer while it's still being written if you wait a little > > at first if you want to find out when the show you want ends.) > > I forgot to say you need the svn version of cuse4bsd too, there was > a bug in the ioctl handling that broke ioctls that pass no data > (_IO) like dvb-s uses. (FE_SET_TONE, FE_SET_VOLTAGE...) > > And I played with w_scan a bit now and found three things: > > 1. the FE_GET_PROPERTY ioctl in needs > to be _IOW not _IOR - yes this is broken on Linux too but they do > a workaround (they just always do the copyin) in > linux/drivers/media/dvb/dvb-core/dvbdev.c:dvb_usercopy(), see the > comment /* some v4l ioctls are marked wrong ... */ here: > > http://linuxtv.org/hg/v4l-dvb/file/7c0b887911cf/linux/drivers/media/dvb/dvb-core/dvbdev.c#l422 > > And I think a workaround is impossible on FreeBSD since the copyin() > of the ioctl data is handled in the ioctl syscall directly not in the > drivers like on Linux: > > http://fxr.watson.org/fxr/source/kern/sys_generic.c#L664 > > so I'd say we'll have to patch our copies of the Linux includes if > we want FE_GET_PROPERTY to work. :( (And I dunno if that's the > only broken one...) > > 2. w_scan for some reason seems to miss random transponders when > I use the updated svn webcamd that uses the pctv452e drivers in the > linuxtv.org v4l-dvb tree instead of just the entire s2-liplianin tree > like I originally did; I say `random' because if I do another scan > then other transponders are missing... Using the s2-liplianin tree > I get a channels.conf with around 1170 lines, using the svn webcamd > I once got 762 lines, another time 884... And I really don't feel > like debugging this because the reason could be anywhere in whatever > other fixes there are in the s2-liplianin tree compared to v4l-dvb, > so I think we really need something like a knob in the webcamd port > to select which tree to use. > > And 3. there's a bug in w_scan that breaks scanning dvb-s when using > the old dvb api: (which it will assume when FE_GET_PROPERTY doesn't > work; and also after applying this fix using the old api will still > make it skip dvb-s2 transponders.) > > --- a/scan.c > +++ b/scan.c > @@ -1640,6 +1643,10 @@ static int set_frontend(int frontend_fd, > case 0x0302: > verbose("%s: using DVB API 3.2\n", __FUNCTION__); > copy_fe_params_new_to_old(&p, &t->param); > +#if 1 > + if (t->type == FE_QPSK) > + p.frequency = intermediate_freq; > +#endif > if (ioctl(frontend_fd, FE_SET_FRONTEND, &p) == -1) { > errorn("Setting frontend parameters failed (API v3.2)\n"); > return -1; > > Cheers, > Juergen