[MPlayer-users] DVD playback issue on older notebook with not so old Linux kernel

Reimar Döffinger Reimar.Doeffinger at gmx.de
Wed May 27 23:44:06 EEST 2020


On Fri, May 15, 2020 at 11:05:34AM +0200, Erik Auerswald wrote:
> I'd like to describe a DVD playback issue I encountered, and how to work
> around the problem, just in case someone else runs into it.
>
> Since upgrading an older notebook (with HDD, no SSD) from Ubuntu 16.04 LTS
> to Ubuntu 18.04 LTS, I could no longer play a complete DVD with MPlayer
> without "hanging" playback.  The picture would freeze for a short,
> but noticable time, at random moments.
>
> This issue can be prevented by disabling swap:
>
>     sudo swapoff -a
>
> I would do that for a dedicated media player PC, but I'd rather avoid
> this for a general purpose notebook system.  I disable swap just before
> playing a DVD now.
>
> The problem lies in the use of swap at all, which impacts the system
> heavily, instead of freeing pages from the page cache, which does not
> impact the system at all for the streaming workload of DVD playback.

Hm, it overall sounds like a kernel issue that maybe should rather be
reported as a kernel bug.
But I would be curious if using zram would "solve" this issue by
giving the kernel a "lower impact" thing to swap into.
That said I don't feel at all certain what exactly goes wrong there,
i.e. what exactly does cause the pause:
Is it not being able to read from the DVD fast enough? Why though?
Is it because the HDD is on the same bus as the DVD drive?
Hardly if it's a USB DVD drive.
If it's not the DVD, -cache can of course not help.
Is it that MPlayer's code/data itself gets swapped out?
Which part then? Running "perf" with wall clock time measurement
maybe can help?
Or does the kernel maybe run into some huge lock that means while
it's busy swapping MPlayer doesn't get to run?
Something entirely else?

> Many years ago, MPlayer developers looked into using something like
> madvise(2) to optimize MPlayer's memory usage, but at least back then
> it did not look promising.

As mentioned by others this would only apply to using mmap, which
MPlayer does not use for reading.
In case of DVDs even worse this is fully handled by libdvdread,
so MPlayer does not really have control over how the reading is
done at all.


More information about the MPlayer-users mailing list