Score:0

after upgrade to Ubuntu 21.10: screen not reawakening from sleep when set with xrandr

it flag

Since I upgraded from Ubuntu 21.04 to 21.10, my screen doesn't turn back on when reawakening my desktop PC from sleep mode. I then have to perform a hard reset to get my PC into working order again.

I use xrandr to switch between a single and dual monitors, so I thought maybe that causes the issue. And indeed, when I set the display settings through the GUI (Settings -> Displays) instead of using xrandr, it works*, i.e. the display wakes up from sleep normally. NOT THE CASE ANYMORE, see edit.

However, as soon as I set the display settings with xrandr, I will be faced with a black screen when waking the PC back up from sleep mode.

I use xrandr, because I can't switch between dual and single displays using Super+P (options are "Mirror", "Join Displays", "External Only", and "Built-in Only", but all three latter options activate both displays). Therefore I'd like to keep using it or find an alternative.

Here are my scripts for switching:

"single.sh":

#!/bin/sh
xrandr --output DVI-I-0 --off --output DVI-I-1 --off --output DP-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-0 --off --output DVI-D-0 --off

"dual.sh":

#!/bin/sh
xrandr --output DVI-I-0 --off --output DVI-I-1 --off --output DP-0 --primary --mode 1920x1080 --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-0 --off --output DVI-D-0 --mode 1600x1200 --pos 1920x46 --rotate normal

"toggle.sh":

#!/bin/bash

TOGGLE=$HOME/.screenlayout/.toggle
DIR=$(dirname "$0")

if [ ! -e $TOGGLE ]; then
    touch $TOGGLE
    $DIR/single.sh
else
    rm $TOGGLE
    $DIR/dual.sh
fi

*EDIT: It worked with a single display, but I still wanted to test it for dual displays. But while I was writing my question, an update to the nvidia drivers was released, so I thought that maybe that'll fix the whole thing. However, instead, now it doesn't work even with a single display anymore. Now sleep mode means hard reset. Removed the xrandr tag for that reason.

EDIT2: My system: Ryzen 2700, GeForce 950. Output of lspci -v | grep -i vga: 0a:00.0 VGA compatible controller: NVIDIA Corporation GM206 [GeForce GTX 950] (rev a1) (prog-if 00 [VGA controller])

kanehekili avatar
zw flag
Well, you've updated your nvidia drivers. Maybe they do not support your card on this driver. But a black screen after sleep is a hint that your driver does not work correctly. What is the output of `lspci -v | grep -i vga` ? Post it into your question ...
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.