Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jan 2011 09:01:19 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        Andrew Gallatin <gallatin@gmail.com>
Cc:        freebsd-multimedia@freebsd.org
Subject:   Re: webcamd: PCTV 801eSE
Message-ID:  <201101260901.19745.hselasky@c2i.net>
In-Reply-To: <AANLkTinh7mA5jrr1240LnOSGL37yzb2uW_yWZfBD5cpa@mail.gmail.com>
References:  <AANLkTinh7mA5jrr1240LnOSGL37yzb2uW_yWZfBD5cpa@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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: <PCTV 801e YUANRD> 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  <YUANRD>
>   iProduct = 0x0002  <PCTV 801e>
>   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



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