* mplayer + heavy io: why ionice doesn't help?
@ 2006-08-18 17:37 Denis Vlasenko
2006-08-18 17:57 ` Nick Warne
2006-08-18 18:01 ` Eric Piel
0 siblings, 2 replies; 12+ messages in thread
From: Denis Vlasenko @ 2006-08-18 17:37 UTC (permalink / raw)
To: mplayer-users, linux-kernel
Hi,
I noticed that mplayer's video playback starts to skip
if I do some serious copying or grepping on the disk
with movie being played from.
nice helps, but does not eliminate the problem.
I guessed that this is a problem with mplayer
failing to read next portion of input data in time,
so I used Jens's ionice.c from
Documentation/block/ioprio.txt
I am using it this:
ionice -c1 -n0 -p<mplayer pid>
but so far I don't see any effect from using it.
mplayer still skips.
Does anybody have an experience in this?
--
vda
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: mplayer + heavy io: why ionice doesn't help?
2006-08-18 17:37 mplayer + heavy io: why ionice doesn't help? Denis Vlasenko
@ 2006-08-18 17:57 ` Nick Warne
2006-08-18 18:01 ` Eric Piel
1 sibling, 0 replies; 12+ messages in thread
From: Nick Warne @ 2006-08-18 17:57 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: mplayer-users, linux-kernel
Hi,
Have you followed this:
http://www.mplayerhq.hu/DOCS/HTML/en/rtc.html
Not that it will help, I don't know, but it could be to do with timing.
Nick
On 18/08/06, Denis Vlasenko <vda.linux@googlemail.com> wrote:
> Hi,
>
> I noticed that mplayer's video playback starts to skip
> if I do some serious copying or grepping on the disk
> with movie being played from.
>
> nice helps, but does not eliminate the problem.
> I guessed that this is a problem with mplayer
> failing to read next portion of input data in time,
> so I used Jens's ionice.c from
> Documentation/block/ioprio.txt
>
> I am using it this:
>
> ionice -c1 -n0 -p<mplayer pid>
>
> but so far I don't see any effect from using it.
> mplayer still skips.
>
> Does anybody have an experience in this?
> --
> vda
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: mplayer + heavy io: why ionice doesn't help?
2006-08-18 17:37 mplayer + heavy io: why ionice doesn't help? Denis Vlasenko
2006-08-18 17:57 ` Nick Warne
@ 2006-08-18 18:01 ` Eric Piel
2006-08-19 18:04 ` Denis Vlasenko
1 sibling, 1 reply; 12+ messages in thread
From: Eric Piel @ 2006-08-18 18:01 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: mplayer-users, linux-kernel
08/18/2006 07:37 PM, Denis Vlasenko wrote/a écrit:
> Hi,
>
> I noticed that mplayer's video playback starts to skip
> if I do some serious copying or grepping on the disk
> with movie being played from.
>
> nice helps, but does not eliminate the problem.
> I guessed that this is a problem with mplayer
> failing to read next portion of input data in time,
> so I used Jens's ionice.c from
> Documentation/block/ioprio.txt
>
> I am using it this:
>
> ionice -c1 -n0 -p<mplayer pid>
>
> but so far I don't see any effect from using it.
> mplayer still skips.
>
> Does anybody have an experience in this?
Hello
IOnice only works with CFQ, have you checked that you are using the CFQ
IO scheduler?
# cat /sys/block/hda/queue/scheduler #put the name of YOUR harddisk
In case it's not the default IO scheduler, you can change it with:
# echo cfq > /sys/block/hda/queue/scheduler
My two cents...
See you,
Eric
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: mplayer + heavy io: why ionice doesn't help?
2006-08-18 18:01 ` Eric Piel
@ 2006-08-19 18:04 ` Denis Vlasenko
2006-08-20 8:22 ` Jan Engelhardt
0 siblings, 1 reply; 12+ messages in thread
From: Denis Vlasenko @ 2006-08-19 18:04 UTC (permalink / raw)
To: Eric Piel; +Cc: mplayer-users, linux-kernel
On Friday 18 August 2006 20:01, Eric Piel wrote:
> 08/18/2006 07:37 PM, Denis Vlasenko wrote/a écrit:
> > Hi,
> >
> > I noticed that mplayer's video playback starts to skip
> > if I do some serious copying or grepping on the disk
> > with movie being played from.
> >
> > nice helps, but does not eliminate the problem.
> > I guessed that this is a problem with mplayer
> > failing to read next portion of input data in time,
> > so I used Jens's ionice.c from
> > Documentation/block/ioprio.txt
> >
> > I am using it this:
> >
> > ionice -c1 -n0 -p<mplayer pid>
> >
> > but so far I don't see any effect from using it.
> > mplayer still skips.
> >
> > Does anybody have an experience in this?
> Hello
>
> IOnice only works with CFQ, have you checked that you are using the CFQ
> IO scheduler?
> # cat /sys/block/hda/queue/scheduler #put the name of YOUR harddisk
>
> In case it's not the default IO scheduler, you can change it with:
> # echo cfq > /sys/block/hda/queue/scheduler
Thanks!
It helps. mplayer skips much less, but still some skipping is present.
I experimented with forcing entire file to be present in the
pagecache, and in this case mplayer almost never skips.
Looks like mplayer have very little tolerance for reads
randomly taking more time to read input stream.
However, I then looked into the mplayer's source
(I wondered why it doesn't do read buffering itself)...
The code is, um, less than pretty.
--
vda
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: mplayer + heavy io: why ionice doesn't help?
2006-08-19 18:04 ` Denis Vlasenko
@ 2006-08-20 8:22 ` Jan Engelhardt
2006-08-20 14:43 ` Lee Revell
0 siblings, 1 reply; 12+ messages in thread
From: Jan Engelhardt @ 2006-08-20 8:22 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: Eric Piel, mplayer-users, linux-kernel
>
>It helps. mplayer skips much less, but still some skipping is present.
Try with -ao alsa, then it should skip less, or at least, if it skip, skip
back so that less audio is lost.
When playing audio-only files, it is always wise to specify e.g. -cache 320
which proved to be a good value for my workloads.
>I experimented with forcing entire file to be present in the
>pagecache, and in this case mplayer almost never skips.
>
>Looks like mplayer have very little tolerance for reads
>randomly taking more time to read input stream.
>
>However, I then looked into the mplayer's source
>(I wondered why it doesn't do read buffering itself)...
>
>The code is, um, less than pretty.
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: mplayer + heavy io: why ionice doesn't help?
2006-08-20 8:22 ` Jan Engelhardt
@ 2006-08-20 14:43 ` Lee Revell
2006-08-20 16:43 ` Denis Vlasenko
0 siblings, 1 reply; 12+ messages in thread
From: Lee Revell @ 2006-08-20 14:43 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: Denis Vlasenko, Eric Piel, mplayer-users, linux-kernel
On Sun, 2006-08-20 at 10:22 +0200, Jan Engelhardt wrote:
> >
> >It helps. mplayer skips much less, but still some skipping is present.
>
> Try with -ao alsa, then it should skip less, or at least, if it skip, skip
> back so that less audio is lost.
> When playing audio-only files, it is always wise to specify e.g. -cache 320
> which proved to be a good value for my workloads.
>
Only with the very latest versions of mplayer does ALSA work at all.
It's unusable here because it resets the auduio stream on each underrun
rather than simply ignoring them.
Lee
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: mplayer + heavy io: why ionice doesn't help?
2006-08-20 14:43 ` Lee Revell
@ 2006-08-20 16:43 ` Denis Vlasenko
2006-08-20 21:36 ` Lee Revell
0 siblings, 1 reply; 12+ messages in thread
From: Denis Vlasenko @ 2006-08-20 16:43 UTC (permalink / raw)
To: Lee Revell; +Cc: Jan Engelhardt, Eric Piel, mplayer-users, linux-kernel
On Sunday 20 August 2006 16:43, Lee Revell wrote:
> On Sun, 2006-08-20 at 10:22 +0200, Jan Engelhardt wrote:
> > >
> > >It helps. mplayer skips much less, but still some skipping is present.
> >
> > Try with -ao alsa, then it should skip less, or at least, if it skip, skip
> > back so that less audio is lost.
> > When playing audio-only files, it is always wise to specify e.g. -cache 320
> > which proved to be a good value for my workloads.
> >
>
> Only with the very latest versions of mplayer does ALSA work at all.
> It's unusable here because it resets the auduio stream on each underrun
> rather than simply ignoring them.
I'm not sure that I ever got an underrun (may check it
for you if you need that, how to do it?),
but mplayer -ao alsa is working for me just fine.
I eliminated skips due to CPU and disk using
nice and -cache 8000. I still can make it skip
when my KDE background picture is changing.
I think that these skips are caused by the X server.
It has no prioritization for request handling and
thus it does not paint mplayer output fast enough:
it needs to repaint background and semi-transparent
konsole(s), and that is taking a few seconds at least.
This is probably aggravated by serializing nature of Xlib,
according to:
http://en.wikipedia.org/wiki/XLib
http://en.wikipedia.org/wiki/XCB
--
vda
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: mplayer + heavy io: why ionice doesn't help?
2006-08-20 16:43 ` Denis Vlasenko
@ 2006-08-20 21:36 ` Lee Revell
2006-08-20 22:04 ` Jan Engelhardt
2006-08-22 16:26 ` Denis Vlasenko
0 siblings, 2 replies; 12+ messages in thread
From: Lee Revell @ 2006-08-20 21:36 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: Jan Engelhardt, Eric Piel, mplayer-users, linux-kernel
On Sun, 2006-08-20 at 18:43 +0200, Denis Vlasenko wrote:
> On Sunday 20 August 2006 16:43, Lee Revell wrote:
> > On Sun, 2006-08-20 at 10:22 +0200, Jan Engelhardt wrote:
> > > >
> > > >It helps. mplayer skips much less, but still some skipping is present.
> > >
> > > Try with -ao alsa, then it should skip less, or at least, if it skip, skip
> > > back so that less audio is lost.
> > > When playing audio-only files, it is always wise to specify e.g. -cache 320
> > > which proved to be a good value for my workloads.
> > >
> >
> > Only with the very latest versions of mplayer does ALSA work at all.
> > It's unusable here because it resets the auduio stream on each underrun
> > rather than simply ignoring them.
>
> I'm not sure that I ever got an underrun (may check it
> for you if you need that, how to do it?),
> but mplayer -ao alsa is working for me just fine.
>
You probably don't get underruns because your machine is fast. Mine is
a 600Mhz Via board, but I know this is an mplayer ALSA driver bug
because it works perfectly with -ao oss, and because mplayer's ALSA
driver maintainer has acknowledged the bug.
> I eliminated skips due to CPU and disk using
> nice and -cache 8000. I still can make it skip
> when my KDE background picture is changing.
>
I also must run mplayer at nice -20 for it to be usable.
> I think that these skips are caused by the X server.
> It has no prioritization for request handling and
> thus it does not paint mplayer output fast enough:
> it needs to repaint background and semi-transparent
> konsole(s), and that is taking a few seconds at least.
>
> This is probably aggravated by serializing nature of Xlib,
> according to:
>
> http://en.wikipedia.org/wiki/XLib
> http://en.wikipedia.org/wiki/XCB
I think the problem is also due to mplayer's faulty design. It should
be multithreaded and use RT threads for the time sensitive work, like
all professional AV applications and many other consumer players do.
Lee
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: mplayer + heavy io: why ionice doesn't help?
2006-08-20 21:36 ` Lee Revell
@ 2006-08-20 22:04 ` Jan Engelhardt
2006-08-22 16:26 ` Denis Vlasenko
1 sibling, 0 replies; 12+ messages in thread
From: Jan Engelhardt @ 2006-08-20 22:04 UTC (permalink / raw)
To: Lee Revell; +Cc: Denis Vlasenko, Eric Piel, mplayer-users, linux-kernel
>> > > >It helps. mplayer skips much less, but still some skipping is present.
>> > >
>> > > Try with -ao alsa, then it should skip less, or at least, if it skip, skip
>> > > back so that less audio is lost.
>> > > When playing audio-only files, it is always wise to specify e.g. -cache 320
>> > > which proved to be a good value for my workloads.
>> >
>> > Only with the very latest versions of mplayer does ALSA work at all.
>> > It's unusable here because it resets the auduio stream on each underrun
>> > rather than simply ignoring them.
>>
>> I'm not sure that I ever got an underrun (may check it
>> for you if you need that, how to do it?),
>> but mplayer -ao alsa is working for me just fine.
>
>You probably don't get underruns because your machine is fast. Mine is
>a 600Mhz Via board, but I know this is an mplayer ALSA driver bug
>because it works perfectly with -ao oss, and because mplayer's ALSA
>driver maintainer has acknowledged the bug.
Good to hear. mpg123 and ogg123 all behave nice (without nice, ionice, or
other priority adjustments) even under disk load.
>I think the problem is also due to mplayer's faulty design. It should
>be multithreaded and use RT threads for the time sensitive work, like
Heh sounds like you need MplayerXP.
>all professional AV applications and many other consumer players do.
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: mplayer + heavy io: why ionice doesn't help?
2006-08-20 21:36 ` Lee Revell
2006-08-20 22:04 ` Jan Engelhardt
@ 2006-08-22 16:26 ` Denis Vlasenko
2006-08-22 17:37 ` Jan Engelhardt
2006-08-22 17:38 ` Xavier Bestel
1 sibling, 2 replies; 12+ messages in thread
From: Denis Vlasenko @ 2006-08-22 16:26 UTC (permalink / raw)
To: Lee Revell; +Cc: Jan Engelhardt, Eric Piel, mplayer-users, linux-kernel
> > I eliminated skips due to CPU and disk using
> > nice and -cache 8000. I still can make it skip
> > when my KDE background picture is changing.
> >
>
> I also must run mplayer at nice -20 for it to be usable.
>
> > I think that these skips are caused by the X server.
> > It has no prioritization for request handling and
> > thus it does not paint mplayer output fast enough:
> > it needs to repaint background and semi-transparent
> > konsole(s), and that is taking a few seconds at least.
> >
> > This is probably aggravated by serializing nature of Xlib,
> > according to:
> >
> > http://en.wikipedia.org/wiki/XLib
> > http://en.wikipedia.org/wiki/XCB
>
> I think the problem is also due to mplayer's faulty design. It should
> be multithreaded and use RT threads for the time sensitive work, like
> all professional AV applications and many other consumer players do.
RT - yes, multithreaded - unsure. Witness how squid manages to
serve hundreds of simultaneous streams using just a single process.
Multithreading seems cool on the first glance and it is easier to code
than clever O_NONBLOCK/select/poll/etc stuff. However,
on single-CPU boxes, which are still a majority, multithreading
just incurs context switching penalty. It cannot magically
make CPU do more work in a unit of time.
--
vda
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: mplayer + heavy io: why ionice doesn't help?
2006-08-22 16:26 ` Denis Vlasenko
@ 2006-08-22 17:37 ` Jan Engelhardt
2006-08-22 17:38 ` Xavier Bestel
1 sibling, 0 replies; 12+ messages in thread
From: Jan Engelhardt @ 2006-08-22 17:37 UTC (permalink / raw)
To: Denis Vlasenko; +Cc: Lee Revell, Eric Piel, mplayer-users, linux-kernel
>
>RT - yes, multithreaded - unsure. Witness how squid manages to
>serve hundreds of simultaneous streams using just a single process.
So apache (with the most common MPMs) is badly designed ;-)
Jan Engelhardt
--
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: mplayer + heavy io: why ionice doesn't help?
2006-08-22 16:26 ` Denis Vlasenko
2006-08-22 17:37 ` Jan Engelhardt
@ 2006-08-22 17:38 ` Xavier Bestel
1 sibling, 0 replies; 12+ messages in thread
From: Xavier Bestel @ 2006-08-22 17:38 UTC (permalink / raw)
To: Denis Vlasenko
Cc: Lee Revell, Jan Engelhardt, Eric Piel, mplayer-users,
linux-kernel
Le mardi 22 août 2006 à 18:26 +0200, Denis Vlasenko a écrit :
> > I think the problem is also due to mplayer's faulty design. It should
> > be multithreaded and use RT threads for the time sensitive work, like
> > all professional AV applications and many other consumer players do.
>
> RT - yes, multithreaded - unsure. Witness how squid manages to
> serve hundreds of simultaneous streams using just a single process.
>
> Multithreading seems cool on the first glance and it is easier to code
> than clever O_NONBLOCK/select/poll/etc stuff. However,
> on single-CPU boxes, which are still a majority, multithreading
> just incurs context switching penalty. It cannot magically
> make CPU do more work in a unit of time.
The problem with mplayer is latency more than throughput, and for that
multithreading is king. Squid can get away with a 100ms delay between
two packets, mplayer can't.
Xav
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2006-08-22 17:39 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-18 17:37 mplayer + heavy io: why ionice doesn't help? Denis Vlasenko
2006-08-18 17:57 ` Nick Warne
2006-08-18 18:01 ` Eric Piel
2006-08-19 18:04 ` Denis Vlasenko
2006-08-20 8:22 ` Jan Engelhardt
2006-08-20 14:43 ` Lee Revell
2006-08-20 16:43 ` Denis Vlasenko
2006-08-20 21:36 ` Lee Revell
2006-08-20 22:04 ` Jan Engelhardt
2006-08-22 16:26 ` Denis Vlasenko
2006-08-22 17:37 ` Jan Engelhardt
2006-08-22 17:38 ` Xavier Bestel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox