From owner-freebsd-multimedia@FreeBSD.ORG Fri Aug 20 18:10:29 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 7AC7410656A7; Fri, 20 Aug 2010 18:10:29 +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 BDE6A8FC15; Fri, 20 Aug 2010 18:10:28 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 589F11E00367; Fri, 20 Aug 2010 20:10:27 +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 o7KI6n7W090705; Fri, 20 Aug 2010 20:06:49 +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 o7KI6n6P090704; Fri, 20 Aug 2010 20:06:49 +0200 (CEST) (envelope-from nox) From: Juergen Lock Date: Fri, 20 Aug 2010 20:06:48 +0200 To: Joe Marcus Clarke Message-ID: <20100820180648.GA90683@triton8.kn-bremen.de> References: <4C66C4BC.4040504@janh.de> <4C6704A6.3050407@FreeBSD.org> <201008191617.o7JGHq9c003392@triton8.kn-bremen.de> <4C6DC8BC.9080100@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C6DC8BC.9080100@freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: me@janh.de, kde@freebsd.org, hselasky@freebsd.org, Juergen Lock , freebsd-multimedia@freebsd.org, 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: Fri, 20 Aug 2010 18:10:29 -0000 On Thu, Aug 19, 2010 at 08:13:48PM -0400, Joe Marcus Clarke wrote: > On 8/19/10 12:17 PM, Juergen Lock wrote: > > In article <4C6704A6.3050407@FreeBSD.org> you write: > >> On 08/14/2010 18:30, Jan Henrik Sylvester wrote: > >>> KDE3-Kaffeine was working with my webcamd based DVB-T stick, > >>> KDE4-Kaffeine does not. > >>> > >>> Now that multimedia/kaffeine is the KDE4 version and the KDE3 version > >>> gone, is there a way to teach Kaffeine about the DVB-T stick? ("Channel > >>> Scan" does not show any "Source".) > >>> > >>> I remember there was a thread about this, but I currently cannot find it. > >> > >> Unfortunately i don't have a supported DVB stick, so i can't test anything. > >> > >> kaffeine uses the v4l-compat headers so in theory it should work like in > >> Linux... > >> > >> Does your stick work with other applications like mplayer or vlc? > > > > I now know what's wrong: Unlike the old kaffeine which looked for > > dvb devices itself, the KDE4 version relies on x11/kdelibs4 to > > find them (, src/dvb/dvbdevice_linux.cpp > > in kaffeine sources), which in turn relies on sysutils/hal > > (solid/solid/backends/hal/haldvbinterface.cpp in kdelibs), and > > at least hal doesn't know about dvb devices on FreeBSD yet, they > > are only handled in hald/linux/device.c in hal sources. I've > > Cc'd the hal and kdelibs port maintainers in case they want to > > look at this... > > Hal does support v4l (and thus webcamd) right now. I added that for > GNOME 2.30. I didn't do any dvb support. I may need some examples of > dmesg and sysctl to make this happen. (Note: I also found a bug in the current hal webcamd v4l handling, more about that below. [1] ) The devices don't show up in sysctl since they are handled by webcamd too, dmesg here only says: ugen5.2: at usbus5 ugen5.3: at usbus5 (the first one is dvb-s2, the second one dual dvb-t.) lshal on FreeBSD has this about them: udi = '/org/freedesktop/Hal/devices/usb_device_2304_21f_noserial' info.bus = 'usb_device' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_0_0_noserial_4' (string) info.product = 'PCTV452e' (string) info.subsystem = 'usb_device' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_2304_21f_noserial' (string) info.vendor = 'Pinnacle' (string) usb_device.bus_number = 5 (0x5) (int) usb_device.can_wake_up = true (bool) usb_device.configuration = '' (string) usb_device.configuration_value = 1 (0x1) (int) usb_device.device_class = 0 (0x0) (int) usb_device.device_protocol = 0 (0x0) (int) usb_device.device_revision_bcd = 512 (0x200) (int) usb_device.device_subclass = 0 (0x0) (int) usb_device.is_self_powered = false (bool) usb_device.level_number = 1 (0x1) (int) usb_device.max_power = 10 (0xa) (int) usb_device.num_configurations = 1 (0x1) (int) usb_device.num_interfaces = 1 (0x1) (int) usb_device.num_ports = 0 (0x0) (int) usb_device.port_number = 2 (0x2) (int) usb_device.product = 'PCTV452e' (string) usb_device.product_id = 543 (0x21f) (int) usb_device.serial = '' (string) usb_device.speed = 480.0 (480) (double) usb_device.speed_bcd = 294912 (0x48000) (int) usb_device.vendor = 'Pinnacle' (string) usb_device.vendor_id = 8964 (0x2304) (int) usb_device.version = 2.0 (2) (double) udi = '/org/freedesktop/Hal/devices/usb_device_2304_21f_noserial_if0' info.bus = 'usb' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_2304_21f_noserial' (string) info.product = 'PCTV452e' (string) info.subsystem = 'usb' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_2304_21f_noserial_if0' (string) info.vendor = 'Pinnacle' (string) usb.bus_number = 5 (0x5) (int) usb.can_wake_up = true (bool) usb.configuration = '' (string) usb.configuration_value = 1 (0x1) (int) usb.device_class = 0 (0x0) (int) usb.device_protocol = 0 (0x0) (int) usb.device_revision_bcd = 512 (0x200) (int) usb.device_subclass = 0 (0x0) (int) usb.interface.class = 255 (0xff) (int) usb.interface.description = '' (string) usb.interface.number = 0 (0x0) (int) usb.interface.protocol = 0 (0x0) (int) usb.interface.subclass = 0 (0x0) (int) usb.is_self_powered = false (bool) usb.level_number = 1 (0x1) (int) usb.max_power = 10 (0xa) (int) usb.num_configurations = 1 (0x1) (int) usb.num_interfaces = 1 (0x1) (int) usb.num_ports = 0 (0x0) (int) usb.port_number = 2 (0x2) (int) usb.product = 'PCTV452e' (string) usb.product_id = 543 (0x21f) (int) usb.serial = '' (string) usb.speed = 480.0 (480) (double) usb.speed_bcd = 294912 (0x48000) (int) usb.vendor = 'Pinnacle' (string) usb.vendor_id = 8964 (0x2304) (int) usb.version = 2.0 (2) (double) and: udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' info.bus = 'usb_device' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_0_0_noserial_4' (string) info.product = 'DVB-T 2' (string) info.subsystem = 'usb_device' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.vendor = 'Afatech' (string) usb_device.bus_number = 5 (0x5) (int) usb_device.can_wake_up = false (bool) usb_device.configuration = '' (string) usb_device.configuration_value = 1 (0x1) (int) usb_device.device_class = 0 (0x0) (int) usb_device.device_protocol = 0 (0x0) (int) usb_device.device_revision_bcd = 512 (0x200) (int) usb_device.device_subclass = 0 (0x0) (int) usb_device.is_self_powered = false (bool) usb_device.level_number = 2 (0x2) (int) usb_device.max_power = 500 (0x1f4) (int) usb_device.num_configurations = 1 (0x1) (int) usb_device.num_interfaces = 1 (0x1) (int) usb_device.num_ports = 0 (0x0) (int) usb_device.port_number = 3 (0x3) (int) usb_device.product = 'DVB-T 2' (string) usb_device.product_id = 34817 (0x8801) (int) usb_device.serial = '' (string) usb_device.speed = 480.0 (480) (double) usb_device.speed_bcd = 294912 (0x48000) (int) usb_device.vendor = 'Afatech' (string) usb_device.vendor_id = 5218 (0x1462) (int) usb_device.version = 2.0 (2) (double) And for comparison, if I plug the dual dvb-t one into a Linux box lshal there has the following: (of which only the /dev/dvb/adapterX/net0 and the ir receiver are not supported by webcamd yet; the ir reciver works but currently no device node gets created and it just outputs to webcamd's stdout, and the .../net0 are afaik not used with regular video/audio broadcasts.) udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' info.linux.driver = 'usb' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_1d6b_2_0000_00_1d_7' (string) info.product = 'DVB-T 2' (string) info.subsystem = 'usb_device' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.vendor = 'Micro Star International' (string) linux.device_file = '/dev/bus/usb/003/002' (string) linux.hotplug_type = 2 (0x2) (int) linux.subsystem = 'usb' (string) linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2' (string) usb_device.bus_number = 3 (0x3) (int) usb_device.can_wake_up = false (bool) usb_device.configuration_value = 1 (0x1) (int) usb_device.device_class = 0 (0x0) (int) usb_device.device_protocol = 0 (0x0) (int) usb_device.device_revision_bcd = 512 (0x200) (int) usb_device.device_subclass = 0 (0x0) (int) usb_device.is_self_powered = false (bool) usb_device.linux.device_number = 2 (0x2) (int) usb_device.linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2' (string) usb_device.max_power = 500 (0x1f4) (int) usb_device.num_configurations = 1 (0x1) (int) usb_device.num_interfaces = 1 (0x1) (int) usb_device.num_ports = 0 (0x0) (int) usb_device.product = 'DVB-T 2' (string) usb_device.product_id = 34817 (0x8801) (int) usb_device.speed = 480.0 (480) (double) usb_device.vendor = 'Micro Star International' (string) usb_device.vendor_id = 5218 (0x1462) (int) usb_device.version = 2.0 (2) (double) udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_usbraw' info.capabilities = {'usbraw'} (string list) info.category = 'usbraw' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.product = 'USB Raw Device Access' (string) info.subsystem = 'usb_device' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_usbraw' (string) linux.device_file = '/dev/usbdev3.2' (string) linux.hotplug_type = 2 (0x2) (int) linux.subsystem = 'usb_device' (string) linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2/usb_device/usbdev3.2' (string) usbraw.device = '/dev/usbdev3.2' (string) udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_logicaldev_input' info.addons.singleton = {'hald-addon-input'} (string list) info.capabilities = {'input', 'input.keys', 'button'} (string list) info.category = 'input' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.product = 'IR-receiver inside an USB DVB receiver' (string) info.subsystem = 'input' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_logicaldev_input' (string) input.device = '/dev/input/event8' (string) input.originating_device = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) input.product = 'IR-receiver inside an USB DVB receiver' (string) linux.device_file = '/dev/input/event8' (string) linux.hotplug_type = 2 (0x2) (int) linux.subsystem = 'input' (string) linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2/input/input8/event8' (string) udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_6' dvb.device = '/dev/dvb/adapter1/net0' (string) info.capabilities = {'dvb'} (string list) info.category = 'dvb' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.product = 'DVB Device' (string) info.subsystem = 'dvb' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_6' (string) linux.device_file = '/dev/dvb/adapter1/net0' (string) linux.hotplug_type = 2 (0x2) (int) linux.subsystem = 'dvb' (string) linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2/dvb/dvb1.net0' (string) udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_5' dvb.device = '/dev/dvb/adapter1/frontend0' (string) info.capabilities = {'dvb'} (string list) info.category = 'dvb' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.product = 'DVB Device' (string) info.subsystem = 'dvb' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_5' (string) linux.device_file = '/dev/dvb/adapter1/frontend0' (string) linux.hotplug_type = 2 (0x2) (int) linux.subsystem = 'dvb' (string) linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2/dvb/dvb1.frontend0' (string) udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_4' dvb.device = '/dev/dvb/adapter1/dvr0' (string) info.capabilities = {'dvb'} (string list) info.category = 'dvb' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.product = 'DVB Device' (string) info.subsystem = 'dvb' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_4' (string) linux.device_file = '/dev/dvb/adapter1/dvr0' (string) linux.hotplug_type = 2 (0x2) (int) linux.subsystem = 'dvb' (string) linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2/dvb/dvb1.dvr0' (string) udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_3' dvb.device = '/dev/dvb/adapter1/demux0' (string) info.capabilities = {'dvb'} (string list) info.category = 'dvb' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.product = 'DVB Device' (string) info.subsystem = 'dvb' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_3' (string) linux.device_file = '/dev/dvb/adapter1/demux0' (string) linux.hotplug_type = 2 (0x2) (int) linux.subsystem = 'dvb' (string) linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2/dvb/dvb1.demux0' (string) udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_2' dvb.device = '/dev/dvb/adapter0/net0' (string) info.capabilities = {'dvb'} (string list) info.category = 'dvb' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.product = 'DVB Device' (string) info.subsystem = 'dvb' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_2' (string) linux.device_file = '/dev/dvb/adapter0/net0' (string) linux.hotplug_type = 2 (0x2) (int) linux.subsystem = 'dvb' (string) linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2/dvb/dvb0.net0' (string) udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_1' dvb.device = '/dev/dvb/adapter0/frontend0' (string) info.capabilities = {'dvb'} (string list) info.category = 'dvb' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.product = 'DVB Device' (string) info.subsystem = 'dvb' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_1' (string) linux.device_file = '/dev/dvb/adapter0/frontend0' (string) linux.hotplug_type = 2 (0x2) (int) linux.subsystem = 'dvb' (string) linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2/dvb/dvb0.frontend0' (string) udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_0' dvb.device = '/dev/dvb/adapter0/dvr0' (string) info.capabilities = {'dvb'} (string list) info.category = 'dvb' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.product = 'DVB Device' (string) info.subsystem = 'dvb' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb_0' (string) linux.device_file = '/dev/dvb/adapter0/dvr0' (string) linux.hotplug_type = 2 (0x2) (int) linux.subsystem = 'dvb' (string) linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2/dvb/dvb0.dvr0' (string) udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb' dvb.device = '/dev/dvb/adapter0/demux0' (string) info.capabilities = {'dvb'} (string list) info.category = 'dvb' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.product = 'DVB Device' (string) info.subsystem = 'dvb' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_dvb' (string) linux.device_file = '/dev/dvb/adapter0/demux0' (string) linux.hotplug_type = 2 (0x2) (int) linux.subsystem = 'dvb' (string) linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2/dvb/dvb0.demux0' (string) udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_if0' info.linux.driver = 'dvb_usb_af9015' (string) info.parent = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial' (string) info.product = 'USB Vendor Specific Interface' (string) info.subsystem = 'usb' (string) info.udi = '/org/freedesktop/Hal/devices/usb_device_1462_8801_noserial_if0' (string) linux.hotplug_type = 2 (0x2) (int) linux.subsystem = 'usb' (string) linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2/3-2:1.0' (string) usb.bus_number = 3 (0x3) (int) usb.can_wake_up = false (bool) usb.configuration_value = 1 (0x1) (int) usb.device_class = 0 (0x0) (int) usb.device_protocol = 0 (0x0) (int) usb.device_revision_bcd = 512 (0x200) (int) usb.device_subclass = 0 (0x0) (int) usb.interface.class = 255 (0xff) (int) usb.interface.number = 0 (0x0) (int) usb.interface.protocol = 0 (0x0) (int) usb.interface.subclass = 0 (0x0) (int) usb.is_self_powered = false (bool) usb.linux.device_number = 2 (0x2) (int) usb.linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1d.7/usb3/3-2/3-2:1.0' (string) usb.max_power = 500 (0x1f4) (int) usb.num_configurations = 1 (0x1) (int) usb.num_interfaces = 1 (0x1) (int) usb.num_ports = 0 (0x0) (int) usb.product = 'USB Vendor Specific Interface' (string) usb.product_id = 34817 (0x8801) (int) usb.speed = 480.0 (480) (double) usb.vendor = 'Micro Star International' (string) usb.vendor_id = 5218 (0x1462) (int) usb.version = 2.0 (2) (double) [1] And now the bug and some more notes: I meanwhile found the hal port's files/patch-hald_freebsd_probing_probe-video4linux.c and briefly looked at it to see if I could easily extend it for dvb myself, but found two problems: a) I'm not sure if we also need code like dvb_add() and friends from hald/linux/device.c and I don't know how that gets invoked, i.e. how hal knows that devices are dvb and need to be handled by dvb_add() (does Linux' udev tell it that?), and b) (this is the bug) hald's current handling of multiple devices in hfp_v4l_get_unit() is broken (the last number in webcamd's pidfile name is _not_ the device index, it's always 0 or at least it is here), and also it would have to be extended/adjusted for webcamd svn which now supports dvb devices with multiple tuners, like the dual dvb-t one I have here. Because of the latter webcamd now allocates each device's first tuner index in increments of 8 (I think that's the max number of tuners on a single device the Linux code will handle), and so if I use webcamd with my two devices for a total of three tuners I get e.g. /dev/dvb/adapter0/*, /dev/dvb/adapter8/*, and /dev/dvb/adapter9/* (and I have to symlink adapter8 to adapter1 and adapter9 to adapter2 if I want vdr to find all of them, but of course that shouldn't affect hal and kdelibs/kaffeine.) I have Cc'd hps, maybe he has an idea how to get the device index out of a running webcamd for hal to use... (maybe webcamd should also do a setproctitle()?) Oh and also I wondered whether there might be races in case of hotplugging a device, i.e. if probe-video4linux.c gets run right at the moment after plugging a device in webcamd and the Linux code it runs might not yet have finished initializing and device nodes might not (all?) have been created yet? Ok, and that's all I have for now, :) Juergen