New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slow startup #6474
Comments
Please post a log made with Other than that, your mpv executable was built against different versions of the FFmpeg libraries than those installed on your system, so make sure to fix that in order to avoid potential issues with undefined behavior. |
Okay, the slowest things turned out to be ytdl hook (why is it even called for local files?!) and window initialization. Got rid of it: with |
Can't reproduce here, ytdl isn't executed for me for local files, and playback starts after 0.039 seconds. |
All of this looks really slow. I would have expected something like OpenGL context creation taking up most of the time, but that doesn’t seem to be the case. Even the libarchive demuxer check seems to be taking over 100 milliseconds where it should take no more than maybe 2 or 5 on very slow systems. |
Also, the ytdl messages you see in the log are from literally just this piece of lua, which should not even remotely take this long to run: https://github.com/mpv-player/mpv/blob/master/player/lua/ytdl_hook.lua#L655-L665 Is your disk dying? |
So yeah, first fix the FFmpeg library issue. Who knows. We actually have code to detect this and exit with an error, but Debian chose to patch it out without fixing their broken packaging/infra. Other than that, you might have to upgrade from your AMD C-50 (which I assume this is since you’ve never mentioned what you’re trying to run mpv on) or start using a distro that is better suited for your hardware. |
Unlikely.
|
If this really is an AMD C-50 (lowest-end CPU from January 2011, and phased out by the end of 2011), then your best hope is to compile mpv yourself with some of the non-essentials stripped out, namely:
|
Even if it is, it should still be faster than my eeePC 900, which is the only comparable piece of hardware I have around. And mpv is not that slow on it (running openSUSE). So yeah, probably either a Debian issue, or a hardware defect. |
So should they rebuild all of dependent packages on every minor update? This would probably delay updates a lot. Broken compatibility is the fault of those who make breaking changes without incrementing the major version.
What exactly? Do they ship some tools for improving performance on HDD which Debian doesn't? Like cachers, or maybe kernel patches? I've heard of BFQ/UKSM, which could improve performance here, but haven't heard of distros shipping them out of box. And building a custom kernel does not require to abandon the polished-for-years system.
Sounds good, but the same could be said about almost all software. Compilation is much more painful on such CPU, and requires a lot of disk space for sources. Moreover, I play archives sometimes too (I could mount it with |
On Thursday, January 31, 2019 1:55:48 PM CET bodqhrohro wrote:
>without fixing their broken packaging/infra
So should they rebuild all of dependent packages on every minor update? This
would probably delay updates a lot. Broken compatibility is the fault of
those who make breaking changes without incrementing the major version.
That is actually what openSUSE does, and they manage to build and
automatically test several snapshots of the entire distro every week.
>or start using a distro that is better suited for your hardware.
What exactly? Do they ship some tools for improving performance on HDD which
Debian doesn't? Like cachers, or maybe kernel patches? I've heard of
BFQ/UKSM, which could improve performance here, but haven't heard of
distros shipping them out of box. And building a custom kernel does not
require to abandon the polished-for-years system.
No, just a distro that is built and configured for systems with slow CPUs,
slow storage and not a lot of RAM, with packages disabling less frequently
used features by default.
This is a niche, so mainstream distros don’t cater to it.
But like I mentioned after that post, it shouldn’t actually be necessary with
your hardware, as even my eeePC 900 still somehow copes with a modern distro
running a full KDE desktop. It isn’t fast at all, but mpv runs much faster
than on your system. Something is fishy.
>your best hope is to compile mpv
Sounds good, but the same could be said about almost all software.
Compilation is much more painful on such CPU, and requires a lot of disk
space for sources. Moreover, I play archives sometimes too (I could mount
it with `fuse-zip` too, but this is less convenient for occasional use),
and even use a DVD drive :D So if they're the bottleneck, they deserve the
performance drawdown.
Well, it is how it is. At least building mpv yourself would allow us to
eliminate the FFmpeg version mismatch as a potential cause for this behavior.
|
Did you somehow manage to disable your hard drive cache? It seems like disk I/O is taking forever in your log. I mean 3s to initialize fonts?! |
Unlikely. Free RAM compensates slow HDD well when there is a lot of it. That's why I have And if the main bottleneck is disk I/O, shouldn't related calls like |
On Thursday, January 31, 2019 5:58:20 PM CET bodqhrohro wrote:
>Did you somehow manage to disable your hard drive cache?
Unlikely. Free RAM compensates slow HDD well when there is a lot of it.
That's why I have `zram` instead of disk swap, and high `vm.swappiness`.
More things coming to light about your setup. This will likely cause Linux to
(perhaps unnecessarily) swap out a lot of program code in compressed RAM,
which has considerable performance overhead especially on a system with slow
CPU/RAM such as yours.
|
Also, swap on zram is probably less efficient than zswap. You are effectively reducing the amount of RAM that is immediately available for both program code and I/O caching, thereby just slowing down your system. |
So does disabling all swap (including zram, zswap, etc.) help? |
Do try that, yes. But disabling swap will pretty much always make things worse compared to having swapspace available. We’re just blindly guessing here anyway, but if it does turn out to fix this performance issue, I suggest trying to enable on-disk swap as well as zswap (which pretty much acts as a compressed swap cache, as it evicts the least recently used pages to disk if necessary). |
zram does compression great. I have compressed/uncompressed amount of zram printed to the panel, usually the compression level is about 20%–35%. Desktop software tend to "leak" (past chatlogs, terminal scrollbacks, forsaken browser tabs and so on), and even though restarting it from time to time is a good practice, having some kind of swap to toss barely useful pages out is a musthave too, if not abused too much, of course.. High The HDD is usually more loaded than CPU, so additionally loading it with pages swapping, even compressed ones, would make things even worse. When I had disk swap, in critical thrashing conditions I had to wait about 10 minutes for each command to complete when rescuing the system in TTY; now it's way better even with LA >50. |
Would you please try the things we’ve told you to try? We’re not getting any closer to tracking down the cause for this slowness without some cooperation, as apparently none of us can reproduce your performance issues even on much slower hardware. |
Actually, you don’t have to. I’m absolutely certain that this is not mpv’s fault, as many of the points where it stalls according to your log make absolutely no sense. Even code that effectively just prints a message and immediately returns sometimes takes dozens of milliseconds to execute on your system. There’s just absolutely nothing we can do about that. |
mpv version and platform
0.29.1, Debian GNU/Linux 10
Reproduction steps
Playing a single file, already opened before, so both the file and mpv should be cached in RAM.
Expected behavior
There is nothing to lag much.
Actual behavior
mpv still takes several seconds to start playback.
Log file
https://0x0.st/zrg7.log
Sample files
strace -c
:strace -cw
:I also tried running
-v -v -v -v
, as you suggested for some similar issues, but without timestamps it's barely informative anyway. How do I enable timestamps? Grepping futexes in plainstrace
output is not much informative too, as only by descriptors I have no idea what are they for and what do they wait for.The text was updated successfully, but these errors were encountered: