You are not logged in.

#1 2019-10-24 17:22:28

i4MwTWS7
Member
Registered: 2019-10-07
Posts: 6

massive lag with mpv

i've had the exact same setup for a while, and it has always worked well, but today it started lag a lot. it seems to happen most times when i go in/out of fullscreen, but seems to be able to happen even when im not. the most videos starting out lagging a lot, and some of them after a short while. when looked at "htop" my cpu usage for mpv only was at 200%, how that even is possible i dont know. the only things i've done to the system today is install and enable apparmor (added kernel parameter according to the wiki), and enabled the "apparmor.service". i have reverted these changes, and its still the same so i dont think thats whats causing it. i also did a "pacman -Syu" today which upgraded these packages:

[ALPM] upgraded librsvg (2:2.46.2-1 -> 2:2.46.3-1)
[ALPM] upgraded libuv (1.33.0-1 -> 1.33.1-1)
[ALPM] upgraded python2 (2.7.16-1 -> 2.7.17-1)
[ALPM] upgraded xkeyboard-config (2.27-1 -> 2.28-1)

i also tried to install vlc to see what happens there, and that seems to be working fine. other than this i didnt do anything to my system.
starting mpv from the terminal gave me this:

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

and i dont think its caused by mpv itself, because last time i upgraded mpv was 2019-10-13, so that is a while ago.

any ideas what this could be? im fairly new to linux so i hope i gave the necessary info/logs, or is there anything more i can provide?

edit: here is something that turned up in "journalctl -f" around the same time as i tried make a video fullscreen.

NVRM: Xid (PCI:0000:01:00): 31, pid=30752, Ch 00000020, intr 10000000. MMU Fault: ENGINE GRAPHICS GPCCLIENT_T1_1 faulted @ 0x1_02020000. Fault is of type FAULT_PTE ACCESS_TYPE_READ

and i just want to add, if it matters, that i can spam fullscrenn/no fullscreen in vlc without any unusual output in journalctl, lag or cpu increase, more than expected. this is what i've experienced before today with mpv too.

edit 2: i have a geforce 750ti and have the "nvidia-lts-1:435.21-6" package installed

Last edited by i4MwTWS7 (2019-10-24 19:22:51)

Offline

#2 2019-10-24 21:07:57

seth
Member
Registered: 2012-09-03
Posts: 51,325

Re: massive lag with mpv

Output of

mpv -v totallynotporn.mp4

?

Offline

#3 2019-10-24 21:33:57

i4MwTWS7
Member
Registered: 2019-10-07
Posts: 6

Re: massive lag with mpv

seth wrote:

Output of

mpv -v totallynotporn.mp4

?

wow, is that the kind of replies we get here? actually when i first saw this issue i watched a video of openttd via invidio.us. i also tried of a local file which contains a bash tutorial, if that matters to u.

Last edited by i4MwTWS7 (2019-10-24 21:34:49)

Offline

#4 2019-10-24 21:49:21

xse
Member
Registered: 2019-01-08
Posts: 36

Re: massive lag with mpv

He is just asking you to post what mpv outputs on the console when -v (verbose) is set, to see if it shows any useful information.


Carefully explaining your problem is half the solution.

Offline

#5 2019-10-24 21:50:03

seth
Member
Registered: 2012-09-03
Posts: 51,325

Re: massive lag with mpv

It matters to me not the slightest, but apparently to you… for whatever reason - that I don't care about either.
The verbose mpv output will be relevant to address the problem, but if your apparent  insecurities do not allow you to look past the jest of a random placeholder, we probably won't get there.

Offline

#6 2019-10-24 22:21:36

i4MwTWS7
Member
Registered: 2019-10-07
Posts: 6

Re: massive lag with mpv

seth wrote:

It matters to me not the slightest, but apparently to you… for whatever reason - that I don't care about either.
The verbose mpv output will be relevant to address the problem, but if your apparent  insecurities do not allow you to look past the jest of a random placeholder, we probably won't get there.

im sorry, i thought it was just a lame sarcastic comment, i apologize. here is the output anyway https://privatebin.net/?b6188c9138abcf1 … trEzgeic4b

Offline

#7 2019-10-24 22:51:51

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,743

Re: massive lag with mpv

You have to play back an actual laggy file for this to be of relevance.

Offline

#8 2019-10-24 23:27:54

i4MwTWS7
Member
Registered: 2019-10-07
Posts: 6

Re: massive lag with mpv

V1del wrote:

You have to play back an actual laggy file for this to be of relevance.

yes, of course, how stupid of me. https://privatebin.net/?290f47100533e7d … 77DQeaHqgg

edit: i dont know if this is of relevance but when i use this command (mpv -v file.whatever) it seems to work a little bit better, but it will eventually break. how i usually open files is this command in i3 'bindsym $mod+Shift+v exec --no-startup-id mpv "$(xclip -o -selection clip board)"', this seems however destroy the playback totally the first time i make it fullscreen, which have never happen before today

Last edited by i4MwTWS7 (2019-10-24 23:36:08)

Offline

#9 2019-10-25 06:11:09

seth
Member
Registered: 2012-09-03
Posts: 51,325

Re: massive lag with mpv

So this is a 4k VP9 at 60FPS youtube stream decoded in software - I can see why this can charge two of your CPU cores (depending on the CPU) and certainly why it might "overcharge" your network connection.
Can we see an affected local file?

If the CPU is the limiting factor, you probably want to ensure to play h264 (for h264-vdpau HW playback), but let's first rule out the network.

Since you only have a FullHD output, you might want to limit the resolution anyway.
Essentially

mpv --ytdl-format='mp4[height<=1080]+bestaudio' 'https://invidio.us/watch?v=Hg2SSghI_wQ'

See the youtube-dl page for more options.

Offline

#10 2019-10-25 09:29:53

i4MwTWS7
Member
Registered: 2019-10-07
Posts: 6

Re: massive lag with mpv

seth wrote:

So this is a 4k VP9 at 60FPS youtube stream decoded in software - I can see why this can charge two of your CPU cores (depending on the CPU) and certainly why it might "overcharge" your network connection.
Can we see an affected local file?

If the CPU is the limiting factor, you probably want to ensure to play h264 (for h264-vdpau HW playback), but let's first rule out the network.

Since you only have a FullHD output, you might want to limit the resolution anyway.
Essentially

mpv --ytdl-format='mp4[height<=1080]+bestaudio' 'https://invidio.us/watch?v=Hg2SSghI_wQ'

See the youtube-dl page for more options.

this have never been a problem since i started using arch a couple a months ago. infact it was working before i switched to arch too, with the same setup. the exact same thing happened with your link, but not quite as fast as with my method. the thing is it is still working flawless in vlc. i dont think i has anything with the file, because its happening with every video in mpv i've tried since this all started out, but not a single time in vlc.

Offline

#11 2019-10-25 12:41:10

seth
Member
Registered: 2012-09-03
Posts: 51,325

Re: massive lag with mpv

What's the output for the command and how does it impact the CPU load?

vlc -v 'https://invidio.us/watch?v=Hg2SSghI_wQ'

doesn't work, apparently it cannot handle the URL, so what exactly do you play w/ vlc?
Also you didn't reply to

seth wrote:

Can we see an affected local file?

- your description sounds a lot like a buffer underrun because the network connection cannot support the video bitrate.

nb. that what videos are available and which one will be default (w/o further parameters by the client) is controlled by google (youtube) - w/o further ado my (slightly dated…) version of youtube-dl defaults to mp4/720p. This is a whopping 216 21.6 times smaller than the 4k/60 video in your log…

Edit: slight slippery of the brain

Last edited by seth (2019-10-25 12:48:57)

Offline

#12 2019-10-28 16:30:46

i4MwTWS7
Member
Registered: 2019-10-07
Posts: 6

Re: massive lag with mpv

seth wrote:

What's the output for the command and how does it impact the CPU load?

vlc -v 'https://invidio.us/watch?v=Hg2SSghI_wQ'

doesn't work, apparently it cannot handle the URL, so what exactly do you play w/ vlc?

vlc -v 'https://youtube.com/watch?v=Hg2SSghI_wQ'
seth wrote:

Also you didn't reply to

seth wrote:

Can we see an affected local file?

- your description sounds a lot like a buffer underrun because the network connection cannot support the video bitrate.

im downloading stuff around 10mb/s and getting 90Mbit/s out right now as we speak, so my internet connection shouldnt be the problem. i cant share the local file right now as im not at home, but ill try do that later.

seth wrote:

nb. that what videos are available and which one will be default (w/o further parameters by the client) is controlled by google (youtube) - w/o further ado my (slightly dated…) version of youtube-dl defaults to mp4/720p. This is a whopping 216 21.6 times smaller than the 4k/60 video in your log…

Edit: slight slippery of the brain

well, even with

height<=1080

its problems. as i said, this is a new problem on hardware i've been using since i installed arch, and even before. not changed any settings or config files or anything else.

Offline

#13 2019-10-28 16:42:58

seth
Member
Registered: 2012-09-03
Posts: 51,325

Re: massive lag with mpv

vlc doesn't actually print the codec details even in verbose mode (sigh), so please use the gui to inspect the AV codec details.

Offline

Board footer

Powered by FluxBB