From owner-freebsd-multimedia@FreeBSD.ORG Tue Jun 26 17:26:34 2012 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 194301065673 for ; Tue, 26 Jun 2012 17:26:34 +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 976A28FC08 for ; Tue, 26 Jun 2012 17:26:33 +0000 (UTC) Received: by smtp.kn-bremen.de (Postfix, from userid 10) id 397F21E006FF; Tue, 26 Jun 2012 19:26:32 +0200 (CEST) Received: from triton8.kn-bremen.de (noident@localhost [127.0.0.1]) by triton8.kn-bremen.de (8.14.4/8.14.4) with ESMTP id q5QHPVVT070735; Tue, 26 Jun 2012 19:25:31 +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 q5QHPV4r070734; Tue, 26 Jun 2012 19:25:31 +0200 (CEST) (envelope-from nox) Date: Tue, 26 Jun 2012 19:25:31 +0200 (CEST) From: Juergen Lock Message-Id: <201206261725.q5QHPV4r070734@triton8.kn-bremen.de> To: hselasky@c2i.net X-Newsgroups: local.list.freebsd.multimedia In-Reply-To: <201206261804.05819.hselasky@c2i.net> References: <4FE83768.6000909@itservice-schaefer.de> <4FE9D99F.5000005@itservice-schaefer.de> <4FE9DB34.7010806@itservice-schaefer.de> Organization: Cc: freebsd-multimedia@freebsd.org Subject: Re: DVB-C (CT-3650) with UnityMedia CI Module not working 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: Tue, 26 Jun 2012 17:26:34 -0000 In article <201206261804.05819.hselasky@c2i.net> you write: >On Tuesday 26 June 2012 17:54:28 Timo Schäfer wrote: >> Am 26.06.2012 17:47, schrieb Timo Schäfer: >> > Am 26.06.2012 17:37, schrieb Hans Petter Selasky: >> >> On Monday 25 June 2012 17:48:05 Timo Schäfer wrote: >> >>> ./adapter0/ca0 >> >> >> >> Can you use the device shown above? >> >> >> >> --HPS >> > >> > how? vdr is not talking to it / does not detect it. >> > >> > under linux vdr looks at the attached ci module and inserted smartcard >> > to unscramble >> > the channel if needed. >> > >> > with my freebsd setup vdr does not detect the ci module and cannot use >> > the smartcard >> > to open the scrambled channels. >> > >> > crw-rw---- 1 webcamd webcamd 0, 97 Jun 26 17:40 ca0 >> > >> > has the needed rights, but i guess its not used/detected. >> >> Ah there is something in /var/log/messages: >> >> Jun 26 14:00:20 barney vdr: [680406016] ERROR: can't get info of CAM >> slot 0 on device 0: Invalid argument >> Jun 26 14:00:28 barney last message repeated 15 times > >Hi, > >> >> does not look good but that seems to be the problem. > >Maybe it is a known IOCTL issue. Some IOCTL needs to be fixed before they can >be used, because the RW flags are not correct. > >Try figuring out what IOCTL this is with ktrace or something like that. Or >simply grep in the code for that error message. Then see if the RW flags are >correct. Bingo! :) At least CA_GET_SLOT_INFO needs to be _IOWR not _IOR. Try this patch in ports/multimedia/v4l_compat/files/patch-dvb-ca.h: --- dvb/ca.h.orig +++ dvb/ca.h @@ -80,7 +80,13 @@ typedef struct ca_pid { #define CA_RESET _IO('o', 128) #define CA_GET_CAP _IOR('o', 129, ca_caps_t) + +/* At least CA_GET_SLOT_INFO needs to be _IOWR not _IOR. + * This is wrong on Linux too but there the driver doesn't care. + * #define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t) + */ +#define CA_GET_SLOT_INFO _IOWR('o', 130, ca_slot_info_t) #define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t) #define CA_GET_MSG _IOR('o', 132, ca_msg_t) #define CA_SEND_MSG _IOW('o', 133, ca_msg_t) .and a very similar one in ports/multimedia/webcamd/files/patch-media_tree-include-linux-dvb-ca.h: --- media_tree/include/linux/dvb/ca.h.orig +++ media_tree/include/linux/dvb/ca.h @@ -80,7 +80,13 @@ typedef struct ca_pid { #define CA_RESET _IO('o', 128) #define CA_GET_CAP _IOR('o', 129, ca_caps_t) + +/* At least CA_GET_SLOT_INFO needs to be _IOWR not _IOR. + * This is wrong on Linux too but there the driver doesn't care. + * #define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t) + */ +#define CA_GET_SLOT_INFO _IOWR('o', 130, ca_slot_info_t) #define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t) #define CA_GET_MSG _IOR('o', 132, ca_msg_t) #define CA_SEND_MSG _IOW('o', 133, ca_msg_t) and then rebuild these two and multimedia/vdr too. Good luck, :) Juergen PS: The submitter of the WebcamCompat wiki TT S2-3650 entry told me he tested the CI too, I wonder what he tested... (Or maybe the old vdr version ignored the error?)