Bug 398465 - Tray of optical device closes itself when a disc is ejected
Summary: Tray of optical device closes itself when a disc is ejected
Status: CONFIRMED
Alias: None
Product: frameworks-solid
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.70.0
Platform: Arch Linux Linux
: HI normal
Target Milestone: ---
Assignee: Lukáš Tinkl
URL:
Keywords:
: 400944 402164 421506 421725 427174 (view as bug list)
Depends on:
Blocks:
 
Reported: 2018-09-10 16:42 UTC by Patrick Silva
Modified: 2021-05-26 21:23 UTC (History)
13 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2018-09-10 16:42:14 UTC
right click device notifier applet in the system tray
click "Configure removable devices"
uncheck "Enable automatic mounting of removable media" option, click "Ok" button
insert a disc into the optical device
restart computer
start plasma session
eject the disc by pressing device physical button
Result: device tray opens and closes itself.
Tray does not close itself if no disc is inside device while tray is ejected.
Comment 1 Patrick Silva 2018-09-18 16:06:48 UTC
It's not necessary to have a disc into device while plasma session starts.
Just start plasma while "Enable automatic mounting of removable media" option is unchecked in "Removable devices" kcm, insert a disc into the device, wait your system to recognize the disc then eject it. Tray will close automatically after ejecting.
Comment 2 Luca Beltrame 2018-09-19 13:23:49 UTC
I tried the steps presented here with my CD drive and I couldn't reproduce this issue.
Comment 3 Patrick Silva 2018-09-19 13:32:22 UTC
(In reply to Luca Beltrame from comment #2)
> I tried the steps presented here with my CD drive and I couldn't reproduce
> this issue.

What are your plasma and frameworks versions? Which distro are you using?
Comment 4 Luca Beltrame 2018-09-19 13:53:28 UTC
openSUSE with the latest master (unreleased) state of Plasma and Frameworks.
Comment 5 Nate Graham 2018-09-19 15:03:57 UTC
Dr. Chapatin, are you able to reproduce this on Neon dev unstable?
Comment 6 Patrick Silva 2018-09-19 15:31:01 UTC
Hi Nate
I can't test Neon, my laptop's drive is broken.

But I tested OpenSuse Krypton using a live pen drive, the problem did not occur.

Fortunately the following tip from Arch Wiki solved my problem \o/
https://wiki.archlinux.org/index.php/Optical_disc_drive#Disc_tray_autocloses

Thank you all.
Comment 7 Andrew Crouthamel 2018-11-12 18:21:31 UTC
*** Bug 400944 has been marked as a duplicate of this bug. ***
Comment 8 Patrick Silva 2018-12-16 22:56:45 UTC
workaround from Arch wiki solved the problem on my system, but it seems there is something wrong with kde software because the problem was reported again as bug 402164.
Comment 9 Nate Graham 2018-12-16 22:58:24 UTC
*** Bug 402164 has been marked as a duplicate of this bug. ***
Comment 10 Nate Graham 2018-12-18 04:52:34 UTC
Yeah, per 402164, this behavior only happens to a fellow when using KDE software, but not with XFCE. So it may not be purely an upstream issue.
Comment 11 rob.j.proffitt 2019-05-15 04:35:16 UTC
I started experiencing the same problem after I upgraded from Kubuntu 18.04 to Kubuntu 19.04. The archlinux workaround did resolve the issue, though.

Operating System: Kubuntu 19.04
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2
Kernel Version: 5.0.0-15-generic
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-6700 CPU @ 3.40GHz
Memory: 31.3 GiB of RAM
Comment 12 Patrick Silva 2019-07-07 14:30:46 UTC
Yesterday I installed Void Linux on my computer.
This problem persists with such distribution, it occurs
no matter if "Enable automatic mounting of removable media"
is unchecked or checked in "Removable devices" kcm. 
The workaround from comment 6 does not work because Void uses
ruint as init system instead of systemd.

Operating System: void 
KDE Plasma Version: 5.15.5
KDE Frameworks Version: 5.59.0
Qt Version: 5.11.3
Kernel Version: 5.1.16_1
Comment 13 BT 2019-07-31 09:32:28 UTC
I can confirm this issue is also present on Gentoo Linux. The 'Enable automatic mounting of removable media' option is disabled. Pressing the physical eject button causes the tray to open and close immediately. I'm using the workaround from comment 6 until this issue is fixed.

Operating System: Gentoo Linux 
KDE Plasma Version: 5.16.4
KDE Frameworks Version: 5.60.0
Qt Version: 5.12.3
Kernel Version: 4.19.62-gentoo
OS Type: 64-bit
Processors: 4 × Intel® Core™ i5-3570K CPU @ 3.40GHz
Memory: 15.6 GiB of RAM

(In reply to Patrick Silva from comment #12)
> The workaround from comment 6 does not work because Void uses
> ruint as init system instead of systemd.
sysctl has nothing to do with systemd. Just add 'dev.cdrom.autoclose = 0' to /etc/sysctl.conf  and reboot.
Comment 14 Patrick Silva 2019-07-31 13:36:08 UTC
(In reply to BT from comment #13)
> (In reply to Patrick Silva from comment #12)
> > The workaround from comment 6 does not work because Void uses
> > ruint as init system instead of systemd.
> sysctl has nothing to do with systemd. Just add 'dev.cdrom.autoclose = 0' to
> /etc/sysctl.conf  and reboot.

You are right. The workaround also works on Void Linux.
Comment 15 Patrick Silva 2020-05-15 02:02:00 UTC
*** Bug 421506 has been marked as a duplicate of this bug. ***
Comment 16 Patrick Silva 2020-05-18 15:15:51 UTC
*** Bug 421725 has been marked as a duplicate of this bug. ***
Comment 17 Patrick Silva 2020-05-18 15:17:00 UTC
I have reverted the workaround mentioned in comment 6 to test again with newer KDE software.

My settings in "Removable devices" kcm when auto-mounting is enabled:
"Enable automatic mounting of removable media", "Automatically mount all removable media at login"
and "Automatically mount all removable media when attached" options are checked.
"Only automatically mount removable media that have been manually mounted before" is unchcked.

If auto-mounting is enabled, this behavior is reproducible when:
  the optical disc is ejected via device notifier;
  the optical disc is ejected via the "Eject" option of the context menu that opens when we right-click on the optical device under "Removable devices"  section of places panel of Dolphin;
  I run "eject" commnand in Konsole.
  
However, if auto-mounting is enabled this behavior is NOT reproducible when I eject the disc by pressing the physical "eject" button of the optical device.

If auto-mounting is disabled, this behavior is reproducible when:
  I press the physical "eject" button of the optical device;
  the optical disc is ejected via the "Eject" option of the context menu that opens when we right-click on the optical device under "Removable devices"  section of places panel of Dolphin;
  I run "eject" commnand in Konsole.
  
It's impossible to eject a disc via device notifier when auto-mounting is disabled.
We only can mount the disc.

Operating System: Arch Linux 
KDE Plasma Version: 5.18.90
KDE Frameworks Version: 5.70.0
Qt Version: 5.15.0 rc2
Kernel Version: 5.6.13-arch1-1
Comment 18 proteus5 2020-08-20 13:30:33 UTC
(In reply to Patrick Silva from comment #17)
> I have reverted the workaround mentioned in comment 6 to test again with
> newer KDE software.
> 
> My settings in "Removable devices" kcm when auto-mounting is enabled:
> "Enable automatic mounting of removable media", "Automatically mount all
> removable media at login"
> and "Automatically mount all removable media when attached" options are
> checked.
> "Only automatically mount removable media that have been manually mounted
> before" is unchcked.
> 
> If auto-mounting is enabled, this behavior is reproducible when:
>   the optical disc is ejected via device notifier;
>   the optical disc is ejected via the "Eject" option of the context menu
> that opens when we right-click on the optical device under "Removable
> devices"  section of places panel of Dolphin;
>   I run "eject" commnand in Konsole.
>   
> However, if auto-mounting is enabled this behavior is NOT reproducible when
> I eject the disc by pressing the physical "eject" button of the optical
> device.
> 
> If auto-mounting is disabled, this behavior is reproducible when:
>   I press the physical "eject" button of the optical device;
>   the optical disc is ejected via the "Eject" option of the context menu
> that opens when we right-click on the optical device under "Removable
> devices"  section of places panel of Dolphin;
>   I run "eject" commnand in Konsole.
>   
> It's impossible to eject a disc via device notifier when auto-mounting is
> disabled.
> We only can mount the disc.
> 
> Operating System: Arch Linux 
> KDE Plasma Version: 5.18.90
> KDE Frameworks Version: 5.70.0
> Qt Version: 5.15.0 rc2
> Kernel Version: 5.6.13-arch1-1

Is there or not a solution to this wrong behavior?
The solution is SIMPLE. The developers have to separate the unmount function from the EJECT FUNCTION otherwise the system doesn't distinguish between the two operations.
Comment 19 proteus5 2020-10-28 15:36:06 UTC
The optical drive still does not work properly.
Comment 20 Nate Graham 2020-11-28 20:02:49 UTC
*** Bug 427174 has been marked as a duplicate of this bug. ***
Comment 21 Nate Graham 2020-11-28 20:05:19 UTC
Can confirm with my hardware, though I found a workaround that works: run `sysctl -w dev.cdrom.autoclose=0`

However apparently this does not work for everyone. Raising the priority since this makes optical drives intensely frustrating to use.
Comment 22 Matevž Jekovec 2021-02-17 08:20:24 UTC
Confirming this bug in updated KUbuntu 20.04. Workaround from comment 6 https://bugs.kde.org/show_bug.cgi?id=398465#c6 works.