Compiling PS3 Media Server on OSX

For help and support with issues specific to Mac OS X
Forum rules
Please make sure you follow the Problem Reporting Guidelines before posting if you want a reply.

Re: Compiling PS3 Media Server on OSX

Postby Wolf » Thu Jun 02, 2011 10:06 am

Could you share a copy of your build? Eager to test it out!
Wolf
 
Posts: 35
Joined: Fri Mar 05, 2010 10:06 pm

Re: Compiling PS3 Media Server on OSX

Postby Raptor399 » Thu Jun 02, 2011 11:10 am

Sorry, I am not going to share a copy of my build as I explained in another thread.

However, I can understand the eagerness for a fresh build, so I will try to explain in detail how to create your own working build:

1) Open a Terminal
2) Create a directory "pms" and change to it: "mkdir pms; cd pms"
3) Use your favorite editor to copy the contents of the latest version of the script to a file named "build-pms-osx.sh" in the "pms" directory.
4) The script should work out of the box, but you might want to change the TARGET_ARCHITECTURE="i386" to "TARGET_ARCHITECTURE="x86_64" on a shiny new device.
5) Run the script and follow its instructions: "sh build-pms-osx.sh". Yes, you will probably need to install stuff, but the script will guide you through it. When you installed a prerequisite, just try the script again.

Note: running the script can take up to 20 minutes and can eat up to 2 GB of your disk space!
During this, a lot of text will scroll over your terminal. This is normal, ignore it - even if the text contains warnings. If there really is a serious error, the script will abort.

Let's assume the script finished properly and created an (unpatched!) "pms-macosx-i386-1.23.0.dmg".
In order to build that file, the PMS source was downloaded, so we can now patch it:

6) Edit the following files:
- "pms/src/ps3mediaserver/net/pms/encoders/MEncoderWebVideo.java"
- "pms/src/ps3mediaserver/net/pms/encoders/MEncoderVideo.java"
- "pms/src/ps3mediaserver/net/pms/encoders/TSMuxerVideo.java"
Search for "acodec=ac3" and replace it with "acodec=ac3_fixed". Save the files afterwards.
7) Time to rebuild PMS: "cd ~/pms/src/ps3mediaserver/osx; ant DMG; cp pms-macosx-1.23.0.dmg ~/pms/pms-macosx-i386-1.23.0.dmg"

And done. You now have a patched version of PMS. Just open the .dmg file in the Finder and install PMS as usual.
Hope this helps, enjoy! :)

*edit* Link to script updated; the latest version now lives in SVN.
Last edited by Raptor399 on Thu Jun 16, 2011 6:53 am, edited 1 time in total.
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Compiling PS3 Media Server on OSX

Postby chocolateboy » Thu Jun 02, 2011 12:00 pm

Great work! Please ping SubJunk to get this tested in the SubJunk build. Also, please attach the patch as a file. I'll add the fix to the next version of PMSEncoder once it's been tested.
chocolateboy
Project Member
 
Posts: 2579
Joined: Wed Sep 16, 2009 10:05 am

Re: Compiling PS3 Media Server on OSX

Postby Raptor399 » Thu Jun 02, 2011 12:31 pm

chocolateboy wrote:Great work! Please ping SubJunk to get this tested in the SubJunk build. Also, please attach the patch as a file. I'll add the fix to the next version of PMSEncoder once it's been tested.


Sure. Added the attachment to the original posting.
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Compiling PS3 Media Server on OSX

Postby Raptor399 » Thu Jun 02, 2011 11:43 pm

Important note by SubJunk in another thread:

SubJunk wrote:Do the newer MEncoder builds break any subtitle support on OS X?
On Windows the newer MEncoder builds break ASS and VOBSUB (2 of the most popular subtitle formats) support, so if it is the same on the mac builds we can't update them either, unless they were never supported on the mac builds.

Edit: It doesn't work with our Windows MEncoder builds, but that's OK because we can easily say "if mac use ac3_fixed, else use ac3", so we still just have to confirm it doesn't break any existing subtitle support.


This means the patch needs rewriting, plus subtitle support needs to be tested well.
I cannot do the latter due to a lack of movies on my computer. ;-)
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Compiling PS3 Media Server on OSX

Postby daboblin » Sat Jun 04, 2011 5:02 am

Hi, I've been trying hard to get this working but I'm having a problem with compiling Mplayer. The output I get is this:

Code: Select all
Undefined symbols for architecture x86_64:
  "_MM_FIX_0_707106781", referenced from:
      _filter6998 in lto.o
  "_MM_FIX_0_541196100", referenced from:
      _filter6998 in lto.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [mencoder] Error 1
make: *** Waiting for unfinished jobs....
Undefined symbols for architecture x86_64:
  "_MM_FIX_0_707106781", referenced from:
      _filter8021 in lto.o
  "_MM_FIX_0_541196100", referenced from:
      _filter8021 in lto.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make: *** [mplayer] Error 1
Fatal error occurred, aborting build.


I've tried several times, starting from scratch each time, and it always fails at this point. I can't find the lto.o object file that it's complaining about so I'm a bit stuck. Any ideas?
daboblin
 
Posts: 5
Joined: Sat Jun 04, 2011 4:59 am

Re: Compiling PS3 Media Server on OSX

Postby Raptor399 » Sat Jun 04, 2011 8:58 am

Are you compiling with FIXED_REVISIONS="yes" or "no"?

In my experience, the message "Undefined symbols" can mean one of three things:

1) Trying to compile a revision of MPlayer that is broken - it is hard to figure out which are working revisions.
Solution: fall back to the last known working revision using "svn update -r $REVISION".

2) Trying to compile incompatible revisions of MPlayer and FFmpeg - not all combinations will work
Solution: fall back to the last know working combination of revisions using "svn update -r $REVISION" and "git rev-list master -n 1 --first-parent --before=2011-xx-xx`"

3) One of the referenced libraries is not compiled for the right architecture - the compiler is very picky and refuses to link "x86_64" stuff with "i386" stuff.
Solution: check the architecture of resulting binaries using "lipo -detailed_info filename". Recompile the deviating binary.

Back to your specific problem... I have tried to find those symbols, but I cannot locate them in sources anywhere, only in binaries:

Code: Select all
src> grep "_MM_FIX_0_707106781" */*
Binary file ffmpeg/ffmpeg_g matches
Binary file mencoder_mt/mencoder matches
Binary file mencoder_mt/mplayer matches
Binary file mplayer/mencoder matches
Binary file mplayer/mplayer matches
src> cd ffmpeg
ffmpeg> grep "_MM_FIX_0_707106781" */*
Binary file libavfilter/libavfilter.a matches
ffmpeg> cd ..
src> find . -name lto.c -print
src> find . -name lto.h -print
src> find . -name lto.o -print
src>

That's not much of a help, sorry. Your errors occur in a "lto.o", but I cannot even find that file or its sources on my system? :-(
You have me puzzled!

The last time I posted the script I fiddled with some git revisions, which seemed to build fine for "i386". Maybe it broke the "x86_64" build. I will check that and get back to you.
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Compiling PS3 Media Server on OSX

Postby Raptor399 » Sat Jun 04, 2011 9:41 am

I just removed everything, took script (version 1.8) and only changed one line:

Code: Select all
TARGET_ARCHITECTURE="x86_64"


Ran the script without any further changes or preparations.
It builds just fine and I ended up with a "pms-macosx-x86_64-1.23.0.dmg".
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

Re: Compiling PS3 Media Server on OSX

Postby daboblin » Sat Jun 04, 2011 10:39 am

Hmm, I did the same and it's still failing at the same point. I wonder if the dev tools need to be at a certain rev? I have both Xcode 3.2.5 and Xcode 4 installed, but 3.2.5 is in /Developer. I could try updating to 3.2.6 I guess.
daboblin
 
Posts: 5
Joined: Sat Jun 04, 2011 4:59 am

Re: Compiling PS3 Media Server on OSX

Postby Raptor399 » Sat Jun 04, 2011 12:03 pm

I have Xcode version 3.2.6 installed, it seems (installed it long ago, and use "Software update" every now and then).
Raptor399
Project Member
 
Posts: 1916
Joined: Thu Mar 10, 2011 12:06 am

PreviousNext

Return to Mac OS X Support

Who is online

Users browsing this forum: No registered users and 3 guests