CD drive eject button does not work

Bug #890592 reported by Feathertail
74
This bug affects 16 people
Affects Status Importance Assigned to Milestone
Nautilus
Unknown
Medium
linux (Ubuntu)
Invalid
Medium
Unassigned
systemd (Debian)
Fix Released
Unknown
udev (Ubuntu)
Fix Released
High
Martin Pitt

Bug Description

PROBLEM

On my laptop, pressing the hardware "eject" button on the DVD drive will pop out the disc, but it will still be treated as mounted by Nautilus. If I then put in another disc, it will still think that the files from the previous disc are there, as though it had not been ejected. This produces an error when I try to manipulate those files.

I can't access the files from the new disc until I eject the old one using the button on Nautilus.

HOW TO REPRODUCE

1. Put a CD or DVD in the drive, close it, and let Nautilus mount it.
2. Eject it using the hardware eject key.
3. Put in a new CD or DVD.

EXPECTED BEHAVIOR

Nautilus will know when I ejected a disc.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: nautilus 1:3.2.1-0ubuntu2
ProcVersionSignature: Ubuntu 3.0.0-12.20-generic 3.0.4
Uname: Linux 3.0.0-12-generic i686
ApportVersion: 1.23-0ubuntu4
Architecture: i386
Date: Tue Nov 15 03:58:34 2011
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release i386 (20111012)
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: nautilus
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Feathertail (feathertail-deactivatedaccount) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in nautilus (Ubuntu):
status: New → Confirmed
Revision history for this message
Bilal Shahid (s9iper1) wrote :

100% confirm behaviour i have also seen this issue many times and able to reproduce it.i have send this bug to upstream.
thanks

Changed in nautilus (Ubuntu):
status: Confirmed → Triaged
importance: Undecided → Low
Changed in nautilus:
importance: Unknown → Medium
status: Unknown → New
Revision history for this message
Sebastien Bacher (seb128) wrote :

Confirmed on precise on my laptop, some infos:
- the disk stay in the ui
- the directory is still in /media and I can still ls it without issue after ejecting the disk
- udisks --dump lists the disk as mounted still

Martin, do you have any clue if that's udisks, udev or the kernel to blame?

affects: nautilus (Ubuntu) → udisks (Ubuntu)
Changed in udisks (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Low → High
Changed in nautilus:
status: New → Unknown
Revision history for this message
Martin Pitt (pitti) wrote :

The first reason is that our current kernel package seems to have the "block" module built in now, so the udev rule which is meant to set the default in-kernel polling value doesn't work:

ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_poll_msecs}=="0", ATTR{parameters/events_dfl_poll_msecs}="2000"

This requires a sysctl.d setting now. Will add to udev package.

However, even when I set the polling interval manually, the kernel still doesn't emit an eject_request uevent, even though it claims to:

$ cat /sys/block/sr0/events
media_change eject_request

I still need to investigate that.

affects: udisks (Ubuntu) → udev (Ubuntu)
Changed in udev (Ubuntu):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package udev - 175-0ubuntu4

---------------
udev (175-0ubuntu4) precise; urgency=low

  * Add builtin-block-polling.patch: Set default polling interval on CD drives
    as well. The events_dfl_poll_msecs will not trigger if "block" is not a
    module, but built in. This will avoid udisks etc. having to poll from
    userspace, and provide proper ejection when the hardware eject button is
    pressed. (LP: #890592)
  * Add 00git-keymaps.patch: Backport keymaps from current git master.
    (LP: #901513, #902332, #902798, #914838, #922405)
  * Add 00git-persistent-net-xen.patch: 75-persistent-net-generator.rules: Add
    Xen. (LP: #897789)
 -- Martin Pitt <email address hidden> Mon, 06 Feb 2012 09:17:28 +0100

Changed in udev (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

The second half of the bug is that the kernel does not send an EJECT_REQUEST uevent any more when the hardware button is pressed. That definitively used to work in the past, but apparently something changed. I'll have a closer look at this.

Changed in linux (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
importance: Undecided → Medium
status: New → In Progress
summary: - Ejecting a CD or DVD manually does not unmount it
+ CD drive eject button does not work
Martin Pitt (pitti)
Changed in linux (Ubuntu):
assignee: Martin Pitt (pitti) → nobody
status: In Progress → Confirmed
sghpunk (sgh-mail)
tags: added: kernel-bug precise quantal udisks
tags: removed: i386 running-unity
Revision history for this message
sghpunk (sgh-mail) wrote :

I use xubuntu 12.04 with 3.5.0-22 kernel

$ uname -a
Linux Acer 3.5.0-22-generic #34~precise1-Ubuntu SMP Wed Jan 9 21:45:40 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

I found that kernel polling does not work with some optical drives, even if I do:
echo 2000 > /sys/block/sr?/events_poll_msecs
echo 2000 > /sys/module/block/parameters/events_dfl_poll_msecs

I can't eject my embedded notebook drive (ID_SERIAL=HL-DT-STDVDRAM_GT31N_KZLAC5D2847) with eject button, but eject /dev/sr0 is working, and eject -i 0 /dev/sr0 is working to.
And no udev events is generated while pressing eject button.

I test this with external USB drive to (ID_SERIAL=TS8XDVDR_Transcend_613143333435363738394B4C-0:0).
But with this drive eject button is working, and udev events is generated.

Ok, but I found more. With those external USB drive eject button stops working while disk is mounted. And while disk is mounted udev receive no eject event from drive eject button. But if I unmount disk by hands after pressing drive eject button, drive ejects itself (and udev receive change event). Seems like while disk is mounted, kernel eject event is waits in some kind of queue.

For workaround I was trying to restore udisks polling (11.04 behavior) writing some udev rules to set ATTR{events_poll_msecs}="-1" and disable tray locking on my devices. It's working, udisks polling is enabled, but again while disk is mounted I can eject it with drive eject button, but no udisks/udev events is generated, and no unmount is performed, I have to unmount it manually.

I even cannot enable old udisks behavior that was working fine for me in 11.04.

Fix it please! Two years is passed.

tags: added: apport-collected
Revision history for this message
sghpunk (sgh-mail) wrote : apport information

AlsaVersion: Advanced Linux Sound Architecture Driver Version 1.0.25.
ApportVersion: 2.0.1-0ubuntu15
Architecture: amd64
ArecordDevices:
 **** List of CAPTURE Hardware Devices ****
 card 0: SB [HDA ATI SB], device 0: ALC271X Analog [ALC271X Analog]
   Subdevices: 1/1
   Subdevice #0: subdevice #0
Card0.Amixer.info:
 Card hw:0 'SB'/'HDA ATI SB at 0xd8500000 irq 16'
   Mixer name : 'Realtek ALC271X'
   Components : 'HDA:10ec0269,10250362,00100100'
   Controls : 27
   Simple ctrls : 13
Card1.Amixer.info:
 Card hw:1 'Generic'/'HD-Audio Generic at 0xd8120000 irq 44'
   Mixer name : 'ATI R6xx HDMI'
   Components : 'HDA:1002aa01,00aa0100,00100200'
   Controls : 6
   Simple ctrls : 1
Card1.Amixer.values:
 Simple mixer control 'IEC958',0
   Capabilities: pswitch pswitch-joined penum
   Playback channels: Mono
   Mono: Playback [on]
DistroRelease: Ubuntu 12.04
HibernationDevice: RESUME=UUID=5f85b9fb-8f2f-483b-99f7-d02745769e7a
InstallationMedia: Xubuntu 12.04.1 LTS "Precise Pangolin" - Release amd64 (20120817.3)
MachineType: Acer Aspire 5553G
MarkForUpload: True
NonfreeKernelModules: fglrx
Package: linux (not installed)
ProcFB: 0 VESA VGA
ProcKernelCmdLine: BOOT_IMAGE=/@/boot/vmlinuz-3.5.0-22-generic root=UUID=9b0e75d9-63f8-4a56-a9c6-09231d0c70eb ro rootflags=subvol=@ ipv6.disable=1 apparmor=0 cdrom.lockdoor=0
ProcVersionSignature: Ubuntu 3.5.0-22.34~precise1-generic 3.5.7.2
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No PulseAudio daemon running, or not running as session daemon.
RelatedPackageVersions:
 linux-restricted-modules-3.5.0-22-generic N/A
 linux-backports-modules-3.5.0-22-generic N/A
 linux-firmware 1.79.1
Tags: precise
Uname: Linux 3.5.0-22-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups: adm audio cdrom dialout dip fuse lpadmin netdev plugdev sambashare scanner sudo vboxusers video
dmi.bios.date: 04/25/2011
dmi.bios.vendor: Phoenix Technologies LTD
dmi.bios.version: V1.23
dmi.board.name: JV51_DN
dmi.board.vendor: Acer
dmi.board.version: Not Applicable
dmi.chassis.type: 10
dmi.chassis.vendor: Acer
dmi.chassis.version: N/A
dmi.modalias: dmi:bvnPhoenixTechnologiesLTD:bvrV1.23:bd04/25/2011:svnAcer:pnAspire5553G:pvrNotApplicable:rvnAcer:rnJV51_DN:rvrNotApplicable:cvnAcer:ct10:cvrN/A:
dmi.product.name: Aspire 5553G
dmi.product.version: Not Applicable
dmi.sys.vendor: Acer

Revision history for this message
sghpunk (sgh-mail) wrote : AcpiTables.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : AlsaDevices.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : AplayDevices.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : AudioDevicesInUse.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : BootDmesg.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : CRDA.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : Card0.Amixer.values.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : Card0.Codecs.codec.0.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : Card1.Codecs.codec.0.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : CurrentDmesg.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : IwConfig.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : Lspci.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : Lsusb.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : PciMultimedia.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : ProcEnviron.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : ProcInterrupts.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : ProcModules.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : RfKill.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : UdevDb.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : UdevLog.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : UserAsoundrc.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote : WifiSyslog.txt

apport information

Revision history for this message
sghpunk (sgh-mail) wrote :

As a temporary workaround I installed udisks_1.0.2-4ubuntu2_amd64.deb from https://launchpad.net/ubuntu/natty/amd64/udisks/1.0.2-4ubuntu2
and disabled cdrom tray locking/kernel polling in udev rules.
And now it is work fine, like was in 11.04. Eject button is ejecting and udisks-daemon is auto unmounting disk after eject.

Revision history for this message
Alexander (lxandr) wrote :

Confirming this!
Ain't working normally in Ubuntu quantal (12.10) too!

tested on:
SONY DVD RW AW-G170A
Optiarc DVD RW AD-7560A
HL-DT-ST DVDRAM GE20NU10 (usb)

When I'm inserting or ejecting disc, I can see events:

$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

# inserting disc

KERNEL[90.080692] change /devices/pci0000:00/0000:00:06.0/ata1/host1/target1:0:0/1:0:0:0/block/sr0 (block)
UDEV [91.836687] change /devices/pci0000:00/0000:00:06.0/ata1/host1/target1:0:0/1:0:0:0/block/sr0 (block)

# ejecting disc

KERNEL[100.320951] change /devices/pci0000:00/0000:00:06.0/ata1/host1/target1:0:0/1:0:0:0/block/sr0 (block)
KERNEL[103.333248] change /devices/pci0000:00/0000:00:06.0/ata1/host1/target1:0:0/1:0:0:0/block/sr0 (block)
UDEV [103.454487] change /devices/pci0000:00/0000:00:06.0/ata1/host1/target1:0:0/1:0:0:0/block/sr0 (block)
UDEV [103.519527] change /devices/pci0000:00/0000:00:06.0/ata1/host1/target1:0:0/1:0:0:0/block/sr0 (block)

But, when the disc is getting mounted, I can't nor eject it with drive's eject button nor see events:

$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

Nothing! Silence!

I've tryed also with latest kernel from ppa. No changes.

$ LANG=en_US apt-cache policy linux-image-generic
linux-image-generic:
  Installed: 3.5.0.17.19
  Candidate: 3.5.0.22.27pre201212150400
  Version table:
     3.5.0.22.27pre201212150400 0
        500 http://ppa.launchpad.net/kernel-ppa/pre-proposed/ubuntu/ quantal/main amd64 Packages
     3.5.0.21.27 0
        500 http://ua.archive.ubuntu.com/ubuntu/ quantal-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu/ quantal-security/main amd64 Packages
 *** 3.5.0.17.19 0
        500 http://ua.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages
        100 /var/lib/dpkg/status

$ LANG=en_US apt-cache policy udev
udev:
  Installed: 175-0ubuntu13
  Candidate: 175-0ubuntu13
  Version table:
 *** 175-0ubuntu13 0
        500 http://ua.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Aaron (aaronuk5) wrote :

Hello. I can also confirm this on ubuntu 13.10.

When I put in a dvd (The Avengers for example) it is mounted as - /media/ukbeast/MARVELS_THE_AVENGERS
when I press eject on my ata-Slimtype_DVD_A_DS8A8SH_3208583_632219412703 dvd ejects but the dvd is still mounted as
/media/ukbeast/MARVELS_THE_AVENGERS.

I find it annoying because I use leawo bluray player for my dvds using wine beacuse the sound seems better than VLC and I have to close and open the software to unmount the dvd in nautilus, so that wine can pass the mount information to leawo.

Revision history for this message
el_calavera (simon-hebel) wrote :

I can confirm this bug still exists in 13.10.

On my current machine, it has existed for years now, but it does not seem to be a problem on other machines I have.

Maybe this is an old broken setting that is never deleted during upgrades? (I haven't done a reinstall since 10.04, only upgrades).
Could there be a way to tell the system to "re-configure" the cdrom drive to get rid of this behaviour?

Revision history for this message
penalvch (penalvch) wrote :
Changed in linux (Ubuntu):
status: Confirmed → Invalid
Changed in systemd (Debian):
status: Unknown → Fix Committed
Changed in systemd (Debian):
status: Fix Committed → Fix Released
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.