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 02-18-2012, 12:25 PM
James Broadhead
 
Default I want to play movies without hangs

On 18 February 2012 05:45, Alex Schuster <wonko@wonkology.org> 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@d530 ~ $ 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
 
Old 02-18-2012, 04:04 PM
Alex Schuster
 
Default I want to play movies without hangs

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
 
Old 02-18-2012, 11:05 PM
Urs Schutz
 
Default I want to play movies without hangs

On Sat, 18 Feb 2012 18:04:07 +0100
Alex Schuster <wonko@wonkology.org> 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
 
Old 02-18-2012, 11:35 PM
Alex Schuster
 
Default I want to play movies without hangs

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
 
Old 05-07-2012, 12:41 PM
Alex Schuster
 
Default I want to play movies without hangs

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
 
Old 05-07-2012, 04:26 PM
Volker Armin Hemmann
 
Default I want to play movies without hangs

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
 
Old 05-07-2012, 04:44 PM
Michael Hampicke
 
Default I want to play movies without hangs

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
 
Old 05-07-2012, 05:14 PM
Volker Armin Hemmann
 
Default I want to play movies without hangs

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
 
Old 05-07-2012, 05:25 PM
Michael Hampicke
 
Default I want to play movies without hangs

> 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.
 
Old 05-07-2012, 05:39 PM
Volker Armin Hemmann
 
Default I want to play movies without hangs

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
 

Thread Tools




All times are GMT. The time now is 04:53 PM.

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