Score:1

xrandr: differential display scaling causes problems with VLC and VirtualBox (fractals)

br flag

On Ubuntu 20.04, I am using a dual monitor setup, the primary monitor is an HiDPI display (192 dpi; 3840x2160; 60 Hz), while the secondary one has normal resolution (96 dpi; 1920x1200; 60 Hz; rotated upright-left and aligned in position).

Display scaling is set to 200% globally ('Settings' app > 'Display' > 'Scale'), otherwise anything on HiDPI display becomes unreadably small. Now, because I don't want everything to be blown up in size on the secondary (96 dpi) display, I am running the following xrandr command at login (startup applications):

xrandr --output HDMI-0 --primary --mode 3840x2160 --pos 0x0 \
       --scale 1x1  --rotate normal --output DP-2 \
       --mode 1920x1200 --pos 4338x-520 --scale 1.6x1.6 \
       --rotate left

Now the problem: For whatever reason I am running into issues with GUI windows of certain applications, such as VLC and VirtualBox. I do not encounter these issues when using 200% display scaling without the xrandr command. To illustrate:

  • VLC (vers. 3.0.9.2): The application window is displayed correctly... VLC-no playback That is, unless I actually start the playback of a video file. While the audio is playing, and the progress bar is progressing, the actual video is not displayed. Instead I see 3 'fractals' of the player inside a single window. VLC-video playback

  • VirtualBox (vers. v6.1.38_Ubuntu): Instead of the VM overview window, I again see at least 3 'fractals' of the snapshot descriptors inside of a single GUI window. virtualbox

I haven't encountered this issue with other applications so far and I am really scratching my head over this. My 'workaround' at the moment is to disable the secondary display whenever I launch either applications. And then afterwards, re-run the xrandr command. But this is getting a bit tedious...

Has anyone else encountered this issue and/or can provide some insight?

Here some system information for troubleshooting:

uname -ar

Linux user-desktop 5.15.0-52-generic #58~20.04.1-Ubuntu SMP Thu Oct 13 13:09:46 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

sudo lshw -c display

*-display
description: VGA compatible controller product: TU117 [GeForce GTX 1650] vendor: NVIDIA Corporation physical id: 0 bus info: pci@0000:04:00.0 version: a1 width: 64 bits clock: 33MHz capabilities: pm msi pciexpress vga_controller bus_master cap_list rom configuration: driver=nvidia latency=0 resources: irq:137 memory:de000000-deffffff memory:c0000000-cfffffff memory:d0000000-d1ffffff ioport:e000(size=128) memory:df000000-df07ffff

nvidia-smi | grep -i driver

| NVIDIA-SMI 470.141.03 Driver Version: 470.141.03 CUDA Version: 11.4 |

ph flag
I think I have a similar issue as I tried to use `xrandx ...` to setup my screen resolution within a VirtualBox and the scaling factor fails really bad. If I keep the scaling at 1x1, everything is fine. I think that what happens is a difference between the window size and the screen size (some form a mixed up between the two). In other words, the scaling introduce an issue where the screen size is not correctly updated and is thought to be larger than it should be (as if the scaling was still 1x1 when I changed it to 2x2).
LUser avatar
br flag
Dear Alexis, thank you for your comment. To be clear, the issue I described occurs on the host OS, not the guest VM. Perhaps your issue is unrelated?
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.