You are not logged in.

#1 2020-04-14 14:58:35

gen2arch
Member
Registered: 2013-05-16
Posts: 206

Enormous lag in all of X especially with multimedia apps (mpv webcams)

Hi,

I attached two visualizers via usb to my laptop which is a lenovo quadcore xeon mobile workstation with nvidia Quadro M2000M (Gm107GLM) graphics adapter, on a 4k display and 64GB of RAM.

Whenever I start guvcview (v 2.0.6-4) a horrible lag results in the entire windowing system, Desktop and every keyboard input is like frozen for a couple of seconds; same thing when exiting the program; during usage of the program fans are turning like crazy.

As this is a rather beefy machine, I was wondering if this is normal behavior with webcam-like hardware, or if something else goes wrong here?

Can anyone help,

thanks.

Last edited by gen2arch (2020-04-14 21:47:22)

Offline

#2 2020-04-14 21:43:56

gen2arch
Member
Registered: 2013-05-16
Posts: 206

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

I guess I'm seeing exactly the behavior described here: https://bbs.archlinux.org/viewtopic.php … 5#p1897945, and perhaps this and this .
Sluggish X performance, mpv performs extremely bad, core temperature rising to 128 C°!! at one moment leading to a shutdown of the computer.

I also have nvidia-dkms version 440.82-1 and kernel 5.6.3.arch1-1.

What's going on here, is there a general regression wrt nvidia/latest kernel?

Last edited by gen2arch (2020-04-14 21:55:10)

Offline

#3 2020-04-15 07:16:40

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,064

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

No issues here, post relevant logs xorg/dmesg/glxinfo/mpv output it also doesn't really read like "same behaviour" you specifically do something "out of the ordinary" to trigger this, it isn't even yet clear whether the nvidia card is involved at all in your particular case.

Last edited by V1del (2020-04-15 07:18:31)

Offline

#4 2020-04-15 13:04:17

gen2arch
Member
Registered: 2013-05-16
Posts: 206

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

V1del wrote:

No issues here, post relevant logs xorg/dmesg/glxinfo/mpv output it also doesn't really read like "same behaviour" you specifically do something "out of the ordinary" to trigger this, it isn't even yet clear whether the nvidia card is involved at all in your particular case.

Do you mean connecting the visualizers to be "out of the ordinary"? I realized (via usbtop) that by using these two cameras at the same time I get about 150Mb/s of raw USB traffic from devices, but I don't think thats a problem.
In fact from a users point of view, symptoms are quite similar to the ones cited: near freeze, very high fan speed, involving graphic intensive apps (guvcview, obs studio, mpv, vlc; mplayer, interestingly, much less so!)
What info exactly would I have to provide, as there is nothing special in the journal when this is happening.
And: how can I determine if the problem -- e.g. considerable lag between audio and video -- already occurs while capturing a video stream (with guvcview) or only at playback (mpv etc)?
Thanks

Offline

#5 2020-04-15 20:46:09

gen2arch
Member
Registered: 2013-05-16
Posts: 206

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

I realized that the freezing effect seems to result from the process

/usr/bin/kwin_x11 -session

which is using for a couple of seconds 100% of cpu after exiting a graphic intensive program. I have no idea if this peak is normal, I don't think so, never realized this behavior before.

Offline

#6 2020-04-16 12:12:48

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,806

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

What is your WM/DE ?

X or wayland ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#7 2020-04-16 19:41:35

gen2arch
Member
Registered: 2013-05-16
Posts: 206

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

Lone_Wolf wrote:

What is your WM/DE ?

X or wayland ?

It is X, with qt5-base version 5.14.2-1,  KDE plasma-desktop version 5.18.4.1-1 and KDE Frameworks version 5.69.0-1.

Offline

#8 2020-04-17 18:20:43

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,806

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

Are you using guvcview (gtk based) or guvcview-qt (qt based) ?
If guvcview , does switching to the qt variant help ?

Compositing may play a role, try running with a non-compositing windowmanager like openbox to see if that makes a difference.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#9 2020-04-19 19:16:31

gen2arch
Member
Registered: 2013-05-16
Posts: 206

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

Lone_Wolf wrote:

Are you using guvcview (gtk based) or guvcview-qt (qt based) ?
If guvcview , does switching to the qt variant help ?

Compositing may play a role, try running with a non-compositing windowmanager like openbox to see if that makes a difference.

Thanks: this was indeed very relevant!

First: I always use guvcview gtk based; guvcview-qt dumps core immediately after start up, dont know why, even on a freshly checked out and compiled version of the program.

Second: yes! this made a very noticable, almost huge difference. I disabled compositing in plasma (Settings > Display and Monitor > Compositor: uncheck "enable compositor on startup"; killed X relogged in and: almost all of the lag on the desktop was gone! Very much less fan activity, and zero cpu peak upon starting up and leaving guvcview!

So what does this mean? Is this caused by the current combination of kernel 5.6.3.arch1-1 and nvidia-dkms version 440.82-1? If I remember correctly (and unusual fan activity is something one remarks immediately) it wasn't like that before the latest update. Never had any issues with compositing.

What could I do to investigate further?

Last edited by gen2arch (2020-04-19 19:18:00)

Offline

#10 2020-04-19 19:50:46

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,064

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

Can you post

glxinfo -B
qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation #Needs qt5-tools

this sounds like your acceleration in general is broken. It might of course still be some weird quadro specific regression.

Last edited by V1del (2020-04-19 19:52:05)

Offline

#11 2020-04-19 20:01:26

gen2arch
Member
Registered: 2013-05-16
Posts: 206

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

V1del wrote:

Can you post

glxinfo -B
qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation #Needs qt5-tools

this sounds like your acceleration in general is broken. It might of course still be some weird quadro specific regression.

Here it is:

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 4096 MB
    Total available memory: 4096 MB
    Currently available dedicated video memory: 3074 MB
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: Quadro M2000M/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 440.82
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6.0 NVIDIA 440.82
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 440.82
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

and:

qdbus org.kde.KWin /KWin org.kde.KWin.supportInformation                                                                                                   
KWin Support Information:
The following information should be used when requesting support on e.g. https://forum.kde.org.
It provides information about the currently running instance, which options are used,
what OpenGL driver and which effects are running.
Please post the information provided underneath this introductory text to a paste bin service
like https://paste.kde.org instead of pasting into support threads.

==========================

Version
=======
KWin version: 5.18.4
Qt Version: 5.14.2
Qt compile version: 5.14.2
XCB compile version: 1.14

Operation Mode: X11 only

Build Options
=============
KWIN_BUILD_DECORATIONS: yes
KWIN_BUILD_TABBOX: yes
KWIN_BUILD_ACTIVITIES: yes
HAVE_DRM: yes
HAVE_GBM: yes
HAVE_EGL_STREAMS: yes
HAVE_X11_XCB: yes
HAVE_EPOXY_GLX: yes
HAVE_WAYLAND_EGL: yes

X11
===
Vendor: The X.Org Foundation
Vendor Release: 12008000
Protocol Version/Revision: 11/0
SHAPE: yes; Version: 0x11
RANDR: yes; Version: 0x14
DAMAGE: yes; Version: 0x11
Composite: yes; Version: 0x4
RENDER: yes; Version: 0xb
XFIXES: yes; Version: 0x50
SYNC: yes; Version: 0x31
GLX: yes; Version: 0x0

Decoration
==========
Plugin: org.kde.kwin.aurorae
Theme: __aurorae__svg__Arc-Dark
Plugin recommends border size: No
Blur: 1
onAllDesktopsAvailable: true
alphaChannelSupported: false
closeOnDoubleClickOnMenu: false
decorationButtonsLeft: 0, 2
decorationButtonsRight: 6, 3, 4, 5
borderSize: 3
gridUnit: 12
font: Noto Sans,10,-1,5,50,0,0,0,0,0,Regular
smallSpacing: 3
largeSpacing: 12

Platform
==========
Name: KWin::X11StandalonePlatform

Options
=======
focusPolicy: 1
nextFocusPrefersMouse: false
clickRaise: true
autoRaise: true
autoRaiseInterval: 250
delayFocusInterval: 300
shadeHover: false
shadeHoverInterval: 250
separateScreenFocus: false
placement: 6
focusPolicyIsReasonable: true
borderSnapZone: 10
windowSnapZone: 10
centerSnapZone: 0
snapOnlyWhenOverlapping: false
rollOverDesktops: true
focusStealingPreventionLevel: 0
operationTitlebarDblClick: 5009
operationMaxButtonLeftClick: 5000
operationMaxButtonMiddleClick: 5015
operationMaxButtonRightClick: 5014
commandActiveTitlebar1: 0
commandActiveTitlebar2: 28
commandActiveTitlebar3: 2
commandInactiveTitlebar1: 4
commandInactiveTitlebar2: 28
commandInactiveTitlebar3: 2
commandWindow1: 7
commandWindow2: 8
commandWindow3: 8
commandWindowWheel: 28
commandAll1: 10
commandAll2: 3
commandAll3: 14
keyCmdAllModKey: 16777251
showGeometryTip: true
condensedTitle: false
electricBorderMaximize: false
electricBorderTiling: true
electricBorderCornerRatio: 0.25
borderlessMaximizedWindows: false
killPingTimeout: 5000
hideUtilityWindowsForInactive: true
compositingMode: 1
useCompositing: false
hiddenPreviews: 1
glSmoothScale: 2
xrenderSmoothScale: false
maxFpsInterval: 16666666
refreshRate: 0
vBlankTime: 6000000
glStrictBinding: true
glStrictBindingFollowsDriver: true
glCoreProfile: false
glPreferBufferSwap: 97
glPlatformInterface: 1
windowsBlockCompositing: true

Screen Edges
============
desktopSwitching: false
desktopSwitchingMovingClients: false
cursorPushBackDistance: 1x1
timeThreshold: 150
reActivateThreshold: 350
actionTopLeft: 0
actionTop: 0
actionTopRight: 0
actionRight: 0
actionBottomRight: 0
actionBottom: 0
actionBottomLeft: 0
actionLeft: 0

Screens
=======
Multi-Head: no
Active screen follows mouse:  no
Number of Screens: 1

Screen 0:
---------
Name: DP-3.1
Geometry: 0,0,3840x2160
Scale: 1
Refresh Rate: 59.996


Compositing
===========
Compositing is not active

Last edited by gen2arch (2020-04-19 20:03:05)

Offline

#12 2020-04-20 09:04:51

gen2arch
Member
Registered: 2013-05-16
Posts: 206

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

V1del wrote:

this sounds like your acceleration in general is broken.

Yes, given the overall symptoms of my actual desktop, this could be the case; especially with programs lik OBS Studio, I have the impression that they run with a constant, non regular lag.
How can I check if acceleration actually works?
Thanks.

Offline

#13 2020-04-20 09:32:06

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,064

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

glxinfo tells us that at least the OpenGL  acceleration should be here and is using the correct driver. So this really might be a nvidia 440.82 <-> quadro bug (I don't have any issues on a Geforce Titan X)  I'd say do try a kernel/nvidia/nvidia-utils downgrade

Offline

#14 2020-04-21 11:33:59

gen2arch
Member
Registered: 2013-05-16
Posts: 206

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

V1del wrote:

glxinfo tells us that at least the OpenGL  acceleration should be here and is using the correct driver. So this really might be a nvidia 440.82 <-> quadro bug (I don't have any issues on a Geforce Titan X)  I'd say do try a kernel/nvidia/nvidia-utils downgrade

V1del, thanks again, here's what happend:

1. I went back to linux 5.5.9.arch1-2 and nvidia-dkms 440.64-2: the lag almost completely disappeared in guvcview and OBS studio, so these two do a lot better with the earlier kernel!

2. I think I know what the enormous CPU peaks and dektop freezes directly at starting and after using guvcview were: this program disables by itself compositing and re-enables it after it closes! This is exactly what is said in an option of Settings > Display and Monitor > Compositor > "Allow applications to block compositing": "Applications can set a hint to block compositing when window is open. This brings performance improvements for e.g. games"
I guess the lag/freeze I saw after closing guvcview results from it restarting the window manager/compositing! I can tell this is the case as during guvcview use the exposé function of the desktops ("show grid") didn't work, but did again work after closing guvcview.

Actually: is there a way to do this manually? Can I disable/enable compositing in a running plasma session without having to logout/login?

Last edited by gen2arch (2020-04-21 11:36:05)

Offline

#15 2020-04-21 11:58:48

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 14,806

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

It used to be possible to enable/disable composting with "Shift+ALT+F12" in KDE , no idea if that shortcut still exists.

Last edited by Lone_Wolf (2020-04-21 11:59:17)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#16 2020-04-21 12:01:52

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,064

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

Yeah that's definitely likely if it did do that. Yes you can press Alt+Shift+F12 to toggle the compositor yourself by default.

Edit. Noooooooooooo.... F5 has failed me tongue

Last edited by V1del (2020-04-21 12:02:27)

Offline

#17 2020-04-21 13:00:43

gen2arch
Member
Registered: 2013-05-16
Posts: 206

Re: Enormous lag in all of X especially with multimedia apps (mpv webcams)

Exactly, that did it: Alt+Shift+F12, perfect!
Doing that manually, I see exactly the behavior I saw with guvcview: the desktop freezes for at least 5 secs! and is back to normal afterwards.

Lone_Wolf and V1del: could you check if this cpu peak happens also on your machines and to what extent? I'd be very interested in that hardware-wise.

Mine is a P50 Lenovo mobile workstation, i.e. it is a notebook, although with dedicated graphics (Nvidia Quadro M2000M, Maxwell). I bought this machine completly irrespective of any graphics performance, I was only interested in compilation speeds and working with text. Never cared at all about audio and video. Now, in the actual crisis, as everyone else, I'm forced to do my teaching online, and this brings in a host of new problems with multimedia apps, this particular machine just seems not to be very good at. Is there some sort of baseline, with regard to hardware, from which on one would be safe to have enough gpu power for real time encoding / streaming, ideally @4k, under linux; what kind of graphics card (generation, architecture) would this be, as long as it runs well under linux?

Last point: is there anything I can do to investigate further the nvidia/kernel issue with Quadro cards I seem to have hit?

Thanks.

Last edited by gen2arch (2020-04-21 13:02:01)

Offline

Board footer

Powered by FluxBB