BUG: Can't play (S)VCDs on some SCSI-drives (easy fix)
Hello! For someone familiar with the code, this bug should be quite easy to fix, I think. SYMPTOMS MPlayer won't play VCDs and SVCDs on some SCSI drives (properly). When MPlayer tries to read a (S)VCD, /var/log/messages is flooded with the following message: Jun 22 22:22:23 pc8 kernel: sr2: CDROM (ioctl) reports ILLEGAL REQUEST. Jun 22 22:22:23 pc8 kernel: UNKNOWN(0xbe) 00 00 00 00 00 00 00 01 f8 00 00 Jun 22 22:22:23 pc8 kernel: Current sr00:00: sense key Illegal Request Jun 22 22:22:23 pc8 kernel: Additional sense indicates Invalid command operation code Jun 22 22:22:24 pc8 kernel: sr2: CDROM (ioctl) reports ILLEGAL REQUEST. Jun 22 22:22:24 pc8 kernel: UNKNOWN(0xbe) 00 00 00 00 01 00 00 01 f8 00 00 Jun 22 22:22:24 pc8 kernel: Current sr00:00: sense key Illegal Request Jun 22 22:22:24 pc8 kernel: Additional sense indicates Invalid command operation code Jun 22 22:22:24 pc8 kernel: sr2: CDROM (ioctl) reports ILLEGAL REQUEST. Jun 22 22:22:24 pc8 kernel: UNKNOWN(0xbe) 00 00 00 00 02 00 00 01 f8 00 00 Jun 22 22:22:24 pc8 kernel: Current sr00:00: sense key Illegal Request Jun 22 22:22:24 pc8 kernel: Additional sense indicates Invalid command operation code [...] With VCDs, there are sometimes frame drops. With SVCDs, there are so many frame drops that playback halts and MPlayer claims the system was "too slow". It isn't, though: 1 GHz Athlon, 640 MB, U160-SCSI, Matrox G450 with mga_vid. During the first few seconds before playback, one can see that the cache is filled only very slowly, roughly less than double speed (ca. 250 kB/sec), I would say, which is just not enough for SVCD, which needs double speed, I think. REASON MPlayer uses the SCSI command "READ CD" (0xbe) to read (S)VCDs, which consist of MODE 2 / FORM 2 tracks. Although many newer SCSI CD-ROM drives implement this command, some don't - for example Plextor 12x and 32x caddy drives and TEAC 55S. Note that these drives are still fully SCSI compliant, since the "READ CD" command is optional in the SCSI-II specification. SOLUTION MPlayer should test if the drive supports "READ CD", and if it doesn't, it should fall back to a normal ten-byte "READ", which is what "vcdxrip" (from the "vcdimager" package) uses: # vcdxrip --cdrom-device=/dev/sr2 ioctl(): Operation not supported INFO: READ_CD failed; switching to READ_10 mode... [...] In MPlayer-0.90pre5/libmpdemux/vcd_read.h, there is some code that directly prepares SCSI commands to be sent ("#ifdef sun"), maybe this piece of code can be used here for the "READ CD"-fallback, by using cdb.scc_cmd = 0x28; // code for ten-byte-read instead of cdb.scc_cmd = 0xBE; and setting the block size of the CD-ROM drive appropriately to 2336. A look into the function "__read_mode2" in vcdimager-0.7.12/libvcd/vcd_image_linuxcd.c might help, because this function is quite short (50 lines) and seems to contain the suggested workaround. SYSTEM Hardware: - 1 GHz Thunderbird on ABIT KT7A-RAID - 640 MB RAM (Infineon chips) - Adaptec AHA-3940 (2 x 2940 on one board with PCI bridge) - Plextor PX-32CSi - BUG occurs - Plextor PX-12CSi - BUG occurs - TEAC CD-R55S - BUG occurs - TEAC CD-R58S - works fine - Pioneer DVD-303 - works fine - Toshiba XM-6402B - works (ATAPI) Software: - GNU/Linux 2.4.18 (remnant of S.u.S.E. 7.3 :-) - aic7xxx_old (driver for Adaptec) - glibc 2.2.4 REFERENCES ftp://ftp.vcdimager.org/pub/vcdimager/vcdimager-0.7_UNSTABLE/vcdimager-0.7.11.tar.gz COMMENTS I have 300+ CD-ROM caddies with movies, and the only caddy CD-ROM drives I have (and want) are Plextors - where this bug occurs... Best regards and thanks for this GREAT player! Marc-Jano
REASON
MPlayer uses the SCSI command "READ CD" (0xbe) to read (S)VCDs, which consist of MODE 2 / FORM 2 tracks. Although many newer SCSI CD-ROM drives implement this command, some don't - for example Plextor 12x and 32x caddy drives and TEAC 55S.
Note that these drives are still fully SCSI compliant, since the "READ CD" command is optional in the SCSI-II specification. mplayer uses linux cdrom-reading code as defined in linux/cdrom.h, so actually
On Saturday 22 June 2002 23:18, Marc-Jano Knopp wrote: that code should do the fallback (which seems a defficiency of that code). However feel free to send a patch with your method, that's compatible with both ide and scsi drives or make it custom-stuff, e.g enabled by configure --enable-alt-scsi-vcd or a commandline option (eg -vcdmode 2). -- Best Regards, Atmos ____________________________________________ - MPlayer Developer - http://mplayerhq.hu/ - ____________________________________________
participants (2)
-
Felix Buenemann -
Marc-Jano Knopp