LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-18-2011, 09:16 AM   #1
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Rep: Reputation: 76
CDDA vs XviD: why so much burden for the CPU, and so much RAM?


Hi:

Let's take a multimedia player. Say MPlayer. Two cases:

(a) I play a file of this type: 640 x 272, 25.00 fps, video: XviD, audio: MPEG-1 Layer 3 (stereo, 48000 Hz).
(b) I play a CDDA.

In case (a), my machine is fast enough so that I can watch and listen perfectly well. In case (b), it seems my machine lacks speed or memory, for the sound is heard as if each second mplayer had to load some buffer and must stop playback for a few milliseconds. "Each second" actually means "at random intervals nearly one second long.

Because the movie (case a) is a compressed format, the actual amount of information is low. But we are speaking about video here (I'm beginning to feel the impression that I'm speaking about what I do not know). Plus, the CPU has the extra work of decoding.

On the other hand in case b, no decoding needed.

So, in view of mplayer's performance in each of those cases, 640 x 272, 25.00 fps is less info than Stereo, 44100 Hz? What is the explanation for this phenomenon: A motion picture less work for the machine than a CDDA?

Last edited by stf92; 06-18-2011 at 02:14 PM.
 
Old 06-18-2011, 11:14 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
If by CDDA you mean playing an audio CD directly, there are other factors at work too. You have the speed and ability of the drive to read the disk (including the condition of the disk itself), the size of the drive's cache, possible driver bugs, and the speed and quality of the bus connection.

I'd be willing to bet that one or more of these are actually causing your slow-down, since CD audio is simple uncompressed PCM and would need much less processing than the compressed xvid/mp3 streams.

Try ripping the audio to an uncompressed .wav file and see if it still causes playback problems.
 
Old 06-18-2011, 02:35 PM   #3
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
Thanks. Yes, I mean Red Book. I hope you did not bet. KsCD has no problem playing the CD (same machine, same drive, same disk). Where as any audio CD will beat the monster program called mplayer.

However, your idea about transferring to a WAV file could perhaps give a clue. Regards.

EDIT
I ripped a CD to WAV, played the WAV. Result: no problem. I played the CD and the result was the same as before. Always speaking about mplayer.

When I compiled the source from the official site the result, in regard to this behaviour, was the same as now, when I am using a slackbuilds.

Last edited by stf92; 06-18-2011 at 03:54 PM.
 
Old 06-18-2011, 05:23 PM   #4
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
My usual audio cd usage with MPlayer is:

Code:
mplayer -cache 2048 -cache-min 80 cddb://
Perhaps the cache settings will help in your case? And of course if cddb:// does not work you can use cdda://. This is Tip 7 from here btw:

Top 10 Tricks and Tips for the svn MPlayer
http://www.andrews-corner.org/mplayer.html
 
1 members found this post helpful.
Old 06-18-2011, 06:47 PM   #5
stf92
Senior Member
 
Registered: Apr 2007
Location: Buenos Aires.
Distribution: Slackware
Posts: 4,442

Original Poster
Rep: Reputation: 76
These settings seem to work fine for my machine (thanks for the link) although what I'd actually like to know is the reason behind it:

640 x 272 pixels= 174080 bits= 21760 bytes
21760 bytes * 25 frame/s = 544000 byte/s
plus decoding.

2 bytes * 44100 Hz * 2 = 176400 byte/s

I do not understand. Perhaps, for movies, mplayer by default uses a large cache. IDK. But I can use mplayer to play CDs for the first time. Thanks a lot.
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Howto convert an Xvid video to normal windows machine (no divX/xvid)? frenchn00b Linux - Software 1 10-01-2008 05:03 PM
Share the burden xpod LinuxQuestions.org Member Intro 5 11-29-2006 06:37 PM
2 CPU and 8G ram BRAHmS Linux - Newbie 2 05-07-2004 10:11 PM
cpu ram os info drbaca1 Linux - General 0 09-03-2001 02:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:50 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