AVBin on MacOSX?

Has anyone got AVBin to work on MacOSX?

I'm not getting sound from any of the AVBin-using games, despite having installed what purports to be a binary of AVBin for MacOSX.

(log in to comment)

Comments

Me too. I've installed AVBin from both the OSX binary off of their site (installs with the shell script) and from the Pyglet installer, and so far I haven't gotten any of the Pyglet games to act as if AVBin is installed (otherwise, the games run fine).

Here is the result of doing a locate avbin:
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/pyglet/media/avbin.py
/opt/local/lib/python2.5/site-packages/pyglet/media/avbin.py
/usr/lib/libavbin.0.dylib
/usr/lib/libavbin.2.dylib
/usr/lib/libavbin.dylib

If someone has gotten AVBin to work on OSX, I'd love to hear about it.

Mac OSX 10.4, Python 2.5, Pyglet 1.0.1
GOT IT.

Silly permissions issues.
CD into /usr/lib, and do a ls -al libavbin*. It should come up with something like:
-rwx------   1 root  clint  5276296 Jan 20 21:31 libavbin.0.dylib
-rwxr-xr-x   1 root  wheel  5289820 Apr 13 23:26 libavbin.2.dylib
lrwxr-xr-x   1 root  clint       16 Apr 13 23:39 libavbin.dylib -> libavbin.0.dylib

See that first one? That's the broken one. To fix it, use:
sudo chmod +rx libavbin.0.dylib

Then when you do an ls -al libavbin*, it should come up with something like:
-rwxr-xr-x   1 root  clint  5276296 Jan 20 21:31 libavbin.0.dylib
-rwxr-xr-x   1 root  wheel  5289820 Apr 13 23:26 libavbin.2.dylib
lrwxr-xr-x   1 root  clint       16 Apr 13 23:39 libavbin.dylib -> libavbin.0.dylib

This should let you enjoy your Pyglet/AVBin games on OSX. I tested it on my system, and it Works For Me! (tm)
Thanks, Martin for all of the help -- it is appreciated.

--clint
Thanks for the debugging guys. Please ignore previous post by me in the other thread.

You'll probably want to symlink to libavbin.2.dylib, as that's the newer version.

I'll be releasing AVbin 3 in the next couple of days (still need to test on PPC and linux/32). I'd really appreciate it if you could check that the installer correctly updates the symlink and sets the right permissions on your machines. (There'll be a new pyglet 1.1 binary installer to go with the new AVbin shortly afterwards, if you prefer that method of installation).

HanClinto wrote:
CD into /usr/lib, and do a ls -al libavbin*. It should come up with something like:
-rwx------   1 root  clint  5276296 Jan 20 21:31 libavbin.0.dylib
-rwxr-xr-x   1 root  wheel  5289820 Apr 13 23:26 libavbin.2.dylib
lrwxr-xr-x   1 root  clint       16 Apr 13 23:39 libavbin.dylib -> libavbin.0.dylib
But that's not what I've got. I just have

-rwxr-xr-x   1 sketchup  sketchup  5289820 Apr  9 17:16 libavbin.2.dylib
lrwxr-xr-x   1 root      wheel          16 Apr  9 17:16 libavbin.dylib -> libavbin.2.dylib
So I've already got the later version, and there is no permission problem.

There must be something else wrong in my case. Is there something I can do to debug why Pyglet isn't finding it or can't use it?

If 'import pyglet.media.avbin' doesn't work, try
import ctypes
ctypes.cdll.LoadLibrary('/usr/lib/libavbin.dylib')
which may give a more helpful error message.
Alex wrote:
If 'import pyglet.media.avbin' doesn't work, try
import ctypes
ctypes.cdll.LoadLibrary('/usr/lib/libavbin.dylib')
Both of these succeed for me, but I still don't get any sound in Robot Underground.
The problem could be audio output rather than AVbin. Perhaps a problem with pyglet's use of OpenAL. The source or documentation packages for pyglet (1.0 or 1.1, both are roughly equivalent in this area) contain a demonstration program 'examples/media_player.py' which should be able to play any WAV file (without AVbin) and pretty much any other sound or movie file (with AVbin).

If you happen to have a pyglet 1.1 alpha or svn checkout in your PYTHONPATH you can run 'python -m pyglet.info' to get some debug info on the OpenAL layer.