When a Mac OSX release

I just joined the forum and I am new to Panda3d. I want to use Panda running on Mac OS X. Currently I am using the compiled version that I found on knuddl.net/moin.cgi/InstallPanda3d#..

Does anyone know when there is going to be an official realease for Mac OS X? Also, I have seen some posts on the forum about the possibility of building Panda for OS X from source. Does the sound work if you do it that way?

inoh

the package i have created did follow the instructions from this forum, including some additional fixes that are not (yet) in CVS.

i am currently trying to get FMOD support running on OS X (i won’t be able to add Miles Sound System support, i don’t have a license).

next on the list is an Intel version.

i can’t give an ETA when this is going to be done (hopefully within the next week), as i did hit some problems (as expected) and need to figure out how to fix them.

hope this helps,
kaweh

Thank you so much for your quick reply kaweh!
That’s great news. I hope you will not encounter too many problems with the sound implementation.
I will keep my eyes peeled for the new release. It is lucky we have people like you supporting the OS X community.

Thanks again, best,

inoh

does anyone know if the maya exporter works on osx as yet? I’ve been trying the one that comes with the pc version but keep getting a syntax error when i try to drop the mel file into the maya workspace.

i was using Maya 7, but when i dropped the MEL script into Maya 7, it would always just crash the whole application (a similiar problem as you describe).

i didn’t really bother to find out why, mainly because i have no experience with MEL scripts, my time with Panda3d is (unfortunatly) limited, and i am comfortable with command line tools.

the maya tools (meaning the command line tools but not the MEL script) are included with the OS X package. they are compiled against Maya 7, so if you are using a different Maya version than 7, you are currently on your own - sorry.

unfortunatly i can’t provide Maya support for any other version than 7. and i’m not even sure how long i can provide Maya 7 support, the license i am using was provided to me temporarly.

cheers,
kaweh

Hey Kaweh,

How is it going with the implementation of fMod for OSx and the intel release? Any progress?

inoh

Unfortunatly I couldn’t free up any time to look into this yet.

Though good news: I will try fmod today and let you know.

Cheers,
Kaweh

Status: got it to compile (using latest CVS), though i’m not quite sure why FMOD is still not picked up by the AudioManager.

So I might need Joshs or Davids support here.

Here we go :slight_smile:

  • FMOD is picked up by ppremake…
g5:~/Projects/panda3d/dtool kaweh$ ppremake
Root is /Users/kaweh/Projects/panda3d/dtool
Reading /Users/kaweh/Projects/panda3d/Config.pp (referred to by PPREMAKE_CONFIG)
Read 18 Sources.pp files.

Configuring support for the following optional third-party packages:
- Did not find NSPR
+ OpenSSL
+ libjpeg
+ libpng
+ libtiff
- Did not find fftw
+ Nvidia Cg High Level Shading Language
+ Cg OpenGL API
- Did not find Cg DX8 API
- Did not find Cg DX9 API
- Did not find Cg DX10 API
- Did not find VRPN
+ zlib
- Did not find Miles Sound System
+ FMOD sound library
+ Freetype
+ OpenGL
- Did not find DirectX
- Did not find OpenCV
- Did not find FFMPEG
+ OpenMaya

Compilation will generate Python interfaces.

See dtool_config.h for more details about the specified configuration.

No errors.
  • Compile and link goes all fine (after adapting the approriate Sources.pp files to link correctly).

  • But a tester does not pick up FMOD (but still tries to load miles_audio); I wonder why I get this message, I would at least expect the system to try to pick up libfmod_audio.dylib, though it directly uses the NullAudioManager.

g5:~/Projects/tester kaweh$ p sound_tester.py 
DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
:display: loading display module: libpandagl.dylib
Known pipe types:
  osxGraphicsPipe
(all display modules loaded.)
:08-16-2006 17:53:06 ShowBase(info): Default graphics pipe is OpenGL (osxGraphicsPipe).
osxGraphicsStateGuardian::osxGraphicsStateGuardian()
:display: Unable to set window properties: size=(800, 600) 
:audio(error):   LoadLibrary() failed, will use NullAudioManager
:audio(error):     dlopen(libmiles_audio.dylib, 6): image not found
:audio: NullAudioManager
:audio: NullAudioManager
:audio: NullAudioManager
:audio: NullAudioManager
:util(warning): Adjusting global clock's real time by 1.46793 seconds.
:08-16-2006 17:53:06 ShowBase(info): __dev__ == 0
:display: Closing osxGraphicsWindow
osxGraphicsStateGuardian::~osxGraphicsStateGuardian()

Any hints how to force the AudioManager to try FMOD (and then I can look into if the libraries are really found).

Thanks,
Kaweh

PS: in pandatool/src/mayaegg/mayaNodeDesc.cxx i had to replace a type usage in line 371 and 373:

from

void MayaNodeDesc::
check_pseudo_joints(bool joint_above) {
  static uint32 space_count = 0;
  string space;
  for (uint32 idx=0; idx<space_count; ++idx) {
    space.append(" ");
  }

to

void MayaNodeDesc::
check_pseudo_joints(bool joint_above) {
  static unsigned int space_count = 0;
  string space;
  for (unsigned int idx=0; idx<space_count; ++idx) {
    space.append(" ");
  }

at least with OS X uint32 is not available in this file. i didn’t look into this deeper, just did this quick hack to my local version to get everything to compile.

You need to put the following in your Config.prc file:

audio-library-name fmod_audio

David

Thanks Dave.

Some progress…

I deliberatly didn’t set DYLD_LIBRARY_PATH correctly to see if it does what I would expect and voila:

:display: Unable to set window properties: size=(800, 600) 
:audio(error):   LoadLibrary() failed, will use NullAudioManager
:audio(error):     dlopen(libfmod_audio.dylib, 6): Library not loaded: libfmodex.dylib
  Referenced from: /usr/local/panda/lib/libfmod_audio.dylib
  Reason: image not found
:audio: NullAudioManager
:audio: NullAudioManager
:audio: NullAudioManager
:audio: NullAudioManager

So with your tip we are trying the correct thing.

Next: Setting DYLD_LIBRARY_PATH to include the path to libfmodex.dylib, I now get:

g5:~/Projects/tester kaweh$ p sound_tester.py 
DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
:display: loading display module: libpandagl.dylib
Known pipe types:
  osxGraphicsPipe
(all display modules loaded.)
:08-17-2006 12:14:12 ShowBase(info): Default graphics pipe is OpenGL (osxGraphicsPipe).
osxGraphicsStateGuardian::osxGraphicsStateGuardian()
:display: Unable to set window properties: size=(800, 600) 
0
0
:audio: NullAudioManager
:util(warning): Adjusting global clock's real time by 1.01746 seconds.
:08-17-2006 12:14:13 ShowBase(info): __dev__ == 0
:display: Closing osxGraphicsWindow
osxGraphicsStateGuardian::~osxGraphicsStateGuardian()

Hm… no sound (playing a sound does not do anything, though loading is returning a AudioSound object), it’s still falling back to the NullAudioManager for some reason - though it seems to find the libraries, so I assume these are the funny lines to investigate:

0
0
:audio: NullAudioManager

Any hints what I should check for next?

I tried a FMOD sample to make sure they run correctly and yes, I can hear FMOD in action with their samples on OS X with no problems.

So, I can compile & link and force FMOD usage, but we are still falling back to the NullAudioManager.

My Config.pp says

#define HAVE_FMOD 1
#define FMOD_IPATH /Users/kaweh/Projects/fmod/api/inc
#define FMOD_LPATH /Users/kaweh/Projects/fmod/api/lib
#define FMOD_LIBS fmodex

and this seems to be right for compiling & linking.

PS: the tester is very minimal

import direct.directbase.DirectStart

sound = loader.loadSfx('sound/bluepill.wav')
sound.play()

run()

Hmm, that is strange. Perhaps it was able to find the libraries, but wasn’t able to load them. Try putting some print statements in config_fmodAudio.cxx, in the init_libFmodAudio() function, to prove that it is getting called (it should be called when the library is successfully loaded).

It may also be that load_dso() is not doing the right thing–you can put some print statements in dtool/src/dtoolutil/load_dso.cxx for this. Be sure you look in the case bracketed by IS_OSX, and not PENV_OSX (which is obsolete and not used).

David

As always: thanks David, making progress due to your help.

function gets called and ends correctly. we are fine here.

same here. gets called and values are fine.

it seems that in audioManager.cxx AudioManager::create_AudioManager i and up with an invalid audio manager

it passes (correctly) the if(!lib_load) block and fails here (line 79-82 in my version)

  PT(AudioManager) am = (*_create_AudioManager)();
  if (!am->is_valid()) {
    am = create_NullAudioManger();
  }

so I investigated further into fmodAudioManager.cxx and the FmodAudioManager constructor, added print statements to line 142+

and now comes the “funny part”, looking at my output, I get:

the constructor is called two times (and fails the second time)? doesn’t make sense, does it?

any hints where the manager is actually created?

ps: how can i enable the audio_debug output easily? i assume something needs to be put into Config.prc?

cheers,
kaweh

Interesting! I believe the constructor is normally supposed to be called twice, since ShowBase wants to have two AudioManagers (one for sound effects, and one for music). I don’t know why it would be failing the second time, however. Is there something about FMOD on OSX that allows it to only have one instance at a time?

To enable audio debug, put the following line in your Config.prc:

notify-level-audio debug

Or even:

notify-level-audio spam

David

Hi Kaweh,

How is it going with the audio debugging of FMOD? Any luck with the audio Managers? Also, is there a plan to do an intel release of Panda3d once the audio is working? For the project I am working on, we would like to use a mac based environment but my machine is a new MacBook. Do you think Panda3d would run on my MacBook if I install the non-intel version or it wouldn’t work at all?

inoh

Heya Inoh,

Unfortunatly I still was not successful with FMOD, though I have now released a new version of my package where FMOD support is available.

And you can also try an Intel build. :slight_smile:

knuddl.net/moin.cgi/InstallPanda3d

Enjoy,
Kaweh

Hey Kaweh,

I have now installed the intel version of Panda3d you released on Friday and it works like a dream! Thank you so much, you are a star!!

It will be interesting to know how you get on with the sound and FMOD.

inoh

ok, i have a hack that can be applied to the 0.5 build for (reduced) sound support. be aware it’s an ugly hack.

David is right, there seems to be a problem to initialize FMOD two times on OS X, but i couldn’t yet get an answer from the FMOD developer forums of why this is the case.

knuddl.net/moin.cgi/InstallPanda3d has been updated to describe the hack. here is the description:

To activate the provided FMOD Ex support follow the following steps

  • make sure the FMOD dynamic libraries are on your DYLD_LIBRARY_PATH (replace with your FMOD installation path):
DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}:/usr/local/panda/lib:<Path To FMOD>/api/lib ; export DYLD_LIBRARY_PATH
  • Edit /usr/local/panda/etc/Config.prc so Panda3D imports FMOD at startup time:
audio-library-name fmod_audio
  • Open /usr/local/panda/lib/direct/showbase/Showbase.py, jump to line 1191:
self.musicManager = AudioManager.createAudioManager()

and change the line, so it says

self.musicManager = None
  • Now FMOD can be used for audio output. The basic audio API seems to work as expected (as described in panda3d.org/manual/index.php/L … _and_Music).

  • You only can use base.sfxManagerList[0] (see panda3d.org/manual/index.php/M … ing_Sounds) to play music ‘’‘and’’’ sound. Be aware that you ‘’‘can’’’ play music ‘’‘and’’’ sound, you are just limited to use one AudioManager, which reduces the number of different sounds to 16 (or to any value set via the configuration variable audio-cache-limit).

hope that helps,
kaweh

[color=orange][size=75] Update: I got sound to work properly, so I removed my complaint about sound. [/size]
Hello,
I’m using Panda3d under OS 10.4 using the binary distribution from your website. Two things don’t seem to work properly, however.

First, when I disable this hack and try to run the samples from your website, many of them don’t seem to be importing everything. For example, a number of them return “Task.cont” at some point but never import Task. I fixed this by simply using the 1.3.2 samples, which are identical except for their imports

Secondly, when I try to run the Airblade example, it crashes while loading SuperCityCurve.egg, with the error:

:loader: Loading model Models/city/SuperCityCurve
:egg2pg: Reading ./Models/city/SuperCityCurve.egg
:egg2pg: Flattened 2 nodes.
:pgraph(warning): Don't know how to copy nodes of type NurbsCurve
Traceback (most recent call last):
  File "main.py", line 33, in ?
    import EnemyFormations
  File "/Users/dlepage/Desktop/Projects/Games/Panda/airblade-1.2.3/EnemyFormations.py", line 16, in ?
    import ClassGlobals
  File "/Users/dlepage/Desktop/Projects/Games/Panda/airblade-1.2.3/ClassGlobals.py", line 74, in ?
    stage1 = Level1.Level1() 
  File "/Users/dlepage/Desktop/Projects/Games/Panda/airblade-1.2.3/Level1.py", line 142, in __init__
    self.rail.loadFile('Models/city/SuperCityCurve')
  File "/usr/local/panda/lib/direct/directutil/Mopath.py", line 30, in loadFile
    self.loadNodePath(nodePath)
  File "/usr/local/panda/lib/direct/directutil/Mopath.py", line 48, in loadNodePath
    print 'Mopath: no valid curves in file: %s' % filename
NameError: global name 'filename' is not defined

Any ideas why any of these errors would happen?

I’ve got myself in a bit of a quandary. I followed the Mac Panda directions, and I was able to load GreetingCard.py but no sound at all. I followed the instructions on the end of the page and switched line 1191 to

self.musicManager = None 

Once I do this I can’t open anything and I get this message

:loader: Loading model models/thankyou_anim
:loader: Reading ./models/thankyou_anim.bam
actor bundle CharacterJointBundle thankyou_card_65, 417724352
:chan: Part thankyou_card_65 has 1 children, while matching anim node has 2:
:chan:   anim has morph, not in part.
:pgraph(warning): Using deprecated LightAttrib interface.
:pgraph(warning): Using deprecated LightAttrib interface.
Traceback (most recent call last):
  File "GreetingCard.py", line 70, in ?
    w = World()
  File "GreetingCard.py", line 23, in __init__
    self.music = loader.loadMusic('sound/soundtrack.mp3')
  File "/usr/local/panda/lib/direct/showbase/Loader.py", line 357, in loadMusic
    return self.loadSound(base.musicManager, *args, **kw)
  File "/usr/local/panda/lib/direct/showbase/Loader.py", line 385, in loadSound
    sound = manager.getSound(soundPath)
AttributeError: 'NoneType' object has no attribute 'getSound'
:display: Closing osxGraphicsWindow
osxGraphicsStateGuardian::~osxGraphicsStateGuardian()

Can anyone help? I am a bit stuck on how this is happening.
[/code]

-Ken Bowen

The problem is that you’re still using the musicmanager. The hack disables it so that you can use the rest of the sound stuff without panda complaining. Try replacing “loader.loadMusic” with “loader.loadSound”, or somewhere putting “base.musicManager = base.soundManager”.