Date: Wed, 1 Sep 2010 19:54:22 +0200 From: Juergen Lock <nox@jelal.kn-bremen.de> To: Hans Petter Selasky <hselasky@freebsd.org> Cc: me@janh.de, kde@freebsd.org, Juergen Lock <nox@jelal.kn-bremen.de>, freebsd-multimedia@freebsd.org, Joe Marcus Clarke <marcus@freebsd.org>, gnome@freebsd.org Subject: Re: kaffeine-1.0 and webcamd based DVB-T? Message-ID: <20100901175422.GA12485@triton8.kn-bremen.de> In-Reply-To: <201008312058.16445.hselasky@freebsd.org> References: <4C66C4BC.4040504@janh.de> <201008302322.20299.hselasky@freebsd.org> <20100831184815.GA93400@triton8.kn-bremen.de> <201008312058.16445.hselasky@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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");
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100901175422.GA12485>