From owner-freebsd-multimedia@FreeBSD.ORG Wed Sep 1 17:58:20 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 4EF2A10656CA; Wed, 1 Sep 2010 17:58:20 +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 D35D18FC13; Wed, 1 Sep 2010 17:58:19 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id D50021E00077; Wed, 1 Sep 2010 19:58:18 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.3) with ESMTP id o81HsNX8012528; Wed, 1 Sep 2010 19:54:23 +0200 (CEST) (envelope-from nox@triton8.kn-bremen.de) Received: (from nox@localhost) by triton8.kn-bremen.de (8.14.4/8.14.3/Submit) id o81HsMAw012527; Wed, 1 Sep 2010 19:54:22 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Wed, 1 Sep 2010 19:54:22 +0200 To: Hans Petter Selasky Message-ID: <20100901175422.GA12485@triton8.kn-bremen.de> References: <4C66C4BC.4040504@janh.de> <201008302322.20299.hselasky@freebsd.org> <20100831184815.GA93400@triton8.kn-bremen.de> <201008312058.16445.hselasky@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201008312058.16445.hselasky@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: me@janh.de, kde@freebsd.org, Juergen Lock , freebsd-multimedia@freebsd.org, Joe Marcus Clarke , gnome@freebsd.org Subject: Re: kaffeine-1.0 and webcamd based DVB-T? 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, 01 Sep 2010 17:58:20 -0000 On Tue, Aug 31, 2010 at 08:58:16PM +0200, Hans Petter Selasky wrote: > On Tuesday 31 August 2010 20:48:15 Juergen Lock wrote: > > On Mon, Aug 30, 2010 at 11:22:20PM +0200, Hans Petter Selasky wrote: > > > Hi, > > > > Hi! > > > > > I've committed to the HAL stuff to webcamd in the I4B SVN as of r1628. To > > > enable HAL support build like this: > > > > > > make -j3 HAVE_HAL=YES LIBDIR=/usr/local/lib > > > > > > Run like this: > > > > > > ./webcamd -H > > > > There's an initialization missing so the code did nothing... > > (works now for dvb, v4l untested due to lack of device.) > > > > Cheers, > > Juergen > > > > Index: webcamd_hal.c > > =================================================================== > > --- webcamd_hal.c (revision 1628) > > +++ webcamd_hal.c (working copy) > > @@ -69,6 +69,8 @@ > > char **ppdev; > > int n; > > > > + if (!(hal_conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL))) > > + return; > > hal_ctx = libhal_ctx_new(); > > if (hal_ctx == NULL) > > return; > > Committed to r1629. Found out your version only works when specifying the usb device with -d explicitly (read: I forgot to test the other case... :( u_unit, u_addr, u_index were not set) - here's a possible fix, also at: http://people.freebsd.org/~nox/tmp/webcamd-hal-r1629.patch Cheers, Juergen Index: kernel/linux_usb.c =================================================================== --- kernel/linux_usb.c (revision 1629) +++ kernel/linux_usb.c (working copy) @@ -266,7 +266,7 @@ * This function is the FreeBSD probe and attach callback. *------------------------------------------------------------------------*/ int -usb_linux_probe(uint8_t bus, uint8_t addr, uint8_t index) +usb_linux_probe_p(int *p_bus, int *p_addr, int *p_index) { const struct usb_device_id *id; struct usb_linux_softc *sc; @@ -281,6 +281,9 @@ uint8_t match_bus_addr; uint8_t index_copy; uint8_t device_index; + uint8_t bus = *p_bus; + uint8_t addr = *p_addr; + uint8_t index = *p_index; for (i = 0;; i++) { if (i == ARRAY_SIZE(uls)) @@ -365,9 +368,11 @@ return (-ENXIO); found: + *p_bus = libusb20_dev_get_bus_number(pdev); + *p_addr = libusb20_dev_get_address(pdev); + *p_index = index_copy; #ifdef HAVE_WEBCAMD - if (pidfile_create(libusb20_dev_get_bus_number(pdev), - libusb20_dev_get_address(pdev), index_copy)) { + if (pidfile_create(*p_bus, *p_addr, index_copy)) { fprintf(stderr, "Webcamd is already running for " "ugen%d.%d.%d\n", libusb20_dev_get_bus_number(pdev), Index: kernel/linux_usb.h =================================================================== --- kernel/linux_usb.h (revision 1629) +++ kernel/linux_usb.h (working copy) @@ -583,7 +583,7 @@ int usb_deregister(struct usb_driver *drv); struct usb_linux_softc *usb_linux2usb(int fd); -int usb_linux_probe(uint8_t bus, uint8_t addr, uint8_t index); +int usb_linux_probe_p(int *pbus, int *paddr, int *pindex); int usb_linux_detach(int fd); int usb_linux_suspend(int fd); int usb_linux_resume(int fd); Index: webcamd.c =================================================================== --- webcamd.c (revision 1629) +++ webcamd.c (working copy) @@ -462,7 +462,7 @@ } linux_init(); - f_usb = usb_linux_probe(u_unit, u_addr, u_index); + f_usb = usb_linux_probe_p(&u_unit, &u_addr, &u_index); if (f_usb < 0) v4b_errx(1, "Cannot find USB device");