Video playback stutters badly if any other program is running
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Video playback stutters badly if any other program is running
Hello, I had Ubuntu 7.04 running on my linux box, and VLC was able to play video files back very nicely using bob deinterlacer. I was able to run all sorts of programs at the same time that the video was playing, and never had any issues...ever.
Now, with mythbuntu 8.04, as soon as any program starts running, the playback starts to stutter badly.
Under ubuntu 7.04, video playback would take 20% of each core on my core 2 duo. Under 8.04, it's the same. So i know i'm not maxing out my cpu.
I'm using a 750GB seagate sata hard drive, so it should be plenty fast to handle it, and it was with ubuntu 7.04.
I don't think it's a video drivers issue because mythbuntu installs the drivers for you. Also, i tried removing those drivers and installing envyNG. Also, i tried using my old ubuntu 7.04's xorg.conf file just incase.
Any ideas as to why the video stutters when another program starts doing something on the system?
Also, my system specs are: core 2 duo 1.8ghz, 1gb ddr2 ram, 750GB seagate sata hard drive, nvidia 7300 LT pci express video card. Mythbuntu 8.04 (i put that i use vlc because neither vlc nor mythbuntu play the videos smoothly, but it seems to not be a mythtv specific issue since vlc also has the stuttering problem.)
Your system might be too slow to decode all pictures. It might be that your CPU basically is not fast enough. It can also be that the subsystem is misconfigured/misdriven, this happens for example under Redhat Linux. Here are some elements to improve speed:
Turn on DMA on your DVD device, for instance:
Under Linux:
# hdparm -d1 /dev/dvd
Under Windows, go to the System section of the control panel, and go to the Hardware manager (it is sometimes in a separate tab, and sometimes, you have to go to the Advanced tab. Then, righ-click on your DVD player, and check the DMA checkbox.
Upgrade to the latest driver for your video board
If you are running Linux, you can additionnaly upgrade to the latest XFree86 version. If supported, check that the xvideo plug-in is effectively used with:
% vlc -vvvv
Stop other running applications...
Try disabling framedropping. Framedropping allows VLC not to decode some pictures when the CPU is overloaded, but can result in choppier playback under certain conditions.
Framedropping behaviour can be configured in the Video preferences of VLC.
It'll give you a list of available IO schedulers and the default / current one in [brackets].
To change it, just echo the name of the scheduler into that file, for example:
Code:
echo deadline > /sys/block/hda/queue/scheduler
(this will probably need to be run as root)
Then test to see what happens when you open a video.
It could also be that the kernel is compiled with different options than a regular kernel to allow higher throughput but less interactive response (in a server fashion rather than a desktop fashion).
It could also be something completely unrelated. This is just my suggestion.
To bigrigdriver: I'm plenty sure it's not a vlc issue, as the issue occurs in other programs. Also, i know the computer is fast enough, because it used to work just fine before upgrading to 8.04 from 7.04. --Any other ideas as to what it could be?
To H_TeXMeX_H:
Here's what i got (i have a bunch of drives in the computer):
It'll give you a list of available IO schedulers and the default / current one in [brackets].
To change it, just echo the name of the scheduler into that file, for example:
Code:
echo deadline > /sys/block/hda/queue/scheduler
I'm just not sure what that all means (obviously i'd change hda to the proper sdx of my drives...but with just noop anticipatory deadline [cfq] showing up, i'd like to wait to see what you think before i make any changes.
Also, how would i change it back if your change doesn't do anything?
Well for any particular drive, yes replace the 'hda' with your drive, you can change the IO scheduler by using 'echo' to tell it which one to use. For example from what you have you can choose between:
noop anticipatory deadline [cfq]
currently you are using cfq, but if you wanted to change to deadline you would 'echo deadline > /sys/block/sda/queue/scheduler' this would be for sda. To change it back to cfq echo cfq into the file. Either way it will always change back to the default with every boot, so whatever you leave it as it will be cfq the next time you boot.
Also, I'm recommending this because I had problems with stuttering and this fixed them. It may not for you if there are other issues such as DMA not being enabled, so make sure it is as bigrigdriver suggests.
EDIT:
I would also use hdparm to test the speed of some of your drives:
Code:
hdparm -tT /dev/hda
That will rule out problems with disk throughput, although you said it works fine in other distros.
Last edited by H_TeXMeX_H; 05-21-2008 at 04:35 PM.
OK, I tried your recommendation and it didn't change anything.
hdparm reports a transfer rate of 75mb/sec on my drives and 29mb/sec on my usb connected drives ---seems fine to me.
Then, i was running Top, and noticed that vlc and mythfrontend run as my user and some of the other programs i run are run as root. So i ran mythfrontend as root, and the video playback is now looking really great.
Why does the root account look better? The nice of the mythfrontend was at 0 when running as the user, and the root programs were all niced at 19. This doesn't make any sense to me. Mythfrontend at 0 should have priority over those other programs.
What can i do? I don't want to run mythfrontend as root all the time, especially because when it loads at startup, it is as user. I don't know how to load it as root.
I do not recommend VLC in Linux because it is unstable and unreliable. On my setups will stutter even on fast computers. I recommend using xine or mplayer to playback videos. When I play videos, I use OpenGL as the video output device and this works well with nVidia and ATI cards. I think XVideo is low quality compared to using OpenGL.
I use the following for video playback with mplayer.
The utility hdparm only benchmarks the raw speed of the hard drive. It does not include a real benchmark which includes the overhead of the bus, the storage controller, and the file system. The file system, XFS, has the highest throughput.
Then, i was running Top, and noticed that vlc and mythfrontend run as my user and some of the other programs i run are run as root. So i ran mythfrontend as root, and the video playback is now looking really great.
Why does the root account look better? The nice of the mythfrontend was at 0 when running as the user, and the root programs were all niced at 19. This doesn't make any sense to me. Mythfrontend at 0 should have priority over those other programs.
What can i do? I don't want to run mythfrontend as root all the time, especially because when it loads at startup, it is as user. I don't know how to load it as root.
-Thanks
That's crazy. "Nicenesses range from -20 (most favorable scheduling) to 19 (least favorable).", so why would it stutter less when it's nice level is least favorable ?
How about run it as regular user but renice it, have you tried that ?
I agree it's crazy. I tried to change the nice value to -10 when run as user and it made no difference.
Also, when run as root, though the video is much better, it's still not where it was in ubuntu 7.04. It's about 95% smooth. Still, better than skipping frames all the time. When i was running mythfrontend as user, you basically got sound just fine and about 1 video frame every 3 to 4 seconds.
Wait, i just reread your last post, it doesn't stutter any differently when the nice level changes. When i ran it as user, it was niced at 0, as root, also niced at 0. Root didn't stutter. When at user, i reniced it to -10 and it made no difference. So as far as i can tell. The only thing that matters here is who i run the program as, when run as root, it's much better. --still, very strange.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.