LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-21-2015, 10:07 AM   #1
linux_walt
Member
 
Registered: Dec 2014
Location: Houston, TX
Distribution: Debian wheezy
Posts: 127

Rep: Reputation: 29
Curious second instance of mplayer


Hello, when I start a movie in mplayer, 2 mplayer processes are started:
Code:
$ pidof mplayer
20569 20568
One is very active, normal cpu usage you are used to seeing, the other is under 1% cpu usage. When you kill the second one, the active one keeps running for a bit, then freezes. It acts like it ran out of video data from a buffer.

I do have the mplayer cache enabled (2MB). Haven't tried disabling it yet, to see if the second instance of mplayer is still started.

Ok, I disabled mplayer cache. Didn't have to restart the movie, and the second mplayer process vanished.

Interesting.

Last edited by linux_walt; 01-21-2015 at 10:08 AM.
 
Old 01-21-2015, 11:48 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Maybe mplayer uses a thread, after all the PIDs are sequential, so the fist one is the one you started when you invoked the command line and the second one is either a thread or a child process which mplayer chooses to use as part of it's architecture. Makes sense considering what you mention as far as usage statistics. What happens if you exit the program normally? Nothing like that? If you kill the first one, does the second one disappear right away? And if you use "ps -ef | grep mplayer" do you find that the second mplayer PID has the first one as it's parent?
 
Old 01-21-2015, 12:38 PM   #3
linux_walt
Member
 
Registered: Dec 2014
Location: Houston, TX
Distribution: Debian wheezy
Posts: 127

Original Poster
Rep: Reputation: 29
Code:
$ ps -ef | grep mplayer
walter   20547  2003  4 09:45 ?        00:07:02 gnome-mplayer
walter   20682     1 36 11:47 ?        00:11:41 mplayer -vo xvmc,xv, -ao alsa:device=hw=1.0 -channels 2 -af-add export=/tmp/mplayer-af_exporthejgok:512 -quiet -slave -noidle -noconsolecontrols -nostop-xscreensaver -identify -volume 33 -af-add volume=-40.000000:0 -softvol -msglevel all=5 -osdlevel 0 -delay 0.000000 -subdelay 0.000000 -subpos 0 -sub-fuzziness 0 -wid 0xe00018 -brightness 0 -contrast 0 -hue 0 -saturation 0 -alang Zuni,zun -slang Zuni,zun -nomsgcolor -nomsgmodule -nokeepaspect -ass -embeddedfonts -ass-font-scale 1.00 -ass-color ffffff00 -cache 2000 /mnt/hd/video/History/China/China_ A Century of Revolution [1949-1976] Part 2.mp4
walter   20683 20682  0 11:47 ?        00:00:06 mplayer -vo xvmc,xv, -ao alsa:device=hw=1.0 -channels 2 -af-add export=/tmp/mplayer-af_exporthejgok:512 -quiet -slave -noidle -noconsolecontrols -nostop-xscreensaver -identify -volume 33 -af-add volume=-40.000000:0 -softvol -msglevel all=5 -osdlevel 0 -delay 0.000000 -subdelay 0.000000 -subpos 0 -sub-fuzziness 0 -wid 0xe00018 -brightness 0 -contrast 0 -hue 0 -saturation 0 -alang Zuni,zun -slang Zuni,zun -nomsgcolor -nomsgmodule -nokeepaspect -ass -embeddedfonts -ass-font-scale 1.00 -ass-color ffffff00 -cache 2000 /mnt/hd/video/History/China/China_ A Century of Revolution [1949-1976] Part 2.mp4
After killing the most active one, both are terminated. Same if I close the program normally:
Code:
~/src/qt$ pidof mplayer
20683 20682
walter@cubier:~/src/qt$ kill 20682
walter@cubier:~/src/qt$ pidof mplayer
walter@cubier:~/src/qt$
I looked up pid 2003, and that was 'openbox'.
 
Old 01-21-2015, 12:44 PM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,882
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
My take is that this shouldn't be a gripe to you if you were concerned that it was a problem that is. It seems to be just as I was guessing, the top process forks a child or creates a worker thread. Hey if it didn't do that, then the UI widgets to control things would not work efficiently because it'd be spending too much time playing the media. Or vice-versa, the playing of the media would be interrupted whenever you do small things like adjust the sound or something.
 
Old 01-21-2015, 01:08 PM   #5
linux_walt
Member
 
Registered: Dec 2014
Location: Houston, TX
Distribution: Debian wheezy
Posts: 127

Original Poster
Rep: Reputation: 29
Nope, no gripe. It was going to be a question, then decided to look a little deeper into it, and realized this must be normal behavior. Apparently, enabling buffering requires a second instance of mplayer.

You would think buffering ability would be included into a single instance of the program.

Last edited by linux_walt; 01-21-2015 at 10:13 PM.
 
  


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
[SOLVED] Switch to instance instead of creating a new instance of a program javascriptninja Linux - Newbie 8 01-28-2012 03:39 PM
MPlayer GUI (gmplayer - NOT gnome-mplayer) single instance fix... poweredbydodge Linux - Desktop 5 04-12-2011 03:34 PM
MPlayer/KMplayer running one instance Supreme1012 Linux - Software 1 06-14-2007 11:44 PM
New, old and curious Rikske0_12 LinuxQuestions.org Member Intro 2 02-15-2006 06:28 AM
Can Mplayer borrow from Real Player, curious? MarcusG Linux - Software 1 03-09-2005 02:51 PM

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

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