From owner-freebsd-multimedia@freebsd.org Sat Sep 30 17:33:33 2017 Return-Path: Delivered-To: freebsd-multimedia@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5F1AE2B9B6 for ; Sat, 30 Sep 2017 17:33:33 +0000 (UTC) (envelope-from curtis@orleans.occnc.com) Received: from mta3.somerville.occnc.com (mta3-em1.somerville.occnc.com [IPv6:2001:4830:c400:203::171]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mta3.somerville.occnc.com", Issuer "" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F8B475F5A for ; Sat, 30 Sep 2017 17:33:33 +0000 (UTC) (envelope-from curtis@orleans.occnc.com) Received: from spinnaker.v6only.occnc.com (spinnaker-em2.v6only.occnc.com [IPv6:2001:470:88e6:2::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: curtis@occnc.com) by mta3-em1.somerville.occnc.com (Postfix) with ESMTPSA id 20BCD1616F; Sat, 30 Sep 2017 13:33:29 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=orleans.occnc.com; s=curtis-orleans; t=1506792810; bh=JL7y+5KeFk6xKZ/n3FOTTaDtNktGi3S6hF3lCHgJ5bU=; h=Subject:To:References:From:Date:In-Reply-To; b=Ks4n2c52DAjTTAaAcf85Nymru8FJDypBWrv3t67GuddQ8dB1SfZV4fz5iyrD8m2Za UCeJ5AjHDQn2KkCn7ckx0Ba3mw/+zGKjembSkoSSTjHnUJykFWaKupfQHXGGRHWCzk n9hu0y/HZ++3id8OU5nkLrixpSI6BTR85G+awuuE= Subject: Re: video using webcamd on Raspberry Pi 3 To: Hans Petter Selasky , freebsd-multimedia@freebsd.org References: <20170930021251.CA4232606DD@mail.turbocat.net> From: Curtis Villamizar Message-ID: <70f306cd-cc6b-7eaf-7146-bbc6cf0f8567@orleans.occnc.com> Date: Sat, 30 Sep 2017 13:33:29 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Sep 2017 17:33:33 -0000 On 09/30/17 04:42, Hans Petter Selasky wrote: > On 09/30/17 03:55, Curtis Villamizar wrote: >> I'm using two camera with webcamd successfully with a amd64 desktop >> running FreeBSD 11.0-STABLE r308356. The same camera don't work using >> FreeBSD 12.0-CURRENT r322787 on a Raspberry Pi 3 (RPi3) which uses the >> arm64 architecture. >> >> Both are using the latest libv4l and webcamd from ports. I'm using >> pwcview for testing though I'd eventually like to get the motion port >> running. >> >> I compiled webcamd with DEBUG on both. On the amd64 (which works >> fine) I get: >> >> # /usr/local/sbin/webcamd -i 0 -d ugen2.3 -U webcamd -G webcamd -H >> Linux video capture interface: v2.00 >> uvcvideo: Unable to create debugfs directory >> USB Video Class driver (1.1.1) >> cpia2: V4L-Driver for Vision CPiA2 based cameras v3.0.1 >> pvrusb2: V4L in-tree version:Hauppauge WinTV-PVR-USB2 MPEG2 >> Encoder/Tuner >> pvrusb2: Debug mask is 31 (0x1f) >> USBVision USB Video Device Driver for Linux : 0.9.11 >> em28xx: Registered (Em28xx v4l2 Extension) extension >> em28xx: Registered (Em28xx dvb Extension) extension >> Attached to ugen2.3[0] >> uvcvideo: Found UVC 1.00 device USB 2.0 Camera (05a3:9310) >> Waiting for HAL USB device. >> Creating /dev/video0 >> >> The difference between that and the RPi3 (arm64) that doesn't work >> are: >> >> --- webcamd-amd64-elp.txt 2017-09-29 14:52:37.265268000 -0400 >> +++ webcamd-rpi3-elp.txt 2017-09-29 14:54:26.374538000 -0400 >> @@ -1,14 +1,10 @@ >> -# /usr/local/sbin/webcamd -i 0 -d ugen2.3 -U webcamd -G webcamd -H >> +# /usr/local/sbin/webcamd -i 0 -d ugen0.4 -U webcamd -G webcamd >> Linux video capture interface: v2.00 >> -uvcvideo: Unable to create debugfs directory >> USB Video Class driver (1.1.1) >> cpia2: V4L-Driver for Vision CPiA2 based cameras v3.0.1 >> pvrusb2: V4L in-tree version:Hauppauge WinTV-PVR-USB2 MPEG2 >> Encoder/Tuner >> pvrusb2: Debug mask is 31 (0x1f) >> USBVision USB Video Device Driver for Linux : 0.9.11 >> -em28xx: Registered (Em28xx v4l2 Extension) extension >> -em28xx: Registered (Em28xx dvb Extension) extension >> -Attached to ugen2.3[0] >> +Attached to ugen0.4[0] >> uvcvideo: Found UVC 1.00 device USB 2.0 Camera (05a3:9310) >> -Waiting for HAL USB device. >> Creating /dev/video0 >> >> The two lines that jump out as missing are the lines that begin with >> "em28xx: Registered". These are in >> work/webcamd-4.8.0.4/media_tree/drivers/media/usb/em28xx/em28xx-video.c >> work/webcamd-4.8.0.4/media_tree/drivers/media/usb/em28xx/em28xx-dvb.c >> but I don't understand how module_init works. >> >> I've tried to turn on more debugging with webcamd -m options. Even >> turning on all debug didn't seem to work. I used >> webcamd -s | grep debug=0 | sed -e 's,=0.*,=255,' -e 's, , -m ,' >> to tun on all variables with .debug in the name, yet got no additional >> output other than from uaudio0 (the microphone on the camera). >> >> Does anyone have any insights into this? >> > > Hi, > > The RPI3 uses a different USB chipset. Is your device high-speed or > full-speed. Are you using an external HUB? > > What does "usbdump -i usbus0 -f 4 -s 65536 -vvv" say when you start > pwcview ? > > Are there any error messages in dmesg ? > > --HPS Hi Petter, Thanks for the reply. No external hub. The camera is USB 2.0. I'm testing with sif (320x240) and vga (640x480) so modest bandwidth. I'm doing a build world on a USB disk at the moment so that might affect the dump. I get scrambled output which is mostly greenish. usbdump produces a lot of output so I will highlight. 16:55:43.747966 usbus0.4 SUBM-ISOC-EP=00000081,SPD=HIGH,NFR=128,SLEN=0,IVAL=0 frame[0] READ 3072 bytes frame[1] READ 3072 bytes frame[2] READ 3072 bytes [...] flags 0x16 status 0x51823 16:55:43.749492 usbus0.4 DONE-ISOC-EP=00000081,SPD=HIGH,NFR=128,SLEN=73412,IVAL=0,ERR=0 frame[0] READ 652 bytes The rest is frame dumps but the read sizes are off: frame[0] READ 652 bytes frame[1] READ 52 bytes frame[2] READ 652 bytes frame[3] READ 652 bytes [...] frame[28] READ 0 bytes frame[29] READ 0 bytes frame[30] READ 3004 bytes frame[31] READ 860 bytes frame[32] READ 12 bytes frame[33] READ 448 bytes frame[34] READ 652 bytes [...] frame[113] READ 652 bytes flags 0x16 status 0xd1821 16:55:43.764598 usbus0.4 SUBM-ISOC-EP=00000081,SPD=HIGH,NFR=128,SLEN=0,IVAL=0 The [...] is where there are a lot of lines with the same content except incrementing frame numbers. I did not include the data with the frame dumps. The whole thing ends after the C-c on usbdump with: 180 packets captured 490 packets received by filter 116 packets dropped by kernel I did a two similar dumps. Not running pwcview I got nothing interesting except 0 packets dropped by kernel. Starting usbdump and then starting and stopping pwcview I got a lot of short packet exchanges which I assume (hope) are setup since there were short reads and writes. Then on to " frame[0] READ 3072 bytes" and output similar to above. Curtis