You are not logged in.

#1 2022-10-13 16:17:56

roadsidejesus
Member
Registered: 2022-10-13
Posts: 6

Laggy video with mpv

At random points in playback, video starts to lag as if it were buffering (video is locally stored), after several seconds it plays normally again. This seems to happen when audio is eac3.

I was trying out different options and was getting following message:

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

But that was a while ago and I can't remember which option made this message show up, without any options behavior is the same (buffering) and whole log can be found here: https://0x0.st/ovjI.log

When message above was issued there were no CPU spikes (at least nothing that htop showed), files aren't broken either - I could play them fine on a different machine.

Any help?

Offline

#2 2022-10-14 02:06:22

jonno2002
Member
Registered: 2016-11-21
Posts: 870

Re: Laggy video with mpv

your using software decoding even though your gt1030 supports hardware decoding, but that shouldnt really be a problem unless your cpu is really slow.... what cpu do you have ?

try using hardware decoding and see what happens out of interest:
https://wiki.archlinux.org/title/Hardwa … celeration
https://wiki.archlinux.org/title/Mpv#Ha … celeration

Offline

#3 2022-10-14 06:07:31

roadsidejesus
Member
Registered: 2022-10-13
Posts: 6

Re: Laggy video with mpv

I've got the same result sadly.
My processor is Intel Core i5-3470 CPU @ 3.20GHz, here's the log file with --hwdec=auto-safe: https://0x0.st/ovVU.log

Offline

#4 2022-10-14 06:37:03

jonno2002
Member
Registered: 2016-11-21
Posts: 870

Re: Laggy video with mpv

something else is going on, whats your setup ? does video playback work fine in browser like youtube etc ?

Offline

#5 2022-10-14 06:51:14

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,464

Re: Laggy video with mpv

Does this also lag

mpv -ao alsa totallynotporn.mkv

Or does

mpv -ao null weallknothatitsporn.mkv

Offline

#6 2022-10-14 10:44:55

roadsidejesus
Member
Registered: 2022-10-13
Posts: 6

Re: Laggy video with mpv

The PC is fairly old, I'm using it as a home theater, 8GB RAM, NVIDIA GeForce GT 1030 graphics card and CPU I mentioned before.
I'm using 3.5 motherboard jack for audio, I'm not using browser on that PC, but online videos (Youtube and others) don't lag at all, I use mpv for all video/audio.
The videos I'm playing are on an external hard drive, connected through USB 2.0, most of them are playing without lag, the ones that lag produce the same log.

-ao alsa

lags, the same as

-ao ull

although the second one doesn't have any sound

Any other info I could provide?

Offline

#7 2022-10-14 12:35:41

roadsidejesus
Member
Registered: 2022-10-13
Posts: 6

Re: Laggy video with mpv

Actually I have USB 3.0 support, but switching to those ports doesn't make a difference in lag

Offline

#8 2022-10-14 12:55:30

jonno2002
Member
Registered: 2016-11-21
Posts: 870

Re: Laggy video with mpv

what about if you transfer the problem files to the internal ssd/hdd ? does that make a difference.
according to your log files the files in question are "h264 1920x1080 29.970fps" which should not be a problem for a 3rd gen i5, even using software decoding.

Offline

#9 2022-10-15 10:31:07

roadsidejesus
Member
Registered: 2022-10-13
Posts: 6

Re: Laggy video with mpv

Moving files to internal hdd fixed it, thanks!
I guess it's possible that my external hdd became slower as it aged? or USB speed isn't fast enough?

Offline

#10 2022-10-15 11:42:38

jonno2002
Member
Registered: 2016-11-21
Posts: 870

Re: Laggy video with mpv

what speed is it running at ?

lsusb -tv

Offline

#11 2022-10-15 12:59:13

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,464

Offline

#12 2022-10-17 17:59:59

roadsidejesus
Member
Registered: 2022-10-13
Posts: 6

Re: Laggy video with mpv

Here's the relevant part of lsusb -tv output

/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
    ID 1d6b:0003 Linux Foundation 3.0 root hub
    |__ Port 3: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        ID 1058:25a1 Western Digital Technologies, Inc. Elements / My Passport
    |__ Port 4: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
        ID 1058:25a2 Western Digital Technologies, Inc. Elements 25A2

Changing cache settings sort of worked out, first video plays fine, but if I play a second one without restarting mpv it's lagging again.

Settings I've used:

--cache=yes
--demuxer-max-bytes=2000000000

Offline

#13 2022-10-17 19:32:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,464

Re: Laggy video with mpv

Are there IO errors in dmesg?
Is this maybe a problem w/ https://wiki.archlinux.org/title/Power_ … utosuspend ?
What if you increase the cache size?

if I play a second one without restarting mpv

You mean

mpv /mnt/usb/favoriteporn.mp4 /mnt/usb/secondfavoriteporn.mp4

Behaves different from

mpv /mnt/usb/favoriteporn.mp4

?

Does the size of the videos matter?
Or do the videos have different bitrates (eg. one FullHD@24 and the other one 8k@60)?

Offline

Board footer

Powered by FluxBB