Topic: ERROR Load Sound : unable to read file on linux

Hello everybody,
it seems I'm stuck in a new trouble.
I'm trying to figure how to manage sounds, so, I added  wav sound file from the editor, set it to loop, but, when I start the game, the console outputs this message:

ERROR Load Sound : unable to read /home/zoiba/Lavoro/Maratis/proj01/sounds/fanfare2.wav file


and I can't hear any sound.
I've compiled Maratris in debug mode but no error come up when I run it with GDB , only the console message.
I'm working on Ubuntu 12.10

Re: ERROR Load Sound : unable to read file on linux

Hi,
can you give the detail of the sound ? format ? 8bit / 16 bits etc ?
Maratis only supports 16bits mono and stereo.

But the error indicates it even cannot read the file at all, before testing the format.

Can you also try with another sound file ? a regular mono or stereo 16 bit 44k.
Thanks,

Re: ERROR Load Sound : unable to read file on linux

I checked other files (wav and ogg) with the same result. I believe the problem is not the sound format, it seems to me that Maratis , for some reason, fails opening the file. I  tried to move the project folder in case it was a path name issue but nothing changed.

Re: ERROR Load Sound : unable to read file on linux

is it happening with your own build ? can you check with the current Maratis build ?
if you are compiling in 64bit linux, there is maybe an issue with "libsndfile" the library that manage sound files in Maratis, the lib is probably prebuilt in 32 bits.

Re: ERROR Load Sound : unable to read file on linux

this happens on both builds, I'm using 32 bit Ubuntu linux.
I'm looking into the source, for now I found that M_fopen opens the file, so, I believe  the problem is elsewhere.

Last edited by Lamberto (2013-02-20 11:01:45)

Re: ERROR Load Sound : unable to read file on linux

ok so it's not a 32/64 issue,
from the error the problem must be with libsndfile, I don't don't have a linux to test here unfortunately.

Just to be sure, you have openAL installed on your linux ?

Re: ERROR Load Sound : unable to read file on linux

[update]
well, I've verified that the problem is libsndfile.
first of all, ldd MaratisEditor shows how it links against libsndfile.so.1 in system path instead of the one in the boundle. After renaming boundled library it links correctly Anyway this alone doesn't resolve the problem.
I compiled Maratis against system library and only after this operation I've got the sounds properly working.

Re: ERROR Load Sound : unable to read file on linux

so the pre-built libsndfile.so is not good, and it doesn't link properly,
do you have an idea how we could fix that ?

Re: ERROR Load Sound : unable to read file on linux

I'm working on it

Re: ERROR Load Sound : unable to read file on linux

pre-built library linkage is only matter of name, it must be named libsndfile.so.1 and must change line 42 of file trunk/dev/var/scons/thirdparty/libsndfile.py

in order to play sounds I found 3 ways that work:
1) make maratis links against system libsndfile (on ubuntu this is a default package, don't know other distros)
2) compile libsndfile without external library (this way ogg files are not played)
3) compile libsndfile with support for external FLAC/Ogg/Vorbis library (plays ogg files but libogg0 must installed on user's system, so this solution is much the same as point 1)

I don't know if there is a way of compiling libsndfile with libogg0 statically linked, this is beyond my knowledge.

Lamberto

Re: ERROR Load Sound : unable to read file on linux

ok, I'll see what I can do.
thank you.

Re: ERROR Load Sound : unable to read file on linux

Just to let you know that there seems to be a problem on windows too, with some sounds i got

OpenAL : Unable to send sound data

Changing the format, bit rate, sampling rate, mono/sterero, the error remains
when converting to aiff i don't have the OpenAL problem displaying but the sound still didn't play

Re: ERROR Load Sound : unable to read file on linux

hum... I think I will drop libsndfile...