Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: DVD-Plugin / libdvdcss



Hello Tilo,

I have problems playing CSS-DVD's in my USB-DVD drive. There is an
errormessage
that something with ioctl is not working. Playing non scrabled DVD's works
fine.

Does anybody have the same problem, and maybe a solution for it ?
Let me guess: is this a SCSI-2/USB drive?
(Have a look at "dmesg" output to find it out)

If so, the problem is inside SCSI drive recognition system, which can be found in "drivers/scsi/sr.c".

The function "get_capabilities()" tries to find out which type of drive you have.

---------------------------schnipp--------------------------------------
rc = sr_do_ioctl(i, cmd, buffer, 128, 1, SCSI_DATA_READ, NULL);

if (rc) {
/* failed, drive doesn't have capabilities mode page */
scsi_CDs[i].cdi.speed = 1;
scsi_CDs[i].cdi.mask |= (CDC_CD_R | CDC_CD_RW | CDC_DVD_R |
CDC_DVD | CDC_DVD_RAM |
CDC_SELECT_DISC | CDC_SELECT_SPEED);
scsi_free(buffer, 512);
printk("sr%i: scsi-1 drive\n", i);
return;
}
---------------------------schnipp--------------------------------------

For my SCSI-2/USB drive, the above SCSI_DATA_READ command fails. As you can see, in this case the driver thinks that your drive is SCSI-1, ie. a CD-drive only.

Unfortunately, the driver only knows SCSI-1 and SCSI-3, so you're out of luck.

The patch below unmasks the DVD drive bit, ie. even if the kernel misdetects your driver, it will allow DVD ioctls to be passed to your drive.

This is not a safe fix, but "it works for me"(tm).

Thanx in advance.
Tilo
CU
Michael.



diff -ur linux-2.4.21/drivers/scsi/sr.c linux-2.4.21.patched/drivers/scsi/sr.c
--- linux-2.4.21/drivers/scsi/sr.c	2003-06-13 16:51:36.000000000 +0200
+++ linux-2.4.21.patched/drivers/scsi/sr.c	2003-08-27 23:52:32.000000000 +0200
@@ -725,7 +725,7 @@
 		/* failed, drive doesn't have capabilities mode page */
 		scsi_CDs[i].cdi.speed = 1;
 		scsi_CDs[i].cdi.mask |= (CDC_CD_R | CDC_CD_RW | CDC_DVD_R |
-					 CDC_DVD | CDC_DVD_RAM |
+					 /* USB-DVD-SCSI-2 hack: */ /* CDC_DVD | */  CDC_DVD_RAM |
 					 CDC_SELECT_DISC | CDC_SELECT_SPEED);
 		scsi_free(buffer, 512);
 		printk("sr%i: scsi-1 drive\n", i);

Home | Main Index | Thread Index