Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: User

I want to play movies without hangs

 

 

First page Previous page 1 2 3 Next page Last page  View All Gentoo user RSS feed   Index | Next | Previous | View Threaded


wonko at wonkology

Feb 16, 2012, 7:29 AM

Post #1 of 64 (1838 views)
Permalink
I want to play movies without hangs

Hi there!

Strange things are going on here.

I've written here in the past about my performance problems. My dual-core
had trouble playing movies without stuttering when there was I/O. It was
mainly swapping that caused this, and 8 G were not enough for me running
KDE4.

Then my hardware broke, and I got new one, except for the system hard
drive and the PSU. It's an AMD FX-4100 quad-core with 3.6 GHz, 16 G of
RAM. Running gentoo-sources-3.2.1 as kernel. But it seems playing movies
got even worse!

The videos do not need to have high quality. When I do this, I get
interruptions, sometimes for more than a whole second:

# dd if=/dev/zero of=/tmp/argh bs=10M count=1000

My whole system is encrypted, but the same happens with unencrypted
partitions. All are on LVM. When I write to another drive, there is no
effect. Throughput is around 50-60 MB/s.

Any ideas where to look? I think I'll create a completely fresh
kernel .config with genkernel, maybe my own .config has some weird
problem. But I tried similar things in the past already, getting a kernel
from a live cd, to no effect.

I put cache = 10240 into .mplayer/config to get 10 MB of video cached,
but I see no effect.

Playing music with Amarok is no problem.

My SATA drives are in AHCI mode, here's some dmesg info about that:

ahci 0000:00:11.0: version 3.0
ahci 0000:00:11.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22
ahci 0000:00:11.0: AHCI 0001.0100 32 slots 4 ports 3 Gbps 0xf impl SATA
mode
ahci 0000:00:11.0: flags: 64bit ncq sntf ilck led clo pmp pio slum part
ccc sxs
scsi0 : ahci
scsi1 : ahci
scsi2 : ahci
scsi3 : ahci
ata1: SATA max UDMA/133 abar m1024 [at] 0xff70b00 port 0xff70b100 irq 22
ata2: SATA max UDMA/133 abar m1024 [at] 0xff70b00 port 0xff70b180 irq 22
ata3: SATA max UDMA/133 abar m1024 [at] 0xff70b00 port 0xff70b200 irq 22
ata4: SATA max UDMA/133 abar m1024 [at] 0xff70b00 port 0xff70b280 irq 22
ahci 0000:02:00.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19
ahci 0000:02:00.0: irq 43 for MSI/MSI-X
ahci: SSS flag set, parallel bus scan disabled
ahci 0000:02:00.0: AHCI 0001.0200 32 slots 2 ports 6 Gbps 0x3 impl SATA
mode
ahci 0000:02:00.0: flags: 64bit ncq sntf stag led clo pmp pio slum part
ccc sxs
ahci 0000:02:00.0: setting latency timer to 64
scsi4 : ahci
scsi5 : ahci
ata5: SATA max UDMA/133 abar m512 [at] 0xff60000 port 0xff600100 irq 43
ata6: SATA max UDMA/133 abar m512 [at] 0xff60000 port 0xff600180 irq 43
pata_atiixp 0000:00:14.1: PCI INT A -> GSI 16 (level, low) -> IRQ 16
scsi6 : pata_atiixp
scsi7 : pata_atiixp
ata7: PATA max UDMA/100 cmd 0x1f0 ctl 0x3f6 bmdma 0xf000 irq 14
ata8: PATA max UDMA/100 cmd 0x170 ctl 0x376 bmdma 0xf008 irq 15

(ata7/8 is the additional PATA controller, seen with the pata_atiixp
driver. I have one drive there, but it is not being used.)

When my new girl-friend comes over and we want to watch a movie, and it
stutters... she will ask why I don't simply use Windows to get
better performance, her five year old PC would do this just fine. Wat do
I tell her? WHAT DO I TELL HER??


And then there's what happened yesterday. A world update was going on,
with libreoffice, firefox, wine and thunderbird emerging in parallel, all
big packages. I have the PORTAGE_TMPDIR on a 5GB tmpfs, only libreoffice
is being compiled on disk. Suddenly, my system became very unresponsive,
the mouse had disappeared, the KDE widgets did not update, and xosview
showed a load of 23. All 4 cores were at 100%, the type of usage was
io-wait. How can I find out in such a case which processes are waiting
for I/O? top showed nothing. The Ctrl-Esc task viewer of KDE showed some
processes being 'inactive on hard drive', does this men those are the
waiting tasks? They varied, they were mostly Akonadi stuff. I stopped
akonadi, and after a while the load dropped. But this may be a
coincidence.

After all had calmed down, I had 2G of swap in use. 16G total RAM, all
being used of course, but only 8G being needed according to the -/+
buffers/cache line in free -m, the other 8G are cache. Does my Linux
somehow prefer to have this much cache, even if tmpfs stuff gets put into
swap? I have vm.swappiness = 0 in /etc/sysctl.conf.

Is there a command to show me what processes the memory in swap belongs
to?

Wonko


markknecht at gmail

Feb 16, 2012, 8:04 AM

Post #2 of 64 (1785 views)
Permalink
Re: I want to play movies without hangs [In reply to]

On Thu, Feb 16, 2012 at 7:29 AM, Alex Schuster <wonko [at] wonkology> wrote:
> Hi there!
>

Hi back at ya.

> How can I find out in such a case which processes are waiting
> for I/O? top showed nothing.

iotop is your friend.

I'll write more when I get some time to think

HTH,
Mark


paul.hartman+gentoo at gmail

Feb 16, 2012, 8:23 AM

Post #3 of 64 (1775 views)
Permalink
Re: I want to play movies without hangs [In reply to]

On Thu, Feb 16, 2012 at 9:29 AM, Alex Schuster <wonko [at] wonkology> wrote:
> I've written here in the past about my performance problems. My dual-core
> had trouble playing movies without stuttering when there was I/O. It was
> mainly swapping that caused this, and 8 G were not enough for me running
> KDE4.
>
> Then my hardware broke, and I got new one, except for the system hard
> drive and the PSU. It's an AMD FX-4100 quad-core with 3.6 GHz, 16 G of
> RAM. Running gentoo-sources-3.2.1 as kernel. But it seems playing movies
> got even worse!

You don't mention anything about video card or video driver setup.
That's the first thing I would suspect.

What video card? What drivers? Are you using hardware accelerated
movie playback?


wonko at wonkology

Feb 16, 2012, 8:49 AM

Post #4 of 64 (1780 views)
Permalink
Re: I want to play movies without hangs [In reply to]

Paul Hartman writes:

> On Thu, Feb 16, 2012 at 9:29 AM, Alex Schuster <wonko [at] wonkology>
> wrote:

> > Then my hardware broke, and I got new one, except for the system hard
> > drive and the PSU. It's an AMD FX-4100 quad-core with 3.6 GHz, 16 G of
> > RAM. Running gentoo-sources-3.2.1 as kernel. But it seems playing
> > movies got even worse!
>
> You don't mention anything about video card or video driver setup.
> That's the first thing I would suspect.
>
> What video card? What drivers? Are you using hardware accelerated
> movie playback?

Sorry. Radeon HD 4250 onboard graphics, using the open source radeon
driver. Hardware acceleration is working fine. As I wrote, it doesn't
matter which quality the videos are. There is not much CPU being used at
all, around 5% to 20%, so this is not the bottleneck.

Wonko


paul.hartman+gentoo at gmail

Feb 16, 2012, 9:21 AM

Post #5 of 64 (1775 views)
Permalink
Re: I want to play movies without hangs [In reply to]

On Thu, Feb 16, 2012 at 10:49 AM, Alex Schuster <wonko [at] wonkology> wrote:
> Paul Hartman writes:
>
>> On Thu, Feb 16, 2012 at 9:29 AM, Alex Schuster <wonko [at] wonkology>
>> wrote:
>
>> > Then my hardware broke, and I got new one, except for the system hard
>> > drive and the PSU. It's an AMD FX-4100 quad-core with 3.6 GHz, 16 G of
>> > RAM. Running gentoo-sources-3.2.1 as kernel. But it seems playing
>> > movies got even worse!
>>
>> You don't mention anything about video card or video driver setup.
>> That's the first thing I would suspect.
>>
>> What video card? What drivers? Are you using hardware accelerated
>> movie playback?
>
> Sorry. Radeon HD 4250 onboard graphics, using the open source radeon
> driver. Hardware acceleration is working fine. As I wrote, it doesn't
> matter which quality the videos are. There is not much CPU being used at
> all, around 5% to 20%, so this is not the bottleneck.
>
> Wonko
>

I wonder if you copy the movie to /dev/shm first (so disk I/O is not
an issue) does it still have problems? At least this can potentially
eliminate disk I/O as the cause if something else weird is going on.
:)

For the problem of massive amounts of RAM consumed, that's strange.
Are you compiling debug symbols? That can make the RAM usage (in
linking especially) explode...


wonko at wonkology

Feb 16, 2012, 9:34 AM

Post #6 of 64 (1775 views)
Permalink
Re: I want to play movies without hangs [In reply to]

Mark Knecht writes:

> On Thu, Feb 16, 2012 at 7:29 AM, Alex Schuster <wonko [at] wonkology>
> wrote:

> > How can I find out in such a case which processes are waiting
> > for I/O? top showed nothing.
>
> iotop is your friend.

I had called it, but didn't spot the problem there. I don't remember
exactly what the output was, I had expected to see some process show a
large value in the IO column, but that was not the case. I THINK! Various
processes appeared, mostly Akonadi stuff.

I should have logged this, I don't remember this s well. I have caught
some illness, and had fever, which did not help my memory. There were
some kworker processes listed on top, but I don't remember whether in
iotop or in top.

Hmm. Now I just started Akonadi again, and get a lot I/O in iotop, and
xosview again shows much iowait CPU activity for a while. But that calmed
down after a minute.

> I'll write more when I get some time to think

Thanks :)

Wonko


markknecht at gmail

Feb 16, 2012, 9:45 AM

Post #7 of 64 (1776 views)
Permalink
Re: I want to play movies without hangs [In reply to]

On Thu, Feb 16, 2012 at 9:34 AM, Alex Schuster <wonko [at] wonkology> wrote:
> Mark Knecht writes:
>
>> On Thu, Feb 16, 2012 at 7:29 AM, Alex Schuster <wonko [at] wonkology>
>> wrote:
>
>> > How can I find out in such a case which processes are waiting
>> > for I/O? top showed nothing.
>>
>> iotop is your friend.
>
> I had called it, but didn't spot the problem there. I don't remember
> exactly what the output was, I had expected to see some process show a
> large value in the IO column, but that was not the case. I THINK! Various
> processes appeared, mostly Akonadi stuff.
>
> I should have logged this, I don't remember this s well. I have caught
> some illness, and had fever, which did not help my memory. There were
> some kworker processes listed on top, but I don't remember whether in
> iotop or in top.
>
> Hmm. Now I just started Akonadi again, and get a lot I/O in iotop, and
> xosview again shows much iowait CPU activity for a while. But that calmed
> down after a minute.
>
>> I'll write more when I get some time to think
>
> Thanks :)
>
>        Wonko
>

Sorry. I was rushing then as now. If you start iotop and then hit the
'o' key it will show only processes actually doing io. If you're hang
is truly an iowait then my experience is that it should at least
identify what process is having the problem.

HTH,
Mark


waltdnes at waltdnes

Feb 17, 2012, 6:13 PM

Post #8 of 64 (1772 views)
Permalink
Re: I want to play movies without hangs [In reply to]

On Thu, Feb 16, 2012 at 04:29:48PM +0100, Alex Schuster wrote

> Then my hardware broke, and I got new one...

I had ***EXACTLY THE SAME PROBLEM ON A FRESH INSTALL***. In My case
it was a 4+ year old Dell with onboard Intel GPU that was having
problems playing NHL Gamecenter Live streams at the slowest speed. I
solved the problem and sped up everything by doing...
1) emerge system
2) emerge world
3) rebuild the kernel and reboot

A fresh install will have the stage 3 binaries built with
lowest-common-denominator x86 or amd64 code (depending if you chose 32
or 64 bit install). This is necessary in order to allow the install
code to run on all CPUs with the target platform. The downside is that
you lose all the optimisations that make Gentoo scream. Rebuilding the
install as described above builds optimized (i.e. faster) binaries. My
CFLAGS line in /etc/make.conf is...

CFLAGS="-O2 -march=native -mfpmath=sse -fomit-frame-pointer -pipe"
CXXFLAGS="${CFLAGS}"

Before rebuilding your system, go over your USE flags to make sure
you've got the maximum optimization. To find out what your CPU
supports, execute the command

grep flags /proc/cpuinfo | head -1

This will define the limits what your system can support. For
instance, mplayer can use the following flags...

waltdnes [at] d53 ~ $ emerge -pv mplayer

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild R ] media-video/mplayer-1.0_rc4_p20110322-r1 USE="X a52 alsa ass dga encode gif jpeg mmx mmxext mng mp3 opengl png quicktime real rtmp sse sse2 ssse3 theora truetype win32codecs x264 xv xvid xvmc -3dnow -3dnowext -aalib (-altivec) -amr (-aqua) -bidi -bindist -bl -bluray -bs2b -cddb -cdio -cdparanoia -cpudetection -custom-cpuopts -debug -dirac -directfb -doc -dts -dv -dvb -dvd -dvdnav (-dxr3) -enca (-esd) -faac -faad -fbcon -ftp -ggi -gsm -iconv -ipv6 -jack -joystick -jpeg2k -ladspa -libcaca -libmpeg2 -lirc -live -lzo -mad -md5sum -mpg123 -nas -network -nut -openal -osdmenu -oss -pnm -pulseaudio -pvr -radio -rar -rtc -samba -schroedinger -sdl -shm -speex -tga -toolame -tremor -twolame -unicode -v4l -vdpau -vidix -vorbis -vpx -xanim -xinerama -xscreensaver -zoran" VIDEO_CARDS="-mga -s3virge -tdfx -vesa" 0 kB

Your CPU will obviously support a different set of USE flags than
mine. Check the files /usr/portage/profiles/use.desc for a list of
global flags and /usr/portage/profiles/use.local.desc for
package-specific flags.

--
Walter Dnes <waltdnes [at] waltdnes>


wonko at wonkology

Feb 17, 2012, 7:13 PM

Post #9 of 64 (1766 views)
Permalink
Re: I want to play movies without hangs [In reply to]

Paul Hartman writes:

> I wonder if you copy the movie to /dev/shm first (so disk I/O is not
> an issue) does it still have problems? At least this can potentially
> eliminate disk I/O as the cause if something else weird is going on.
> :)

Yes, this helps. As does copying the movie to another partition than that
on which I to the I/O with my dd if=/dev/zero of= command. If I dd to
this partition, tough, it happens again.

> For the problem of massive amounts of RAM consumed, that's strange.

It's been so for years... but with 16 G of RAM it's no longer an issue.
Well, unless this weird problem happened wth parallel emerges on tmpfs. It
doesn't happen every time though.

> Are you compiling debug symbols? That can make the RAM usage (in
> linking especially) explode...

No. I sometimes enable it, but only when I hunt a bug and want to produce
better bug reports.
And even if the emerge would need very much memory, shouldn't this be
taken from the 8 G of caches being used, instead of starting to swap?

Wonko


wonko at wonkology

Feb 17, 2012, 9:45 PM

Post #10 of 64 (1763 views)
Permalink
Re: I want to play movies without hangs [In reply to]

Walter Dnes writes:

> On Thu, Feb 16, 2012 at 04:29:48PM +0100, Alex Schuster wrote
>
> > Then my hardware broke, and I got new one...
>
> I had ***EXACTLY THE SAME PROBLEM ON A FRESH INSTALL***. In My case
> it was a 4+ year old Dell with onboard Intel GPU that was having
> problems playing NHL Gamecenter Live streams at the slowest speed. I
> solved the problem and sped up everything by doing...
> 1) emerge system
> 2) emerge world
> 3) rebuild the kernel and reboot

Good idea, Walter! But not in my case. The system had been set up long
ago, and I did an emerge -e @world in the past already.

> A fresh install will have the stage 3 binaries built with
> lowest-common-denominator x86 or amd64 code (depending if you chose 32
> or 64 bit install). This is necessary in order to allow the install
> code to run on all CPUs with the target platform. The downside is that
> you lose all the optimisations that make Gentoo scream. Rebuilding the
> install as described above builds optimized (i.e. faster) binaries. My
> CFLAGS line in /etc/make.conf is...
>
> CFLAGS="-O2 -march=native -mfpmath=sse -fomit-frame-pointer -pipe"
> CXXFLAGS="${CFLAGS}"

I had those, when I upgraded the hardware:
CFLAGS="-march=k8-sse3 -mfpmath=sse -O2 -pipe"
Or something very silimar.

But I also just did an emerge -e @world on the new system, using more
sophisticated CFLAGS. I got them by doing like suggested on [*], using
what -march=natve would do. And adding support for this graphite
stuff. They are:
CFLAGS="-pipe -march=amdfam10 -O2 \
-floop-interchange -floop-strip-mine -floop-block \
-msse -msse2 -msse3 -msse4 -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"

> Before rebuilding your system, go over your USE flags to make sure
> you've got the maximum optimization. To find out what your CPU
> supports, execute the command
>
> grep flags /proc/cpuinfo | head -1
>
> This will define the limits what your system can support. For
> instance, mplayer can use the following flags...
>
> waltdnes [at] d53 ~ $ emerge -pv mplayer
>
> These are the packages that would be merged, in order:
>
> Calculating dependencies... done!
> [ebuild R ] media-video/mplayer-1.0_rc4_p20110322-r1 USE="X a52
> alsa ass dga encode gif jpeg mmx mmxext mng mp3 opengl png quicktime
> real rtmp sse sse2 ssse3 theora truetype win32codecs x264 xv xvid xvmc
> -3dnow -3dnowext -aalib (-altivec) -amr (-aqua) -bidi -bindist -bl
> -bluray -bs2b -cddb -cdio -cdparanoia -cpudetection -custom-cpuopts
> -debug -dirac -directfb -doc -dts -dv -dvb -dvd -dvdnav (-dxr3) -enca
> (-esd) -faac -faad -fbcon -ftp -ggi -gsm -iconv -ipv6 -jack -joystick
> -jpeg2k -ladspa -libcaca -libmpeg2 -lirc -live -lzo -mad -md5sum
> -mpg123 -nas -network -nut -openal -osdmenu -oss -pnm -pulseaudio -pvr
> -radio -rar -rtc -samba -schroedinger -sdl -shm -speex -tga -toolame
> -tremor -twolame -unicode -v4l -vdpau -vidix -vorbis -vpx -xanim
> -xinerama -xscreensaver -zoran" VIDEO_CARDS="-mga -s3virge -tdfx -vesa"
> 0 kB
>
> Your CPU will obviously support a different set of USE flags than
> mine. Check the files /usr/portage/profiles/use.desc for a list of
> global flags and /usr/portage/profiles/use.local.desc for
> package-specific flags.

These are my USE flags for mplayer, they should be fine:
[ebuild R ] media-video/mplayer-1.0_rc4_p20120213 USE="3dnow
3dnowext X a52 aalib alsa ass cdio dga directfb dts dv dvb dvd dvdnav
enca encode faad fbcon ftp ggi gif iconv ipv6 jack jpeg jpeg2k live mad
mmx mmxext mng mp3 nas network openal opengl osdmenu oss png pnm
quicktime rar real rtc samba sdl shm speex sse sse2 ssse3 theora toolame
tremor truetype twolame unicode vorbis x264 xinerama xscreensaver xv xvid
(-altivec) (-aqua) -bidi -bindist -bl -bluray -bs2b -cddb -cdparanoia
-cpudetection -debug -doc (-dxr3) (-esd) -faac -gsm -joystick -ladspa
-libcaca -libmpeg2 -lirc -lzo -md5sum -nut -pulseaudio -pvr -radio -rtmp
-tga -v4l -vdpau (-vidix) (-win32codecs) -xanim -xvmc -zoran"
VIDEO_CARDS="-mga -s3virge -tdfx" 0 kB

Now I'm bulding a new kernel, using genkernel, and without providing a
custom made .config. Just in case I have some weird setting somewhere
(debug output for SCSI stuff or something like that).

[later...]

So I did. Argh. I thought genkernel was smart enough to generate a
working kernel from scratch, if no existing .config would be given. But
the initramfs could not open my encrypted root partition, until I compiled
XTS and AES directly into the kernel, not only as modules. Genkernel did
not include modules for my NIC, somewhat annoying because I had to wait
several minutes for mysql to start, until I could open a root shell. KDM
was already running at that time, but I only saw a blank screen, because
the radeon stuff was not compiled with KMS. There's also something
wrong with my hardware clock. And iotop does not work, the kernel is
missing CONFIG_TASKSTATS, CONFIG_TASK_DELAY_ACCT
and CONFIG_TASK_IO_ACCOUNTING.

But now I have KDE running again. As soon as I do my dd command, mplayer
stutters, sometimes hanging for seconds. So it's probably not a flaw in
my kernel .config. Too bad, I hoped that was the problem.

I'm out of ideas now. This is really annoying, my system is fast, mplayer
is using around 20% only, the system is mostly idle, but when there is
I/O, videos do not run smoothly. And I do not want to copy every movie I
want to watch to another drive first.

BTW, when I do the dd if=/dev/zero of=/home/argh bs=10M count=1000
command, and interrupt with Ctrl-C, it takes some seconds until it stops.
Shouldn't this happen immediately, unless I specify a very large block
size? Writing speed is okay, 100 MB/s.

Time to go to sleep now.

[*] http://en.gentoo-wiki.com/wiki/Safe_Cflags#-march.3Dnative

Wonko


jamesbroadhead at gmail

Feb 18, 2012, 5:25 AM

Post #11 of 64 (1758 views)
Permalink
Re: I want to play movies without hangs [In reply to]

On 18 February 2012 05:45, Alex Schuster <wonko [at] wonkology> wrote:
> Walter Dnes writes:
>
>> On Thu, Feb 16, 2012 at 04:29:48PM +0100, Alex Schuster wrote
>>
>> > Then my hardware broke, and I got new one...
>>
>>   I had ***EXACTLY THE SAME PROBLEM ON A FRESH INSTALL***.  In My case
>> it was a 4+ year old Dell with onboard Intel GPU that was having
>> problems playing NHL Gamecenter Live streams at the slowest speed.  I
>> solved the problem and sped up everything by doing...
>> 1) emerge system
>> 2) emerge world
>> 3) rebuild the kernel and reboot
>
> Good idea, Walter! But not in my case. The system had been set up long
> ago, and I did an emerge -e @world in the past already.
>
>>   A fresh install will have the stage 3 binaries built with
>> lowest-common-denominator x86 or amd64 code (depending if you chose 32
>> or 64 bit install).  This is necessary in order to allow the install
>> code to run on all CPUs with the target platform.  The downside is that
>> you lose all the optimisations that make Gentoo scream.  Rebuilding the
>> install as described above builds optimized (i.e. faster) binaries.  My
>> CFLAGS line in /etc/make.conf is...
>>
>> CFLAGS="-O2 -march=native -mfpmath=sse -fomit-frame-pointer -pipe"
>> CXXFLAGS="${CFLAGS}"
>
> I had those, when I upgraded the hardware:
> CFLAGS="-march=k8-sse3 -mfpmath=sse -O2 -pipe"
> Or something very silimar.
>
> But I also just did an emerge -e @world on the new system, using more
> sophisticated CFLAGS. I got them by doing like suggested on [*], using
> what -march=natve would do. And adding support for this graphite
> stuff. They are:
> CFLAGS="-pipe -march=amdfam10 -O2 \
>        -floop-interchange -floop-strip-mine -floop-block \
>        -msse -msse2 -msse3 -msse4 -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"
>
>>   Before rebuilding your system, go over your USE flags to make sure
>> you've got the maximum optimization.  To find out what your CPU
>> supports, execute the command
>>
>> grep flags /proc/cpuinfo | head -1
>>
>>   This will define the limits what your system can support.  For
>> instance, mplayer can use the following flags...
>>
>> waltdnes [at] d53 ~ $ emerge -pv mplayer
>>
>> These are the packages that would be merged, in order:
>>
>> Calculating dependencies... done!
>> [ebuild   R    ] media-video/mplayer-1.0_rc4_p20110322-r1  USE="X a52
>> alsa ass dga encode gif jpeg mmx mmxext mng mp3 opengl png quicktime
>> real rtmp sse sse2 ssse3 theora truetype win32codecs x264 xv xvid xvmc
>> -3dnow -3dnowext -aalib (-altivec) -amr (-aqua) -bidi -bindist -bl
>> -bluray -bs2b -cddb -cdio -cdparanoia -cpudetection -custom-cpuopts
>> -debug -dirac -directfb -doc -dts -dv -dvb -dvd -dvdnav (-dxr3) -enca
>> (-esd) -faac -faad -fbcon -ftp -ggi -gsm -iconv -ipv6 -jack -joystick
>> -jpeg2k -ladspa -libcaca -libmpeg2 -lirc -live -lzo -mad -md5sum
>> -mpg123 -nas -network -nut -openal -osdmenu -oss -pnm -pulseaudio -pvr
>> -radio -rar -rtc -samba -schroedinger -sdl -shm -speex -tga -toolame
>> -tremor -twolame -unicode -v4l -vdpau -vidix -vorbis -vpx -xanim
>> -xinerama -xscreensaver -zoran" VIDEO_CARDS="-mga -s3virge -tdfx -vesa"
>> 0 kB
>>
>>   Your CPU will obviously support a different set of USE flags than
>> mine.  Check the files /usr/portage/profiles/use.desc for a list of
>> global flags and /usr/portage/profiles/use.local.desc for
>> package-specific flags.
>
> These are my USE flags for mplayer, they should be fine:
> [ebuild   R    ] media-video/mplayer-1.0_rc4_p20120213  USE="3dnow
> 3dnowext X a52 aalib alsa ass cdio dga directfb dts dv dvb dvd dvdnav
> enca encode faad fbcon ftp ggi gif iconv ipv6 jack jpeg jpeg2k live mad
> mmx mmxext mng mp3 nas network openal opengl osdmenu oss png pnm
> quicktime rar real rtc samba sdl shm speex sse sse2 ssse3 theora toolame
> tremor truetype twolame unicode vorbis x264 xinerama xscreensaver xv xvid
> (-altivec) (-aqua) -bidi -bindist -bl -bluray -bs2b -cddb -cdparanoia
> -cpudetection -debug -doc (-dxr3) (-esd) -faac -gsm -joystick -ladspa
> -libcaca -libmpeg2 -lirc -lzo -md5sum -nut -pulseaudio -pvr -radio -rtmp
> -tga -v4l -vdpau (-vidix) (-win32codecs) -xanim -xvmc -zoran"
> VIDEO_CARDS="-mga -s3virge -tdfx" 0 kB
>
> Now I'm bulding a new kernel, using genkernel, and without providing a
> custom made .config. Just in case I have some weird setting somewhere
> (debug output for SCSI stuff or something like that).
>
> [later...]
>
> So I did. Argh. I thought genkernel was smart enough to generate a
> working kernel from scratch, if no existing .config would be given. But
> the initramfs could not open my encrypted root partition, until I compiled
> XTS and AES directly into the kernel, not only as modules. Genkernel did
> not include modules for my NIC, somewhat annoying because I had to wait
> several minutes for mysql to start, until I could open a root shell. KDM
> was already running at that time, but I only saw a blank screen, because
> the radeon stuff was not compiled with KMS. There's also something
> wrong with my hardware clock. And iotop does not work, the kernel is
> missing CONFIG_TASKSTATS, CONFIG_TASK_DELAY_ACCT
> and CONFIG_TASK_IO_ACCOUNTING.
>
> But now I have KDE running again. As soon as I do my dd command, mplayer
> stutters, sometimes hanging for seconds. So it's probably not a flaw in
> my kernel .config. Too bad, I hoped that was the problem.
>
> I'm out of ideas now. This is really annoying, my system is fast, mplayer
> is using around 20% only, the system is mostly idle, but when there is
> I/O, videos do not run smoothly. And I do not want to copy every movie I
> want to watch to another drive first.
>
> BTW, when I do the dd if=/dev/zero of=/home/argh bs=10M count=1000
> command, and interrupt with Ctrl-C, it takes some seconds until it stops.
> Shouldn't this happen immediately, unless I specify a very large block
> size? Writing speed is okay, 100 MB/s.
>
> Time to go to sleep now.
>
> [*] http://en.gentoo-wiki.com/wiki/Safe_Cflags#-march.3Dnative
>
>        Wonko
>

Please try:
~/.mplayer/config
lavdopts=threads=2
# Use 128MiB input cache by default.
cache = 131072
# Prefill 20% of the cache before starting playback.
cache-min = 20.0

Which should eliminate disk IO somewhat


wonko at wonkology

Feb 18, 2012, 9:04 AM

Post #12 of 64 (1759 views)
Permalink
Re: I want to play movies without hangs [In reply to]

James Broadhead writes:

> Please try:
> ~/.mplayer/config
> lavdopts=threads=2
> # Use 128MiB input cache by default.
> cache = 131072
> # Prefill 20% of the cache before starting playback.
> cache-min = 20.0
>
> Which should eliminate disk IO somewhat

James, thanks for your input. I already had threads = 2 in my config, now
I notice that this syntax is not valid. My cache setting was only 10M, and
I did not know about cache-min.

First, I thought these settings would help, the video I tested this with
this night no longer had problems. I commented the settings one after
another in order to find out which settings exactly helped most, and even
without them, it played fine. Maybe the whole video was in the cache at
that time already.

Then I tried another video, again with the settings you suggested, and it
stuttered. There were small pauses when the system did some stuff, and
when I did my dd test, the pauses were as long as five seconds. FIVE
SECONDS!

Wonko


u.schutz at bluewin

Feb 18, 2012, 4:05 PM

Post #13 of 64 (1758 views)
Permalink
Re: I want to play movies without hangs [In reply to]

On Sat, 18 Feb 2012 18:04:07 +0100
Alex Schuster <wonko [at] wonkology> wrote:

...
>
> Then I tried another video, again with the settings you
> suggested, and it stuttered. There were small pauses when
> the system did some stuff, and when I did my dd test, the
> pauses were as long as five seconds. FIVE SECONDS!
>
> Wonko
>

Just an idea: Is the disk OK? Replace /dev/sda with your
disk...

smartctl -t short /dev/sda

and after some minutes

smartctl --all /dev/sda

If all went OK then the status is «PASSED», and you could
try the extended or long tests with smartctl.
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.

Urs


wonko at wonkology

Feb 18, 2012, 4:35 PM

Post #14 of 64 (1752 views)
Permalink
Re: I want to play movies without hangs [In reply to]

Urs Schutz writes:

> Just an idea: Is the disk OK? Replace /dev/sda with your
> disk...
>
> smartctl -t short /dev/sda
>
> and after some minutes
>
> smartctl --all /dev/sda
>
> If all went OK then the status is «PASSED», and you could
> try the extended or long tests with smartctl.

I have smartd running. A short self test is done every day, and a long test
once per week.

> 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.

Wonko


wonko at wonkology

May 7, 2012, 5:41 AM

Post #15 of 64 (1636 views)
Permalink
Re: I want to play movies without hangs [In reply to]

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


volkerarmin at googlemail

May 7, 2012, 9:26 AM

Post #16 of 64 (1636 views)
Permalink
Re: I want to play movies without hangs [In reply to]

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
> ]
>
> > 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.

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.

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

--
#163933


gentoo-user at hadt

May 7, 2012, 9:44 AM

Post #17 of 64 (1634 views)
Permalink
Re: I want to play movies without hangs [In reply to]

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
>> ]
>>
>>> 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.
>
> 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.
>
> For me the worst case is: writing lots of files on a usb device - sucks
> everywhere, even on a vt.
>

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


volkerarmin at googlemail

May 7, 2012, 10:14 AM

Post #18 of 64 (1632 views)
Permalink
Re: I want to play movies without hangs [In reply to]

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.

--
#163933


gentoo-user at hadt

May 7, 2012, 10:25 AM

Post #19 of 64 (1636 views)
Permalink
Re: I want to play movies without hangs [In reply to]

> 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.

It was just an idea, but maybe there's something wrong on the hardware
side? Broken cable, hard drive about to die?

Have to checked the SMART data of your hard drive lately (error log,
relocate sector count). You can also run some tests with smartctl.

Or monitor your IO with dstat or iotop. iotop tells you which app causes
high io load.

Or maybe you kernel is using some generic and slow driver for your ata
controller instead of an optimized one?

Personally I never had IO problems on linux unless theres was something
wrong with either the hardware or the kernel driver.

Hope that helps.


volkerarmin at googlemail

May 7, 2012, 10:39 AM

Post #20 of 64 (1634 views)
Permalink
Re: I want to play movies without hangs [In reply to]

Am Montag, 7. Mai 2012, 19:25:29 schrieb Michael Hampicke:
> > 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.
>
> It was just an idea, but maybe there's something wrong on the hardware
> side? Broken cable, hard drive about to die?

no, and this problem has been there since Suse 6.2 and kernel 2.2

>
> Have to checked the SMART data of your hard drive lately (error log,
> relocate sector count). You can also run some tests with smartctl.

of course

>
> Or monitor your IO with dstat or iotop. iotop tells you which app causes
> high io load.

cp of course

>
> Or maybe you kernel is using some generic and slow driver for your ata
> controller instead of an optimized one?

seriously...

>
> Personally I never had IO problems on linux unless theres was something
> wrong with either the hardware or the kernel driver.

good for you

>
> Hope that helps.

no

--
#163933


markknecht at gmail

May 7, 2012, 10:39 AM

Post #21 of 64 (1638 views)
Permalink
Re: I want to play movies without hangs [In reply to]

On Mon, May 7, 2012 at 5:41 AM, Alex Schuster <wonko [at] wonkology> 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


wonko at wonkology

May 7, 2012, 11:52 AM

Post #22 of 64 (1641 views)
Permalink
Re: I want to play movies without hangs [In reply to]

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


rdalek1967 at gmail

May 7, 2012, 1:43 PM

Post #23 of 64 (1634 views)
Permalink
Re: I want to play movies without hangs [In reply to]

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"


wonko at wonkology

May 7, 2012, 2:09 PM

Post #24 of 64 (1635 views)
Permalink
Re: I want to play movies without hangs [In reply to]

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


wonko at wonkology

May 7, 2012, 2:11 PM

Post #25 of 64 (1641 views)
Permalink
Re: I want to play movies without hangs [In reply to]

Mark Knecht writes:

> On Mon, May 7, 2012 at 5:41 AM, Alex Schuster <wonko [at] wonkology>
> 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

First page Previous page 1 2 3 Next page Last page  View All Gentoo user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.