Jump to content
Eternal Lands Official Forums
Torg

Major NEW_SOUND update - EL gets a (complete?) sound system

Recommended Posts

Ok, hopefully have fixed the sound 0 problem.

 

Also, added 2 new sounds "Drag Item" and "Drop Item" for drag and drop sounds in the inventory and storage windows. There is some additional code for using items, but it doesn't work yet. :-P

Share this post


Link to post
Share on other sites

Fountains still don't fade in/out.

 

Teleporters fade in and out. The attributes for fountains and teleporters are the same in the config, but teleporters are wav sounds, fountains ogg ...

Edited by Florian

Share this post


Link to post
Share on other sites
Fountains still don't fade in/out.

 

Teleporters fade in and out. The attributes for fountains and teleporters are the same in the config, but teleporters are wav sounds, fountains ogg ...

That shouldn't have any effect. Once the Ogg is loaded into an OpenAL buffer, then its in WAV format and OpenAL code.

 

For fading the gain of the OpenAL source is changed with OpenAL commands, so it should be identical for both. It works fine for me. I'll have another look, but I can't see any reason why it shouldn't work for you. Last time I had problems was because the distance was wrong, but if the config setup is the same, then I don't know what the problem is. :-S

Share this post


Link to post
Share on other sites

I posted this to the CVS error thread while responding to something on there but realised it would better sit here. I know its not a consequence of the NEW_SOUND code but may be if its a general problem people are having, it could be fixed at the same time :P

 

One issue I'm still having with sound though. Even though my CPU is not running at anything like 100% (I have FPS capped quite low). The sounds and music regularly start to sound as if they are playing back slower than intended (a downwards pitch shift and more metallic kind of sound). This also happens with the old sound code but never use to happen before the 1.4 release. I've not changed my hardware at all so its curious.

Share this post


Link to post
Share on other sites
One issue I'm still having with sound though. Even though my CPU is not running at anything like 100% (I have FPS capped quite low). The sounds and music regularly start to sound as if they are playing back slower than intended (a downwards pitch shift and more metallic kind of sound). This also happens with the old sound code but never use to happen before the 1.4 release. I've not changed my hardware at all so its curious.

That's really odd. I've never seen or heard of that behaviour before. I'm thinking it might be something on your machine. Did you upgrade your OpenAL libs between 1.3 and 1.4? I don't believe that was much change to sound at all before 1.4 (since initially committing NEW_SOUND way back when), so libs are likely to be the only things that's changed.

 

If your libs have changed, I still don't get why you'd have that behaviour. And less idea what to do about it. :-S

Share this post


Link to post
Share on other sites

If your libs have changed, I still don't get why you'd have that behaviour. And less idea what to do about it. :-S

My libs possibly changed. I'm running Debian stable and using libopenal-dev 0.0.8-4 and libopenal0a 0.0.8-4 according to dpkg. Before the last Debian stable update, I was using testing and did have to move these libraries back and forth to get sound working at all. I'll have a look around and see what I can do/find out.

Share this post


Link to post
Share on other sites
I'm running Debian stable and using libopenal-dev 0.0.8-4 and libopenal0a 0.0.8-4 according to dpkg.

Hmmm, same, but I've never had any problems with them working.

Share this post


Link to post
Share on other sites

Hi all,

I would like to test the new sound engine because i contributed a lot the these sounds in the "new_sounds" package but i need some help compiling on my x86_64 machine. Could you tell me what modification i have to do on the makefile on this architecture? Up to know i get messages like this:

"CPU you selected does not support x86-6"

 

thanks

Erdie

Share this post


Link to post
Share on other sites

Hi all,

I would like to test the new sound engine because i contributed a lot the these sounds in the "new_sounds" package but i need some help compiling on my x86_64 machine. Could you tell me what modification i have to do on the makefile on this architecture? Up to know i get messages like this:

"CPU you selected does not support x86-6"

 

thanks

Erdie

Enable the FEATURE 'X86_64' and set PLATFORM to -march=athlon64 in make.defaults/make.conf.

Share this post


Link to post
Share on other sites

small change:

Index: particles.c
===================================================================
RCS file: /cvsroot/elc/elc/particles.c,v
retrieving revision 1.134
diff -u -d -p -r1.134 particles.c
--- particles.c 26 Aug 2007 16:04:48 -0000	  1.134
+++ particles.c 27 Aug 2007 21:50:30 -0000
@@ -684,7 +684,9 @@ int add_particle_sys (const char *file_n

	if (sound_on)
	{
+  #ifdef _EXTRA_SOUND_DEBUG
			printf("Looking for particle sound for: %s\n", file_name);
+  #endif
			snd = get_sound_index_for_particle_file_name(file_name);
			if (snd >= 0)
			{

 

 

/EDIT

 

crash

 

[23:39:49] Got invalid sound number: -1

 

(gdb) bt full

#0 0x900248c7 in semaphore_wait_signal_trap ()

No symbol table info available.

#1 0x90001582 in pthread_mutex_lock ()

No symbol table info available.

#2 0x3003ca78 in SDL_mutexP ()

No symbol table info available.

#3 0x000d31a8 in add_sound_object (type=44, x=137, y=119, me=0) at sound.c:2668

i = <value optimized out>

loops = <value optimized out>

error = <value optimized out>

source = <value optimized out>

pSource = <value optimized out>

pNewType = (sound_type *) 0x3a81500

stage = <value optimized out>

sourcePos = {137, 119, 0}

sourceVel = {0, 0, 0}

buffer = 0

#4 0x0002f49f in put_bag_on_ground (bag_x=137, bag_y=119, bag_id=17) at bags.c:81

x = 68.75

y = 59.75

z = 0

obj_3d_id = <value optimized out>

snd = <value optimized out>

#5 0x000a7831 in process_message_from_server (in_data=0x1c933d30 "\e\006", data_length=8) at multiplayer.c:1049

buf = '\000' <repeats 14 times>, "HB", '\000' <repeats 12 times>, "®\034(Á\000\000(Á\000\000\000\000\026 ºB\000\000¾B", '\000' <repeats 14 times>, "\200?", '\000' <repeats 14 times>, "\200?", '\000' <repeats 196 times>, "YKæ\021", '\000' <repeats 34 times>, "\200?\000\000\000\000\000\000\000\000Þ\037)\223Ð\204\021\005Ðæÿ¿Hèÿ¿y )\223\200çÿ¿Ðæÿ¿¬\000\000\000@5:\023àÁ}¢\001\000\000\000,èÿ¿\000\000\000\000\000\000\000\000\000\000\200?", '\000' <repeats 18 times>, "\200?", '\000' <repeats 18 times>, "\200?\000\000\000\000\000\000\000\000BÙл\000\000\000\000"...

text_buf = "\006á\234\e\023\000\000\000\000\000\000\000\a\000\000\000øÄÿ¿ðà\234\eðà\234\eÀ\226\020\005\000\000\000\000Æ9 \e\004=\201 \000\000\000\000\025\000\000\000 à\200\220\000\000\000\000\000\000\000\000\025\000\000\000\000\000\000\000\000\000\200\005`Ïÿ¿\224Åÿ¿\b\000\000\000ðç\022\005\a\000\000\000(Óÿ¿\000\000\000\000ðç\022\005ðç\b\000T\000\000\000\006\000\000\000<¿\213\220\000\000\000\000\000\000\000\000\224Åÿ¿`Ïÿ¿\000\000\000\000\bÆÿ¿z+\000\220\200\000\000\000ð¬Ô\030xÅÿ¿\b\000\000\000\000\000\200\005\200\000\000\000\002Æÿ¿\000\000\000\000\002\000\000\000\002\000\b\000xÅÿ¿; \002\220"...

#6 0x0009b796 in start_rendering () at main.c:155

event = {

type = 4 '\004',

active = {

type = 4 '\004',

gain = 0 '\000',

state = 0 '\000'

},

key = {

type = 4 '\004',

which = 0 '\000',

state = 0 '\000',

keysym = {

scancode = 9 '\t',

sym = SDLK_WORLD_50,

mod = KMOD_NONE,

unicode = 0

}

},

motion = {

type = 4 '\004',

which = 0 '\000',

state = 0 '\000',

x = 777,

y = 784,

xrel = 210,

yrel = 0

},

button = {

type = 4 '\004',

which = 0 '\000',

button = 0 '\000',

state = 0 '\000',

x = 777,

y = 784

},

jaxis = {

type = 4 '\004',

which = 0 '\000',

axis = 0 '\000',

value = 777

},

jball = {

type = 4 '\004',

which = 0 '\000',

ball = 0 '\000',

xrel = 777,

yrel = 784

},

jhat = {

type = 4 '\004',

which = 0 '\000',

hat = 0 '\000',

value = 0 '\000'

},

jbutton = {

type = 4 '\004',

which = 0 '\000',

button = 0 '\000',

state = 0 '\000'

},

resize = {

type = 4 '\004',

w = 51381001,

h = 210

},

expose = {

type = 4 '\004'

},

quit = {

type = 4 '\004'

},

user = {

type = 4 '\004',

code = 51381001,

data1 = 0xd2,

data2 = 0x0

},

syswm = {

type = 4 '\004',

msg = 0x3100309

}

}

network_thread = (SDL_Thread *) 0x169bde00

message_queue = (queue_t *) 0x133a3550

done = 0

network_thread_data = {0x133a3550, 0x5e11bc}

#7 0x0009b834 in SDL_main (argc=1, argv=0x5106f20) at main.c:290

 

I guess I'll have to remove compiler optimizations again ...

 

/EDIT2

 

next crash

 

(gdb) bt full

#0 0x900248c7 in semaphore_wait_signal_trap ()

No symbol table info available.

#1 0x90001582 in pthread_mutex_lock ()

No symbol table info available.

#2 0x3003ca78 in SDL_mutexP ()

No symbol table info available.

#3 0x000c5a16 in add_sound_object (type=44, x=81, y=131, me=0) at sound.c:2668

i = 0

loops = 0

error = 0

tx = 0

ty = 0

distanceSq = 0

source = -1

pSource = (source_data *) 0x0

pType = (sound_type *) 0x0

pNewType = (sound_type *) 0x3ae4190

maxDistanceSq = 0

stage = 1879076457

sourcePos = {81, 131, 0}

sourceVel = {0, 0, 0}

buffer = 0

#4 0x0002a859 in put_bag_on_ground (bag_x=81, bag_y=131, bag_id=7) at bags.c:81

x = 40.75

y = 65.75

z = 0

obj_3d_id = 436

snd = 44

#5 0x0009824a in process_message_from_server (in_data=0x18eda360 "\e\006", data_length=8) at multiplayer.c:1049

text_buf = "\205umbrena: \201*tickles Cyp*\000 crak*\000ooks is annoying\000won't letme\000U\201\220ÈÆÿ¿z+\000\220\200\000\000\000\220î\032\030ÈÅÿ¿§-\000\220\000\000\200\005\200\000\000\000\032Æÿ¿\bÆÿ¿\000Æÿ¿\002Æÿ¿ÈÅÿ¿; \002\220\000\000\200\005x\000\000\000àªí\0303U\201\220\200\000\000\0003U\201\220\030Çÿ¿\032Y\201\220x\000\000\000\200\000\000\000\000\000\200\005\004\000\000\000\000\000\000\000\003\000%\000\000\000\000\000\200\000\000\000\200\000\000\000àªí\030\000\000\000\001\001\000\000\000"...

#6 0x0008e13b in start_rendering () at main.c:155

message = (message_t *) 0x18eb2640

event = {

type = 24 '\030',

active = {

type = 24 '\030',

gain = 254 'þ',

state = 46 '.'

},

key = {

type = 24 '\030',

which = 254 'þ',

state = 46 '.',

keysym = {

scancode = 3 '\003',

sym = 323266448,

mod = 805729281,

unicode = 20256

}

},

motion = {

type = 24 '\030',

which = 254 'þ',

state = 46 '.',

x = 3,

y = 0,

xrel = -22640,

yrel = 4932

},

button = {

type = 24 '\030',

which = 254 'þ',

button = 46 '.',

state = 176 '°',

x = 3,

y = 0

},

jaxis = {

type = 24 '\030',

which = 254 'þ',

axis = 46 '.',

value = 3

},

jball = {

type = 24 '\030',

which = 254 'þ',

ball = 46 '.',

xrel = 3,

yrel = 0

},

jhat = {

type = 24 '\030',

which = 254 'þ',

hat = 46 '.',

value = 176 '°'

},

jbutton = {

type = 24 '\030',

which = 254 'þ',

button = 46 '.',

state = 176 '°'

},

resize = {

type = 24 '\030',

w = 3,

h = 323266448

},

expose = {

type = 24 '\030'

},

quit = {

type = 24 '\030'

},

user = {

type = 24 '\030',

code = 3,

data1 = 0x1344a790,

data2 = 0x30067401

},

syswm = {

type = 24 '\030',

msg = 0x3

}

}

network_thread = (SDL_Thread *) 0x169ba200

message_queue = (queue_t *) 0x134a3400

done = 0

network_thread_data = {0x134a3400, 0x643dfc}

#7 0x0008e637 in SDL_main (argc=1, argv=0x5206f20) at main.c:290

Edited by Florian

Share this post


Link to post
Share on other sites

Ok, next installment... 'Use item' and 'Use with' inventory sounds should work. I don't know of any 'Use with' items so I haven't tested it.

 

'Use with' sounds are configured with the sound name of "<image id> on <image id>"... so <sound name="2 on 4"> for example.

 

'Use item' sounds are more complex and have their own XML config block. Here is the XML I am suggesting for the client release. Feel free to paste it into your own config, but remember to also create a new sound for "eat", "read" and "drink":

<!-- Define some "Use item" sounds. These sounds are linked to the item's image ID. Image_ids tag can
	contain a comma delimited list of image id's.

	<item>
		<image_ids>0,1,2</image_ids>
		<sound>Eat</sound>
	</item>
-->
<item>
	<image_ids>0,1,2,63,74,319</image_ids>
	<sound>Eat</sound>
</item>
<item>
	<image_ids>4,8,20,21,22,23,24,146,147,148</image_ids>
	<sound>Read</sound>
</item>
<item>
	<image_ids> 10,11,12,13,14,15,16,17,18,19,150,151,152,155,156,157,242,243,244,245,367,368,369,371</image_ids>
	<sound>Drink</sound>
</item>

Afaik, this is all the image ID's for all the items that can be eaten, read or drunk (potions). If I've missed anything, please let me know.

 

You may need to remove the space from the last <image_ids> when pasting the code into your config.

 

EDIT (crusadingknight): No idea why the forum software was eating the closing '>', but I edited your post to fix it by throwing in a space. For anyone else reading this, you can just copy and paste it without a problem now.

 

EDIT (Torg): Yeah, I thought of doing that, but I thought it would confuse people... probably not any less and thinking about the code it would likely work with the space anyway... oops. :-P

Edited by Torg

Share this post


Link to post
Share on other sites

Ok, yet another installment...

 

This time I have (hopefully) fixed the problem with your actor's sounds coming from weird directions occasionally. Please test it for me!

 

 

(this is most evident with the footsteps sound)

Share this post


Link to post
Share on other sites
BTW: Is there a way to tell openal not to block my sound device?

At this stage, I have no idea, sorry.

 

Maybe I found a possibility to fix this. I investigated the sources of openal. In the file:

alc_backend_alsa.c

there is this line:

/* alsa stuff */

#define DEFAULT_DEVICE "plughw:0,0"

 

If you replace "0,0" with "dmix" or "default" (most distributions are using dmix as default) it should work. I am on work now - I will test it today evening.

Ok... after spending most of the night trying to sort this out, I've finally got dmix working on my machine... and low and behold, it works for EL too (with a little config).

 

You should have an openal config file (/etc/openalrc or ~/.openalrc under Debian). If you set the correct alsa device in there it should work. I had massive problems with Dmix working on my system, probably due to upgrading from Sarge, so I needed to manually create some of the Dmix config. Part of that involved defining "ossmix" which I now use as my Alsa device and it works fine.

Share this post


Link to post
Share on other sites

You should have an openal config file (/etc/openalrc or ~/.openalrc under Debian). If you set the correct alsa device in there it should work. I had massive problems with Dmix working on my system, probably due to upgrading from Sarge, so I needed to manually create some of the Dmix config. Part of that involved defining "ossmix" which I now use as my Alsa device and it works fine.

I don´t have any file in this kind and will try to create a new one. Could you tell me the syntax to put in the device there?

 

BTW: Annother problem - with a female character, i cannot see any cloaks. When i logon with my son´s male character, i can see his cloak.

Edited by Erdie

Share this post


Link to post
Share on other sites

[snip]

BTW: Annother problem - with a female character, i cannot see any cloaks. When i logon with my son´s male character, i can see his cloak.

That's a configuration issue. Check you haven't b0rked your actor definition files and ensure data_dir in ~/.elc/el.ini is set correctly.

Share this post


Link to post
Share on other sites
BTW: Annother problem - with a female character, i cannot see any cloaks. When i logon with my son´s male character, i can see his cloak.

If you double check the first post, the NEW_SOUND config I supplied uses Roja's new actor defs, which requires a new bundle of stuff and extra compile options. Go back and have another read. :-)

 

I don´t have any file in this kind and will try to create a new one. Could you tell me the syntax to put in the device there?

Google is your friend. It really depends on your system. The config file is possibly under /usr/lib/openal or something on other systems.

My config is this, but the device out is specific to my system as I needed to create a dummy device. It probably won't work on your system.

(define devices '(alsa))
(define alsa-out-device "ossmix")

 

Observation:

background sounds keep playing when you get disconnected.

Ahhh. Yeah, ok, thanks.

Share this post


Link to post
Share on other sites

Ok, yet another update.

 

Florian's bug with sounds continuing when disconnected should be fixed.

 

Also there is now basic implementation of different sounds for different walking tiles. However, there are many problems with the system (as mentioned in the Map Tiles thread) and so something more accurate would be needed for this to be suitable for release. If anyone wants to try this, please check the details in that thread. It would be great to have this in the November release, but I won't have time with the workload for this.

 

Anyways... the new config bits to test it are:

	<tile_type>
	<tiles>1,2,19,34,50</tiles>
	<sound>Sheep</sound>
</tile_type>

Feel free to choose a different sound to test this with. That just generally is my fall-back test sound.

Share this post


Link to post
Share on other sites

I still get client freezes like this:

 

#0  0x900248c7 in semaphore_wait_signal_trap ()
No symbol table info available.
#1  0x90001582 in pthread_mutex_lock ()
No symbol table info available.
#2  0x3005014a in SDL_mutexP (mutex=0x13b02470) at /usr/src/SDL-1.2.12/Xcode/SDL/../../src/thread/pthread/SDL_sysmutex.c:108
	retval = 0
#3  0x000c669e in add_sound_object (type=42, x=118, y=43, me=0) at sound.c:2702
	i = 90879632
	loops = 817999
	error = -1073757432
	tx = 388886016
	ty = 7183920
	distanceSq = 805634430
	source = -1
	pSource = (source_data *) 0x172dee00
	pType = (sound_type *) 0x8c
	pNewType = (sound_type *) 0x3af54c0
	maxDistanceSq = 0
	stage = -1073757512
	sourcePos = {118, 43, 0}
	sourceVel = {0, 0, 0}
	buffer = 0
#4  0x000fc682 in parse_special_effect (sfx=SPECIAL_EFFECT_RESTORATION, data=0x1afcbe04) at special_effects.c:680
	offset = 0
	need_target = 0
	sfx_sound = 42
	var_a = 590
	var_b = 0
	caster = (actor *) 0x1736ce00
	target = (actor *) 0x0
	x = 0
	y = 0

 

(SDL and EL with full debug information)

 

/EDIT

sound types:

#3 0x000c669e in add_sound_object (type=42, x=118, y=43, me=0) at sound.c:2702

#3 0x000c669e in add_sound_object (type=44, x=144, y=114, me=0) at sound.c:2702

Edited by Florian

Share this post


Link to post
Share on other sites

I've been working on the "loading sounds into buffers, not sources" code, and I have made a little discovery which might help in the mutex crashing the client bugs.

 

It seems there are a couple of "return 0"'s, where the function crashes out because of an error, but it *doesn't* unlock the sounds mutex! That to me suggests the possibility of big issues, but not knowing enough about the whole mutex thing, I don't really know.

 

Basically my thoughts currently are, fix the problems with our limited number of sources being loaded and then paused (eh??), by only loading them when needed... as possible implement the source sharing code, which I think will be trivial... and then see what bugs have been fixed/created. I'm hoping some of the mutex issues will go away at this point. However, if they haven't then I'll start to debug them.

 

So... if you are having mutex issues (yes, I'm looking at you Florian), can you please try adding "UNLOCK_SOUND_LIST();" before any returns in add_sound_object and update_sounds, that occur within the LOCK_SOUND_LIST();....UNLOCK_SOUND_LIST(); code blocks.

Share this post


Link to post
Share on other sites

I think you're on the right track:

 

#define LOCK_SOUND_LIST() { printf("LOCK_SOUNDLIST\n"); SDL_LockMutex(sound_list_mutex); }

#define UNLOCK_SOUND_LIST() { printf("UNLOCK_SOUND_LIST\n"); SDL_UnlockMutex(sound_list_mutex); }

 

LOCK_SOUNDLIST

UNLOCK_SOUND_LIST

LOCK_SOUNDLIST

UNLOCK_SOUND_LIST

LOCK_SOUNDLIST

LOCK_SOUNDLIST

--> freeze

 

Index: sound.c
===================================================================
RCS file: /cvsroot/elc/elc/sound.c,v
retrieving revision 1.142
diff -u -d -p -r1.142 sound.c
--- sound.c	 31 Aug 2007 11:43:58 -0000	  1.142
+++ sound.c	 1 Sep 2007 22:46:02 -0000
@@ -1298,8 +1298,11 @@ void kill_local_sounds()
	UNLOCK_SOUND_LIST();
#ifdef OGG_VORBIS
#ifndef OSX
-	   if(!have_music)
+	   if(!have_music) 
+ {
+  UNLOCK_SOUND_LIST();
			return;
+ }
	playing_music = 0;
	alSourceStop(music_source);
	alGetSourcei(music_source, AL_BUFFERS_PROCESSED, &processed);
@@ -2741,7 +2744,7 @@ unsigned int add_sound_object(int type, 
#ifdef _EXTRA_SOUND_DEBUG
			printf("Sound overflow: %s, %d\n", pNewType->name, i);
#endif //_EXTRA_SOUND_DEBUG
-
+  UNLOCK_SOUND_LIST();
			return 0;
	}
	//this is the lowest-priority sound but there is a spare slot at the end of the list

 

Different mutex-related freeze ...

 

(gdb) bt full

#0 0x900248c7 in semaphore_wait_signal_trap ()

No symbol table info available.

#1 0x90001582 in pthread_mutex_lock ()

No symbol table info available.

#2 0x04966939 in CAMutex::Lock (this=0x13b05804) at /Developer/Examples/CoreAudio/PublicUtility/CAMutex.cpp:156

theError = 77055779

theAnswer = false

theCurrentThread = (pthread_t) 0xa000d000

#3 0x0496b86f in OALSource::Stop (this=0x13b057e0) at /usr/src/openal/OpenAL-MacOSX/oalSource.cpp:1506

wasLocked = false

#4 0x0495858c in alSourceStop (sid=2401) at /usr/src/openal/OpenAL-MacOSX/oalImp.cpp:2627

oalSource = (OALSource *) 0x13b057e0

result = 1

#5 0x000c6e96 in stop_sound_source_at_index (index=0) at sound.c:2953

error = 0

pSource = (source_data *) 0x3af3d00

sourceTemp = {

source = 2684413248,

play_duration = -1073757208,

sound_type = 0,

current_stage = 41,

cookie = 387927040

}

#6 0x000c7011 in stop_sound (cookie=41) at sound.c:2994

n = 0

#7 0x0000ccca in destroy_all_actors () at actor_scripts.c:990

i = 0

#8 0x0000cdd6 in update_all_actors () at actor_scripts.c:1018

str = "\006¼å@\001\0008\000\005\000\000\000\000\006\000\000\000\000\000\000\000s\t\000\000°¢\003206\000\000\000\000"

#9 0x0000d327 in add_command_to_actor (actor_id=2419, command=51 '3') at actor_scripts.c:1177

k = 19

act = (actor *) 0x172d5a00

 

*sigh*

 

/EDIT

 

and the old freeze is still there

 

LOCK_SOUNDLIST

LOCK_SOUNDLIST

^C

Program received signal SIGINT, Interrupt.

0x900248c7 in semaphore_wait_signal_trap ()

(gdb) bt full

#0 0x900248c7 in semaphore_wait_signal_trap ()

No symbol table info available.

#1 0x90001582 in pthread_mutex_lock ()

No symbol table info available.

#2 0x3005014a in SDL_mutexP (mutex=0x13c02470) at /usr/src/SDL-1.2.12/Xcode/SDL/../../src/thread/pthread/SDL_sysmutex.c:108

retval = 0

#3 0x000c65a4 in add_sound_object (type=44, x=106, y=136, me=0) at sound.c:2707

i = 0

loops = 0

error = 0

tx = 0

ty = 0

distanceSq = 0

source = -1

pSource = (source_data *) 0x0

pType = (sound_type *) 0x0

pNewType = (sound_type *) 0x3af5580

maxDistanceSq = 0

stage = 1879076457

sourcePos = {106, 136, 0}

sourceVel = {0, 0, 0}

buffer = 0

#4 0x0002ae3d in put_bag_on_ground (bag_x=106, bag_y=136, bag_id=1) at bags.c:81

x = 53.25

y = 68.25

z = 0

obj_3d_id = 205

snd = 44

 

/EDIT2

 

maybe

 

#define LOCK_SOUND_LIST() { log_error_detailed("LOCK_SOUNDLIST\n", __FILE__, __FUNCTION__, __LINE__); SDL_LockMutex(sound_list_mutex); }

#define UNLOCK_SOUND_LIST() { log_error_detailed("UNLOCK_SOUND_LIST\n", __FILE__, __FUNCTION__, __LINE__); SDL_UnlockMutex(sound_list_mutex); }

 

will help ...

 

/EDIT3

 

yes, it might actually help:

 

[01:01:17] sound.c.update_sound:3095 - LOCK_SOUNDLIST

[01:01:17] sound.c.update_sound:3252 - UNLOCK_SOUND_LIST

[01:01:17] sound.c.update_sound:3095 - LOCK_SOUNDLIST

[01:01:17] sound.c.update_sound:3252 - UNLOCK_SOUND_LIST

[01:01:17] sound.c.add_sound_object:2707 - LOCK_SOUNDLIST

[01:01:17] sound.c.add_sound_object:2897 - UNLOCK_SOUND_LIST

[01:01:17] sound.c.update_sound:3095 - LOCK_SOUNDLIST

[01:01:56] sound.c.stop_all_sounds:3036 - LOCK_SOUNDLIST

Edited by Florian

Share this post


Link to post
Share on other sites

I think you're on the right track:

<snip>

[01:01:17] sound.c.update_sound:3095 - LOCK_SOUNDLIST

[01:01:56] sound.c.stop_all_sounds:3036 - LOCK_SOUNDLIST

Yep, that's what I was thinking.

 

If you want to fix it yourself, have a look at update_sound() and see where the returns are that are missing UNLOCK's. Otherwise, it should be fixed when I get this next update done.

Share this post


Link to post
Share on other sites

If you want to fix it yourself, have a look at update_sound() and see where the returns are that are missing UNLOCK's. Otherwise, it should be fixed when I get this next update done.

There are no returns with missing UNLOCK's ...

Share this post


Link to post
Share on other sites

If you want to fix it yourself, have a look at update_sound() and see where the returns are that are missing UNLOCK's. Otherwise, it should be fixed when I get this next update done.

There are no returns with missing UNLOCK's ...

Eh? I found at least 2 errors that had returns and no UNLOCK in-front... iirc.

 

I guess its off to grab a fresh copy of the source. :-P

 

/edit: Ok, 3 new UNLOCK's in there. Interestingly, I doubt any of them are the point where the code is crashing out of update_sound. o.O

 

/edit2: Damn. I was looking at, and thinking about add_sound_object(), not update_sound(). I'll take a look at update_sound then.

Edited by Torg

Share this post


Link to post
Share on other sites
[01:01:17] sound.c.update_sound:3095 - LOCK_SOUNDLIST

[01:01:17] sound.c.update_sound:3252 - UNLOCK_SOUND_LIST

[01:01:17] sound.c.update_sound:3095 - LOCK_SOUNDLIST

[01:01:17] sound.c.update_sound:3252 - UNLOCK_SOUND_LIST

[01:01:17] sound.c.add_sound_object:2707 - LOCK_SOUNDLIST

[01:01:17] sound.c.add_sound_object:2897 - UNLOCK_SOUND_LIST

[01:01:17] sound.c.update_sound:3095 - LOCK_SOUNDLIST

[01:01:56] sound.c.stop_all_sounds:3036 - LOCK_SOUNDLIST

Ok, this is something interesting...

 

There are a bunch of update_sound()'s all at 01:01:17 (and from the timers, it should be updated several times a second).... but it isn't updated again until 01:01:56.

 

That suggests that maybe there is some kind of race condition in the code that means update_sound actually isn't finishing. That wouldn't suprise me given some of the other small, but potentially catastrophic bugs. Some of the functions work directly on arrays that are being looped over. That always opens the possibility for them to get out of sync and hence need to be checked very carefully.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×