UFO:Alien Invasion

Technical support => Mac => Topic started by: tchristney on December 21, 2009, 03:10:03 am

Title: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: tchristney on December 21, 2009, 03:10:03 am
Edit: this has been fixed in macports trunk, but this may be useful info if you don't use the source version of macports.

Hi fellow mac users. I've been experiencing a problem the last couple of weeks with OGG sound files not playing, and getting an error:

Code: [Select]
S_LoadSound: There are 0 joysticks available.
S_LoadSound: Could not find sound file: 'footsteps/water_under'

IF you are having the same problem (i.e. no footsteps being played, among other things), then read on! Otherwise, pretend that this message ends here.  ;)

I finally tracked it down and it is a problem with SDL_mixer that has only been fixed with version 1.2.11 (which is not current in macports). It is fairly easy to modify the macports Portfile and PortIndex files to upgrade your version. First, find the port file using port file libsdl_mixer, and open it in an editor as the super user.


Next, you need to change the PortIndex file so that it knows about the change. If port file libsdl_mixer returns a path PREFIX/audio/libsdl_mixer/Portfile, then you need to edit PREFIX/PortIndex (again as the super user). Search for libsdl_mixer, and change 1.2.10 to 1.2.11. Save and exit.

Lastly, run port upgrade libsdl_mixer. Done!

I'm going to notify the port maintainer to get this modification upstream. And no, mattn, I'm not going to update the wiki because this problem will hopefully be extremely short lived.  ;) :P ;D

ps. if this doesn't work for you, keep in mind that I'm using the source version of macports from their trunk and using the most up to date dports. Modifying the instructions to work for a packaged release of macports is left as an exercise for the reader...
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: Mattn on February 28, 2010, 08:52:05 am
we have reports about a missing libvorbis and libogg in the created dmg files. it would be really cool if you could have a look at that issue, too (looks like they are not added because they are not found by otool (because they are loaded at runtime))
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: keybounce on May 26, 2010, 01:22:37 am
Alright, what do you do if you have the up to date version of sdl_mixer, a properly set
stbmac:23 Michael$ echo $DYLD_FALLBACK_LIBRARY_PATH
:/opt/local/lib/:/opt/local/lib/

and you still get these errors on some sound files?

I get the main background music, but no sound effects.
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: keybounce on June 14, 2010, 09:52:32 pm
Bump

I am still getting these errors on the current branch checkout.

At the load sample code, at
                if (!(chunk = Mix_LoadWAV_RW(rw, qfalse)))
                        Com_Printf("S_LoadSound: %s.\n", Mix_GetError());

the Mix_LoadWAV_RW call is failing.

stbmac:23 Michael$ port installed libsdl_mixer
The following ports are currently installed:
  libsdl_mixer @1.2.8_1+universal
  libsdl_mixer @1.2.11_0+universal (active)

I've got 1.2.11 of sdl_mixer

I've verified that the sound file is found, and opened.

stbmac:23 Michael$ printenv | egrep DYLD
DYLD_FALLBACK_LIBRARY_PATH=:/opt/local/lib/

I've got my environment set.
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: smlacc on June 17, 2010, 01:14:48 am
I still have this problem too.  Running otool on the ufo binary inside the ufoai.app I generated just now gives this output:
-------------------
   /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
   /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 751.21.0)
   /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 15.0.0)
   @executable_path/../Libraries/libvorbis.0.dylib (compatibility version 5.0.0, current version 5.3.0)
   @executable_path/../Libraries/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
   @executable_path/../Libraries/libcurl.4.dylib (compatibility version 6.0.0, current version 6.1.0)
   @executable_path/../Libraries/libjpeg.8.dylib (compatibility version 9.0.0, current version 9.2.0)
   @executable_path/../Libraries/libpng14.14.dylib (compatibility version 17.0.0, current version 17.0.0)
   @executable_path/../Libraries/libSDL-1.2.0.dylib (compatibility version 12.0.0, current version 12.3.0)
   @executable_path/../Libraries/libSDL_image-1.2.0.dylib (compatibility version 9.0.0, current version 9.2.0)
   @executable_path/../Libraries/libSDL_mixer-1.2.0.dylib (compatibility version 11.0.0, current version 11.1.0)
   @executable_path/../Libraries/libSDL_ttf-2.0.0.dylib (compatibility version 11.0.0, current version 11.0.0)
   @executable_path/../Libraries/libogg.0.dylib (compatibility version 7.0.0, current version 7.0.0)
   @executable_path/../Libraries/libtheora.0.dylib (compatibility version 4.0.0, current version 4.10.0)
   @executable_path/../Libraries/libintl.8.dylib (compatibility version 10.0.0, current version 10.0.0)
   /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 125.0.1)
   /usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 227.0.0)
   /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 550.19.0)
   /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices (compatibility version 1.0.0, current version 38.0.0)
   /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 1038.29.0)
-----------
Have checked, and al libraries listed are where they should be, including the ogg/theora ones.

Smlacc
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: keybounce on June 27, 2010, 05:48:53 pm
I'm not able to test this right now (time and priorities), but I'm thinking that we may need to switch from the MacPorts version of SDL to the official binary of SDL -- some changes were made back in November about how it links in some sound supports. (Just found this out last night).
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: keybounce on August 05, 2010, 07:34:25 am
Bump

I can confirm the following:
1. Modifying the configure.ac to use the frameworks is a pain, but doable.
2. It fixes all sound issues -- no more complaints about unable to load a sound file.
3. Graphics are still messed up on the battlefield.
4. The 3D world is still too dark.
5. I could not get ufomodel to build -- SDLMain vs main issues.
6. Some of the libraries that configure tests for don't need to be tested for. System built with them turned off. (Zlib and XviD.)

To get this to work, I had to do the following:

PKG_CONFIG_PATH=/usr/X11/lib/pkgconfig:/usr/lib/pkgconfig ; export PKG_CONFIG_PATH
aclocal --verbose -I /opt/local/share/aclocal/
autoconf
./configure --disable-uforadiant --enable-universal

Pkg-config was the really odd one. It's in /opt/local (so it came from macports), and will not check the system directories by default. There are config files in the system directories, but apparently no system supplied pkg-config.

The combination of pkg-config and aclocal is needed to fix ...
Quote
#---------------------------------------------------------------------------------------
------
# defined some defaults for users (mac-users..) who might not have pkg-config.
#---------------------------------------------------------------------------------------
------

m4_define_default([PKG_CHECK_MODULES],
        [AC_MSG_ERROR([For current build options, pkg-config is required. Did you maybe
forget to run aclocal with the current include path?])])

Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: Mattn on August 05, 2010, 09:50:52 am
which m4 files in /opt/local/share/aclocal/ are needed? i will add them to our svn in the versions we need them (to be able to rebuild aclocal.m4 in a "correct" way on each system)

pkg-config stuff is really strange, is that written on the macports homepage somewhere?

zlib should not be deactivated - xlib can be
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: Mattn on August 05, 2010, 10:56:52 am
should we completely switch over to the frameworks?
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: keybounce on August 05, 2010, 07:37:45 pm
As for the frameworks:
1. The sound issue is linking related, and it's fixed in the frameworks. Potentially it could be fixed in the library versions.
2. It does nothing to fix the graphics issues
3. I found the hard way that you need the development frameworks. It's not "This is used to develop the SDL code", it's "This is used if you are developing a program that uses SDL".

In particular, there are _MULTIPLE_ implementations of main() (in the development frameworks) that set things up and call SDL_main(). Just as a quick example, the code that is used for ufo fails to work for ufomodel. And, sdl-config doesn't exist in the end user framework version.
4. You still have to copy the stuff into the .dmg for distribution.

At the moment, using the frameworks version for sound might make sense, but not if the .dmg packaging breaks their linking fix. (Not tested yet).

As for pkg-config, it was trial and error. I'm still learning how aclocal, autoconf, and automake all fit together (and automake isn't even used here.)

Aclocal needed
# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
# serial 1 (pkg-config-0.24)
...
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
# ----------------------------------
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
...

I hope that's enough to tell you what it needed. A comparison of the config files produced by my autoconf versus your autoconf shows that my version is out of date. (Hmm, checking ... yep, I'm using the stock version from 10.5.8, not the macports version.)
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: incognito_uk on August 20, 2010, 11:51:35 pm
For those of us that aren't developers is there any way around the lack of sound problem?

I love the game and thank everyone for the time they put into making it but without sound or music it spoils the enjoyment of the game.

Any help you guys can offer would be greatly appreciated.
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: keybounce on August 21, 2010, 12:22:28 am
I can't compile something that gives graphics properly. Anything I compile has garbled lighting. Apparently, it even affects x86 machines (or have I misunderstood that? Anyone gotten my builds to run on x86?)

My focus has been more on that then on the sound.
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: Mattn on August 21, 2010, 08:39:20 am
well - on my x86 machine the lighting works ((i)mac mini)

if you would give me a teamviewer (download (http://www.teamviewer.com/de/download/index.aspx)) session i would like to have a look at it. (maybe join the irc channel to coordinate that?)
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: keybounce on August 28, 2010, 10:04:24 pm
Alright, I have TeamViewer up and running, and everything compiled.

What do I need to do to get you on my computer? (It's behind a NAT router; do I have to forward ports?)
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: keybounce on August 28, 2010, 10:34:36 pm
Getting back to the original topic: The current version, using library (not frameworks) versions of the sound libraries, does work on a local compile; dmg package not yet tested.
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: Mattn on August 29, 2010, 03:59:08 pm
What do I need to do to get you on my computer? (It's behind a NAT router; do I have to forward ports?)

no, nothing like that is needed for teamviewer - that's the clue about it. all i need is the number and the password - contact me via irc, icq or jabber to sync the access
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: incognito_uk on September 28, 2010, 12:18:20 am
Does anyone have any idea when the sound issue will be resolved?
I love this game but without the sound or music its just not as entertaining.
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: Mattn on September 28, 2010, 08:12:52 am
it's resolved with 2.4 - we are using the sdl frameworks now and the problems are history with these
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: incognito_uk on September 30, 2010, 11:55:57 pm
it's resolved with 2.4 - we are using the sdl frameworks now and the problems are history with these
Cool! Is 2.4 ready for download or do I have to sit tight for a bit longer?
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: keybounce on October 02, 2010, 03:10:18 am
Just a bit ...
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: Mattn on October 02, 2010, 08:15:28 am
i'm just merging the build system fixes into the 2.3 branch - i will try to create a new dmg this weekend to get some feedback about this issue. i hope to have this fixed then
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: Mattn on October 02, 2010, 11:58:56 am
ok, the stuff is in the 2.3 branch now - feedback would be nice.
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: OldMan88 on October 04, 2010, 06:53:58 am
All the files available at Sourceforge still have the 2010 - 06 - 17 date tag... and I also tried redownloading the 2.3 dmg, with no luck on sound still (except for the into movie when I first opened the app), though I haven't tested the glass breaking for sound.

Have the changes only been added to the source, or not been properly merged? Or am I missing something?

I have an Intel i5 iMac and haven't downloaded any libs... under the impression I'm not supposed to need to download any.
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: Mattn on October 04, 2010, 07:50:34 am
the changes are of course only in the source and will be part of the official 2.3.1 release.
Title: Re: [FIXED in macports trunk] SDL_mixer + OGG broken? Fix in macports!
Post by: falcn on October 16, 2010, 07:57:54 am
Just finished building 2.4-dev from trunk on a Mac Os X 10.6.4 (intel)
The sound is working fine (no sound in official stable 2.3)

The intro played at the first run is laggy as hell, 100% CPU, 1fps, distorted sound - both in stable and 2.4-dev.
It's playing fine (5% CPU usage) with any external player. You may consider chosing another playback method/library.

I've played 4 hours with no problems, but currently the game crashes for me at certain moment during the interceptor chase
Quote
B_UpdateStorageAndCapacity: current number of item 'rpg_ammo' is negative: reset to 0
B_UpdateStorageAndCapacity: current number of item 'rpg_ammo' is negative: reset to 0
B_UpdateStorageAndCapacity: current number of item 'rpg_ammo' is negative: reset to 0
Assertion failed: (entry), function LIST_GetNext, file src/common/list.c, line 230.
Abort trap
Maybe the old save from 2.3 is causing the problem, I'm trying to find out.