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

Erik Auerswald auerswal at unix-ag.uni-kl.de
Tue May 19 14:04:41 EEST 2020


Hello David,

thanks for your feedback. :-)

First of all I want to say that I am using MPlayer for DVD playback for
many years, I still do, and it does work!  Everything I describe in this
thread concerns sporadic glitches in playback quality only.

On Mon, May 18, 2020 at 09:57:41PM +0100, Dave Woodfall wrote:
> On 2020-05-17 20:45,
> Erik Auerswald <auerswal at unix-ag.uni-kl.de> put forth the proposition:
> > On 17.05.20 13:07, Alexander Strasser wrote:
> > > On 2020-05-15 11:05 +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.
> > >
> > > Did you have a look at the caching settings?
> > > In particular -cache and -cache-min ?
> >
> > Yes, I did.  I am using a 64MiB MPlayer cache for DVD playback with the
> > default -cache-min setting.
> >
> > I have been using these settings for years on the exact same hardware.
> > The playback issues described in this thread are relatively "new".
> > (I reinstalled the notebook with Ubuntu 18.04 about a year ago.)
> >
> > Using no MPlayer cache for DVD playback, e.g., for dvdnav://, does not
> > work well on that notebook.
> 
> It's usually recommended not using cache  at all to play DVDs, as you
> may know.

Well, it is recommended to not use MPlayer's cache with dvdnav://,
but I am using dvd:// where MPlayer's cache works well.

In my experience, VLC works better than MPlayer with dvdnav:// (but
I have a couple if DVDs that VLC cannot play at all, but MPlayer using
dvdnav:// can).

I prefer MPlayer's dvd:// mode over VLC or dvdnav://.  That is not only
nostalgia, but I have been using MPlayer for DVD playback way before
MPlayer gained dvdnav:// support.

> MPlayer should play directly what is coming from the drive without
> caching it.

I do not see any technical reason for this assertion.  Anyway, MPlayer
does not do that, instead it reads data from page cache.  It may place
this data into its own cache, too.  Then it interprets the data as a
video and plays it.  The data can come from a DVD image on disk as well,
no DVD drive needed at all for playback ("cat /dev/sr0 > dvd.img" used to
work well in the past).  To the contrary, a caching layer is required to
mitigate the difference between DVD drive speed and movie playback speed.

The way MPlayer's dvdnav:// is implemented is not aligned with the way
MPlayer's cache is implemented, but that does not mean that playing
"directly from the drive" would be better in general.  Even MPlayer's
dvdnav:// uses caching via the page cache.

> It sounds to me like your DVD player can't spin fast enough if
> MPlayer can't play without cache, or perhaps it's having problems
> reading the disk, and is re-reading too often.  Have you tried any
> other drives?

It can play without cache, but sometimes with small glitches caused by
the DVD medium.  You may know of the layer transition problem, as well as
slow seeking, e.g., between tracks.  Using a sufficiently large MPlayer
cache avoids all of these reliably.  I use different cache settings
for different media formats; e.g., a smaller cache for Internet radio,
or no cache for dvdnav://.

A cache can only mitigate (but not solve) some of the above problems:

- Too slow a DVD drive would require a large cache that is filled before
  starting playback.  Copying the DVD to HDD was a common solution in
  the past.  Even todays older computers tend to be much faster than the
  computers of that time.  The DVD drive in question has sufficient speed.

- Transient read errors often can be masked by a sufficiently large cache.
  They are quite obvious during playback, because the drive is seeking for
  each re-read.  I have not been describing this problem, and disabling
  swap obviously does not have any effect on this neither.

- Permanent read errors cannot be masked by a cache.

Cleaning a DVD can solve read errors (this cannot remove a scratch,
of course).

> There may also be power saving settings that keep the drive from
> spinning up.

Not a problem, the drive spins up reliably and does not spin down during
playback.  Even drive spindown while pausing MPlayer is reliably masked
by using MPlayer's cache with dvd://.

> I'd look into that, and also cpufreq may need to be set
> to `performance' if it's in `powersave' mode.

That is not needed for DVD playback for me.  Some HD videos do require
'performance' mode for perfect playback, therefore I already use it.

> I think toying with cgroups or swappiness is looking in the wrong
> direction.

I think you are mistaken. ;-)

> Did you say what hardware you're using?  CPU cores, speed, RAM, DVD
> drive model and max speed etc?

I did not specify this.  It is a Lenovo X121 notebook with i3 processor,
8 GiB RAM, and a USB DVD writer.  Write and read speeds of the DVD writer
are far higher than needed for DVD playback (which technically just
requires single speed).

The important thing is that this setup has been able to play back DVD
movies using MPlayer without any problems for many years.  Then it
started to develop problems.

> Knowing those might give more clues.

I am not so sure about that.  If I think back, the first computer I used
for DVD playback was a single core AMD Duron 700 with a quad speed DVD
reader and 1 GiB of RAM.  MPlayer could play DVDs back then just fine.

An important point is the fact that "sudo swapoff -a" solves the problems.

Additionally, the same problems occur when playing large video files
from HDD instead of DVD, unless swap is disabled.

Thanks,
Erik
-- 
A distributed system is one in which the failure of a computer you didn't
even know existed can render your own computer unusable.
                        -- Leslie Lamport


More information about the MPlayer-users mailing list