Date: Tue, 26 Jun 2012 19:25:31 +0200 (CEST) From: Juergen Lock <nox@jelal.kn-bremen.de> To: hselasky@c2i.net Cc: freebsd-multimedia@freebsd.org Subject: Re: DVB-C (CT-3650) with UnityMedia CI Module not working Message-ID: <201206261725.q5QHPV4r070734@triton8.kn-bremen.de> In-Reply-To: <201206261804.05819.hselasky@c2i.net> References: <4FE83768.6000909@itservice-schaefer.de> <4FE9D99F.5000005@itservice-schaefer.de> <4FE9DB34.7010806@itservice-schaefer.de>
next in thread | previous in thread | raw e-mail | index | archive | help
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?)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201206261725.q5QHPV4r070734>
