Chaosforge Forum

  • December 09, 2024, 07:16
  • Welcome, Guest
Please login or register.



Login with username, password and session length
Pages: [1]

Author Topic: Can't enable sound on Mac OS X 10.8  (Read 12623 times)

victorng

  • Private
  • *
  • Offline Offline
  • Posts: 1
  • Lost Soul
    • View Profile
Can't enable sound on Mac OS X 10.8
« on: May 28, 2013, 20:43 »

So I'm on Mac, and I already have the original DIABDAT.MPQ file
However, it seems that changing the "sound" variable from "NONE" to "FMOD", "SDL" or "DEFAULT" will result in DiabloRL not being able to start up.
OR maybe it's a problem with the pathname format? I tried both POSIX and Windows.

A screenshot:

Logged

Kornel Kisielewicz

  • God Hand
  • Apostle
  • *
  • *
  • Offline Offline
  • Posts: 4576
    • View Profile
    • http://chaosforge.org/
Re: Can't enable sound on Mac OS X 10.8
« Reply #1 on: May 28, 2013, 23:07 »

Uh, forgot to mention it, sound MPQ decoding currently only works on Windows.

This is only due to the fact that I have too little OS X experience to try to compile StormLib on other systems. Technically they say it should work, but I didn't have a chance to test - http://www.zezula.net/en/mpq/download.html

A StormLib.dylib is needed in a place that DiabloRL can find it.

P.S. If someone manages to do that, I'd happily use his .dylib in the next version and provide full credit in the release and manual!
« Last Edit: May 28, 2013, 23:08 by Kornel Kisielewicz »
Logged
at your service,
Kornel Kisielewicz

siwucha

  • Lance Corporal
  • *
  • Offline Offline
  • Posts: 24
  • Lost Soul
    • View Profile
Re: Can't enable sound on Mac OS X 10.8
« Reply #2 on: May 29, 2013, 03:29 »

I could get sound partially working under archlinux:

- I installed stormlib via https://aur.archlinux.org/packages/stormlib/  (The PKGBUILD looks fairly standard, so it seems if you have the right dependencies installed - which are listed in the PKGBUILD - there are no problems compiling stormlib).
- In vstormlibrary.pas the constant 'StormDefaultPath' points to 'StormLib.so'. It should point to 'libstorm.so' instead. I "solved" this problem by symlinking 'libstorm.so' to 'StormLib.so' in /usr/lib. (didn't want to compile).

Now I get to the main menu of diablorl and have background music. However as soon as I do anything I get the following error (which seems sdl related, but I didn't have time to look into it):

Code: [Select]
An unhandled exception occurred at $0000000000535479 :
EStreamError : Seek not implemented
  $0000000000535479 line 859 of src/rlui.pas
  $000000000059CB0F line 114 of ../fpcvalkyrie/src/vsdlsound.pas
  $000000000059854F line 182 of ../fpcvalkyrie/src/vsound.pas
  $0000000000534371 line 552 of src/rlui.pas
  $0000000000582C7C line 734 of ../fpcvalkyrie/src/vuielements.pas
  $00000000005833A4 line 793 of ../fpcvalkyrie/src/vuielements.pas
  $000000000056929A line 387 of ../fpcvalkyrie/src/vuielement.pas
  $000000000056956D line 442 of ../fpcvalkyrie/src/vuielement.pas
  $0000000000569552 line 442 of ../fpcvalkyrie/src/vuielement.pas
  $0000000000569552 line 442 of ../fpcvalkyrie/src/vuielement.pas
  $000000000057CA17 line 682 of ../fpcvalkyrie/src/vconui.pas
  $000000000058BF37 line 147 of ../fpcvalkyrie/src/vio.pas
  $000000000058BEA0 line 131 of ../fpcvalkyrie/src/vio.pas
  $00000000004687A8 line 78 of src/rlgame.pas
  $0000000000426210 line 50 of src/rl.pas

An unhandled exception occurred at $00007F6FEFBAD350 :
EAccessViolation : Access violation
  $00007F6FEFBAD350
  $0000000000599101
  $000000000059C970
  $0000000000436172
  $00000000004E06CB
  $0000000000468090
  $0000000000436172
  $000000000043B222

Logged

Kornel Kisielewicz

  • God Hand
  • Apostle
  • *
  • *
  • Offline Offline
  • Posts: 4576
    • View Profile
    • http://chaosforge.org/
Re: Can't enable sound on Mac OS X 10.8
« Reply #3 on: May 29, 2013, 03:34 »

Source build or binary package from website?

Edit: Nevermind - checked the sources. It is indeed an issue with SDL's version (windows uses FMOD), which means I should be able to easily reproduce it. It seems that contrary to FMOD, SDL output needs seeking to work properly, and the default MPQStreams that I made don't have that implemented -- however, it also seems that stormlib has seeking support so it should be a relatively minor change.

Is that stormlib binary in arch-linux linked to anything else? Could it serve as a general binary for later deployment?
« Last Edit: May 29, 2013, 03:42 by Kornel Kisielewicz »
Logged
at your service,
Kornel Kisielewicz

siwucha

  • Lance Corporal
  • *
  • Offline Offline
  • Posts: 24
  • Lost Soul
    • View Profile
Re: Can't enable sound on Mac OS X 10.8
« Reply #4 on: May 29, 2013, 09:40 »

I used the diablorl package (diablorl-linux-x64-050.tar.gz) from the website. I built stormlib from sources using the (inofficial) archlinux provided "script" which I linked to, called PKGBUILD.
The forum didn't let me attach the resulting 'libstorm.so', so I uploaded it at http://www1.datafilehost.com/d/2b427487.
On the technical side I would expect that you can bundle it. The PKGBUILD lists bzip2 and zlib as dependencies. So it might link to those libraries. I don't know enough about the cmake system to give you a definitive answer on possible dependencies. There might be licencing issues as well.

Archlinux installed libstorm.so in /usr/lib. But it also works for me if I put "libstorm.so" in the diablorl directory and set the "LD_LIBRARY_PATH" accordingly.  (i.e. "export LD_LIBRARY_PATH="./" && ./rl")

Instructions if you want to build libstorm.so for yourself (without archlinux build system):
- download and unzip stormlib.zip.
- cd into "StormLib".
- "cmake -DCMAKE_BUILD_TYPE=Release"
- "make".

This is basically the same that the PKGBUILD does. If it doesn't work, check whether bzip2 and zlib are installed. I am willing to provide help if it still doesn't work.
« Last Edit: May 29, 2013, 09:50 by siwucha »
Logged

AaronBP

  • Private
  • *
  • Offline Offline
  • Posts: 2
  • Lost Soul
    • View Profile
Re: Can't enable sound on Mac OS X 10.8
« Reply #5 on: June 21, 2013, 23:23 »

So it might link to those libraries. I don't know enough about the cmake system to give you a definitive answer on possible dependencies. There might be licencing issues as well.

I don't have access to a Linux box ATM, but IIRC you can tell what the dependencies of a lib are from the command line. Lets see... Here it is.
Logged

Grolm

  • Private
  • *
  • Offline Offline
  • Posts: 3
  • Lost Soul
    • View Profile
Re: Can't enable sound on Mac OS X 10.8
« Reply #6 on: July 05, 2013, 16:01 »

Hi,

I managed to play sound on ubuntu 13.04 64bits:

Code: [Select]
# required packages
sudo apt-get -y install build-essential fpc libsdl1.2-dev libsdl1.2-dbg lua5.1 liblua5.1-0-dev subversion p7zip-full wget sed

DRL_DIR=/tmp/diablorl-build
MPQ_PATH=/PATH/TO/DIABDAT.MPQ # replace by the actual path to DIABDAT.MPQ from Diablo CD

# create absolute path
cd $(dirname "${MPQ_PATH}")
MPQ_PATH="$PWD/$(basename "${MPQ_PATH}")"
cd - &>/dev/null

mkdir -p "${DRL_DIR}"
cd "${DRL_DIR}"
DRL_DIR="$PWD"

# downloads (tested with rev 770 from fpcvalkyrie and 1178 of diablorl)
svn checkout -r 770 http://svn.code.sf.net/p/fpcvalkyrie/code/trunk fpcvalkyrie
svn checkout -r 1178 http://svn.code.sf.net/p/diablorl/code/trunk diablorl
wget http://www.zezula.net/download/stormlib.zip
7z x stormlib.zip

# Build StormLib
cd "${DRL_DIR}"/StormLib
make -f Makefile.linux
cp libStorm.so "${DRL_DIR}"/diablorl/bin/lib
cd "${DRL_DIR}"/diablorl/bin/lib
ln -s libStorm.so StormLib.so

# patch fpcvalkyrie
cd "${DRL_DIR}"/fpcvalkyrie/src
sed -i~  -e 's/\(^[[:space:]]*\)\(FPrev.FNext := FNext;\)/\1if FPrev <> nil then \2/' \
         -e 's/\(^[[:space:]]*\)\(FNext.FPrev := FPrev;\)/\1if FNext <> nil then \2/' vnode.pas

# patch diablorl
cd "${DRL_DIR}"/diablorl/src
sed -i~ -e 's/\(raise EStreamError.CreateFmt.*;\)/{\1}/' rlui.pas

# compile
cd "${DRL_DIR}"/diablorl/src
FPCDIR=/usr/lib/fpc/2.6.0/ fpcmake
make COMPILER_UNITDIR=../../fpcvalkyrie/libs/ FPCOPT="-k-lm" DEBUG=1


# config and run
cd "${DRL_DIR}"/diablorl/bin
./mpq
cp -vf "${MPQ_PATH}" .
sed -i~ -e 's/sound     = "NONE"/sound     = "SDL"/' \
        -e 's/mpq       = ""/mpq       = "DIABDAT.MPQ"/' config.lua

# Create a runner
cat <<EOF > /tmp/diablorl
#!/bin/sh
cd "${DRL_DIR}/diablorl/bin"
export LD_LIBRARY_PATH="${DRL_DIR}/diablorl/bin/lib"
./rl
EOF
sudo mv /tmp/diablorl /usr/local/bin/diablorl
sudo chmod 755 /usr/local/bin/diablorl

# Run and Have Fun with
diablorl

Logged

Grolm

  • Private
  • *
  • Offline Offline
  • Posts: 3
  • Lost Soul
    • View Profile
Re: Can't enable sound on Mac OS X 10.8
« Reply #7 on: July 05, 2013, 16:18 »

Here a setup script I made :

http://dl.free.fr/qwJbd9j8F
Logged
Pages: [1]