From owner-freebsd-multimedia@FreeBSD.ORG Wed Jan 26 08:01:18 2011 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 969FF1065670 for ; Wed, 26 Jan 2011 08:01:18 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe04.c2i.net [212.247.154.98]) by mx1.freebsd.org (Postfix) with ESMTP id 1834E8FC12 for ; Wed, 26 Jan 2011 08:01:17 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=wd7fLirDSts22yawIUsTeMUS9lsm8Llc0grT6RvpTjU= c=1 sm=1 a=8nJEP1OIZ-IA:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=xq3W2uTSAAAA:8 a=qnmMcjOPhsKM3pm3ChoA:9 a=7BeerQF0D5Gq652e7FkA:7 a=UBqmhdbBPGD-_o5S1SuwtlNW4JoA:4 a=wPNLvfGTeEIA:10 a=K3ocPEHWFzcA:10 a=NGvTQoL1X-7ETxtE:21 a=4WTsfeCq1eNEdM3C:21 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe04.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 78545389; Wed, 26 Jan 2011 09:01:14 +0100 From: Hans Petter Selasky To: Andrew Gallatin Date: Wed, 26 Jan 2011 09:01:19 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.4.5; amd64; ; ) References: In-Reply-To: X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101260901.19745.hselasky@c2i.net> Cc: freebsd-multimedia@freebsd.org Subject: Re: webcamd: PCTV 801eSE 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, 26 Jan 2011 08:01:18 -0000 On Wednesday 26 January 2011 02:41:41 Andrew Gallatin wrote: > Hi Hans, > > I'm trying to use a USB stick that I just bought. > (http://linuxtv.org/wiki/index.php/Pinnacle_PCTV_HD_Stick_(801eSE)) > > It works perfectly under Linux (Arch Linux's 2.6.35). Webcamd sees it, and > it seems to almost work: > > # usbconfig -u 4 -a 2 dump_device_desc > ugen4.2: at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) > pwr=ON > > bLength = 0x0012 > bDescriptorType = 0x0001 > bcdUSB = 0x0200 > bDeviceClass = 0x0000 > bDeviceSubClass = 0x0000 > bDeviceProtocol = 0x0000 > bMaxPacketSize0 = 0x0040 > idVendor = 0x2304 > idProduct = 0x023a > bcdDevice = 0x0100 > iManufacturer = 0x0001 > iProduct = 0x0002 > iSerialNumber = 0x0003 <01008D3B7A> > bNumConfigurations = 0x0001 > > > # webcamd > <...> > dvb-usb: found a 'Pinnacle PCTV HD Pro USB Stick' in warm state. > dvb-usb: will pass the complete MPEG2 transport stream to the software > demuxer. DVB: registering new adapter (Pinnacle PCTV HD Pro USB Stick) > DVB: registering adapter 0 frontend 0 (Samsung S5H1411 QAM/8VSB > Frontend)... xc5000 129-0064: creating new instance > xc5000: Successfully identified at address 0x64 > xc5000: Firmware has been loaded previously > dvb-usb: schedule remote query interval to 50 msecs. > dvb-usb: Pinnacle PCTV HD Pro USB Stick successfully initialized and > connected. dib0700: rc submit urb failed > > Creating /dev/dvb/adapter0/demux0 > Creating /dev/dvb/adapter0/dvr0 > Creating /dev/dvb/adapter0/frontend0 > xc5000: waiting for firmware upload (dvb-fe-xc5000-1.6.114.fw)... > Loading firmware at '/boot/modules/dvb-fe-xc5000-1.6.114.fw', f=7 > xc5000: firmware read Zu bytes. > xc5000: firmware uploading... > xc5000: firmware upload complete... > dib0700: i2c write error (status = -32) > > s5h1411_readreg: readreg error (ret == 0) > dib0700: i2c write error (status = -32) > > s5h1411_readreg: readreg error (ret == 0) > > > However, I'm running into issues in that the actual recorded stream is > quite corrupt, even though the signal is fine, and the same station > comes in clearly if I boot into linux. Eg, a tool like "azap" does > not show any "uncorrectable errors", but the stream itself is > pixelated / corrupt enough to crash mplayer. I can see just enough > of the picture to tell that I'm tuned to the correct station. I'm > not sure if this is a tuning issue, or a USB issue or what is going > on. I also do not see the > s5h1411_readreg and dib0700 errors on linux. These errors do not > happen all the time on FreeBSD either. But the stream is always > corrupt. > > This is on a fairly beefy machine (Xeon 5150 @ 2.66GHz) which can > easily sustain 20Gb/s through its PCIe bus (its one of my 10GbE > testing machines in my home lab).. I'm running 9-current as of last > weekend, with witness/diagnostic disabled. I'm running webcamd pulled > from your svn as of this evening. A ~2 week old build also shows the > same issue. > > Can you offer any advice as to how to debug this? > Try to check the USB buffer size: #define DIB0700_DEFAULT_STREAMING_CONFIG(ep) \ .streaming_ctrl = dib0700_streaming_ctrl, \ .stream = { \ .type = USB_BULK, \ .count = 4, \ .endpoint = ep, \ .u = { \ .bulk = { \ .buffersize = 39480, \ } \ } \ } 1) Number is not power of 512! > 39480 / 512 ans = 77.109 Try updating that value first. Else you can try adding some printouts in kern/linux_usb.c about printing out the URB lengths that are setup, and any status value in the function usb_linux_non_isoc_callback(). --HPS