Topic: Error Load Sound on newer version of Maratis

I use MaratisEditor from this website -> download,
and everything is ok.
And then I update from svn, and now I can't play sound anymore, from both of MaratisEditor or MaratisPlayer.

I'm using linux Fedora 15.

I used this command from terminal.
#./MaratisEditor
->(then I open my project that contains sound, I test ogg, and mp3)
#GL_VERSION : 2.1 Mesa 7.11.2
#ERROR Load Sound : unable to read /home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Examples/test/sounds/spring.ogg file
#ERROR Load Sound : unable to read /home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Examples/test/sounds/spring.mp3 file
(but MaratisEditor still open, but without sound when click "play")

so I try open wav format.
#./MaratisEditor
->(open project that contains wav format sound)
#GL_VERSION : 2.1 Mesa 7.11.2
#ERROR Load Sound : non supported format
#ERROR Load Sound : non supported format

it's still produce error.

when I open using MaratisPlayer:
#./MaratisPlayer ../Example/........./test.mproj
(for any format of sound, ogg, mp3, and wav that I test)
#Segmentation fault (core dumped)

then I use valgrind to detect error of MaratisPlayer:
#valgrind ./MaratisPlayer ../Example/......./test.mproj

output wrote:

==2316== Memcheck, a memory error detector
==2316== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
==2316== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
==2316== Command: ./MaratisPlayer ../Examples/Door/Door.mproj
==2316==
==2316== Use of uninitialised value of size 4
==2316==    at 0x80B893F: MWindow::create(char const*, unsigned int, unsigned int, int, bool) (in /home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Bin/MaratisPlayer)
==2316==    by 0x80805BD: main (in /home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Bin/MaratisPlayer)
==2316==
==2316== Use of uninitialised value of size 4
==2316==    at 0x80B895C: MWindow::create(char const*, unsigned int, unsigned int, int, bool) (in /home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Bin/MaratisPlayer)
==2316==    by 0x80805BD: main (in /home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Bin/MaratisPlayer)
==2316==
==2316== Use of uninitialised value of size 4
==2316==    at 0x80B8964: MWindow::create(char const*, unsigned int, unsigned int, int, bool) (in /home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Bin/MaratisPlayer)
==2316==    by 0x80805BD: main (in /home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Bin/MaratisPlayer)
==2316==
==2316== Invalid read of size 4
==2316==    at 0x460CEB0F: XCreateWindow (in /usr/lib/libX11.so.6.3.0)
==2316==    by 0x80B89D8: MWindow::create(char const*, unsigned int, unsigned int, int, bool) (in /home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Bin/MaratisPlayer)
==2316==    by 0x80805BD: main (in /home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Bin/MaratisPlayer)
==2316==  Address 0x105 is not stack'd, malloc'd or (recently) free'd
==2316==
==2316==
==2316== Process terminating with default action of signal 11 (SIGSEGV)
==2316==  Access not within mapped region at address 0x105
==2316==    at 0x460CEB0F: XCreateWindow (in /usr/lib/libX11.so.6.3.0)
==2316==    by 0x80B89D8: MWindow::create(char const*, unsigned int, unsigned int, int, bool) (in /home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Bin/MaratisPlayer)
==2316==    by 0x80805BD: main (in /home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Bin/MaratisPlayer)
==2316==  If you believe this happened as a result of a stack
==2316==  overflow in your program's main thread (unlikely but
==2316==  possible), you can try to increase the size of the
==2316==  main thread stack using the --main-stacksize= flag.
==2316==  The main thread stack size used in this run was 8388608.
==2316==
==2316== HEAP SUMMARY:
==2316==     in use at exit: 94,933 bytes in 69 blocks
==2316==   total heap usage: 151 allocs, 82 frees, 257,876 bytes allocated
==2316==
==2316== LEAK SUMMARY:
==2316==    definitely lost: 124 bytes in 1 blocks
==2316==    indirectly lost: 0 bytes in 0 blocks
==2316==      possibly lost: 48,098 bytes in 22 blocks
==2316==    still reachable: 46,711 bytes in 46 blocks
==2316==         suppressed: 0 bytes in 0 blocks
==2316== Rerun with --leak-check=full to see details of leaked memory
==2316==
==2316== For counts of detected and suppressed errors, rerun with: -v
==2316== Use --track-origins=yes to see where uninitialised values come from
==2316== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 35 from 8)
Segmentation fault (core dumped)

If I remove sound from my project, MaratisEditor and MaratisPlayer works flawlessly.

here it's some library version on my machine(using ldd)
#ldd MaratisPlayer

output wrote:

             linux-gate.so.1 =>  (0x00c76000)
    libMEngine.so => ./libMEngine.so (0x00d96000)
    libMCore.so => ./libMCore.so (0x00545000)
    libGL.so.1 => /usr/lib/libGL.so.1 (0x48979000)
    libXxf86vm.so.1 => /usr/lib/libXxf86vm.so.1 (0x47d3d000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x46095000)
    libdl.so.2 => /lib/libdl.so.2 (0x45eb4000)
    libopenal.so.1 => /usr/lib/libopenal.so.1 (0x45ec6000)
    libsndfile.so.1 => ./libsndfile.so.1 (0x00110000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x4638b000)
    libm.so.6 => /lib/libm.so.6 (0x45e6c000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00171000)
    libc.so.6 => /lib/libc.so.6 (0x45cdf000)
    libpthread.so.0 => /lib/libpthread.so.0 (0x45e98000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x461f0000)
    libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x465d7000)
    libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x46372000)
    libdrm.so.2 => /usr/lib/libdrm.so.2 (0x48a03000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x461d0000)
    /lib/ld-linux.so.2 (0x45cbd000)
    librt.so.1 => /lib/librt.so.1 (0x45ebb000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x4606f000)

I'm using libsndfile.so.1 (link to libsndfile.so) from Maratis too.

Thank you.


*edit
add error info when I use Maratis from Nistur.

I open MaratisEditor from terminal
#./MaratisEditor
(open project that have sound)
#Segmentation fault (core dumped)

I don't know why it's now showing GL version.

Last edited by jurgel (2012-01-19 16:14:34)

Re: Error Load Sound on newer version of Maratis

Very complete bug report, thanks. If it's happening in svn, it's not going to be my file I/O fixes, but if Anael wants, I can look at it tonight quickly?

Re: Error Load Sound on newer version of Maratis

Nistur, you can have a look if you want of course,
I think it is probably a building problem, or a bad linking with libsndfile.
Jurgel, are you on a 64bit linux ? (we use a pre-build lib for libsndfile that is probably only 32bits)

PS : mp3 won't work, it is not a license free codec and is not supported.

Re: Error Load Sound on newer version of Maratis

Right, so maybe I'm not the best person to try and fix this. My PC, apparently I've not set up audio at all under Linux, and my laptop, I'm getting the following when trying to load an .ogg:

AL lib: pulseaudio.c:612: Context did not connect: Access denied
GL_VERSION : 1.4 Mesa 7.11.2
ERROR Load Sound : non supported format

I will try and get my computer set up properly soon, but I don't think I can sort this bug any time soon

Re: Error Load Sound on newer version of Maratis

@anael
I'm use 32bit version of linux.
and I try with default libsndfile from /usr/lib, but the error still remain.

ohh, so mp3 doesn't work, but it's ok, there is ogg which is better.

Re: Error Load Sound on newer version of Maratis

Mh... strange...
is there any chance you have another version of libsndfile installed on your system ?
when building, the compiler first looks at the system libraries.
> in case it is, try to remove openAL and libsndfile dynamic libs from your maratis folder (to force use of system lib)

Re: Error Load Sound on newer version of Maratis

I've already try to use libsndfile from Maratis folder, and from my system lib, both of these not work,
and there is no openal in Maratis folder, so I use from my system lib.

In older version of Maratis, I use libsndfile and openal from my system lib, and everything works ok.

I'll find the error more specific again later, maybe the error isn't come from libsndfile or openal.
and I will report if I have a progress.

Thanks.

Re: Error Load Sound on newer version of Maratis

It's possible that, when you compile it yourself, the compiler use the headers of your system libsndfile (if you have, and if the version is different than the svn one), not sure... I had something like that when building the linux version, at some point it was not clear so I removed all the double libs or headers that was in the system.

Re: Error Load Sound on newer version of Maratis

Ok, I'd remove libsndfile-devel and openal-devel,
then recompile from svn, I'd delete build/ and prod/ before compile,
and open MaratisEditor then open my project,
but the error still "ERROR Load Sound : non supported format"

I think it's cause by my other system libs/header, the version maybe not compatible with maratis.
So, I'll wait for next official release.

In the current working version, there isn't Object list, that help me so much.
and in the lua scripting, function changeScene() give me Segmentation fault. (didn't happen in svn version)

I'll wait for it big_smile

Thanks.

Re: Error Load Sound on newer version of Maratis

I checked the error "ERROR Load Sound : non supported format"
it happens after libsndfile read the sound but if the format is not supported,
just to be sure, are you using a sound that is 8bits or using more than 2 channels by any chance ?

(it would not explain why it works on the previous version thought)

Re: Error Load Sound on newer version of Maratis

Codec: Vorbis
Channel: Stereo
Sample rate:44100 Hz
Bitrate: 256 kbps

I also can't play wav format,
I test the example WaterGameDemo and Door(from scripting tutorial)

Re: Error Load Sound on newer version of Maratis

I had try compile Maratis to debug,
and here it's

#0  0x080d91d5 in M_SFRead (ptr=0x8d75b60, count=12, user_data=0x0)
    at Maratis/Common/MLoaders/MSndFileLoader.cpp:57
#1  0x001bb568 in psf_fread (ptr=0x8d75b60, bytes=1, items=12, psf=0x8d6c830)
    at file_io.c:321
#2  0x001b988c in header_read (psf=0x8d6c830, ptr=<optimized out>, bytes=12)
    at common.c:817
#3  0x001ba1a9 in psf_binheader_readf (psf=0x8d6c830, format=0x1e46fe "b")
    at common.c:1039
#4  0x00191aed in guess_file_type (psf=0x8d6c830) at sndfile.c:2312
#5  0x0019778b in psf_open_file (psf=0x8d6c830, sfinfo=0xbfffe1c8)
    at sndfile.c:2671
#6  0x00198704 in sf_open_virtual (sfvirtual=0xbfffe1e0, mode=16,
    sfinfo=0xbfffe1c8, user_data=0x8eecc00) at sndfile.c:397
#7  0x080d92be in M_loadSound (
    filename=0x8ed1330 "/home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Examples/test/sounds/spring.ogg", data=0xbfffe268)
    at Maratis/Common/MLoaders/MSndFileLoader.cpp:82
#8  0x0017c978 in MDataLoader::loadData (this=0x172d34,
    filename=0x8ed1330 "/home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Examples/test/sounds/spring.ogg", data=0xbfffe268)
    at MSDK/MCore/Sources/MDataLoader.cpp:74
#9  0x0015dfb6 in MSoundRef::update (this=0x8eb83c8)
    at MSDK/MEngine/Sources/MSoundRef.cpp:68
---Type <return> to continue, or q <return> to quit---
#10 0x0014397d in MLevel::loadSound (this=0x8813e08,
    filename=0xbfffe504 "/home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Examples/test/sounds/spring.ogg", preload=true)
    at MSDK/MEngine/Sources/MLevel.cpp:256
#11 0x080d7a88 in M_loadLevel (
    filename=0x8acaf04 "/home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Examples/test/levels/test.level", data=0x8813e08, clearData=true)
    at Maratis/Common/MFileManager/MLevelLoad.cpp:644
#12 0x080d747a in xmlLevelLoad (
    filename=0x8acaf04 "/home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Examples/test/levels/test.level", data=0x8813e08)
    at Maratis/Common/MFileManager/MLevelLoad.cpp:470
#13 0x0017c978 in MDataLoader::loadData (this=0x172d70,
    filename=0x8acaf04 "/home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Examples/test/levels/test.level", data=0x8813e08)
    at MSDK/MCore/Sources/MDataLoader.cpp:74
#14 0x0808d5ff in Maratis::loadLevel (this=0x83b71e0,
    filename=0x8acaf04 "/home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Examples/test/levels/test.level") at Maratis/Editor/Maratis/Maratis.cpp:1114
#15 0x0808d462 in Maratis::loadProject (this=0x83b71e0,
    filename=0xbfffeb34 "/home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Examples/test/test.mproj") at Maratis/Editor/Maratis/Maratis.cpp:1062
#16 0x0808d32e in Maratis::okLoadProject (
---Type <return> to continue, or q <return> to quit---
    filename=0xbfffeb34 "/home/jurgel/Downloads/Maratis-3.02cBeta-Linux_x86-32/Examples/test/test.mproj") at Maratis/Editor/Maratis/Maratis.cpp:1028
#17 0x080b0a07 in MaratisUI::fileBrowserEvents (fileBrowser=0x8a42948,
    event=MGUI_FILE_BROWSER_EVENT_OK)
    at Maratis/Editor/Maratis/MaratisUI.cpp:2234
#18 0x080f5c70 in MGuiFileBrowser::fileBrowserOkButtonEvents (button=
    0x8a43958, guiEvents=0xbfffec98)
    at MSDK/MGui/Sources/MGuiFileBrowser.cpp:46
#19 0x080f2fb6 in MGuiButton::onEvent (this=0x8a43958, windowEvent=0xbfffeee8)
    at MSDK/MGui/Sources/MGuiButton.cpp:212
#20 0x080fcc14 in MGuiWindow::internalEvent (this=0x8a42a18,
    windowEvent=0xbfffeee8) at MSDK/MGui/Sources/MGuiWindow.cpp:190
#21 0x080fd59c in MGuiWindow::onEvent (this=0x8a42a18, windowEvent=0xbfffeee8)
    at MSDK/MGui/Sources/MGuiWindow.cpp:391
#22 0x080ef994 in MGui::onEvent (this=0x83b7cc0, windowEvent=0xbfffeee8)
    at MSDK/MGui/Sources/MGui.cpp:194
#23 0x080b2977 in MaratisUI::windowEvents (windowEvents=0xbfffeee8)
    at Maratis/Editor/Maratis/MaratisUI.cpp:2906
#24 0x081047b0 in MWindow::sendEvents (this=0x83b7a20, events=0xbfffeee8)
    at MSDK/MGui/Sources/X11/MX11Window.cpp:329
#25 0x08104a4a in MWindow::onEvents (this=0x83b7a20)
    at MSDK/MGui/Sources/X11/MX11Window.cpp:416
#26 0x080a06d3 in main (argc=1, argv=0xbffff264) at Maratis/Editor/main.cpp:160
(gdb) quit

It's certainly error from libsndfile, I'm use libsndfile from maratis folder.

Thanks.


*edit
Ahh, I've some question.
I'd create HUD Layer, and embed it in MGame, so I can scripting easier, I can display and control any object in HUD Layer from current Scene.
I'd test it, and it's works. So, for scripting, every object in each scene have id, right? And I don't want to have same id from current Scene and HUD Layer. So I made every id from HUD Layer to be negative, but it's fail, I think object's id can't be negative, then I try to change every id from HUD Layer + 100 (if id=1 then id=101) and it's works flawlessly.
But I think, I can't create objects from current scene more than 100 to make it different to objects in HUD Layer, so I want to know what is the largest number of objects that I can create, so I can divide it by 2, or any other suggestion?
I can upload soon.

Thank you smile

Last edited by jurgel (2012-01-22 11:13:16)

Re: Error Load Sound on newer version of Maratis

just to be sure,
the only libsnd libs and headers you have are the one from Maratis svn ?
- there is no libsnd headers / libs in your system ?

Re: Error Load Sound on newer version of Maratis

yes I am,
I've remove libsndfile-devel from my system.

Re: Error Load Sound on newer version of Maratis

About your HUD, I'm not sure to understand what you are doing, but for the limit it is the maximum that can handle an unsigned int (I don't have the number in head).

Re: Error Load Sound on newer version of Maratis

Ahh, my mistake, I didn't realize that it's unsigned int, so it can't be negative. Many thanks.

It's just like tutorial "How to create game interface" that you make, but I embed it in MGame, I've edit MLevel and MScript, and so MaratisEditor.
So if I create new project, the default created scene is Scene-1 and HUD Layer, if open from older project, just add new scene named "HUD Layer", so that layer objects are shareable and controlable from currentScene (ex. Scene-1), so you don't need to create c++ file to make game interface, and the good thing is you can share/control any objects in HUD Layer from currentScene script.

Re: Error Load Sound on newer version of Maratis

ok, interesting.
It make me remeber that for the next release we need to update the scrip function "getObject" to be able to also get objects from other scenes (now it's true it's only getting current scene objects).

About your compilation, this afternoon I will check that everything compile on linux, if it's working I'll give you a link for you to try.

Re: Error Load Sound on newer version of Maratis

Oh, so there is already a plan to able to get objects from other scenes, currently I just able to get objects from HUD Layer.
I'll look for next release smile

Thank you for a time to check compilation on linux.

btw, if you want to look at my code, here it's, it's just MSDK and Maratis folder,
and I'm edit from Nistur build.

Re: Error Load Sound on newer version of Maratis

I build the last svn version :
http://www.maratis3d.org/download/M_Lin … -rev93.zip

I'm curious to see if it works for you (I just ran python scons.py)

Re: Error Load Sound on newer version of Maratis

wow, strange, it's works.
all sound works flawlessly.
thank you very much.

The error must be from my machine library when compiling.
I don't know what make it error.

Problem solved.
Thank you again smile