Re: Status of the patches under review at LMML (60 patches)

2010-07-11 Thread Henrik Kurelid
://patchwork.kernel.org/patch/110090

   == mantis patches - waiting for Manu Abraham 
 abraham.m...@gmail.com ==

 Apr,15 2010: [5/8] ir-core: convert mantis from ir-functions.c
   http://patchwork.kernel.org/patch/92961 Jun,11 2010: stb0899:
Removed an extra byte sent at init on DiSEqC bus  
http://patchwork.kernel.org/patch/105621 Jun,20 2010: Mantis DMA transfer 
cleanup,
fixes data corruption and a race, improve 
http://patchwork.kernel.org/patch/107036 Jun,20 2010: Mantis: append tasklet 
maintenance for DVB stream
delivery http://patchwork.kernel.org/patch/107055 Jun,20 2010: 
[2/2] DVB/V4L: mantis: remove unused files
http://patchwork.kernel.org/patch/107062 Jun,20 2010: mantis: use dvb_attach to 
avoid double dereferencing on module removal
http://patchwork.kernel.org/patch/107063 Jun,21 2010: Mantis, hopper: use 
MODULE_DEVICE_TABLE use the macro to make modules 
http://patchwork.kernel.org/patch/107147 Jul, 3 2010: mantis: Rename 
gpio_set_bits to mantis_gpio_set_bits  
http://patchwork.kernel.org/patch/109972

   == Waiting for my fixes on Docbook ==

 Feb,25 2010: DocBook/Makefile: Make it less verbose   
   http://patchwork.kernel.org/patch/82076 Feb,25 2010: DocBook:
Add rules to auto-generate some media docbooks
http://patchwork.kernel.org/patch/82075 Feb,25 2010: DocBook/v4l/pixfmt.xml: Add
missing formats for gspca cpia1 and sn9c20 
http://patchwork.kernel.org/patch/82074 Feb,25 2010: v4l: document new Bayer 
and monochrome pixel
formats   http://patchwork.kernel.org/patch/82073

   == Waiting for Antti Palosaari cr...@iki.fi review ==

 Mar,21 2010: af9015 : more robust eeprom parsing  
   http://patchwork.kernel.org/patch/87243 May,20 2010: New NXP
tda18218 tuner 
http://patchwork.kernel.org/patch/101170

   == Waiting for Tobias Lorenz tobias.lor...@gmx.net review ==

 Feb, 3 2010: radio-si470x-common: -EINVAL overwritten in 
 si470x_vidioc_s_tuner()http://patchwork.kernel.org/patch/76786

   == Waiting for its addition at linux-firmware and driver test 
 by David Wong davidtlw...@gmail.com  ==

 Nov, 1 2009: lgs8gxx: remove firmware for lgs8g75 
   http://patchwork.kernel.org/patch/56822

   == Andy Walls awa...@radix.net and Aleksandr Piskunov 
 aleksandr.v.pisku...@gmail.com are discussing around the solution ==

 Oct,11 2009: AVerTV MCE 116 Plus radio
   http://patchwork.kernel.org/patch/52981

   == Waiting for Andy Walls awa...@md.metrocast.net ==

 Apr,10 2010: cx18: missing audio for analog recordings  
   http://patchwork.kernel.org/patch/91879

   == Patches waiting for Patrick Boettcher pboettc...@dibcom.fr 
 review ==

 Jan,15 2010: remove obsolete conditionalizing on DVB_DIBCOM_DEBUG 
   http://patchwork.kernel.org/patch/73147 May,25 2010: V4L/DVB:
Adding support to the Geniatech/MyGica SBTVD Stick S870   
http://patchwork.kernel.org/patch/102314

   == Gspca patches - Waiting Hans de Goede hdego...@redhat.com 
 submission/review ==

 Jan,29 2010: [gspca_jf,tree] gspca zc3xx: signal when unknown packet received 
   http://patchwork.kernel.org/patch/75837

   == Gspca patches - Waiting Jean-Francois Moine 
 moin...@free.fr submission/review ==

 Feb,24 2010: gspca pac7302: add USB PID range based on heuristics 
   http://patchwork.kernel.org/patch/81612

   == Waiting for Steven Toth st...@kernellabs.com review ==

 Feb, 6 2010: cx23885: Enable Message Signaled Interrupts(MSI).
   http://patchwork.kernel.org/patch/77492 May, 5 2010: tda10048:
fix the uncomplete function tda10048_read_ber
http://patchwork.kernel.org/patch/97058 May, 6 2010: tda10048: fix bitmask for 
the
transmission mode
http://patchwork.kernel.org/patch/97340 May, 6 2010: tda10048: clear the 
uncorrected packet registers
when saturatedhttp://patchwork.kernel.org/patch/97341 May, 6 2010: 
dvb_frontend: fix typos in comments and one function  
http://patchwork.kernel.org/patch/97343

   == Waiting for Henrik Kurelid hen...@kurelid.se comments 
 about an userspace patch for MythTV ==

 Mar, 1 2010: firedtv: add parameter to fake ca_system_ids in CA_INFO  
   http://patchwork.kernel.org/patch/82912

   == Waiting for Mike Isely is...@isely.net review ==

 Apr,25 2010: Problem with cx25840 and Terratec Grabster AV400 
   http://patchwork.kernel.org/patch/94960

   == Waiting for Igor M. Liplianin liplia...@tut.by 
 comments/review ==

 Mar,10 2010: DM1105: could not attach

Re: How to add DVB-S2 support to firedtv?

2010-02-18 Thread Henrik Kurelid
Hi,

Regarding the documentation and code:
From a quick glance, the LNB/QPSK2 code follows the documentation fairly good.
I guess it could do with a deeper check (I could see that at least the FEC 
switch case does seems to have some invalid values) but I would prefer
that this is done by someone that actually has a DVB-S(2) card.

Regards,
Henrik

 Hi all,

 what steps need to be taken to get DVB-S2 support into the firedtv
 driver?  (The status is, as far as I understood:  FireDTV S2 and Floppy
 DTV S2 devices recognize HD channels during channel scan but cannot tune
 to them.  FireDTV C/CI DVB-C boxes however tune and play back HD
 channels just fine.)

 I suppose the frontend needs to be extended for s2api.  Was there a
 respective conversion in another DVB driver that can serve as a good
 coding example?

 Is documentation from Digital Everywhere required regarding the
 vendor-specific AV/C requests (LNB_CONTROL? TUNE_QPSK2?) or is the
 current driver code enough to connect the dots?

 Is the transport stream different from DVB-C HD streams so that changes
 to the isochronous I/O part would be required?
 --
 Stefan Richter
 -=-==-=- --=- -===-
 http://arcgraph.de/sr/


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH resend] firedtv: length field corrupt in ca2host if length127

2009-10-03 Thread Henrik Kurelid
Hi,

Comments inline.

Regards,
Henrik

 From: Henrik Kurelid he...@kurelid.se

 This solves a problem in firedtv that has become major for Swedish DVB-T
 users the last month or so.  It will most likely solve issues seen by
 other users as well.

 If the length of an AVC message is greater than 127, the length field
 should be encoded in LV mode instead of V mode. V mode can only be used
 if the length is 127 or less. This patch ensures that the CA_PMT
 message is always encoded in LV mode so PMT message of greater lengths
 can be supported.

 Signed-off-by: Henrik Kurelid hen...@kurelid.se
 Signed-off-by: Stefan Richter stef...@s5r6.in-berlin.de
 ---

 On  2 Oct, Henrik Kurelid wrote:
 Here is a patch that solves a problem in firedtv that has become major for
 Swedish DVB-T users the last month or so.
 It will most likely solve issues seen by other users as well.
 Please review and comment.

 I don't have a CA module, hence can't test it myself.  Is the message
 format vendor-defined or ist there a standard for this?
The Ca2Host and Host2Ca messages are vendor specific. According to the 
documentation from DE the same message structure applies to all cards
independent of the delivery system. The patch have been verified by myself on 
DVB-T+CA and at least one user on the DE forums with a similar setup.

 Anyway, I am resending this patch for Mauro to apply, since the original
 posting had lines wrapped.  I also took the liberty to standardize the
 hexadecimal constants to lowercase to match the rest of firedtv-avc.c.
Thanks for cleaning up my mess again, Stefan. I really need to configure my 
mail agent better!

  drivers/media/dvb/firewire/firedtv-avc.c |   38 ---
  1 file changed, 20 insertions(+), 18 deletions(-)

 Index: linux-2.6.32-rc1/drivers/media/dvb/firewire/firedtv-avc.c
 ===
 --- linux-2.6.32-rc1.orig/drivers/media/dvb/firewire/firedtv-avc.c
 +++ linux-2.6.32-rc1/drivers/media/dvb/firewire/firedtv-avc.c
 @@ -1050,28 +1050,28 @@ int avc_ca_pmt(struct firedtv *fdtv, cha
   c-operand[4] = 0; /* slot */
   c-operand[5] = SFE_VENDOR_TAG_CA_PMT; /* ca tag */
   c-operand[6] = 0; /* more/last */
 - /* c-operand[7] = XXXprogram_info_length + 17; */ /* length */
 - c-operand[8] = list_management;
 - c-operand[9] = 0x01; /* pmt_cmd=OK_descramble */
 + /* Use three bytes for length field in case length  127 */
 + c-operand[10] = list_management;
 + c-operand[11] = 0x01; /* pmt_cmd=OK_descramble */

   /* TS program map table */

 - c-operand[10] = 0x02; /* Table id=2 */
 - c-operand[11] = 0x80; /* Section syntax + length */
 - /* c-operand[12] = XXXprogram_info_length + 12; */
 - c-operand[13] = msg[1]; /* Program number */
 - c-operand[14] = msg[2];
 - c-operand[15] = 0x01; /* Version number=0 + current/next=1 */
 - c-operand[16] = 0x00; /* Section number=0 */
 - c-operand[17] = 0x00; /* Last section number=0 */
 - c-operand[18] = 0x1f; /* PCR_PID=1FFF */
 - c-operand[19] = 0xff;
 - c-operand[20] = (program_info_length  8); /* Program info length */
 - c-operand[21] = (program_info_length  0xff);
 + c-operand[12] = 0x02; /* Table id=2 */
 + c-operand[13] = 0x80; /* Section syntax + length */
 + /* c-operand[14] = XXXprogram_info_length + 12; */
 + c-operand[15] = msg[1]; /* Program number */
 + c-operand[16] = msg[2];
 + c-operand[17] = 0x01; /* Version number=0 + current/next=1 */
 + c-operand[18] = 0x00; /* Section number=0 */
 + c-operand[19] = 0x00; /* Last section number=0 */
 + c-operand[20] = 0x1f; /* PCR_PID=1FFF */
 + c-operand[21] = 0xff;
 + c-operand[22] = (program_info_length  8); /* Program info length */
 + c-operand[23] = (program_info_length  0xff);

   /* CA descriptors at programme level */
   read_pos = 6;
 - write_pos = 22;
 + write_pos = 24;
   if (program_info_length  0) {
   pmt_cmd_id = msg[read_pos++];
   if (pmt_cmd_id != 1  pmt_cmd_id != 4)
 @@ -1113,8 +1113,10 @@ int avc_ca_pmt(struct firedtv *fdtv, cha
   c-operand[write_pos++] = 0x00;
   c-operand[write_pos++] = 0x00;

 - c-operand[7] = write_pos - 8;
 - c-operand[12] = write_pos - 13;
 + c-operand[7] = 0x82;
 + c-operand[8] = (write_pos - 10)  8;
 + c-operand[9] = (write_pos - 10)  0xff;
 + c-operand[14] = write_pos - 15;

   crc32_csum = crc32_be(0, c-operand[10], c-operand[12] - 1);
   c-operand[write_pos - 4] = (crc32_csum  24)  0xff;


 --
 Stefan Richter
 -=-==--= =-=- ---==
 http://arcgraph.de/sr/


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] firedtv: length field corrupt in ca2host if length127

2009-10-01 Thread Henrik Kurelid
Here is a patch that solves a problem in firedtv that has become major for
Swedish DVB-T users the last month or so.
It will most likely solve issues seen by other users as well.
Please review and comment.

---

From 751c52ea5509b85590cc6eeddb16ecc1eecfcb0c Mon Sep 17 00:00:00 2001
From: Henrik Kurelid hen...@kurelid.se
Date: Thu, 1 Oct 2009 07:17:31 +0200
Subject: [PATCH] firedtv: length field corrupt in ca2host if length127

If the length of an AVC message is greater than 127, the length field should
be encoded in LV mode instead of V mode. V mode can only be used if the
length
is 127 or less. This patch ensures that the CA_PMT message is always encoded
in LV mode so PMT message of greater lengths can be supported.

Signed-off-by: Henrik Kurelid hen...@kurelid.se
---
 drivers/media/dvb/firewire/firedtv-avc.c |   38
+++--
 1 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/drivers/media/dvb/firewire/firedtv-avc.c
b/drivers/media/dvb/firewire/firedtv-avc.c
index d056a40..143a322 100644
--- a/drivers/media/dvb/firewire/firedtv-avc.c
+++ b/drivers/media/dvb/firewire/firedtv-avc.c
@@ -1051,28 +1051,28 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int
length)
c-operand[4] = 0; /* slot */
c-operand[5] = SFE_VENDOR_TAG_CA_PMT; /* ca tag */
c-operand[6] = 0; /* more/last */
-   /* c-operand[7] = XXXprogram_info_length + 17; */ /* length */
-   c-operand[8] = list_management;
-   c-operand[9] = 0x01; /* pmt_cmd=OK_descramble */
+   /* Use three bytes for length field in case length  127 */
+   c-operand[10] = list_management;
+   c-operand[11] = 0x01; /* pmt_cmd=OK_descramble */
 
/* TS program map table */
 
-   c-operand[10] = 0x02; /* Table id=2 */
-   c-operand[11] = 0x80; /* Section syntax + length */
-   /* c-operand[12] = XXXprogram_info_length + 12; */
-   c-operand[13] = msg[1]; /* Program number */
-   c-operand[14] = msg[2];
-   c-operand[15] = 0x01; /* Version number=0 + current/next=1 */
-   c-operand[16] = 0x00; /* Section number=0 */
-   c-operand[17] = 0x00; /* Last section number=0 */
-   c-operand[18] = 0x1f; /* PCR_PID=1FFF */
-   c-operand[19] = 0xff;
-   c-operand[20] = (program_info_length  8); /* Program info length
*/
-   c-operand[21] = (program_info_length  0xff);
+   c-operand[12] = 0x02; /* Table id=2 */
+   c-operand[13] = 0x80; /* Section syntax + length */
+   /* c-operand[14] = XXXprogram_info_length + 12; */
+   c-operand[15] = msg[1]; /* Program number */
+   c-operand[16] = msg[2];
+   c-operand[17] = 0x01; /* Version number=0 + current/next=1 */
+   c-operand[18] = 0x00; /* Section number=0 */
+   c-operand[19] = 0x00; /* Last section number=0 */
+   c-operand[20] = 0x1f; /* PCR_PID=1FFF */
+   c-operand[21] = 0xff;
+   c-operand[22] = (program_info_length  8); /* Program info length
*/
+   c-operand[23] = (program_info_length  0xff);
 
/* CA descriptors at programme level */
read_pos = 6;
-   write_pos = 22;
+   write_pos = 24;
if (program_info_length  0) {
pmt_cmd_id = msg[read_pos++];
if (pmt_cmd_id != 1  pmt_cmd_id != 4)
@@ -1114,8 +1114,10 @@ int avc_ca_pmt(struct firedtv *fdtv, char *msg, int
length)
c-operand[write_pos++] = 0x00;
c-operand[write_pos++] = 0x00;
 
-   c-operand[7] = write_pos - 8;
-   c-operand[12] = write_pos - 13;
+   c-operand[7] = 0x82;
+   c-operand[8] = (write_pos - 10)  8;
+   c-operand[9] = (write_pos - 10)  0xFF;
+   c-operand[14] = write_pos - 15;
 
crc32_csum = crc32_be(0, c-operand[10], c-operand[12] - 1);
c-operand[write_pos - 4] = (crc32_csum  24)  0xff;
-- 
1.6.0.6


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] firedtv: refine AVC debugging

2009-07-17 Thread Henrik Kurelid
Hi,

I gave this some thought when I implemented it. These are should not 
happend-situations where the drivers or hardware sends unknown/unimplemented
commands. Rather than making sure that they are never seen in the logs I wanted 
them to always be logged (as long as some debug logging is turned
on) since they indicate driver/hw problems.

Do you disagree with my reasoning? I guess that the best would be to make sure 
that all unknown messages are always logged as warnings with their
full content.

Regarding your other comment, I will fix that in the next patch version.

Regards,
Henrik



 Henrik Kurelid wrote:
 +static int debug_fcp_opcode_flag_set(unsigned int opcode,
 +const u8 *data, int length) +{
 +   switch (opcode) {
 +   case AVC_OPCODE_VENDOR: break;
 +   case AVC_OPCODE_READ_DESCRIPTOR:return avc_debug  
 AVC_DEBUG_READ_DESCRIPTOR; +   case AVC_OPCODE_DSIT:  
return avc_debug  AVC_DEBUG_DSIT; +   case AVC_OPCODE_DSD: 
   return avc_debug  AVC_DEBUG_DSD; +   default:
   return 1;
 +   }
 +
 +   if (length  7 ||
 +   data[3] != SFE_VENDOR_DE_COMPANYID_0 ||
 +   data[4] != SFE_VENDOR_DE_COMPANYID_1 ||
 +   data[5] != SFE_VENDOR_DE_COMPANYID_2)
 +   return 1;
 +
 +   switch (data[6]) {
 +   case SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL: return avc_debug  
 AVC_DEBUG_REGISTER_REMOTE_CONTROL; +   case
SFE_VENDOR_OPCODE_LNB_CONTROL: return avc_debug  
AVC_DEBUG_LNB_CONTROL; +   case SFE_VENDOR_OPCODE_TUNE_QPSK:  
return avc_debug  AVC_DEBUG_TUNE_QPSK; +   case 
SFE_VENDOR_OPCODE_TUNE_QPSK2:  return avc_debug  
AVC_DEBUG_TUNE_QPSK2; +  
case SFE_VENDOR_OPCODE_HOST2CA: return avc_debug  
AVC_DEBUG_HOST2CA; +   case SFE_VENDOR_OPCODE_CA2HOST:
return avc_debug  AVC_DEBUG_CA2HOST; +   }
 +   return 1;
 +}
 +
  static void debug_fcp(const u8 *data, int length)
  {
 unsigned int subunit_type, subunit_id, op;
 const char *prefix = data[0]  7 ? FCP -  : FCP - ;
 -   if (avc_debug  AVC_DEBUG_FCP_SUBACTIONS) {
 -   subunit_type = data[1]  3;
 -   subunit_id = data[1]  7;
 -   op = subunit_type == 0x1e || subunit_id == 5 ? ~0 : data[2]; 
 +   subunit_type = data[1]  3;
 +   subunit_id = data[1]  7;
 +   op = subunit_type == 0x1e || subunit_id == 5 ? ~0 : data[2]; +   
 if (debug_fcp_opcode_flag_set(op, data, length)) {
 printk(KERN_INFO %ssu=%x.%x l=%d: %-8s - %s\n,
 [...]

 Shouldn't the three return statements in debug_fcp_opcode_flag_set be 'return 
 0' rather than one?
 --
 Stefan Richter
 -=-==--= -=== =---=
 http://arcgraph.de/sr/
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in the 
 body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html




--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] firedtv: refine AVC debugging

2009-07-16 Thread Henrik Kurelid
Hi,

Here is another patch for the firedtv driver. This one changes the debug 
logging somewhat to make it easier to find issues with the driver since it
is still fairly untested for variants of delivery systems, CAMs and CA systems.

---

firedtv: refine AVC debugging

The current AVC debugging can clog the log down a lot since many applications
tend to check the signal strength very often. This patch enables users to
select which AVC messages to log using a bitmask.
In addition, it also enables the possibility to debug application PMTs sent
to the driver. This will be usable since the CA support is still poorly tested
for lots of CAMs and CA systems.

Signed-off-by: Henrik Kurelid hen...@kurelid.se

diff -r 48086ebb22a8 linux/drivers/media/dvb/firewire/firedtv-avc.c
--- a/linux/drivers/media/dvb/firewire/firedtv-avc.cThu Jul 16 16:13:09 
2009 +0200
+++ b/linux/drivers/media/dvb/firewire/firedtv-avc.cThu Jul 16 21:54:34 
2009 +0200
@@ -89,14 +89,31 @@ struct avc_response_frame {
u8 operand[509];
 };

-#define AVC_DEBUG_FCP_SUBACTIONS   1
-#define AVC_DEBUG_FCP_PAYLOADS 2
+#define AVC_DEBUG_READ_DESCRIPTOR  0x0001
+#define AVC_DEBUG_DSIT 0x0002
+#define AVC_DEBUG_DSD  0x0004
+#define AVC_DEBUG_REGISTER_REMOTE_CONTROL  0x0008
+#define AVC_DEBUG_LNB_CONTROL  0x0010
+#define AVC_DEBUG_TUNE_QPSK0x0020
+#define AVC_DEBUG_TUNE_QPSK2   0x0040
+#define AVC_DEBUG_HOST2CA  0x0080
+#define AVC_DEBUG_CA2HOST  0x0100
+#define AVC_DEBUG_APPLICATION_PMT  0x4000
+#define AVC_DEBUG_FCP_PAYLOADS 0x8000

 static int avc_debug;
 module_param_named(debug, avc_debug, int, 0644);
-MODULE_PARM_DESC(debug, Verbose logging (default = 0
-   , FCP subactions =__stringify(AVC_DEBUG_FCP_SUBACTIONS)
-   , FCP payloads =  __stringify(AVC_DEBUG_FCP_PAYLOADS)
+MODULE_PARM_DESC(debug, Verbose logging bitmask (none (default) = 0
+   , FCP subaction(READ DESCRIPTOR) =
__stringify(AVC_DEBUG_READ_DESCRIPTOR)
+   , FCP subaction(DSIT) =   
__stringify(AVC_DEBUG_DSIT)
+   , FCP subaction(REGISTER_REMOTE_CONTROL) =
__stringify(AVC_DEBUG_REGISTER_REMOTE_CONTROL)
+   , FCP subaction(LNB CONTROL) =
__stringify(AVC_DEBUG_LNB_CONTROL)
+   , FCP subaction(TUNE QPSK) =  
__stringify(AVC_DEBUG_TUNE_QPSK)
+   , FCP subaction(TUNE QPSK2) = 
__stringify(AVC_DEBUG_TUNE_QPSK2)
+   , FCP subaction(HOST2CA) =
__stringify(AVC_DEBUG_HOST2CA)
+   , FCP subaction(CA2HOST) =
__stringify(AVC_DEBUG_CA2HOST)
+   , Application sent PMT =  
__stringify(AVC_DEBUG_APPLICATION_PMT)
+   , FCP payloads(for selected subactions) = 
__stringify(AVC_DEBUG_FCP_PAYLOADS)
, or all = -1));

 static const char *debug_fcp_ctype(unsigned int ctype)
@@ -142,31 +159,67 @@ static const char *debug_fcp_opcode(unsi
return Vendor;
 }

+static int debug_fcp_opcode_flag_set(unsigned int opcode,
+const u8 *data, int length)
+{
+   switch (opcode) {
+   case AVC_OPCODE_VENDOR: break;
+   case AVC_OPCODE_READ_DESCRIPTOR:return avc_debug  
AVC_DEBUG_READ_DESCRIPTOR;
+   case AVC_OPCODE_DSIT:   return avc_debug  
AVC_DEBUG_DSIT;
+   case AVC_OPCODE_DSD:return avc_debug  
AVC_DEBUG_DSD;
+   default:return 1;
+   }
+
+   if (length  7 ||
+   data[3] != SFE_VENDOR_DE_COMPANYID_0 ||
+   data[4] != SFE_VENDOR_DE_COMPANYID_1 ||
+   data[5] != SFE_VENDOR_DE_COMPANYID_2)
+   return 1;
+
+   switch (data[6]) {
+   case SFE_VENDOR_OPCODE_REGISTER_REMOTE_CONTROL: return avc_debug  
AVC_DEBUG_REGISTER_REMOTE_CONTROL;
+   case SFE_VENDOR_OPCODE_LNB_CONTROL: return avc_debug  
AVC_DEBUG_LNB_CONTROL;
+   case SFE_VENDOR_OPCODE_TUNE_QPSK:   return avc_debug  
AVC_DEBUG_TUNE_QPSK;
+   case SFE_VENDOR_OPCODE_TUNE_QPSK2:  return avc_debug  
AVC_DEBUG_TUNE_QPSK2;
+   case SFE_VENDOR_OPCODE_HOST2CA: return avc_debug  
AVC_DEBUG_HOST2CA;
+   case SFE_VENDOR_OPCODE_CA2HOST: return avc_debug  
AVC_DEBUG_CA2HOST;
+   }
+   return 1;
+}
+
 static void debug_fcp(const u8 *data, int length)
 {
unsigned int subunit_type, subunit_id, op;
const char *prefix = data[0]  7 ? FCP -  : FCP - ;

-   if (avc_debug  AVC_DEBUG_FCP_SUBACTIONS) {
-   subunit_type = data[1]  3;
-   subunit_id = data[1]  7;
-   op = subunit_type == 0x1e || subunit_id == 5 ? ~0 : data[2];
+   subunit_type = data[1]  3;
+   subunit_id = data[1]  7;
+   op = subunit_type

Re: Digital Everywhere FloppyDTV / FireDTV (incl. CI)

2009-07-15 Thread Henrik Kurelid
Hi Lou,

I do not have a DVB-C variant, but if you enable the AVC logging in the driver 
(cat -1  /sys/module/firedtv/parameters/debug) and give a pointer to
a log from where you try to do a tune or scan, I can take a look at the log for 
you to see what I can come up with.
Also, please provide information about what scan file you are using.

Regards,
Henrik


 David Lister wrote:
 Hi all,

 just found out that these cards have finally some preliminary Linux
 support. They seem quite versatile and even customizable -- a true gift
 for dedicated hobbyists. :) PCI/PCIe/AGP or floppy drive mounting and
 firewire /connection/ chaining look especially interesting. Even
 FloppyDTV is apparently half internal, half external - sort of. Anybody
 with hands-on access? Any updates? Share your experience! :o)

 I have been evaluating the Floppy DTV DVB-S2, DVB-T and DVB-C variants.

 So far I have managed to get fairly good results from the DVB-S2 and
 DVB-T adapters but I can't get the DVB-C device to tune under linux. I
 tested it with a windows PC to be sure it wasn't faulty and it worked fine.

 I've had them all working (i.e. appearing as devices) while chained one
 to the next and when individually connected to a 1394 adapter card.

 Now I need to spend some more time to see if they will give the
 performance I need, but so far so good.

 If anyone has been able to tune the cable adapter under linux I'd like
 to hear more.

 I had to make a small modification to the driver to enable some frontend
 settings required by my applications, but apart from that the latest v4l
   drivers have been sufficient.

 Cheers,

 Lou
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: firedtv and ca-module

2009-07-15 Thread Henrik Kurelid
Hi Johs,

Please provide a kernel log when you have enabled AVC debugging (cat -1  
/sys/module/firedtv/parameters/debug) and I will take a look at it for
you. Please split the log in two or indicate where you do the second tuning.

Regards,
Henrik

 Hi,

 I'm having trouble using the firedtv driver to watch scrambled
 channels using a ca-module. Here's my setup: I have a firedtv c/ci
 tuner with an irdeto cam, and am running Fedora 10 with a 2.6.29.1
 kernel. In general I have no problems with FTA channels, but scrambled
 channels do not always work. I've tested my setup on a macbook in mac
 osx using eyetv, and here I can watch scrambled channels without any
 problems, so I doubt my problems are hardware related.

 I have tried to track down the problem using various dvb-apps, and the
 app I've had the best results with is gnutv from dvb-apps. If I try to
 tune to a scrambled channel I get the following:

 [r...@hp-laptop gnutv]# ./gnutv -channels ./channels.conf -out file
 test.mpg 3+
 CAM Application type: 01
 CAM Application manufacturer: cafe
 CAM Manufacturer code: babe
 CAM Menu string: Irdeto Access
 CAM supports the following ca system ids:
 Using frontend FireDTV C/CI, type DVB-C
 status SCVYL | signal ff00 | snr 2525 | ber 00be | unc  |
 FE_HAS_LOCK

 and then it hangs. But if I kill the process and try again it works and I get:

 [r...@hp-laptop gnutv]# ./gnutv -channels ./channels.conf -out file
 test.mpg 3+
 CAM Application type: 01
 CAM Application manufacturer: cafe
 CAM Manufacturer code: babe
 CAM Menu string: Irdeto Access
 CAM supports the following ca system ids:
 Using frontend FireDTV C/CI, type DVB-C
 status SCVYL | signal ff00 | snr 2525 | ber 0082 | unc  |
 FE_HAS_LOCK
 Received new PMT - sending to CAM...

 So I need to tune the channel twice for it to work. After this first
 time it keeps working even if I stop gnutv and start it again, as long
 as I want to watch the same channel. As soon as try to watch a
 different channel I again need to tune it twice before it works.

 Well that's not completely true. Because after playing around with
 several different channels it appears there might be a pattern. If I
 have been able to successfully watch a scrambled channel by tuning it
 twice as described above then I can watch all channels in the mux
 without having to tune twice again. The problem only appears again
 when I try to watch a channel in a different mux.

 I hope that some of you can make some sense of my problem. Please let
 me know if I can provide any additional information.

 /Johs
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] firedtv: add PID filtering for SW zigzag retune

2009-07-15 Thread Henrik Kurelid
Hi,

There is a problem in the firedtv driver that causes recordings to stop if the 
SW zigzag algorithm in dvb-core kicks in with a retune after the
application has set up the PID filters. Since tuning and setting PID filters 
uses the same AVC command (DSD) and only the replace subfunction is
supported by the card, it is not possible to do a retune without setting the 
PID filters. This means that the PID filtering has to be sent in each
tune.

This problem applies to C and T cards since S and S2 cards tune using a vendor 
specific command. The patch below corrects the problem by sending the
PID list in each tune. I have tested it on my T card with a good result. Since 
I can not test this on a C card I would appreciate if someone could
try it out there as well.

How to trigger problem:
Zap to a channel and output AV to a file, e.g. tzap -c channels.conf SVT1 -r 
-o SVT1.ts. After a short while, pull the antenna cable from the
card. The lock on the channel will disappear and the TS file will stop 
increasing in size. Wait a couple of seconds. Replug the cable again. You
will get a lock on the channel again, but the TS file will never increase in 
size agains sinze no PIDS are filtered.

Patch:

From dacd5b98be802176c10026617323f68b76ba19d0 Mon Sep 17 00:00:00 2001
From: Henrik Kurelid hen...@kurelid.se
Date: Tue, 14 Jul 2009 22:34:24 +0200
Subject: [PATCH] firedtv: add PID filtering for SW zigzag retune

The AVC protocol uses the same command for tuning and PID filtering
and since dvb-core uses a software zigzagging to do automatic
retuning this could cause all PID filters to be cleared. PID
filter information is now included in all DSD commands to the card.

Signed-off-by: Henrik Kurelid hen...@kurelid.se
---
 drivers/media/dvb/firewire/firedtv-avc.c |   43 +
 1 files changed, 31 insertions(+), 12 deletions(-)

diff --git a/drivers/media/dvb/firewire/firedtv-avc.c 
b/drivers/media/dvb/firewire/firedtv-avc.c
index 32526f1..dccea83 100644
--- a/drivers/media/dvb/firewire/firedtv-avc.c
+++ b/drivers/media/dvb/firewire/firedtv-avc.c
@@ -254,6 +254,27 @@ int avc_recv(struct firedtv *fdtv, void *data, size_t 
length)
return 0;
 }

+int add_pid_filter(struct firedtv *fdtv,
+  u8* operand)
+{
+   int i, n, pos = 1;
+
+   for (i = 0, n = 0; i  16; i++) {
+   if (test_bit(i, fdtv-channel_active)) {
+   operand[pos++] = 0x13; /* flowfunction relay */
+   operand[pos++] = 0x80; /* dsd_sel_spec_valid_flags - 
PID */
+   operand[pos++] = (fdtv-channel_pid[i]  8)  0x1f;
+   operand[pos++] = fdtv-channel_pid[i]  0xff;
+   operand[pos++] = 0x00; /* tableID */
+   operand[pos++] = 0x00; /* filter_length */
+   n++;
+   }
+   }
+   operand[0] = n;
+
+   return pos;
+}
+
 /*
  * tuning command for setting the relative LNB frequency
  * (not supported by the AVC standard)
@@ -316,7 +337,8 @@ static void avc_tuner_tuneqpsk(struct firedtv *fdtv,
}
 }

-static void avc_tuner_dsd_dvb_c(struct dvb_frontend_parameters *params,
+static void avc_tuner_dsd_dvb_c(struct firedtv *fdtv,
+   struct dvb_frontend_parameters *params,
struct avc_command_frame *c)
 {
c-opcode = AVC_OPCODE_DSD;
@@ -378,13 +400,12 @@ static void avc_tuner_dsd_dvb_c(struct 
dvb_frontend_parameters *params,

c-operand[20] = 0x00;
c-operand[21] = 0x00;
-   /* Nr_of_dsd_sel_specs = 0 - no PIDs are transmitted */
-   c-operand[22] = 0x00;
-
-   c-length = 28;
+   /* Add PIDs to filter */
+   c-length = ALIGN(22 + add_pid_filter(fdtv, c-operand[22]) + 3, 4);
 }

-static void avc_tuner_dsd_dvb_t(struct dvb_frontend_parameters *params,
+static void avc_tuner_dsd_dvb_t(struct firedtv *fdtv,
+   struct dvb_frontend_parameters *params,
struct avc_command_frame *c)
 {
struct dvb_ofdm_parameters *ofdm = params-u.ofdm;
@@ -481,10 +502,8 @@ static void avc_tuner_dsd_dvb_t(struct 
dvb_frontend_parameters *params,

c-operand[15] = 0x00; /* network_ID[0] */
c-operand[16] = 0x00; /* network_ID[1] */
-   /* Nr_of_dsd_sel_specs = 0 - no PIDs are transmitted */
-   c-operand[17] = 0x00;
-
-   c-length = 24;
+   /* Add PIDs to filter */
+   c-length = ALIGN(17 + add_pid_filter(fdtv, c-operand[17]) + 3, 4);
 }

 int avc_tuner_dsd(struct firedtv *fdtv,
@@ -502,8 +521,8 @@ int avc_tuner_dsd(struct firedtv *fdtv,
switch (fdtv-type) {
case FIREDTV_DVB_S:
case FIREDTV_DVB_S2: avc_tuner_tuneqpsk(fdtv, params, c); break;
-   case FIREDTV_DVB_C: avc_tuner_dsd_dvb_c(params, c); break;
-   case FIREDTV_DVB_T: avc_tuner_dsd_dvb_t(params, c); break;
+   case FIREDTV_DVB_C: avc_tuner_dsd_dvb_c(fdtv, params, c); break