Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
dvd_drives [2013/07/13 15:51]
beandog created
dvd_drives [2014/08/18 16:08]
beandog [DVD Drives]
Line 1: Line 1:
 ====== DVD Drives ====== ====== DVD Drives ======
  
-Polling DVD drives to see if it is closed or not is a real pain to do in Linux.+  * [[dvd_drive_status]] 
 +  * [[dvd_eject]] 
 +  * [[regionset]] 
 +  * [[trayopen]] 
 + 
 +==== Polling a Drive: Is Open / Has Media ==== 
 + 
 +Polling DVD drives to see if it is closed or not is a real pain to do in Linux. (**Edit:** it was!  Check out [[dvd_drive_status]] which solves everything here) 
 + 
 +I highly recommend reading [[http://​wonkabar.org/​2013/​07/​03/​reading-ejecting-ripping-and-polling-dvd-devices-in-linux-also-notes-on-my-dvd-library/​| this blog post]] where I describe various ways I poll the drive to see if it is empty or not. 
 + 
 +Also, check out [[trayopen]],​ which I added to this wiki after writing that blog post.
  
 The reason is because there are race conditions. The reason is because there are race conditions.
Line 14: Line 25:
 Ideally, this would work perfectly fine.  However, the problem happens after step #3, closing the tray.  The device becomes available **before** it is actually ready to read from.  This is particularly annoying with DVD drives because some firmware (most of them, that I've seen) for the devices will freak out if you are trying to access the data encrypted by CSS. Ideally, this would work perfectly fine.  However, the problem happens after step #3, closing the tray.  The device becomes available **before** it is actually ready to read from.  This is particularly annoying with DVD drives because some firmware (most of them, that I've seen) for the devices will freak out if you are trying to access the data encrypted by CSS.
  
-The best solution I've found to work around this mess?  Close the DVD tray and wait 30 seconds for the device to finish polling.+The best solution I've found to work around this mess?  Close the DVD tray and wait 30 seconds for the device to finish polling.  Seriously. ​ Just avoid the problem by applying some patience.
  
 You can duplicate the scenario if you like, like this: You can duplicate the scenario if you like, like this:
Line 62: Line 73:
 The place this is a problem is that sometimes this happening multiple times, it can lock up your DVD drive in the sense that it won't read anymore for that session. ​ You can sometimes hear the DVD drive physically clunking if it errors out.  In cases where it gives up like that, simply reboot your box, and go on with your life. The place this is a problem is that sometimes this happening multiple times, it can lock up your DVD drive in the sense that it won't read anymore for that session. ​ You can sometimes hear the DVD drive physically clunking if it errors out.  In cases where it gives up like that, simply reboot your box, and go on with your life.
  
-In *very* rare cases, it will lock up your box and you'll be forced to reboot. ​ And by rare, I mean I've had it happen maybe three or four times when accessing the drive thousands of times over a number of years. ​ Worst cases scenarios are statistically unlikely, but it's worth mentioning in case it happens to you.+In *very* rare cases, it will lock up your box with a kernel panic and you'll be forced to reboot. ​ And by rare, I mean I've had it happen maybe three or four times when accessing the drive thousands of times over a number of years. ​ Worst cases scenarios are statistically unlikely, but it's worth mentioning in case it happens to you.

Navigation