Author Topic: Mplayer initialization error  (Read 6558 times)

klanmce

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Mplayer initialization error
« on: December 04, 2009, 01:06:33 am »
First I will like to indicate if this post seems silly, I am not coder in writing application, only experience is minimal best, doing my degree which was in pascal and Java.

Here goes:

When trying to use mplayer, through Mplayer_Player, I am getting the following error in the log:
Quote
MPlayer engine didn't set up within 10 seconds, something is wrong <0xb7101b
90>
Return code: 141
3       12/03/09 19:12:19       26 (spawning-device)    Device died... count=1/50 dev=26

,

From my investigation, I think the error is coming from this condition in the Mplayer_Player.cpp file, the error output highlighted.
Quote
if (m_pPlayerEngine->GetEngineState()==MPlayerEngine::PLAYBACK_FINISHED)
   {
      g_pPlayerInstance = this;
      g_iMplayerChildPID = m_pPlayerEngine->GetChildPID();
      
      struct sigaction new_action;
      new_action.sa_sigaction = SignalHandler_CHLD;
      new_action.sa_flags = SA_SIGINFO /*| SA_NOCLDSTOP*/;      
      sigaction(SIGCHLD, &new_action, NULL);
      LoggerWrapper::GetInstance()->Write(LV_STATUS, "MPlayer - installed SIGCHLD handler");
      
      signal(SIGPIPE, SignalHandler_PIPE);
      LoggerWrapper::GetInstance()->Write(LV_STATUS, "MPlayer - installed SIGPIPE handler");

      LoggerWrapper::GetInstance()->Write(LV_STATUS, "MPlayer engine initialized and ready to go");
   }
   else
      LoggerWrapper::GetInstance()->Write(LV_CRITICAL, "MPlayer engine didn't set up within 10 seconds, something is wrong");

Prior to the above quote, the following suppose to insure the black file is finished played.
Quote
while (m_pPlayerEngine->GetEngineState()!=MPlayerEngine::PLAYBACK_FINISHED && iCounter!=0)
   {
      Sleep(100);
      iCounter--;
   }

I am stating the obvious, when saying the condition is returning false, in either the while - so it exists early and then the if fails or in the if condition so the else kicks in.

Any information - logic, on what supposed to happen in this line: m_pPlayerEngine->GetEngineState()!=MPlayerEngine::PLAYBACK_FINISHED, found below in MPlayerEngine, have not fully gotten a handle on this
Quote
MPlayerEngine::EngineState MPlayerEngine::GetEngineState() {
   PLUTO_SAFETY_LOCK(stateLock, m_engineStateMutex);
   return m_eEngineState;
}

Also, In my ignorance is it possible the sleep time is to long, or the loop to short.

Once I get this to work, plan on editing to get mplayer working with vdpau, I know xine already works with beta2. Have not upgraded to beta2 as yet, fixing my test machine for that, so I know what is entailed, minimize transition for the family.

Is this fixed by chance in beta2?

Thanks for all assistance

klanmce

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Re: Mplayer initialization error
« Reply #1 on: December 04, 2009, 01:20:44 am »
Forgot to add, am also see the following error, which possible indicate something wrong with running mplayer
Quote
1       12/03/09 18:13:18       26 (spawning-device)    Starting... 1
1       12/03/09 18:13:18       26 (spawning-device)    Found ./MPlayer_Player
05      12/03/09 19:12:08.992           MPlayer_Player::Log I'm a parent <0xb7101b90>
05      12/03/09 19:12:08.992           MPlayer_Player::Log [EngineOutputReader] EngineOutputReader - started <0xb60ffb90>
05      12/03/09 19:12:08.992           MPlayer_Player::Log I'm a child <0xb7101b90>
05      12/03/09 19:12:08.992           MPlayer_Player::Log Starting mplayer <0xb7101b90>
05      12/03/09 19:12:08.992           MPlayer_Player::Log execle() failed <0xb7101b90>
01      12/03/09 19:12:18.990           MPlayer engine didn't set up within 10 seconds, something is wrong <0xb7101b90>           

Which would be from the following piece of code in the MPlayerEngine
Quote
Log("Starting mplayer");
      
      if (m_bOverrideAudioSettings) {
         // device dependant, replacing ":" with "=" to keep mplayer parser happy
         string sALSADevice = "alsa:device="+StringUtils::Replace(m_sALSADevice,":", "=");
         
         // depending on the passthrough setting
         string sALSACodec = (m_bALSAPassthrough?"hwac3,hwdts,":"") + string("a52,");
         
         execle(MPLAYER_BINARY, MPLAYER_BINARY_SHORT, "-slave", "-idle", "-msglevel", "all=4", "-noborder",
            "-fixed-vo", "-fs", "-vo", "xv,x11", "-vf", "screenshot",
            "-ao", sALSADevice.c_str(),
            "-ac", sALSACodec.c_str(),
            "-lavdopts", "fast:threads=2", BLACK_MPEG_FILE, (char *) 0, environ);
      }
      else {
         execle(MPLAYER_BINARY, MPLAYER_BINARY_SHORT, "-slave", "-idle", "-msglevel", "all=4", "-noborder",
                "-fixed-vo", "-fs", "-vo", "xv,x11", "-vf", "screenshot",
              "-lavdopts", "fast:threads=2", BLACK_MPEG_FILE, (char *) 0, environ);
      }

      Log("execle() failed");
      exit(127);


Thanks again.

klanmce

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Re: Mplayer initialization error
« Reply #2 on: December 04, 2009, 11:54:59 pm »
Quick question.

If I want to compile one module "MPlayer_Player", what are the exact steps, looked at the set up development environment, I did such.

klanmce

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Re: Mplayer initialization error
« Reply #3 on: December 05, 2009, 12:39:44 pm »
Took the plunge and upgrade to beta2 on production system, MPlayer_Player is now working.

Thanks guys.

Do not seem to be using vdpau, no problem, will recompile mplayer as tested previously and attempt to make the modifications in MPlayer_Player. As test system down, doing this on an MD, which I created a backup of its directory.

My question still stands, can I only compile one module?. Simple tried make and got some dependency errors.

niz23

  • Guru
  • ****
  • Posts: 361
    • View Profile
Re: Mplayer initialization error
« Reply #4 on: December 05, 2009, 09:20:55 pm »
klanmce,

Took the plunge and upgrade to beta2 on production system, MPlayer_Player is now working.

Thanks guys.

Do not seem to be using vdpau, no problem, will recompile mplayer as tested previously and attempt to make the modifications in MPlayer_Player. As test system down, doing this on an MD, which I created a backup of its directory.

My question still stands, can I only compile one module?. Simple tried make and got some dependency errors.

There´s already a patch that I have made that will enable vdpau in mplayer.
It´s scheduled for inclusion in upcoming updates.
Atm there is several bugs in mplayer_player that need to be solved. It do not affect watching but som other feature don´t work.

As for the issues you stated. Yes you´re correct. I haven´t paid any attention to the issue you mention as mplayer_player still work.

/niz23

niz23

  • Guru
  • ****
  • Posts: 361
    • View Profile
Re: Mplayer initialization error
« Reply #5 on: December 05, 2009, 09:40:29 pm »
Quick question.

If I want to compile one module "MPlayer_Player", what are the exact steps, looked at the set up development environment, I did such.

"test-pkg.sh 656,657" should build mplayer_player on a builder.

klanmce

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Re: Mplayer initialization error
« Reply #6 on: December 05, 2009, 10:14:13 pm »
Ok thanks.

From your last post, this will not work on my test MD mentioned (on a builder), test system is down.

niz23

  • Guru
  • ****
  • Posts: 361
    • View Profile
Re: Mplayer initialization error
« Reply #7 on: December 05, 2009, 10:47:36 pm »
Not sure what you mean by "test system is down".

You need to run it on a builder. As in a standalone builder or a chroot one.
Before you can run it you mus be able to do a complete build of lmce on your builder.
Otherwise test-pkg wont´t work.

The numbers in test-pkg can be found in webadmin under software packages.
In this example the number correspond to mplayer_player source and mplayer_player binary.


/niz23

Ok thanks.

From your last post, this will not work on my test MD mentioned (on a builder), test system is down.


klanmce

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Re: Mplayer initialization error
« Reply #8 on: December 05, 2009, 11:08:28 pm »
Ok, thanks for the information, clarified some aspects for me.

avajon

  • Veteran
  • ***
  • Posts: 120
    • View Profile
Re: Mplayer initialization error
« Reply #9 on: January 08, 2010, 11:31:59 am »
hi,

last week i upgraded from 810 alpha to 810 beta2. there were some problems but i could solve everything - except mplayer. (i didn't use mplayer before, so i don't know if it works before update).
I tried to play a 1080p mkv movie, so i changed the fileformat in webadmin to Linuxmce BlueRay and played it on my md. but i only get a black screen with this log output from mplayer:

Code: [Select]
05      01/08/10 11:21:11.807           MPlayer_Player::Log I'm a parent <0xb7142b90>
05      01/08/10 11:21:11.807           MPlayer_Player::Log [EngineOutputReader] EngineOutputReader - started <0xb6140b90>
05      01/08/10 11:21:16.943           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |MPlayer UNKNOWN-4.3.2 (C) 2000-2009 MPlayer Team| <0xb6140b90>
05      01/08/10 11:21:16.972           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |mplayer: could not connect to socket| <0xb6140b90>
05      01/08/10 11:21:16.973           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |mplayer: No such file or directory| <0xb6140b90>
05      01/08/10 11:21:16.973           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Failed to open LIRC support. You will not be able to use your remote control.| <0xb6140b90                   >
05      01/08/10 11:21:16.973           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Playing /usr/pluto/share/black.mpeg.| <0xb6140b90>
05      01/08/10 11:21:16.973           MPlayer_Player::Log [EngineOutputReader] Playback preinit for file: /usr/pluto/share/black.mpeg <0xb6140b90>
05      01/08/10 11:21:17.193           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |AVI file format detected.| <0xb6140b90>
05      01/08/10 11:21:17.193           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |[aviheader] Video stream found, -vid 0| <0xb6140b90>
05      01/08/10 11:21:17.193           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |AVI: No audio stream found -> no sound.| <0xb6140b90>
05      01/08/10 11:21:17.193           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |VIDEO:  [mpg2]  640x480  24bpp  25.000 fps  945.4 kbps (115.4 kbyte/s)| <0xb6140b90>
05      01/08/10 11:21:17.193           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Clip info:| <0xb6140b90>
05      01/08/10 11:21:17.193           MPlayer_Player::Log [EngineOutputReader] Analyzing line: | Software: MEncoder dev-SVN-r24750-4.1.3| <0xb6140b90>
05      01/08/10 11:21:17.263           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |[VO_XV] Could not grab port 355.| <0xb6140b90>
05      01/08/10 11:21:17.264           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Opening video filter: [screenshot]| <0xb6140b90>
05      01/08/10 11:21:17.265           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |==========================================================================| <0xb6140b90>
05      01/08/10 11:21:17.266           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough| <0xb6140b90>
05      01/08/10 11:21:17.266           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Could not find matching colorspace - retrying with -vf scale...| <0xb6140b90>
05      01/08/10 11:21:17.266           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Opening video filter: [scale]| <0xb6140b90>
05      01/08/10 11:21:17.267           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |The selected video_out device is incompatible with this codec.| <0xb6140b90>
05      01/08/10 11:21:17.267           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Try appending the scale filter to your filter list,| <0xb6140b90>
05      01/08/10 11:21:17.267           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |e.g. -vf spp,scale instead of -vf spp.| <0xb6140b90>
05      01/08/10 11:21:17.267           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |VDecoder init failed :(| <0xb6140b90>
05      01/08/10 11:21:17.267           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family| <0xb6140b90>
05      01/08/10 11:21:17.268           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Unsupported PixelFormat -1| <0xb6140b90>
05      01/08/10 11:21:17.268           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Selected video codec: [ffmpeg2] vfm: ffmpeg (FFmpeg MPEG-2)| <0xb6140b90>
05      01/08/10 11:21:17.268           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |==========================================================================| <0xb6140b90>
05      01/08/10 11:21:17.269           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Audio: no sound| <0xb6140b90>
05      01/08/10 11:21:17.269           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Starting playback...| <0xb6140b90>
05      01/08/10 11:21:17.269           MPlayer_Player::Log [EngineOutputReader] Playback started: /usr/pluto/share/black.mpeg <0xb6140b90>
05      01/08/10 11:21:17.270           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.| <0xb6140b90>
05      01/08/10 11:21:17.270           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |[swscaler @ 0x89669c0]| <0xb6140b90>
05      01/08/10 11:21:17.270           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |No accelerated colorspace conversion found.| <0xb6140b90>
05      01/08/10 11:21:17.270           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |[swscaler @ 0x89669c0]| <0xb6140b90>
05      01/08/10 11:21:17.270           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |using unscaled yuv420p -> rgb24 special converter| <0xb6140b90>
05      01/08/10 11:21:17.270           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |VO: [xv] 640x480 => 640x480 Planar YV12  [fs]| <0xb6140b90>
01      01/08/10 11:21:21.807           MPlayer engine didn't set up within 10 seconds, something is wrong <0xb7142b90>
05      01/08/10 11:21:22.387           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Error while parsing playlist| <0xb6140b90>
05      01/08/10 11:21:22.388           MPlayer_Player::Log [EngineOutputReader] Analyzing line: |Warning: empty playlist| <0xb6140b90>
05      01/08/10 11:21:22.391           PlayerEnginePoll - detected start of playlist <0xb513eb90>
05      01/08/10 11:21:22.391           PlayerEnginePoll - engine plays file  <0xb513eb90>
05      01/08/10 11:21:23.191           MPlayer_Player::Log Failed to get stream time position <0xb513eb90>
05      01/08/10 11:21:23.491           MPlayer_Player::Log Failed to get stream time length <0xb513eb90>
05      01/08/10 11:21:23.879           MPlayer_Player::CMD_Play_Media - audio track info not found <0xb7142b90>
05      01/08/10 11:21:24.179           MPlayer_Player::Log Failed to get stream audio codec <0xb7142b90>
05      01/08/10 11:21:24.291           MPlayer_Player::Log Failed to get stream time position <0xb513eb90>
05      01/08/10 11:21:24.479           MPlayer_Player::Log Failed to get stream video codec <0xb7142b90>
05      01/08/10 11:21:24.479           MPlayer_Player::EVENT_Playback_Started(streamID=1019) <0xb7142b90>
05      01/08/10 11:21:24.479           MPlayer_Player::UpdateTracksInfo - detecting count of tracks <0xb7142b90>
05      01/08/10 11:21:24.479           MPlayer_Player::UpdateTracksInfo - detect command: /opt/pluto-ffmpeg/bin/ffmpeg -i "" 2>&1 | grep "Stream.*Audio" > /tmp/MPlayer_75.ffmpeg.info <0xb                   7142b90>
05      01/08/10 11:21:24.510           MPlayer_Player::UpdateTracksInfo - detect command returned code: 256 <0xb7142b90>
05      01/08/10 11:21:24.511           MPlayer_Player::UpdateTracksInfo - no audio tracks found <0xb7142b90>
05      01/08/10 11:21:24.511           MPlayer_Player::CMD_Set_Media_ID is not implemented <0xb7142b90>
05      01/08/10 11:21:24.591           MPlayer_Player::Log Failed to get stream time length <0xb513eb90>
05      01/08/10 11:21:25.392           MPlayer_Player::Log Failed to get stream time position <0xb513eb90>
05      01/08/10 11:21:25.692           MPlayer_Player::Log Failed to get stream time length <0xb513eb90>
05      01/08/10 11:21:26.491           MPlayer_Player::Log Failed to get stream time position <0xb513eb90>

i hope someone knows what here happens...

regards
avajon

klanmce

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Re: Mplayer initialization error
« Reply #10 on: January 09, 2010, 01:50:35 am »
I checked it today and realized I am also getting some issues with mplayer again; since my re-install of beta2 I had been having issues with mythtv and the packages were not installing, so was fighting with that, as such, my using mplayer to play the *.m2ts files was not priority - getting the wife and kids happy, they want livetv.

I also realized it was not using vdpau, so I am now building my development machine, which I am stuck at the import phase where rsync is timing out connecting to the site, to have mplayer use vdpau; I am seeing in htop are ...-fixed-vo -fs  -vo xv,x11 -vf

I think I am supposed to see vdpau being used, but in any case I am not seeing the reduced cpu usage as when I run mplayer from the command line on the same file.

Planning an update tomorrow, that's what fix my issue last time, before I decided to do a clean dvd install

niz23

  • Guru
  • ****
  • Posts: 361
    • View Profile
Re: Mplayer initialization error
« Reply #11 on: January 09, 2010, 05:25:38 pm »
Have you set vdpau as hw accel sdetting in webadmin for your md on which you use mplayer?
Which nvidia card do you have?

For your information I´m reengineering our mplayer functionality.
The reason for that is because atm several mplayer functions do not work as expected.
For example pause. Timecode is not sent back to lmce correctly.

Status right now is that it is working but lack some parts. Hope to get it to beta status during next week.

I have chosen another way to integrate mplayer than what was used before. Instead of engineering our own
integration to mplayer through pipes(since mplayer do not have a socket interface) I have chosen a existing
library that support several other players as it´s backend too. Namely Xine, Gstreamer, vlc and mplayer.

libplayer is a relly nice library to write media players in.
It abstracts all backend player functionlity into one common api.


/niz23

My goal is to get this into lmce0810 release.


klanmce

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Re: Mplayer initialization error
« Reply #12 on: January 10, 2010, 04:01:30 pm »
Yes I enabled vpdau in the webadmin for the MD in question, also tried the auto option. I am using a onboard 9300 in one MD and a 9400 on another MD.

You doing some good work man, I was just thinking to change the play option in the existing script when mplayer is called for now, removing them, and using a config file in /root/mplayer/, and putting the play options inside there for vdpau, so you do not need to specify anything; this is based on how I got it to play using the command like in kde.

Before all that, I still fighting to get my development env built, I am stuck at
Quote
prepare-scripts/import-external-files.sh

Where it fails on connection time out to rsync.linuxmce.org, have a post already for it.


pw44

  • Addicted
  • *
  • Posts: 666
    • View Profile
Re: Mplayer initialization error
« Reply #13 on: February 21, 2010, 03:24:58 pm »
Hia,
regarding mplayer, i have some questions and would appreciate  if someone can clarify me:
1) changed the fileformat in webadmin to Linuxmce BlueRay - where is it done?
2) renaming H264 .mkv files to .m2ts plays no sound. - how can it be done, having sound?
3) .mp4 files renamed to .m2ts also does not play sound.
On my MD (hybrid), i have the following configuration:
sound card: standard sound card
audio settings: manual settings
Use AC3/DTS pass-through: unchecked.
This configuration was changed to provide sound when playing dvds and dvd files, and it works well (DTS, Dolby, etc.. all over optical SPDIF)
Video Card: GeForce or TNT2
Hardware acceleration: vdpau
Deinterlace quality: highest
Mobo: Asus M3N78-VM, with video out HDMI and Nvidia 9200.
What is to be done to maintain the file extension .mkv or .mp4 and having sound playing?
TIA