LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-12-2010, 05:07 PM   #1
malloc
Member
 
Registered: Jul 2010
Posts: 111

Rep: Reputation: 4
Mplayer lags when playing over the network


The program mplayer lags when playing high quality media over the network. This is not an issue when playing locally, but it becomes an issue when playing large (>= 1 GiB) Matroska video files over the network.
By "lag" I mean that the animation freezes at a fixed frequency, every five second or so the animation will halt for a fraction of a second, which is very annoying.

The network is a 100 Mbit switched ethernet network, I typically get around 10 MiB per second in actual flow rate and there is no noteworthy traffic on the network that degrades the performance. The lag is there regardless of traffic.

If I have a file at 1.4 GiB which is 60 minutes long, shouldn't that equal < 0.4 MiB/sec in required flow rate? I.e. I should be able to play this file over a 10 Mbit network. Yet, even on a 100 Mbit network this doesn't work.

The computer I use to play this media is a 4.12 GHz Core i7 with 6 GiB RAM and a GTX480 graphics card.
I have the latest graphics drivers.
I use Slackware 13.1.0.
I use a custom, small and highly optimized kernel (although the same issue is there with the standard kernel).
My version of mplayer is MPlayer SVN-r31498-snapshot-4.4.4.

The network protocol used is SMB, i.e. I play from a mounted SMB resource.

I have tried to host the file on different computers, both are dedicated file servers, one is a Pentium 4 3.0 GHz with 2 GiB RAM with no load other than hosting files, the other being almost equivalent except with a 2.8 GHz CPU.
Watching the system load on the machines yield nothing of interest, sending a mere ~0.5 MiB per second is nothing for a computer like that, even though a P4 is not exactly new anymore.

What is interesting though is that if I use the "-vo gl" argument to mplayer, the performance is greatly improved, there is very rarely any lag.

Now correct me if I'm wrong, but why on earth would the video output driver chosen affect the performance on a machine that has a 4.12 GHz Core i7 CPU, plenty of RAM, a very fast graphics card, and nothing else to do? I.e. no load at all?
When I use the standard output driver, there is almost no load at all on the system. So what the heck is this?
 
Old 11-13-2010, 06:03 AM   #2
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, first thing I would try is the '-cache' option for mplayer.

Also, any errors or warning from mplayer while playing the file ? (on the CLI)

Are you getting this 10 MB/sec while playing the movie or when loading other files ?
 
Old 11-13-2010, 07:56 PM   #3
malloc
Member
 
Registered: Jul 2010
Posts: 111

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by H_TeXMeX_H View Post
Well, first thing I would try is the '-cache' option for mplayer.

Also, any errors or warning from mplayer while playing the file ? (on the CLI)

Are you getting this 10 MB/sec while playing the movie or when loading other files ?
No, I don't get any errors or warnings from the console when playing media.

Caching is another approach that solves the problem, but my question is not how to solve this, but why it needs to be solved in the first place.
I.e. why do I need to increase the cache size when the network doesn't use more than 1/20 of its bandwidth? Please also keep in mind that the latency is between 100 and 200 microseconds to this server as there are no additional hops to reach it.
And at least equally strange: Why does it matter what output driver I use?

10 MiB/sec is the flow rate I get when I do something that requests maximum performance, such as copy a file. This is also over SMB, and from the same server which I play media from.
 
Old 11-14-2010, 03:32 AM   #4
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
I think it is a buffering / cache issue. The movie is not stored anywhere when you are reading it, watch the transfer rate while playing the movie. I'm betting it is not being read at 10 MB/s, but rather it is read as needed, but mplayer miscalculates and there is a buffer underrun, and so the movie stutters or freezes from time to time. Telling mplayer to use a bigger cache is one solution. Another is to use an intermediate buffer program and pipe this to mplayer.
 
  


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
MPlayer lags, unable to play properly posix_memalign Linux - Software 10 04-26-2010 07:15 PM
World Of Warcraft Lags When I Have Browser Open Playing Music With Grooveshark! ilikelinux55 Linux - Newbie 3 04-07-2010 08:08 PM
Audio CD lags systematically with MPlayer? violagirl23 Linux - Software 3 09-11-2007 04:38 PM
SSH connection lags within network eam Linux - General 3 08-02-2004 10:17 AM
Playing Real Network Content with Mplayer brokenflea Fedora 1 03-17-2004 11:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:15 PM.

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