LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 05-21-2008, 01:18 PM   #1
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Rep: Reputation: 30
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.)

-Thanks

Last edited by xmrkite; 05-21-2008 at 01:55 PM.
 
Old 05-21-2008, 02:09 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
From the VideoLAN FAQ:
Quote:
1.7.
Video is choppy

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.
 
Old 05-21-2008, 02:10 PM   #3
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
It might be the IO scheduler. Maybe ...

Try doing this, first run:
Code:
cat /sys/block/hda/queue/scheduler
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.
 
Old 05-21-2008, 03:37 PM   #4
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
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):


steve@mythtv-server:~$ cat /sys/block/sda/queue/scheduler
noop anticipatory deadline [cfq]
steve@mythtv-server:~$ cat /sys/block/sdb/queue/scheduler
noop anticipatory deadline [cfq]
steve@mythtv-server:~$ cat /sys/block/sdc/queue/scheduler
noop anticipatory deadline [cfq]
steve@mythtv-server:~$ cat /sys/block/sdd/queue/scheduler
noop anticipatory deadline [cfq]
steve@mythtv-server:~$ cat /sys/block/sde/queue/scheduler
noop anticipatory deadline [cfq]
steve@mythtv-server:~$ cat /sys/block/sdf/queue/scheduler
noop anticipatory deadline [cfq]
steve@mythtv-server:~$ cat /sys/block/sdg/queue/scheduler



in regards to:

Quote:
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?

--Thanks
 
Old 05-21-2008, 04:30 PM   #5
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
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.
 
Old 05-22-2008, 12:49 AM   #6
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
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.

-Thanks
 
Old 05-22-2008, 04:02 AM   #7
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
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.

mplayer -vo gl,xv,x11,null -ao alsa,oss,null -vf scale=-1:-1 file

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.

IMHO, mythtv is unstable and hard to configure.
 
Old 05-22-2008, 06:33 AM   #8
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by xmrkite View Post
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 ?
 
Old 05-22-2008, 11:27 AM   #9
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
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.

Last edited by xmrkite; 05-22-2008 at 11:32 AM.
 
Old 05-22-2008, 12:19 PM   #10
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Might want to report this to the devs who maintain the distro, it looks like something distro-specific. Maybe they know how to fix it.
 
Old 05-23-2008, 04:20 PM   #11
xmrkite
Member
 
Registered: Oct 2006
Location: California, USA
Distribution: Mint 16, Lubuntu 14.04, Mythbuntu 14.04, Kubuntu 13.10, Xubuntu 10.04
Posts: 554

Original Poster
Rep: Reputation: 30
OK, i guess it is a bug that they're aware of. --Thanks for all the help.

PS. the info on the bug can be found here: https://bugs.launchpad.net/ubuntu/+s...ux/+bug/188226
 
Old 05-24-2008, 07:47 AM   #12
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Well there you see how important it is to have a kernel that's been configured properly, it can make a huge difference.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
video playback problems during fast video sequences atti Linux - Hardware 2 04-17-2006 03:50 AM
Video Playback-speeded up audio & video howone SUSE / openSUSE 1 10-20-2005 01:24 AM
Audio/Video goes badly out of sync after 2 minutes. bb002 Ubuntu 1 10-11-2005 08:20 PM
Mobility Radeon x300 PCIe, DVD Playback stutters mnemonic Linux - Hardware 0 07-28-2005 03:54 PM
xine stutters terribly related to video? ChristopherORO Linux - Software 2 12-16-2003 04:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration