FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 05-07-2012, 05:39 PM
Mark Knecht
 
Default I want to play movies without hangs

On Mon, May 7, 2012 at 5:41 AM, Alex Schuster <wonko@wonkology.org> wrote:
> Some while ago, I wrote:
>
> [
> mplayer stutters when I/O is going on, even hangs for seconds when I do a
> dd if=/dev/zero of=somefile bs=1M
> ]
>
>> Urs Schutz writes:
>>
>> > Just an idea: Is the disk OK? Replace /dev/sda with your
>> > disk...
> [...]
>> > I had a bad disk here, which resulted in slow IO, but not
>> > complete failure. Smart detected this immediately. Sorry,
>> > I do not know how to check disks with LVM.
>>
>> Didn't you get errors in yslog then?
>>
>> I also thought about swapping the system drive - I have a larger backup
>> drive, with nearly identical logical volumes on it, where I make
>> backups with rdiffbackup. So even the content is identical, except for
>> an additional rdiff-backup directory containing the increments. So all
>> I have to do is to echange the two volume group names, reboot, and the
>> system will run from the other drive. But I very much doubt this will
>> help, transfer speed looks okay to me, around 100 MB/s with dd.
>
> I did it in another way. I created a large file system (LVM) on my 2nd
> drive, copied /, /usr, /var, /opt and /home over. My whole system is
> encrypted, but I omitted this, just to make sure this is not the
> bottleneck.
>
> Alas, no change. Another thing I tried was to change the SATA mode in my
> BIOS from AHCI to whatever the other option is. This did not help either.
>
> Now this is really annoying. I watch small clips mostly, and can live
> with that, and when I want to watch stuff with others, I copy the file to
> tmpfs, which seems to help a lot.
>
> But now I found another solution: NOT USING KDE.
>
> When X crashed (trying to make the old Unreal game play), I fired up
> another window manager, and when I played a video in there, there was no
> problem at all. So, I have another workaround.
>
> But does anyone have an idea, why running KDE is the problem? Disabling
> desktop effects does not help.
>
> I must be totally crazy because I still want to use KDE, despite the big
> trouble it gives me nearly every day. Yes, most things work fine now, but
> there are many many little problems, daily application crashes, and every
> time I log in I fear that the desktop won't come up. 8G of RAM was not
> enough to avoid swapping, so now I have 16G, that's fine, I no longer
> care about kwin using 1G of my RAM. Oh, and I no longer use KMail, after
> it ate thousands of mails I just wanted to move. No problem, they were
> not important, but I no longer trust the KDEPIM suite. And it seems the
> developers do not care about this, the bug report got no replies.
>
> But anyway. Any idea why it only happens with KDE? I will ask on the KDE
> mailing list, but I thought I post here first, maybe there's something
> Gentoo-specific going on here.
>
> * * * *Wonko
>

Hey Wonko,
OK, fire up two terminals. In one run top, hit 1 & z so you see all
your CPUs and then watch CPU usage. In the second terminal su to root
and run iotop -o. Now, watch for a few minutes and get a feel for
what's going on when video is not running. Then start your video and
watch IO usage and CPU usage. Where's the problem?

Once you get an idea where the bottleneck is we can address what a
solution might be. In general, if the CPUs aren't maxed out and it's
an I/O problem then usually a bit more buffering is a simple solution.
Other more draconian solution might be a real-time kernel with a
player (if there is one) that is set up for real-time playback.

Looking forward to hearing your test results.

Cheers,
Mark
 
Old 05-07-2012, 06:52 PM
Alex Schuster
 
Default I want to play movies without hangs

Michael Hampicke writes:

> Am 07.05.2012 18:26, schrieb Volker Armin Hemmann:
> > Am Montag, 7. Mai 2012, 14:41:34 schrieb Alex Schuster:
> >> Some while ago, I wrote:
> >>
> >> [
> >> mplayer stutters when I/O is going on, even hangs for seconds when I
> >> do a dd if=/dev/zero of=somefile bs=1M
> >> ]
[...]
> >> But now I found another solution: NOT USING KDE.
> >>
> >> When X crashed (trying to make the old Unreal game play), I fired up
> >> another window manager, and when I played a video in there, there
> >> was no problem at all. So, I have another workaround.
> >>
> >> But does anyone have an idea, why running KDE is the problem?
> >> Disabling desktop effects does not help.
> >
> > nepomuk/virtuoso running in the background
> >
> > whenever you have more than 1 process doing IO linux sucks ass.
> >
> > Now, you write to a partition, nepomuk tries to index it (1 read) and
> > your player reading the video file (2nd read). Interactivity is shot.
> >
> > Pause/kill nepomuk and look if it helps.

Nice shot, but this cannot be the problem. Sorry, now that I read my post
again I see I did not mention that I _still_ have KDE running all the
time, doing whatever it does. I only need to play the videos outside in a
window manager I have running in parallel.
And the output of my dd action goes to another partition anyway, which is
not being indexed. I have 280,000 files indexed, a plain locate gives
nearly ten times as much.
Virtuoso has been a big pain in the past indeed. So I had it disabled
until KDE 4.8 I think. It does some indexing now when I log in, and it is
still doing so 8 hours after I logged in the last time, but I do not
notice this much, since KDE 4.8. Whether it affects my video playback I'm
not so sure, but I have the playback problems even when it is not running
- there's too much stuff going on all the time.

> > For me the worst case is: writing lots of files on a usb device -
> > sucks everywhere, even on a vt.

Indeed. But should this affect an mplayer using a huge cache?
Does it also suck when you are writing with cp, using ionice -c 3?

> Maybe changing the kernel io scheduler will help?
>
> # /usr/src/linux/Documentation/block/switching-sched.txt
> # /usr/src/linux/Documentation/block/deadline-iosched.txt
> # /usr/src/linux/Documentation/block/cfq-iosched.txt

Nope. I just tried noop and deadline (cfq is my default) and did not see
much of a difference.

Wonko
 
Old 05-07-2012, 08:43 PM
Dale
 
Default I want to play movies without hangs

Alex Schuster wrote:
<<< SNIP >>>
> Now this is really annoying. I watch small clips mostly, and can live
> with that, and when I want to watch stuff with others, I copy the file to
> tmpfs, which seems to help a lot.
>
> But now I found another solution: NOT USING KDE.
>
> When X crashed (trying to make the old Unreal game play), I fired up
> another window manager, and when I played a video in there, there was no
> problem at all. So, I have another workaround.
>
> But does anyone have an idea, why running KDE is the problem? Disabling
> desktop effects does not help.
>
> I must be totally crazy because I still want to use KDE, despite the big
> trouble it gives me nearly every day. Yes, most things work fine now, but
> there are many many little problems, daily application crashes, and every
> time I log in I fear that the desktop won't come up. 8G of RAM was not
> enough to avoid swapping, so now I have 16G, that's fine, I no longer
> care about kwin using 1G of my RAM. Oh, and I no longer use KMail, after
> it ate thousands of mails I just wanted to move. No problem, they were
> not important, but I no longer trust the KDEPIM suite. And it seems the
> developers do not care about this, the bug report got no replies.
>
> But anyway. Any idea why it only happens with KDE? I will ask on the KDE
> mailing list, but I thought I post here first, maybe there's something
> Gentoo-specific going on here.
>
> Wonko
>
>


When I first built this rig, I ran into this issue as well. What I did
was tell smplayer, in my case, to cache more of the video. I have mine
set to cache 6Mbs and it plays fine even on HD videos.

This may not help you but if you have not tried it yet, may be worth a
shot. It is aggravating when it does this tho.

Also, there was a thread a good while back with this issue and their fix
was to do a emerge -e world with everything optimized for their CPU and
such. May be worth thinking about at least.

Dale

:-) :-)

--
I am only responsible for what I said ... Not for what you understood or
how you interpreted my words!

Miss the compile output? Hint:
EMERGE_DEFAULT_OPTS="--quiet-build=n"
 
Old 05-07-2012, 09:09 PM
Alex Schuster
 
Default I want to play movies without hangs

Dale writes:

> When I first built this rig, I ran into this issue as well. What I did
> was tell smplayer, in my case, to cache more of the video. I have mine
> set to cache 6Mbs and it plays fine even on HD videos.

I have cache = 131072 and cache-min=20.0 in .mplayer/config. That's
128MB, this should be enough. Got this hint by James Broadhead some
months ago in this thread.

> Also, there was a thread a good while back with this issue and their fix
> was to do a emerge -e world with everything optimized for their CPU and
> such. May be worth thinking about at least.

That was Walter Dnes, also in thos thread. But everything should be quite
optimized here, with:
CFLAGS="-pipe -march=amdfam10 -O2
-floop-interchange -floop-strip-mine -floop-block
-msse -msse2 -msse3 -msse4a -msse4.1 -msse4.2 -m3dnow
-mcx16 -msahf -maes -mpclmul -mpopcnt -mabm -mlwp -mavx
--param l1-cache-size=16
--param l1-cache-line-size=64
--param l2-cache-size=2048"

And I do not have high CPU load when playing movies.

Wonko
 
Old 05-07-2012, 09:11 PM
Alex Schuster
 
Default I want to play movies without hangs

Mark Knecht writes:

> On Mon, May 7, 2012 at 5:41 AM, Alex Schuster <wonko@wonkology.org>
> wrote:
> > Some while ago, I wrote:
> >
> > [
> > mplayer stutters when I/O is going on, even hangs for seconds when I
> > do a dd if=/dev/zero of=somefile bs=1M
> > ]
[...]
> OK, fire up two terminals. In one run top, hit 1 & z so you see all
> your CPUs and then watch CPU usage. In the second terminal su to root
> and run iotop -o. Now, watch for a few minutes and get a feel for
> what's going on when video is not running. Then start your video and
> watch IO usage and CPU usage. Where's the problem?
>
> Once you get an idea where the bottleneck is we can address what a
> solution might be. In general, if the CPUs aren't maxed out and it's
> an I/O problem then usually a bit more buffering is a simple solution.
> Other more draconian solution might be a real-time kernel with a
> player (if there is one) that is set up for real-time playback.
>
> Looking forward to hearing your test results.

Thanks for your support, Mark!

I did this already, but sometimes I do not notice anything. I guess it's
short I/O operations in that case. CPU load is not the problem, and it
happens for both high-quality videos and small ones.
Currently iotop shows stuff like kjournald, kworker, kdeinit4,
akonadiserver, firefox. And lots of virtuoso-t and nepomuk when I enable
indexing again, which I just suspended.
And mplayer of course, it shows up in about every 2nd redisplay, which
happens every second.

Well... but when I do the same in the other window manager, it seems I
see fewer processes then. Are they mostly suspended when I am on another
display?
And I should fire up the same stuff (Firefox, Chromium, maybe KDEPIM
stuff) in the other WM and see if this makes things worse. But I'll do
this tomorrow. Thanks for the inspiration, though, at least I have
something more to try now.

The interrupts are very small normally, but noticeable, annoying and
somewhat embarrassing. When they just happened I only noticed akonadi and
kjournald during that time. I can force larger interrupts by doing my dd
command.

But anyway - my intention is not so much to find out what all these
I/O processes are and how to make them calm down, renice them or whatever.
Four cores @ 3.6 GHz just should be able to play movies without any
interruption. And it _is_ possible, when I start the playback on another
window manager, while KDE is still running on the other display.

I could just switch to, um, ummmm.... Gnome maybe... or Xfce4... or
something else, but I would not like to do so. Despite by big KDE
problems. I hate KDE. But I still want it. I feel mad.

Wonko
 
Old 05-07-2012, 09:16 PM
Stroller
 
Default I want to play movies without hangs

On 7 May 2012, at 21:43, Dale wrote:
> ...
> Also, there was a thread a good while back with this issue and their fix
> was to do a emerge -e world with everything optimized for their CPU and
> such. May be worth thinking about at least.

I understood that issue as significantly different - in that case there was stuttering of demanding video with no other i/o occurring. In this case *any* video, even low-res standard-def video, is pausing when i/o load is applied. The previous case is CPU / GPU video decoding performance issue, I think this one is clearly not.

Stroller.
 
Old 05-07-2012, 10:56 PM
walt
 
Default I want to play movies without hangs

On 05/07/2012 10:14 AM, Volker Armin Hemmann wrote:
> Am Montag, 7. Mai 2012, 18:44:05 schrieb Michael Hampicke:
>> Maybe changing the kernel io scheduler will help?
>>
>> # /usr/src/linux/Documentation/block/switching-sched.txt
>> # /usr/src/linux/Documentation/block/deadline-iosched.txt
>> # /usr/src/linux/Documentation/block/cfq-iosched.txt
>
> nice idea - but that didn't help in the past. Why should it help now?
>
> The question is - why does disk IO make the mouse jerky and delays keyboard
> input? That is just idiotic.

Have you tested ck-sources for comparison?
 
Old 05-07-2012, 11:13 PM
Volker Armin Hemmann
 
Default I want to play movies without hangs

Am Montag, 7. Mai 2012, 15:56:20 schrieb walt:
> On 05/07/2012 10:14 AM, Volker Armin Hemmann wrote:
> > Am Montag, 7. Mai 2012, 18:44:05 schrieb Michael Hampicke:
> >> Maybe changing the kernel io scheduler will help?
> >>
> >> # /usr/src/linux/Documentation/block/switching-sched.txt
> >> # /usr/src/linux/Documentation/block/deadline-iosched.txt
> >> # /usr/src/linux/Documentation/block/cfq-iosched.txt
> >
> > nice idea - but that didn't help in the past. Why should it help now?
> >
> > The question is - why does disk IO make the mouse jerky and delays
> > keyboard
> > input? That is just idiotic.
>
> Have you tested ck-sources for comparison?

in the past, yes. Complete disappointment.

But it is ok, if the io happens between two very fast drives (ssd - ssd or ssd
- raid5). So the problem is:
io with one slow drive being written to
swapping

those cases are just horrible.

And vanilla-sources just work. Stable. Even with suspend to ram and ati
drivers.

--
#163933
 
Old 05-07-2012, 11:56 PM
walt
 
Default I want to play movies without hangs

On 05/07/2012 04:13 PM, Volker Armin Hemmann wrote:

> And vanilla-sources just work. Stable. Even with suspend to ram and ati
> drivers.

That confuses me. Are you saying the gentoo-sources don't 'just work'?
 
Old 05-08-2012, 03:05 PM
Volker Armin Hemmann
 
Default I want to play movies without hangs

Am Montag, 7. Mai 2012, 16:56:43 schrieb walt:
> On 05/07/2012 04:13 PM, Volker Armin Hemmann wrote:
> > And vanilla-sources just work. Stable. Even with suspend to ram and ati
> > drivers.
>
> That confuses me. Are you saying the gentoo-sources don't 'just work'?

I don't know, haven't used gentoo sources in ages. I don't need fb
beautification, zcache, alps or livecd goodies. I like to be as close to
upstream as possible, so bug reports are taken seriously.

vanilla-sources work reliably with that annoying io-stuff. But no matter which
kernel I tried, ck, zen, gentoo, love etc pp that annoying io-stuff was always
there.. so no reason at all to use a patched up kernel.


--
#163933
 

Thread Tools




All times are GMT. The time now is 12:39 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org