w_scan and szap-s2 ports for testing (was: Re: Webcamd : Can it support dvb-s/dvb-s2 usb devices ?)

Juergen Lock nox at jelal.kn-bremen.de
Wed Apr 14 17:47:09 UTC 2010


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 at 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 <include/linux/dvb/frontend.h> 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


More information about the freebsd-multimedia mailing list