Bug 452382

Summary: KScreen turns my monitor back on after "xset dpms force off"
Product: [Plasma] KScreen Reporter: Danilo Luvizotto <danilo.luvizotto>
Component: commonAssignee: kscreen-bugs-null <kscreen-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: minor CC: alvaro.carroz, eugene.shalygin+bugzilla.kde, nate, qydwhotmail
Priority: NOR    
Version: 5.24.4   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Plasma KDED journal
Plasma KScreen journal

Description Danilo Luvizotto 2022-04-07 21:53:02 UTC
SUMMARY
I have a laptop with the lid closed connected to an external monitor. Whenever the monitor is suspended, kscreen will turn it back on after a few seconds.


STEPS TO REPRODUCE
1. Make sure "KScreen 2" is running in the "Background Services" kcm
2. run "xset dpms force off" and touch nothing more

OBSERVED RESULT
The monitor will go black for a few seconds and back on

EXPECTED RESULT
The monitor should turn off and not back on without user interaction

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 5.24.4-1
KDE Frameworks Version: 5.92.0-1
Qt Version: 5.15.3+kde+r137-1

ADDITIONAL INFORMATION

STEPS TO **NOT** REPRODUCE
1. Disable "KScreen 2" in the "Background Services" kcm
2. run "xset dpms force off" and touch nothing more

OBSERVED RESULT (FOR THE HOW TO **NOT** REPRODUCE CASE)
The monitor will turn off and stay off until I touch the mouse or keyboard

The laptop is a Slimbook KDE.
The monitor is a Mi Curved Gaming Monitor 34"

I also have another laptop connected to this monitor running the same versions of everything which won't have the problem. This other laptop is a Dell Precision 5760.
Comment 1 Danilo Luvizotto 2022-04-07 21:57:11 UTC
Created attachment 148036 [details]
Plasma KDED journal

Attaching output of:
journalctl --user -b -u plasma-kded | grep kscreen > plasma-kded-journal.txt
Comment 2 Danilo Luvizotto 2022-04-07 21:59:01 UTC
Created attachment 148037 [details]
Plasma KScreen journal

Output of:
journalctl --user -b -u plasma-kscreen > plasma-kscreen-journal.txt
Comment 3 Eugene Shalygin 2022-05-28 12:17:17 UTC
Same problem on Gentoo with:

Operating System: Gentoo Linux 2.8
KDE Plasma Version: 5.24.5
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4
Kernel Version: 5.18.0-gentoo (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 9 5900HX with Radeon Graphics
Memory: 62.3 GiB of RAM
Graphics Processor: AMD RENOIR
Comment 4 Eugene Shalygin 2022-06-05 20:34:22 UTC
https://gitlab.freedesktop.org/drm/amd/-/issues/662
Comment 5 Danilo Luvizotto 2022-06-06 18:19:16 UTC
(In reply to Eugene Shalygin from comment #4)
> https://gitlab.freedesktop.org/drm/amd/-/issues/662

I'm running linux 5.18.1 and still experience the problem every time I suspend my external monitor.

Also, please notice in the original description: the problem only occurs when "KScreen 2" is enabled in kcm's background services. It does not happen if KScreen 2 is disabled. Thus, it is probably not a kernel problem.
Comment 6 Eugene Shalygin 2022-06-06 18:51:08 UTC
I am on 5.18.1 as well and experienced the same problem. Disabling automatic input selection in my screen settings helped. You can check X log for the events screens produce.
Comment 7 Danilo Luvizotto 2022-06-06 19:11:48 UTC
(In reply to Eugene Shalygin from comment #6)
> I am on 5.18.1 as well and experienced the same problem. Disabling automatic
> input selection in my screen settings helped. You can check X log for the
> events screens produce.

Thank you for your tip. How do I disable automatic input selection? Can't find it.
Comment 8 Eugene Shalygin 2022-06-06 19:21:06 UTC
(In reply to Danilo Luvizotto from comment #7)
> Thank you for your tip. How do I disable automatic input selection? Can't
> find it.

Sorry, I don't know. Watched video [1] and saw no obvious option. My screens are much more primitive, they provide a straightforward option "Input auto switch".

https://www.youtube.com/watch?v=TjhH1o1Ygms
Comment 9 Danilo Luvizotto 2022-06-06 19:25:27 UTC
(In reply to Eugene Shalygin from comment #8)
> (In reply to Danilo Luvizotto from comment #7)
> > Thank you for your tip. How do I disable automatic input selection? Can't
> > find it.
> 
> Sorry, I don't know. Watched video [1] and saw no obvious option. My screens
> are much more primitive, they provide a straightforward option "Input auto
> switch".
> 
> https://www.youtube.com/watch?v=TjhH1o1Ygms

Oh, you mean in the monitor itself. Thank you for even searching for a video of my monitor model.

I'm afraid my monitor doesn't have that option, so I'm helpless for now.
Comment 10 Danilo Luvizotto 2022-06-06 19:29:24 UTC
I've run the following command to check if there were input events waking up my monitor, and I get an event from "Virtual core XTEST pointer" only when KScreen 2 is enabled:

sleep 3 && xinput test-xi2 --root
⎡ Virtual core pointer                          id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ Logitech M720 Triathlon                   id=10   [slave  pointer  (2)]
⎜   ↳ MX Keys Mini Keyboard                     id=17   [slave  pointer  (2)]
⎜   ↳ MX Keys Mini Keyboard                     id=16   [slave  pointer  (2)]
⎜   ↳ UNIW0001:00 093A:0255 Touchpad            id=14   [slave  pointer  (2)]
⎣ Virtual core keyboard                         id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ Sleep Button                              id=9    [slave  keyboard (3)]
    ↳ Logitech Webcam C925e                     id=11   [slave  keyboard (3)]
    ↳ HD Webcam: HD Webcam                      id=12   [slave  keyboard (3)]
    ↳ HD Webcam: IR Camera                      id=13   [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=15   [slave  keyboard (3)]
    ↳ Logitech M720 Triathlon                   id=18   [slave  keyboard (3)]
    ↳ MX Keys Mini Keyboard                     id=19   [slave  keyboard (3)]
    ↳ MX Keys Mini Keyboard                     id=20   [slave  keyboard (3)]
EVENT type 1 (DeviceChanged)
    device: 2 (4)
    reason: SlaveSwitch
        Reporting 3 classes:
                Class originated from: 4. Type: XIButtonClass
                Buttons supported: 10
                Button labels: "Button Left" "Button Middle" "Button Right" "Button Wheel Up" "Button Wheel Down" "Button Horiz Wheel Left" "Button Horiz Wheel Right" None None None
                Button state:
                Class originated from: 4. Type: XIValuatorClass
                Detail for Valuator 0:
                  Label: Rel X
                  Range: -1.000000 - -1.000000
                  Resolution: 0 units/m
                  Mode: relative
                Class originated from: 4. Type: XIValuatorClass
                Detail for Valuator 1:
                  Label: Rel Y
                  Range: -1.000000 - -1.000000
                  Resolution: 0 units/m
                  Mode: relative

EVENT type 6 (Motion)
    device: 4 (4)
    detail: 0
    flags:
    root: 1919.00/1079.00
    event: 1919.00/1079.00
    buttons:
    modifiers: locked 0x10 latched 0 base 0 effective: 0x10
    group: locked 0 latched 0 base 0 effective: 0
    valuators:
        0: 1919.00
        1: 1079.00
    windows: root 0x6d7 event 0x6d7 child 0x5e00022
Comment 11 Fushan Wen 2022-06-07 16:16:56 UTC
Can reproduce
Comment 12 Nate Graham 2022-11-08 19:31:03 UTC
In general, when using kscreen, the kscreen-doctor command line is the preferred way to manipulate screens.
Comment 13 Nate Graham 2022-11-08 19:36:08 UTC
Ah actually this manifests elsewhere with supported workflows in powerdevil too. See Bug 413618.

*** This bug has been marked as a duplicate of bug 413618 ***