Skip to Content.
Sympa Menu

baslinux - Re: [BL] MPlayer

baslinux AT lists.ibiblio.org

Subject: Baslinux mailing list

List archive

Chronological Thread  
  • From: Stephen Clement <s.clement AT sympatico.ca>
  • To: baslinux AT lists.ibiblio.org
  • Subject: Re: [BL] MPlayer
  • Date: Mon, 09 May 2005 00:04:10 -0400

sindi keesan wrote:

On Sun, 8 May 2005, David Moberg wrote:

----- Original Message -----
From: "sindi keesan" <keesan AT sdf.lonestar.org>

What does "jobs" say?


Nothing. which jobs - no jobs in .......
What is jobs?


When I typed 'jobs' nothing seemed to happen.

jobs, like fg, is built into the shell. The ash manpage
should be able to tell you more about it than I can.


Do some programs work okay in the background (perhaps wget?) but mplayer and play do not?

Most programs should work okay in the background, although a few don't I think.


If I remove the & and everything following it, your method works:

mkfifo audiodump.wav
mplayer -ao pcm http: (or pnm: etc.) WITHOUT & or fg
switch vt's
play audiodump.wav - the file is 4096 not 0 now and stays that size.


I probably misunderstood very clear directions for use and left in the &.
If I type Ctrl-Z mplayer stops doing anything, fg brings it back.


Normal.

Play audiodump.wav & does not play either, works without the &.
If I start running out of terminals I will use 'screen' to make ten
terminals out of one.


Keep reading for a script which will work with just one terminal,
and greatly simplify what you need to type.

With bated breath!


I am getting lovely sound quality from wdav now. I have only a 4K
.wav file but no skips. It sounds far better than the radio.
Mplayer said something about a cache - maybe that is acting to
buffer the file before it gets into the .wav file. Player is
telling me
A: 6:52.3 (time elapsed) 3% 15%
The 3% went down to 2.9% and the 15 alternates with 16 and 17.


You can use the -cache option to change the size of the buffer.
e.g. mplayer -ao pcm -cache 8192


The default cache seems to be 320K and it works perfectly. I think I can start playing before the cache actually fills up, at about 7%.

320K should be just fine. Up it to 512K if you have issues.


On a previous occasion the middle figure was 92% and rising - is
this something to do with buffering or lost clusters? You did not
include docs for mplayer.


I included the manpage in the package. Both the regular one (if you
have man on BL2) and a version that works on regular BL3.


Thanks, I somehow missed it. I have man2html in BL2 and a script called mann that looks for the man page and converts and displays with lynx. I will look up what the numbers mean.

ps now tells me there are five copies of mplayer running.

I killed them all and started over, and after I started playing I
again have five copies running. Sizes about 8K, three are State T
and two state S. I have one copy of sox and none of mpg123 or
play. The same process numbers keep coming back except for the
last two copies of mplayer.

The second to last is taking up 3% of cpu and the others 0%, but
they are all taking up about 1-1.5% of memory.

If I kill the first three it keeps playing. If it kill the fourth
it stops. The fourth is the one at the top of the list in 'top'.
What are the others doing?


I think this is a scheme to improve performance. Certain CPU features
(for example, SMP, HyperThreading, MMX) can greatly improve performance
if a program is split into several threads or processes. (Mozilla does
the same thing.) Likely, one thread handles networking, another audio
output, another handles the status output. The fourth is probably the
master process (or "parent"), so killing it also kills the child
processes.


But without the first three child processes it still works and I don't notice any degradation in quality.

Well, then the main MPlayer binary probably just takes over the jobs that those child processes used to perform.


Sox is using 1.3% of cpu and 0.4 % of memory. What else besides
compiling and gzipping uses more cpu? Image manipulation?


Try playing a DVD on a framebuffer with anything slower than a P4
and watch the CPU usage climb to 100%. Or try mp3 decoding on a 386
or slow 486.


A DVD involves image manipulation. I have played mp3s in DOS on a 486.

DVD isn't really image manipulation, it is more of displaying lots of images really, really fast.


For some reason this 200MHz computer (which I think came with this
cpu in the board, set to its maximum speed of 200MHz), is
identified by mplayer as AMD K6 324.0 MHz (Family: 5, Stepping; 2).
dmesg tells me the computer has a 200461 KHz processor. I think
the cpu was also labelled that way, or we looked up its number to
get the speed.


The two CPU models may share the Family and Stepping codes.


So is mplayer wrong here?

Yes.


A friend says the 300 and 350 MHz AMD cpus, even in a super socket
7, are i686 and ought to work with your first mplayer and that any
board which can go over 233 MHz is 686.


I think that the Pentium MMX 266 and lower are merely i586. I know
that all other Intels 233 or higher are 686s.


But what is an AMD K6 350MHz? It did not work with the first mplayer you compiled. In super socket 7. Did your version actually require Intel? That may determine where we put the DVD drive. I am not at that computer right now but how would I check if it is equivalent to i686 intel?

The first version required i686, I think. That would've been the problem.


Perhaps you live in Australia?


No, NW Oregon. Quite a ways from Australia.

You are probably not getting our warm dry sunny weather.

Well it's nice and sunny here in Ontario (Canada).



I've figured out that MPlayer only needs the fg junk if it is sent
to the background. Sox doesn't have this problem. So, here is the
updated script:

#!/bin/sh
mkfifo /tmp/audiodump.wav
play /tmp/audiodump.wav &
exec real_mplayer -ao pcm -aofile /tmp/audiodump.wav "$@"

# End of script


I have already renamed the second mplayer to mplayeralsa (and the first version to mplayerp2). I will try this when next in linux (now in DOS).
The "$@" means I can put more than one argument after mplayer?

I'd guess so.

Does the -aofile /tmp/audiodump.wav tell it where to make the .wav file so I don't need to be in /tmp?

Yes


See the real_mplayer? I think that for convenience you may want to
rename /usr/local/bin/mplayer to /usr/local/bin/real_mplayer, then
put the above script into /usr/local/bin/mplayer. chmod +x. You
should then be able to merely run:

mplayer http://www.foobar.com/radio/music.mp3


And I could paste the URL in with gpm (or screen once I figure out how). I had Realplayer8 in linux working with links on one computer, but I can't think of a way to coordinate mplayer with links or lynx since I first need to extract the URL from files of various formats such as .pls or .m3u or whatever is used by realaudio and windows-media. I bet Steven or you could come up with some script that looks for things starting in http:// or pnm:// or rstp:// (?) and cuts off anything preceding, except that some of these little files have TWO URLs in them with words in between.

(I'm guessing you meant me when you said Steven)

#!/bin/sh
wget -q $1 -O /tmp/urlfile && sed -e 's/http:\/\//WORKShttp:\/\//g' -e 's/rstp:\/\//WORKSrstp:\/\//g' -e 's/pnm:\/\//^WORKSpnm:\/\//g' /tmp/urlfile |grep WORKS |sed -e 's/WORKS//g'

With this it will automatically fetch the file and search out the URL's. Getting it to automatically play is beyond the use of this script, however.


and get sound. You can also add options directly to the command
line, since I used the "$@" tag. All you need is a writable /tmp
directory to put the audiodump file in.

My question was, why someone would broadcast in MP3 and also OGG -
does OGG have some advantage, better compression or something?


I answered your second question and completely neglected the first
one. Oggs sound better to my ears, all else being equal. Also,
don't forget the patent issues with MP3. Not everyone wants to
deal with those.


I will try to hear the difference once I find a 20K OGG broadcast.
All the formats I have tried sound infinitely better than listening to radio broadcasts from 60-75 miles away, even at 20K, though this is supposed to be less than FM quality I think (is that 64K?).

Yes, FM quality is supposedly 64K. Also, I will say too that I find OGG to be superior.


So mplayer can't handle this realplayer format for some reason. What
is afm?


Audio File (or Format) Manager?

I presume it looks for three variants by name and then by
number. Is this something I can add later or must it be compiled in?


It may need the binary codecs from the MPlayer website. The Linux ones
should work on a PC with my MPlayer binary. Setup may be a bit tricky.


It said to compile them in. I have no idea what to do with a codec, whatever that is. No big deal, now that I have 20 MP3 and some usable RA and WM stations. I will try your script soon.

David

Stephen Clement

--
_______________________________________________
NEW! Lycos Dating Search. The only place to search multiple dating sites at once.
http://datingsearch.lycos.com

_______________________________________________
BasLinux mailing list
BasLinux AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/baslinux



keesan AT sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org
_______________________________________________
BasLinux mailing list
BasLinux AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/baslinux






Archive powered by MHonArc 2.6.24.

Top of Page