eject button not working for non-data CDs

Bug #448921 reported by terry_gardener
56
This bug affects 10 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Triaged
Medium
Unassigned
Karmic
Triaged
Medium
Unassigned

Bug Description

Binary package hint: devicekit-disks

In the test i used an audio-cd, dvd-video, dvd-data disc (win 7 disc), and cd data disc (ubuntu 9.10 & ubuntu 9.04 discs)

this is the behaviour of these discs.
-the audio cd will mount and play in app and then unmount and eject with the eject drive button.
-dvd-video once mounted does not respond at all to the eject button press and needs to unmount/eject from nautilus.
-dvd-data disc will mount and allow you to navigate the data on the disc, when you press the eject button it does eject but leaves itself mounted, so when you but in another disc it doesn't mount, until you have unmounted this disc in nautilus.
-cd data discs works the same as dvd data discs.

i was asked in bug #397734 to raise new bug.

ProblemType: Bug
Architecture: i386
Date: Sun Oct 11 19:16:53 2009
DistroRelease: Ubuntu 9.10
NonfreeKernelModules: nvidia
Package: devicekit-disks 007-2
ProcEnviron:
 PATH=(custom, user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-13.44-generic
SourcePackage: devicekit-disks
Uname: Linux 2.6.31-13-generic i686

Revision history for this message
terry_gardener (terry-gardener) wrote :
Revision history for this message
Martin Pitt (pitti) wrote :

Thanks for your report. Please open a Terminal, and do

  sudo /usr/lib/devicekit-disks/devkit-disks-daemon --replace > /tmp/debug.txt 2>&1

Then insert a DVD, press eject button, wait a couple of seconds. Then press Control-C to cancel the debugging process, and attach /tmp/debug.txt here.

Afterwards, do

  devkit-disks --dump > /tmp/dk-dump.txt

and attach /tmp/dk-dump.txt here.

Thank you!

Changed in devicekit-disks (Ubuntu):
status: New → Incomplete
Revision history for this message
terry_gardener (terry-gardener) wrote :

i have done the above and attached the files required.

Revision history for this message
terry_gardener (terry-gardener) wrote :
Changed in devicekit-disks (Ubuntu):
status: Incomplete → New
Martin Pitt (pitti)
Changed in devicekit-disks (Ubuntu):
status: New → Confirmed
Revision history for this message
Sebastien Bacher (seb128) wrote :

Confirming the issue there, after playing a DVD in totem the button doesn't work, do you need any extra details?

Revision history for this message
Martin Pitt (pitti) wrote :

Can you confirm that if you insert a video DVD and didn't start the video player (totem) yet, you can still eject it using the button? And as soon as totem starts, it doesn't work any more? That's the behaviour I get now.

Martin Pitt (pitti)
summary: - eject button not working
+ eject button not working for video DVDs
Martin Pitt (pitti)
Changed in devicekit-disks (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
terry_gardener (terry-gardener) wrote : Re: eject button not working for video DVDs

martin

i can confirm that if you mount the dvd video without playing it. the eject button on the drive works but it leaves it mounted so when you insert another disk it doesn't work until you have unmounted the first disk.

when you press the eject button on the drive it should do both unmount and eject the disc.

also when you start and play the dvd video with either totem or vlc the eject button on the drive stops working.

Martin Pitt (pitti)
Changed in devicekit-disks (Ubuntu):
importance: Undecided → High
Changed in devicekit-disks (Ubuntu Karmic):
importance: High → Medium
Martin Pitt (pitti)
Changed in devicekit-disks (Ubuntu Karmic):
status: Confirmed → In Progress
Revision history for this message
John Wheelwright (jbwheelwright) wrote :

I'm having the same problem with DVD's and CD's don't work at all.

Revision history for this message
Martin Pitt (pitti) wrote :

I did some investigations for this. It's not intrinsically specific to DVDs, it happens as soon as a program open()s the raw device without O_NONBLK:

 * insert CD or DVD, don't open in video player

 * $ python
   >>> f = open('/dev/sr0')
   >>> f.close()

  -> drive gets locked

 * eject, insert again

 * Python 2.6.4 (r264:75706, Nov 2 2009, 14:44:17)
   >>> import os
   >>> f = os.open('/dev/sr0', os.O_RDONLY | os.O_NONBLOCK)

  -> drive does not get locked

However, O_NONBLOCK has a much larger impact than just avoiding drive door lock, it changes the behaviour of open() itself when the device is not fully ready yet, as well as the default behaviour of all subsequent write() or read(). So doing this change in our video players would require larger code changes.

This is just mainly seen with DVDs because for data CDs/DVDs the raw device does not get open()ed, but just gets mounted. Only audio/video players, CD rippers/burners, etc. open the raw device.

summary: - eject button not working for video DVDs
+ eject button not working for non-data CDs
Revision history for this message
Martin Pitt (pitti) wrote :

This is way outside the range of what dk-d can control. We either need to fix it in all video players or change the tray locking behaviour in the kernel itself.

affects: devicekit-disks (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu Karmic):
status: In Progress → Triaged
assignee: Martin Pitt (pitti) → nobody
Changed in linux (Ubuntu):
assignee: Martin Pitt (pitti) → nobody
status: In Progress → Triaged
Revision history for this message
Martin Pitt (pitti) wrote :

Confirming that open() doesn't lock the CD-ROM door after

  # echo 0 > /proc/sys/dev/cdrom/lock

I'll mark that as a dupe of bug 397734 now and reopen the kernel task.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.