Current CD-ROM patches


My name is Jens Axboe and I maintain the CD-ROM driver subsystem in the Linux kernel. This site will contain more info in the future, but for now it will only be a patch repository for the various CD-ROM drivers (ATAPI, SCSI, and the Uniform layer).

Any bugs or questions regarding these patches should be sent to me.

I can always use equipment for testing, old as well as new. A CD-RW and DVD-RAM drive are of particular interest. If you feel like donating something (or know somebody who does) send me a note.

Description
2.2
2.3
2.2-ac
November 9, 1999
2.2.13
none
none

  • Some quick fixes for the Toshiba owners. There still seems to be a problem with the SD-M1212 drive that I haven't had that much time to look at.

  • Had a couple of nice experiences with the packet writing in ide-cd. It is close to usable now. I actually copied an ordinary CD with dd and it worked like a charm!

    • dd if=/dev/hda of=/dev/hdb bs=2048

    Mounting UDF is still a bit tricky, though. Unlike using dd or cp directly on the device, writes from a file system come in scattered chunks (somewhat, the kernel has merged any writes in chunks as big as it can). For fixed packet writing we must write out exactly a 32 block (for example) packet everytime, so when I get a small write I have to gather the surrounding data from disc before I can write it all out. Welcome to deadlock country... It does look promising, however, and I have sucessfully copied files to an UDF volume on disc. I won't have time to work on this further until next week, though. I think we are looking at an alpha release in a couple of weeks.

  • The tools package has also seen extensive changes. Several people mailed me about the -q quick setup option mentioned in the README, which I had not added to the program yet. That is now in there - just insert a CD-RW disc and it will set it up appropriately on its own. Ben Fennema is working on merging with mkudf and when the writeable support is done you should be able to use plain mkudf with /dev/cdrom as output file too.

  • 2.3.26 and above contains most of my new stuff, 2.2.13-ac3 and above has DVD ioctl support. For stock 2.2, get the patch from the link. Andre and I will be merging patches so that 2.2 users with special IDE chipsets should be able to play DVD movies too in the near future.

  • I badly need a SCSI CD-RW drive if SCSI is to be as well supported as ATAPI for writeable mounting! If you or your company wish to see decent SCSI support, please consider a donation.


November 4, 1999
2.2.13
none
none

  • Forgot to merge a few fixes in the nov3-2.2 patch, mainly the Toshiba fix parts. The 2.3 and 2.2-ac version both had them in.

November 3, 1999
2.2.13
2.3.25
2.2.13-ac2

  • Some people experienced authentication problems with drives from Creative's DXR2/DXR3 kit and some Toshiba models. This release should fix those errors. If not, let me know.

  • Fixed a few places where I did not memset a buffer prior to use. init_cdrom_command has been changed to do this too.

  • Changed setup_report_key() and setup_send_key() to set the buffer length on its own, based on the DVD key format passed.

  • Fixed minor ide-cd which could affect multi session CD's.

  • Note that there is a 2.2-ac patch available. This is not because I sadistically crave having yet another tree to support, but mainly because I discussed including the patch in 2.2.13-ac with Alan. This could lead to integration in 2.2 mainstream. It doesn't contain all the stuff that is in 2.3, but gets fairly close.

  • Misc cleanups. Enjoy, share, and be happy.

October 31, 1999
2.2.13
2.3.24
none

  • Got a patch from Arnd Bergmann that attempted to fix the SCSI low ISA DMA problem in the 2.3 kernels. I hacked it up a bit to fix a couple of minor errors. If you are running a CD-ROM of a ISA SCSI adapter that can do DMA, you should apply this patch.

  • Fixed a couple of missing spin locks in the SCSI CD-ROM driver.

  • Lowered stack usage dramatically in some of the DVD functions. We could have been very close to the kernel stack size limit before and might even have exceeded it in some rare scenarios. Keith Owens spawned the initial discussion by listing a stack usage high score on the kernel list.

  • David Woodhouse pointed out that the NEC-260 needs a small work around to enable audio and eject on 2.2.13. The fix is applicable to 2.3.XX too.

  • Had time to play around with DVD viewing in Linux. Works rather well, although I had no audio output. The framerate was consistent around 23-25 fps which isn't bad at all. If you are interested in DVD on Linux, check out the LiVid page.

  • NetBSD adopted the Linux DVD interface, which is very good news. I hope the other *BSD variants do the same, so that the programs developed for Linux work there too.

  • Read the Slashot linked DVD-HOWTO. Some of it is just crap, so let me dispell a few myths I've seen one time too many:

    • He refers to Andrew's DVD patch. The kernel stuff we have now is pretty much directly taken from Andrew's patch and he did an excellent job. It only works on ATAPI, however.
    • The 2.2 patches I post here are referenced as "the SCSI patch", which is just plain wrong. My patch works on SCSI and ATAPI. I don't see how that makes it a SCSI patch, but apparently a lot of other people seem to be under that impression.
    • If you are using a 2.3 kernel or a 2.2 kernel with my patch, you don't need to change the key member to key1/key2. This was a part of Andrew's interface.


  • Ported to 2.2 again. The old patch did not apply to 2.2.13 at all. This time I also verified that it builds modular as well as builtin. The 2.3 patch is only a bug fix patch, it contains nothing new and interesting. The latter applies cleanly to 2.3.25-pre3, too.

October 19, 1999
none
2.3.23
none

  • Updates have been scarce lately, mainly because I've been busy doing other stuff (believe it or not, I don't get paid to hack CD-ROM drivers, unfortunately :). I also attended the Linux Expo '99 in London and met some very cool people, Alan Cox and Stephen Tweedie amongst others. Here's a picture of me stealing Alan's red hat.

  • The writeable support has also been at a stand still because of this, but is proceeding nicely now. I'm done making any promises as to when this will be ready. For now you can take a look the start of a CD-ROM tools package for disc formatting etc.

  • This is mainly a fixup patch for 2.3.23-pre2/3, since parts of my patch got integrated without me knowing. I'll put up a 2.2 version soon, for those of you running the stable kernel. Provided that this fixup gets included in 2.3.23 final, I'll also stick up a new patch for 2.3.


September 26, 1999
2.2.12
2.3.18
2.3.18ac9

  • Changed the format of the CDROM_SEND_COMMAND ioctl. It was not that handy working with before, if you had to send data to the drive. Basically, before you had to do setup the command, copy it to a buffer, and send that to the Uniform layer. Now you build the command and pass along a buffer for data instead.

  • Working on the tools package for CD-R/W and DVD-R handling exposed a problem with IRQ timeouts in the IDE layer. All commands queued from the ATAPI CD-ROM driver were assumed to finish within 5 seconds, or the command would be aborted and an error printed. Considering that a format or blank command can take up to an hour, this wasn't very handy. Instead I added a per-drive IRQ timeout and modified ide_set_handler along with the affected drivers appropriately.

  • Fixed a problem with the newer ASUS CD-ROM drives.

  • Removed remnants of changer support in ide-cd. Thanks to Richard Sharman for this patch.

  • Added a setup of write parameters for CD-R, CD-RW, and DVD-R drives. Write support is still not finished, some changes must be made to the UDF file system. Should not take that long now, however. I had a "throw away first version" this week, what is in this patch if from the new version. This also means that IDE and SCSI should be done at the same time.


September 19, 1999
none
none
none

  • No patches today, just a status report. I have a few fixes pending, but none so serious that they can't wait.

  • I have writable CD-R/CD-RW mounting working, sort of. CD-R seems to work fine with variable sized packets - the packet size is the size of the file written unless it exceeds the buffer capacity of the drive. In that case the write is split. This should ensure a good recording speed and eliminates buffer underruns completely. CD-RW with fixed packet sizes gives me strange errors... This might just be my drive, but I'm not sure. Let me know if you have an CD-R or CD-RW drive, use 2.3 kernels, and you are willing to test experimental patches. The first alpha should be ready next weekend, I hope.

  • rw mounting is being developed in the ATAPI driver, SCSI support will be added later.


September 14, 1999
2.2.12
2.3.18
none

  • Gadi Oxman responded with this mail regarding the mysterious hangs I have been experiencing with ide_do_drive_cmd. Naturally Gadi was right and it appears to work excellent now.

  • Removed all references to cdrom_mode_sense and cdrom_mode_select in ide-cd and exported the Uniform functions. It was a trivial fix - except in ide_cdrom_probe_capabilities. At this point in time the CD-ROM hasn't been registered with the Uniform layer and I needed to handle some if the setup myself.

  • Fixed a strange problem with the WPI CDS-32X Wearnes drive. It failed the capabilities probe - this was a long standing bug.

  • Added a init_cdrom_command to setup generic cdrom packets - even I messed it up from time to time.


September 12, 1999
2.2.12
2.3.18
none

  • Implemented partition based mounting of multisession CD's. So if you want to mount session 3 of your CD-ROM, do something like :

    mount /dev/hdc3 /mnt/cdrom

    or a variant of that, depending on where you CD-ROM is located. Note that this only works with ATAPI drives, since the SCSI CD-ROM driver uses minor numbers to distinguish between different drives!

  • Both Erik and Richard supplied patches to bring the changer support in a working state.

  • Various minor fixes and cleanups. Ported to 2.3.18 and made a patch against 2.2.12 as well.


September 10, 1999
none
2.3.17
none

  • Finally fixed all the VCD/CDi problems, I hope. Works like a charm here and gives me 50+ fps now. The bug was really embarrassing so I'm not going to mention it! Find it in the patch and get a second patch for free tomorrow.

  • I have experienced mysterious hangs of the really bad kind when ripping audio or playing video CD's. It turned out that repeated calls to ide_do_drive_cmd() with ide_wait as action would hang the machine hard. I couldn't get debug info even with a serial console. I wrote a ide_do_drive_cmd_wait() that works and as a bonus only disables interrupts on the current CPU instead of all of them. Now ripping from 4 CD's simultaneously is rock solid!

  • The changer support is a bit unstable right now - it might work for you and it might not. Erik Andersen is looking into the problem.

  • Other cleanups and reinstatement of Heiko's TOC fixes.


September 9, 1999
none
2.3.17
none

  • Merged in Richard Sharman new CD-ROM changer support. This unifies changer handling across ATAPI and SCSI, previously only ATAPI supported changers. This isn't done yet, still need to do a bit of rearranging.

  • Looked into why it isn't possible to play VCD/CDi movies with the current code. I haven't quite figured it out yet - SCSI seems to work and so does ATAPI over ide-scsi, but not ATAPI alone. Give me a mail if you experience otherwise (both stock 2.3.17 and with my patch).

  • Fixed a couple of memory leaks in cdrom.c.

  • No 2.2 patch today and I'm not sure that I'll continue putting out 2.2 patches. I just spend too much time merging code back from 2.3. In the future I will provide a 2.2 patch that contains only the DVD stuff and assorted bug fixes. Send me a mail if you would like me to continue providing up-to-date patches for 2.2 as well.

  • Ported to 2.3.17.


September 2, 1999
2.2.12
2.3.16
none

  • David Miller reported that the Uniform layer set negative transfer lengths for some packets and this was confusing some SCSI drivers when doing DMA. It did so for historical reasons, since ide-cd has always viewed data transfers going to the drive as having negative buffer lengths. This was fixed up and ide-cd now behaves as the SCSI CD-ROM driver. It cleaned up the code a bit too, which is always a good thing.

  • Changed the warning for applications not opening O_NONBLOCK when they should to be a little more informative (before it just told you that the program was buggy, not why).


Older updates