You are not logged in.
Hi, back on Linux after a long stint away.
I've spent the week trying to debug an issue where MPV and VLC take a long time [45 seconds according to logs] to even start a video that is hosted on a non-local machine. The video can be YouTube or even on a SMB share hosted within the local area network and mounted.
I don't think it's an SMB issue, but here's my SMB config:
//TRUENAS/media on /mount type cifs (rw,relatime,vers=3.1.1,cache=strict,upcall_target=app,username=user,domain=WORKGROUP,uid=1000,forceuid,gid=1000,forcegid,addr=192.168.68.63,file_mode=0755,dir_mode=0755,iocharset=utf8,soft,nounix,serverino,mapposix,reparse=nfs,nativesocket,symlink=native,rsize=4194304,wsize=4194304,bsize=1048576,retrans=1,echo_interval=60,actimeo=1,closetimeo=1,_netdev)
I don't think it's an MPV issue, as the flatpak version has no problems
Interestingly, the VLC flatpak has the same issue.
Here are the symptoms:
MPV builds:
https://pastebin.com/Sk5V6Hmr
https://pastebin.com/GkyWph3L
MPV log:
https://pastebin.com/Dw77e01q
MPV strace:
https://pastebin.com/rx6aikAw
https://pastebin.com/QKYHhxAR
I don't think it's a DNS issue [DNS resolution averages 6ms usually]. Ping does sometimes spike into the multi-hundred of milliseconds, but that's probably because of the router I use.
I'm frankly at a loss. I hope someone else has seen a similar problem or know where else to look for issues.
EDIT Appended system and network details:
My System:
Operating System: Arch Linux
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.6-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × Intel® Core™ i9-9900K CPU @ 3.60GHz
Memory: 62.7 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3080 Ti
Manufacturer: Micro-Star International Co., Ltd.
Product Name: MS-7B17
System Version: 1.0
2: enp5s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group 57841 qlen 1000
link/ether 02:76:c6:01:4d:21 brd ff:ff:ff:ff:ff:ff
altname enx0276c6014d21
inet 192.168.68.57/22 brd 192.168.71.255 scope global dynamic noprefixroute enp5s0
valid_lft 6784sec preferred_lft 6784sec
Last edited by WhonderWy (2025-05-23 01:04:24)
Offline
Does it help to limit the stream buffer or the cache-secs?
https://man.archlinux.org/man/mpv.1#stream
Edi: nb. that youtube has lag, this combats google efforts to make you use their shitty website.
It's (also) CPU related but should™ not take 45s
Last edited by seth (2025-05-23 07:29:49)
Offline
Unfortunately, it makes no difference whether I increase or decrease the buffer/cache.
I also confirmed that it happens with regular streams m3u8 but not when `script-opts=ytdl_hook-ytdl_path=yt-dlp` is included. Naturally, it makes no difference when playing from the SMB mount.
Offline
How does wget/curl/just copying those files behave?
What about yt-dlp directly?
Do they also delay 45s before actually fetching the video?
Offline
No delay at all. They work just fine.
It's just mpv [and vlc] with remote videos [hosted on LAN or elsewhere].
Offline
strace tail is just
[pid 76380] 23:37:46.903863 openat(AT_FDCWD, "/mount/video.mkv", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 8
[pid 76380] 23:37:46.904485 fstat(8, {st_mode=S_IFREG|0755, st_size=1463988988, ...}) = 0
[pid 76367] 23:37:47.862318 <... poll resumed>) = 0 (Timeout)
[pid 76367] 23:37:47.862597 poll([{fd=6, events=POLLIN}, {fd=3, events=POLLIN}], 2, 1000) = 0 (Timeout)
[pid 76367] 23:37:48.863881 poll([{fd=6, events=POLLIN}, {fd=3, events=POLLIN}], 2, 1000) = 0 (Timeout)
[pid 76367] 23:37:49.864681 poll([{fd=6, events=POLLIN}, {fd=3, events=POLLIN}], 2, 1000) = 0 (Timeout)
[pid 76367] 23:37:50.866433 poll([{fd=6, events=POLLIN}, {fd=3, events=POLLIN}], 2, 1000) = 0 (Timeout)
[pid 76367] 23:37:51.867991 poll([{fd=6, events=POLLIN}, {fd=3, events=POLLIN}], 2, 1000) = 0 (Timeout)
[pid 76367] 23:37:52.868723 poll([{fd=6, events=POLLIN}, {fd=3, events=POLLIN}], 2, 1000) = 0 (Timeout)
23:37:46.855738 openat(AT_FDCWD, "/dev/urandom", O_RDONLY|O_CLOEXEC) = 3
23:37:46.860648 openat(AT_FDCWD, "/home/user/.config/mpv/input.conf", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 6
Move away the input.conf (urandom is no longer supposed to block)
Offline
Hope I'm not misunderstanding you, but even moving the input.conf away [renaming it] did nothing.
Offline
If it's still in .config/mpv/ it'll be sourced, regardless how you name it.
Move it away from that path.
Then post an updated strace.
Offline
Roger. Renamed the entire .config/mpv directory into something that doesn't have "mpv" in its name.
Directory got recreated by mpv but is empty.
MPV Log:
http://0x0.st/8xil.txt
Strace Log:
http://0x0.st/8xiU.txt
Offline
6841 09:23:11.067050 openat(AT_FDCWD, "/etc/mpv/scripts", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 9 <0.000009>
6852 09:23:11.068825 openat(AT_FDCWD, "/etc/mpv/scripts/thumbfast.lua", O_RDONLY|O_NONBLOCK|O_CLOEXEC) = 9 <0.000007>
6852 09:23:11.070758 openat(AT_FDCWD, "/etc/mpv/script-opts/thumbfast.conf", O_RDONLY) = 9 <0.000007>
6852 09:23:11.070883 read(9, "# Socket path (leave empty for auto)\nsocket=\n\n# Thumbnail path (leave empty for auto)\nthumbnail=\n\n# Maximum thumbnail generation size in pixels (scaled down to fit)\n# Values are scaled when hidpi is enabled\nmax_height=200\nmax_width=200\n\n# Scale factor for thumbnail display size (requires mpv 0.38+)\n# Note that this is lower quality than increasing max_height and max_width\nscale_factor=1\n\n# Apply tone-mapping, no to disable\ntone_mapping=auto\n\n# Overlay id\noverlay_id=42\n\n# Spawn thumbnailer on fil"..., 4096) = 910 <0.000007>
6853 09:23:11.097620 <... openat resumed>) = 9 <0.000950>
6844 09:23:11.109574 read(11, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE fontconfig SYSTEM \"fonts.dtd\">\n<fontconfig>\n <!-- Generic name aliasing -->\n <alias>\n <family>sans-serif</family>\n <prefer>\n <family>URW Gothic</family>\n </prefer>\n </alias>\n\n <!-- Generic name assignment -->\n <alias>\n <family>URW Gothic</family>\n <default>\n <family>sans-serif</family>\n </default>\n </alias>\n\n <!-- Original PostScript base font mapping -->\n <alias binding=\"same\">\n <family>URW Gothic</family>\n "..., 8192) = 913 <0.000006>
6844 09:23:11.110400 read(11, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE fontconfig SYSTEM \"fonts.dtd\">\n<fontconfig>\n <!-- Generic name aliasing -->\n <alias>\n <family>serif</family>\n <prefer>\n <family>P052</family>\n </prefer>\n </alias>\n\n <!-- Generic name assignment -->\n <alias>\n <family>P052</family>\n <default>\n <family>serif</family>\n </default>\n </alias>\n\n <!-- Original PostScript base font mapping -->\n <alias binding=\"same\">\n <family>P052</family>\n <default>\n <family>P"..., 8192) = 975 <0.000005>
…
6844 09:23:11.115605 readlink("/proc/self/exe", "/usr/bin/mpv", 4095) = 12 <0.000011>
6843 09:23:12.060316 <... poll resumed>) = 0 (Timeout) <1.000369>
6843 09:23:12.060826 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000558>
6843 09:23:13.062343 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001146>
6843 09:23:14.064400 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000913>
6843 09:23:15.066308 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001184>
6843 09:23:16.068418 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000891>
6843 09:23:17.070342 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000984>
6843 09:23:18.072357 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001161>
6843 09:23:19.074350 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000966>
6843 09:23:20.076387 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000943>
6843 09:23:21.078265 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001061>
6843 09:23:22.080198 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001088>
6843 09:23:23.082403 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000938>
6843 09:23:24.084419 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000901>
6843 09:23:25.086567 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000758>
6843 09:23:26.088303 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001008>
6843 09:23:27.090381 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000967>
6843 09:23:28.092385 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000959>
6843 09:23:29.094298 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001015>
6843 09:23:30.096342 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000963>
6843 09:23:31.098337 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001205>
6843 09:23:32.106681 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000628>
6843 09:23:33.108414 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000870>
6843 09:23:34.110505 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001162>
6843 09:23:35.112162 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001199>
6843 09:23:36.114377 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001193>
6843 09:23:37.116796 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000505>
6843 09:23:38.118424 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000880>
6843 09:23:39.120375 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001202>
6843 09:23:40.122719 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000615>
6843 09:23:41.124358 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000952>
6843 09:23:42.126181 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001263>
6843 09:23:43.128634 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001189>
6843 09:23:44.131020 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001204>
6843 09:23:45.133214 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001098>
6843 09:23:46.134815 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000518>
6843 09:23:47.135878 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.000743>
6843 09:23:48.137948 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001252>
6843 09:23:49.140329 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001194>
6843 09:23:50.142748 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001141>
6843 09:23:51.150152 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001209>
6843 09:23:52.152558 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001206>
6843 09:23:53.154868 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001155>
6843 09:23:54.157152 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000) = 0 (Timeout) <1.001199>
6843 09:23:55.159306 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000 <unfinished ...>
6853 09:23:56.119654 read(9, <unfinished ...>
6843 09:23:56.160555 <... poll resumed>) = 0 (Timeout) <1.001149>
6843 09:23:56.160999 poll([{fd=7, events=POLLIN}, {fd=4, events=POLLIN}, {fd=6, events=POLLIN}], 3, 1000 <unfinished ...>
6853 09:23:56.171792 <... read resumed>"\32E\337\243\243B\206\201\1B\367\201\1B\362\201\4B\363\201\10B\202\210matroskaB\207\201\4B\205\201\2\30S\200g\1\0\0\0WB\262\310\21M\233t\317M\273\214S\253\204\25I\251fS\254\202\20\3M\273\214S\253\204\26T\256kS\254\202\20ZM\273\216S\253\204\34S\273kS\254\204WBG\303M\273\216S\253\204\22T\303gS\254\204WB\2568M\273\214S\253\204\31A\244iS\254\202\32\374\354O\254\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 131072) = 131072 <0.052057>
6853 09:23:56.181648 read(9, ":\177E\1;\376\331\2\223\376\273\231\1HL\320r\225\306\311\216\204\376\302\376\367\376\261\204\237\3\357w\254\275QHWYIH\257\0\4\0\"\0\0\5\325\5\260\0\33\0 \0'\0,\0\0\1!\21#\21#535#53\21!2\26\0273\25#\26\25\24\0073\25#\2\1\25!&#\0014'!\25!6\00527!\25\3\7\376\317\374\270\270\270\270\2-\271\3717\345\275\1\1\275\341p\375R\1\362Hy\1\24\2\375\275\2D\1\376\354\177F\376\n\2\35\375\343\3 \240G\240\1\t\220y\240\23\23\21\20\240\376\375\2\310>>\376\372\24\24G\17\34788\0\3\0j\377\203\4\360\6\27\0\31\0 \0&\0\0%\6\6\7\25#5&\0\0215\20\000753\25\26\26\27#&&'\21!\5\20\27\21\6\6\25\5#\021667\4\360+\333\325\303\334\376\364\1\1\347\303\340\343\30\370\20ij\1\333\374y\351vs\2\213\337fb\27\276:\213\vku*\1c\1#_\1+\1g#[W\25\375\273`\213\24\375\371C\376\210`\4\30(\365\302\335\376\214\0076\31\0\3\0\"\0\0\5d\5\260\0\27\0\32\0\36\0\0\23!\0233\23!\25!\0273\25#\23!\3!\3!\23#537!%3'\3!'!\"\1g\321\343\321\1R\376\370?\311\200\204\376\370w\375\315w\376\371\203\225\337?\376\342\2T\253U\324\1\247:\376\315\3\210\2(\375\330\303\246\303\376\244\1T\376\254\1\\\303\246\303\364\375\243\246\0\2\0C\377\354\4\214\5\304\0\25\0+\0\0\1\25!5!6654#\"\6\7#6632\26\25\24\7\23\6\4#\"&547#5!\25!\6\6\25\0243267\4\214\373\267\2\262\36\31\275q^\2\375\6\326"..., 6375742) = 6375742 <0.073834>
6853 09:23:56.265054 read(9, "\37C\266u8\10\264\347\201\0\243 \214\351\201\0\0\200\0\0\2\307\6\5\377\377\303\334E\351\275\346\331H\267\226,\330 \331#\356\357x264 - core 164 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=4 deblock=1:1:1 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=0.40:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=96 keyint_min=4"..., 131072) = 131072 <0.000018>
6853 09:23:56.265350 read(9, "\34S\273k fn\273\220\263\201\0\267\213\367\201\1\361\203cI\n\360\201\3\273\221\263\202\7\322\267\213\367\201\1\361\203\2154\204\360\201\4\273\221\263\202\17\244\267\213\367\201\1\361\203\305\t}\360\201\4\273\221\263\202\27v\267\213\367\201\1\361\203\352?\30\360\201\4\273\222\263\202\37H\267\214\367\201\1\361\204\1\23@\334\360\201\4\273\230\263\202#\202\267\222\367\201\3\361\204\1+ \275\360\203\1\f\360\262\202\7\320\273\222\263\202'\32\267\214\367\201\1\361\204\1Otb\360\201\4\273\222\263\202.\354\267\214\367\201\1\361\204\1[\342\246\360\201\4\273\222\263\2026\276\267\214\367\201\1\361\204\1x1/\360\201\4\273\230\263\202=\220\267\222\367\201\3\361\204\1x1/\360\203\r\372<\262\202\7X\273\222\263\202>\220\267\214\367\201\1\361\204\1\221\"\241\360\201\4\273\222\263\202Fb\267\214\367\201\1\361\204\1\267G\325\360\201\4\273\230\263\202IH\267\222\367\201\3\361\204\1\267G\325\360\203\r\301\r\262\202\tL\273\222\263\202N4\267\214\367\201\1\361\204\1\311\333\0\360\201\4\273\222\263\202V\6\267\214\367\201\1\361\204\1\362\276\16\360\201\4\273\222\263\202]\330\267\214\367\201\1\361\204\2!x\311\360\201\4\273\230\263\202^\246\267\222\367\201\3\361\204\2!x\311\360\203\5\24\345\262\202\16\246\273\222\263\202e\252\267\214\367\201\1\361\204\2KQ\6\360\201\4\273\222\263\202m|\267\214\367\201\1\361\204\2}Br\360\201\4\273\222\263\202uN\267\214\367\201\1\361\204\2\247\374\25\360\201\4\273\222\263\202} \267\214\367\201\1\361\204\2\334\321\233\360\201\4\273\222\263\202\204\362\267\214\367\201\1\361\204\3\25\207O\360\201\4\273\222\263\202\214\304\267\214\367\201\1\361\204\0037\210\241\360\201\4\273\222\263\202\224\226\267\214\367\201\1\361\204\3"..., 131072) = 27397 <0.021822>
6853 09:23:56.995614 read(9, "\37C\266u8\10\264\347\201\0\243 \214\351\201\0\0\200\0\0\2\307\6\5\377\377\303\334E\351\275\346\331H\267\226,\330 \331#\356\357x264 - core 164 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=4 deblock=1:1:1 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=0.40:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=96 keyint_min=4"..., 131072) = 131072 <0.000019>
6853 09:23:56.995937 +++ exited with 0 +++
strace is longer and now actually covers the end of the wait - and the thumbnailer also makes way more sense than the input config
Offline
Sadly it doesn't look like the thumbnailer is it either.
Offline
Meh.
10152 19:09:47.148937 openat(AT_FDCWD, "/mnt/video.mkv/VIDEO_TS.IFO", O_RDONLY) = -1 ENOTDIR (Not a directory) <0.000013>
10152 19:09:47.148978 openat(AT_FDCWD, "/mnt/video.mkv/VIDEO_TS/VIDEO_TS.IFO", O_RDONLY) = -1 ENOTDIR (Not a directory) <0.000007>
10152 19:09:47.149143 openat(AT_FDCWD, "/mnt/video.mkv/MovieObject.bdmv", O_RDONLY) = -1 ENOTDIR (Not a directory) <0.000007>
10152 19:09:47.149170 openat(AT_FDCWD, "/mnt/video.mkv/BDMV/MovieObject.bdmv", O_RDONLY) = -1 ENOTDIR (Not a directory) <0.000005>
10152 19:09:47.149345 openat(AT_FDCWD, "/mnt/video.mkv", O_RDONLY|O_NONBLOCK|O_CLOEXEC <unfinished ...>
10152 19:09:47.152880 <... openat resumed>) = 9 <0.003524>
10152 19:10:32.213361 read(9, "\32E\337\243\243B\206\201\1B\367\201\1B\362\201\4B\363\201\10B\202\210matroskaB\207\201\4B\205\201\2\30S\200g\1\0\0\0WB\262\310\21M\233t\317M\273\214S\253\204\25I\251fS\254\202\20\3M\273\214S\253\204\26T\256kS\254\202\20ZM\273\216S\253\204\34S\273kS\254\204WBG\303M\273\216S\253\204\22T\303gS\254\204WB\2568M\273\214S\253\204\31A\244iS\254\202\32\374\354O\254\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 131072) = 131072 <0.057715>
10152 19:10:32.283430 read(9, ":\177E\1;\376\331\2\223\376\273\231\1HL\320r\225\306\311\216\204\376\302\376\367\376\261\204\237\3\357w\254\275QHWYIH\257\0\4\0\"\0\0\5\325\5\260\0\33\0 \0'\0,\0\0\1!\21#\21#535#53\21!2\26\0273\25#\26\25\24\0073\25#\2\1\25!&#\0014'!\25!6\00527!\25\3\7\376\317\374\270\270\270\270\2-\271\3717\345\275\1\1\275\341p\375R\1\362Hy\1\24\2\375\275\2D\1\376\354\177F\376\n\2\35\375\343\3 \240G\240\1\t\220y\240\23\23\21\20\240\376\375\2\310>>\376\372\24\24G\17\34788\0\3\0j\377\203\4\360\6\27\0\31\0 \0&\0\0%\6\6\7\25#5&\0\0215\20\000753\25\26\26\27#&&'\21!\5\20\27\21\6\6\25\5#\021667\4\360+\333\325\303\334\376\364\1\1\347\303\340\343\30\370\20ij\1\333\374y\351vs\2\213\337fb\27\276:\213\vku*\1c\1#_\1+\1g#[W\25\375\273`\213\24\375\371C\376\210`\4\30(\365\302\335\376\214\0076\31\0\3\0\"\0\0\5d\5\260\0\27\0\32\0\36\0\0\23!\0233\23!\25!\0273\25#\23!\3!\3!\23#537!%3'\3!'!\"\1g\321\343\321\1R\376\370?\311\200\204\376\370w\375\315w\376\371\203\225\337?\376\342\2T\253U\324\1\247:\376\315\3\210\2(\375\330\303\246\303\376\244\1T\376\254\1\\\303\246\303\364\375\243\246\0\2\0C\377\354\4\214\5\304\0\25\0+\0\0\1\25!5!6654#\"\6\7#6632\26\25\24\7\23\6\4#\"&547#5!\25!\6\6\25\0243267\4\214\373\267\2\262\36\31\275q^\2\375\6\326"..., 6375742) = 6375742 <0.116622>
10152 19:10:32.418037 read(9, "\37C\266u8\10\264\347\201\0\243 \214\351\201\0\0\200\0\0\2\307\6\5\377\377\303\334E\351\275\346\331H\267\226,\330 \331#\356\357x264 - core 164 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=4 deblock=1:1:1 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=0.40:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=96 keyint_min=4"..., 131072) = 131072 <0.002533>
10152 19:10:32.420881 read(9, "\34S\273k fn\273\220\263\201\0\267\213\367\201\1\361\203cI\n\360\201\3\273\221\263\202\7\322\267\213\367\201\1\361\203\2154\204\360\201\4\273\221\263\202\17\244\267\213\367\201\1\361\203\305\t}\360\201\4\273\221\263\202\27v\267\213\367\201\1\361\203\352?\30\360\201\4\273\222\263\202\37H\267\214\367\201\1\361\204\1\23@\334\360\201\4\273\230\263\202#\202\267\222\367\201\3\361\204\1+ \275\360\203\1\f\360\262\202\7\320\273\222\263\202'\32\267\214\367\201\1\361\204\1Otb\360\201\4\273\222\263\202.\354\267\214\367\201\1\361\204\1[\342\246\360\201\4\273\222\263\2026\276\267\214\367\201\1\361\204\1x1/\360\201\4\273\230\263\202=\220\267\222\367\201\3\361\204\1x1/\360\203\r\372<\262\202\7X\273\222\263\202>\220\267\214\367\201\1\361\204\1\221\"\241\360\201\4\273\222\263\202Fb\267\214\367\201\1\361\204\1\267G\325\360\201\4\273\230\263\202IH\267\222\367\201\3\361\204\1\267G\325\360\203\r\301\r\262\202\tL\273\222\263\202N4\267\214\367\201\1\361\204\1\311\333\0\360\201\4\273\222\263\202V\6\267\214\367\201\1\361\204\1\362\276\16\360\201\4\273\222\263\202]\330\267\214\367\201\1\361\204\2!x\311\360\201\4\273\230\263\202^\246\267\222\367\201\3\361\204\2!x\311\360\203\5\24\345\262\202\16\246\273\222\263\202e\252\267\214\367\201\1\361\204\2KQ\6\360\201\4\273\222\263\202m|\267\214\367\201\1\361\204\2}Br\360\201\4\273\222\263\202uN\267\214\367\201\1\361\204\2\247\374\25\360\201\4\273\222\263\202} \267\214\367\201\1\361\204\2\334\321\233\360\201\4\273\222\263\202\204\362\267\214\367\201\1\361\204\3\25\207O\360\201\4\273\222\263\202\214\304\267\214\367\201\1\361\204\0037\210\241\360\201\4\273\222\263\202\224\226\267\214\367\201\1\361\204\3"..., 131072) = 27397 <0.035074>
10152 19:10:33.178788 read(9, "\37C\266u8\10\264\347\201\0\243 \214\351\201\0\0\200\0\0\2\307\6\5\377\377\303\334E\351\275\346\331H\267\226,\330 \331#\356\357x264 - core 164 - H.264/MPEG-4 AVC codec - Copyleft 2003-2022 - http://www.videolan.org/x264.html - options: cabac=1 ref=4 deblock=1:1:1 analyse=0x3:0x113 me=hex subme=8 psy=1 psy_rd=0.40:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=2 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=2 keyint=96 keyint_min=4"..., 131072) = 131072 <0.006053>
10152 19:10:33.185271 +++ exited with 0 +++
What is this child process then?
Offline
Couldn't say.
Dusting up on my rusty C debugging, I found the C function that is causing the delay.
fstatfs
in
/usr/src/debug/mpv/mpv/stream/stream_file.c#229
in the
HAVE_LINUX_FSTATFS
block seems to be the point when mpv hangs for me.
I'm suspecting there's something fishy with my network configuration.
Offline
MPV and VLC take a long time [45 seconds according to logs] to even start a video that is hosted on a non-local machine. The video can be YouTube or even on a SMB share hosted within the local area network and mounted.
No delay [w/ wet, curl, cp] at all. They work just fine.
It's just mpv [and vlc] with remote videos [hosted on LAN or elsewhere].
Check "ps fax" while it's hanging.
A network config causing problems w/ all destinations and protocols but only limited to very particular clients and leading to consistent 45s timeouts is 2-3 coincidents too many - the universe isn't that lazy.
There'll be something else going on.
Offline
Attempting to run ps fax while it's hanging takes as long as the process itself. ps fax only displays the tree when MPV stops hanging. I might need another terminal emulator.
3997 ? Rsl 0:18 \_ /usr/bin/konsole
4028 pts/1 Ss 0:01 | \_ /usr/bin/zsh
94113 pts/1 Sl+ 0:00 | | \_ mpv --pause --no-config -v /mnt/video.mkv
10739 pts/5 Ss 0:01 | \_ /usr/bin/zsh
94433 pts/5 R+ 0:00 | | \_ ps fax
11323 pts/6 Ss 0:00 | \_ /usr/bin/zsh
13484 pts/6 S+ 0:00 | \_ man fstatfs
13492 pts/6 S+ 0:00 | \_ less
Offline
mpv should be able to play a video on a frmaebufer console - what if you only boot the multi-user.target (2nd link below, no SDDM, no KDE) and try to play the video there?
Same problem?
Also skip all network FS mounts in your fstab and just try to play via http, in doubt a youtube video.
Offline
I'll test that right now. But I'm pretty confident it's related to fstatfs now.
It hangs when it tries to execute the `int result = fstatfs(f, &buf);` line. And it makes my system feel unresponsive too.
#include <stdio.h>
#include <fcntl.h>
#include <sys/vfs.h> /* or <sys/statfs.h> */
int main(int argc, char *argv[]) {
struct statfs buf;
char *video_path = "/mount/video.mkv";
int f = open(video_path, O_RDONLY);
int result = fstatfs(f, &buf);
printf("%d\n", result);
return 0;
}
Offline
No GUI took 45 seconds too.
And I tried measuring a Youtube video and it is significantly less than 45 seconds. It's only 8 seconds...
time mpv "https://www.youtube.com/watch?v=LDU_Txk06tM"
[uosc] script-opts/uosc.conf:135 unknown key 'autoload_types', ignoring
● Video --vid=1 (av1 3840x2160 30 fps) [default]
● Audio --aid=1 --alang=eng (opus 2ch 48000 Hz) [default]
File tags:
Date: 20180401
Uploader: Monstercat Instinct
Channel_URL: https://www.youtube.com/channel/UCp8OOssjSjGZRVYK6zWbNLg
[auto_profiles] Applying auto profile: vrr-frame-tripling
AO: [pipewire] 48000Hz stereo 2ch floatp
Using hardware decoding (nvdec-copy).
VO: [gpu-next] 3840x2160 nv12
[auto_profiles] Applying auto profile: 4k60
AV: 00:00:01 / 00:03:12 (1%) A-V: 0.000 Cache: 2.1s/3MB
Exiting... (Quit)
mpv "https://www.youtube.com/watch?v=LDU_Txk06tM" 2.63s user 1.93s system 52% cpu 8.633 total
I was wrong about all remote video. Although I feel like 8 seconds is still a bit too long.
Offline
As mentioned, yt has timeouts in order to prevent being blocked. Google isn't too happy that people are using ways around their shit webpage
But at least things start to make more sense, because we're likely only dealing w/ access to a transparent remote FS.
How many network mounts have you actually tested an can you try playing a video from that server using http?
Offline
Ah, I finally understand what you mean.
Looks like it's either just that server or SMB related. HTTP from a different computer on my local network is just fine.
Also, I know we're still in the thick of things but thanks a lot for helping. I really appreciate your time.
Offline
mpv smb://server/share/path/to/video.mp4
Do you configure non-standard mount options for cifs?
What does your fstab look like?
Offline
Trying the smb protocol URL doesn't work on mine, apparently.
[stream] No protocol handler found to open URL smb://TRUENAS.local/media/video.mkv
[stream] The protocol is either unsupported, or was disabled at compile-time.
Truth be told, I've been fiddling with the fstab a lot. Currently, it looks like so:
//TRUENAS.local/media /home/user/media cifs rw,noserverino,rsize=8388608,wsize=8388608,vers=3.1.1,iocharset=utf8,_netdev,nofail,credentials=/etc/samba/credentials/share,uid=1000,gid=1000
I'm starting to suspect TrueNAS. I span up SMB on a small Ubuntu VM and mounted its share and MPV and VLC had no problems whatsoever.
Offline
Yes, is disabled in the arch build (pobably doesn't work as plugin and nobody *wants* to use smb anyway )
Some power-saving option?
What if you play a remote video and once it actually starts immediately start to play a second one next to it? Does that also delay?
Offline
Ahaha, makes sense.
Hmm, I made some more changes to the config on TrueNAS's side and restarted the service, and now it looks like it stops hanging.
Haven't confirmed, but it may have been self-inflicted due to me prematurely trying to get off SMB and attempting NFS.
Offline