Jump to content
Eternal Lands Official Forums
Torg

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

Recommended Posts

BTW i don't hear sounds from fountains. Is that how it shoudl be

Nope, that's not how it should be. There is an issue with particle system sounds. I think they work if you spawn next to one (in range of it). Thanks for reminding me, I forgot about that one.

Share this post


Link to post
Share on other sites

Emmm, no i don't hear the fountain if i spawn near it. And also i don't hear the "log on/change map" sound as well if i spawn near a fountain. (And it's so nice to hear that sound again. Reminds me for when i first started playing EL :P).

Share this post


Link to post
Share on other sites
Emmm, no i don't hear the fountain if i spawn near it. And also i don't hear the "log on/change map" sound as well if i spawn near a fountain. (And it's so nice to hear that sound again. Reminds me for when i first started playing EL :P).

If you turn on the extra debugging for sound you'll find the reason you don't hear the teleport in sound when you login, because there is a bug with you being too far away from the location the sound is inserted, and hence it is ignored. I forgot to add that one to the list also. Damn. :-P

Share this post


Link to post
Share on other sites

Emmm, no i don't hear the fountain if i spawn near it. And also i don't hear the "log on/change map" sound as well if i spawn near a fountain. (And it's so nice to hear that sound again. Reminds me for when i first started playing EL :P).

Ok, they should all now be fixed. Enjoy. :-)

Share this post


Link to post
Share on other sites

Yay!!

 

I fixed the bug with the client crashing when it turned off sound (either by the option or closing the client).

 

Interestingly, there was a second code block to close device inside a check if it existed. I can only assume that the existance of the streams caused that to be an issue under NEW_SOUND as they are in a seperate thread and may linger around a little longer.

Share this post


Link to post
Share on other sites

A small patch:

Index: sound.c
===================================================================
RCS file: /cvsroot/elc/elc/sound.c,v
retrieving revision 1.128
diff -u -d -p -r1.128 sound.c
--- sound.c	 12 Aug 2007 06:36:18 -0000	  1.128
+++ sound.c	 12 Aug 2007 07:41:21 -0000
@@ -38,6 +38,10 @@
#define		LOCK_SOUND_LIST() SDL_LockMutex(sound_list_mutex);
#define		UNLOCK_SOUND_LIST() SDL_UnlockMutex(sound_list_mutex);

+#ifdef _EXTRA_SOUND_DEBUG
+ #define printf LOG_ERROR
+#endif
+
typedef struct {
	char file_name[64];
	int min_x;

The reason for this is that with OSX normal printf's go just somewhere, but not in a log file.

Share this post


Link to post
Share on other sites
The reason for this is that with OSX normal printf's go just somewhere, but not in a log file.

Oh ok. Can you not run it from the console under OSX? (I really don't know much about OSX's underlying BSD interface).

 

/edit:

I added an #ifdef OSX so it doesn't break Windows/Linux systems.

 

Just wondering, should this be global (ie. under platform.h) for any other debugging code?

Edited by Torg

Share this post


Link to post
Share on other sites

Console output under OSX is collected in a central console.log with it's own viewer application. But that's not very comfortable for debugging, hence use LOG_ERROR.

Share this post


Link to post
Share on other sites

[1452995.478002] el.x86_64.linux[1167] general protection rip:2b193149aac4 rsp:4087a050 error:0

OUCH. This was from a CVS snapshot before your 'More bug fixes' post, and occured when changing map from SRI storage to SRI.

Share this post


Link to post
Share on other sites
OUCH. This was from a CVS snapshot before your 'More bug fixes' post, and occured when changing map from SRI storage to SRI.

Hmmm. Probably something to do with stopping all the sounds on the map change (if it was in the sound code). Unfortunatly there is not enough info for me to work with. :-S

Share this post


Link to post
Share on other sites

Ok... should have fixed the Ogg files stuffing up sometimes.

 

I have discovered some new issues however when testing fireplaces (specifically the one in Portland storage). When I enter the room my system gets hit with 120 particle systems!!!!

 

Needless to say my client falls over big time. The client does limit itself to only 14 sounds, so I'm not completely sure why it crashes yet... but still. Do we really need that many calls to add_particle_sys??

 

/edit: Ahhhh. I think I've just worked it out. That would be adding all the particle systems for that map (an insides map)... and I'm guessing there are several houses with fires going, hence a massive bombardment of particle effects. Grum's code to isolate insides is looking much nicer already!!

Edited by Torg

Share this post


Link to post
Share on other sites

Client froze completely:

#0  0x900248c7 in semaphore_wait_signal_trap ()
#1  0x90001582 in pthread_mutex_lock ()
#2  0x3002ee39 in SDL_mutexP ()
#3  0x000d450c in add_sound_object (type=18, x=107, y=133) at sound.c:2409
#4  0x000b9e5b in add_particle_sys (file_name=0x1a6b00 "./particles/teleport_out.part", x_pos=53.5, y_pos=66.5, z_pos=0, dynamic=1) at particles.c:756
#5  0x000ba805 in add_particle_sys_at_tile (file_name=0x1a6b00 "./particles/teleport_out.part", x_tile=107, y_tile=133, dynamic=1) at particles.c:803
#6  0x000a8545 in process_message_from_server (in_data=0x195ad5f0 "\r\005", data_length=7) at multiplayer.c:844
#7  0x0009c2e7 in start_rendering () at main.c:154
#8  0x0009c385 in SDL_main (argc=1, argv=0x6106f20) at main.c:287

 

oh and BTW, remote heal should definitely keep that sound :P

 

/EDIT:

got another one:

#0  0x900248c7 in semaphore_wait_signal_trap ()
#1  0x90001582 in pthread_mutex_lock ()
#2  0x9add00d6 in CAMutex::Lock ()
#3  0x9add24be in OALSource::Stop ()
#4  0x9adc61d5 in alSourceStop ()
#5  0x000cf975 in stop_sound_source_at_index (index=0) at sound.c:2836
#6  0x0000ad47 in destroy_actor (actor_id=95) at actor_scripts.c:949
#7  0x000a6570 in process_message_from_server (in_data=0x195a7a90 "\006\003", data_length=5) at multiplayer.c:544
#8  0x0009c2e7 in start_rendering () at main.c:154
#9  0x0009c385 in SDL_main (argc=1, argv=0x6106f20) at main.c:287

 

both client freezes happened while I was sitting at beam, somebody cast remote heal and somebody else caused fighting sounds

 

/EDIT2:

error_log before client freeze

[22:24:59] Inserting new source at index 0/2
[22:24:59] Cookie 928. Playing this sound unless out of range.
[22:24:59] Trying to add sound: 22 (Walk) at 90, 141. Camera: 93, 141
[22:24:59] Inserting new source at index 1/3
[22:24:59] Cookie 929. Playing this sound unless out of range.
[22:25:00] Trying to add sound: 23 (Male pain) at 107, 153. Camera: 93, 141
[22:25:00] Inserting new source at index 0/3
[22:25:00] Cookie 930. Playing this sound unless out of range.
[22:25:00] Stopping cookie 919 with sound source index 3
[22:25:00] Stopping cookie 930 with sound source index 0
[22:25:00] Trying to add sound: 28 (Bone attack) at 107, 153. Camera: 93, 141
[22:25:00] Inserting new source at index 0/2
[22:25:00] Cookie 931. Playing this sound unless out of range.
[22:25:04] Stopping cookie 931 with sound source index 0

Edited by Florian

Share this post


Link to post
Share on other sites
Client froze completely:

<snip>

 

/EDIT:

got another one:

<snip>

both client freezes happened while I was sitting at beam, somebody cast remote heal and somebody else caused fighting sounds

 

/EDIT2:

<snip>

Yeah, it seems there are issues with locking the sounds (when you are adding them, so the update function doesn't see them as invalid etc)... which is probably why it was disabled. The problem with it being disabled is of course that sounds are in different states when different functions check them, and hense things die worse.

 

Ahhh, the joys of threading (or non-sequencial code execution). :-P

 

oh and BTW, remote heal should definitely keep that sound :D

LOL!!! I was waiting for someone to notice that. :-P

Share this post


Link to post
Share on other sites

next one

#0  0x90009cd7 in mach_msg_trap ()
#1  0x90009c38 in mach_msg ()
#2  0x90be7949 in io_connect_method_structureI_structureO ()
#3  0x124d672b in gldInitDispatch ()
#4  0x123959b1 in glReadPixels_Exec ()
#5  0x92b22c87 in glReadPixels ()
#6  0x000a3699 in anything_under_the_mouse (object_id=0, object_type=4) at misc.c:142
#7  0x0006de70 in display_game_handler (win=0x59c5600) at gamewin.c:995
#8  0x0005bea1 in draw_window (win=0x59c5600) at elwindows.c:1076
#9  0x0005c0bc in display_windows (level=1) at elwindows.c:1243
#10 0x0004d68f in draw_scene () at draw_scene.c:129
#11 0x0009c315 in start_rendering () at main.c:167
#12 0x0009c385 in SDL_main (argc=1, argv=0x6106f20) at main.c:287

[23:26:10] Cookie 86. Playing this sound unless out of range.
[23:26:11] Trying to add sound: 23 (Male pain) at 129, 117. Camera: 145, 122
[23:26:11] Inserting new source at index 0/5
[23:26:11] Attemping to load sound: File: sound/pain-male11.ogg
[23:26:11] Result: File: sound/pain-male11.ogg, Format: 4355, Size: 104896, Freq: 44100.000000
[23:26:11] Cookie 87. Playing this sound unless out of range.
[23:26:12] Stopping cookie 87 with sound source index 0
[23:26:12] Trying to add sound: 25 (Punch1) at 129, 117. Camera: 145, 122
[23:26:12] Inserting new source at index 0/5
[23:26:12] Cookie 88. Playing this sound unless out of range.

 

This one was really weird. Weather effects (rain, lightning) and decreasing health messages still worked, the rest was frozen ... even the death bag appeared ...

 

/EDIT

 

and another one

#0  0x900248c7 in semaphore_wait_signal_trap ()
#1  0x90001582 in pthread_mutex_lock ()
#2  0x9add00d6 in CAMutex::Lock ()
#3  0x9add24be in OALSource::Stop ()
#4  0x9adc61d5 in alSourceStop ()
#5  0x000cf975 in stop_sound_source_at_index (index=0) at sound.c:2836
#6  0x0000aa28 in destroy_all_actors () at actor_scripts.c:989
#7  0x0000f4a4 in add_command_to_actor (actor_id=2419, command=5 '\005') at actor_scripts.c:1017
#8  0x000a62aa in process_message_from_server (in_data=0x1958cc80 "\002\004", data_length=6) at multiplayer.c:530
#9  0x0009c2e7 in start_rendering () at main.c:154
#10 0x0009c385 in SDL_main (argc=1, argv=0x6106f20) at main.c:287

 

/EDIT2

and another one

#0  0x900248c7 in semaphore_wait_signal_trap ()
#1  0x90001582 in pthread_mutex_lock ()
#2  0x3002ee39 in SDL_mutexP ()
#3  0x0000ae4b in animate_actors () at actor_scripts.c:435
#4  0x00060b2a in HandleEvent (event=0xbfffe970) at events.c:274
#5  0x0009c11a in start_rendering () at main.c:142
#6  0x0009c385 in SDL_main (argc=1, argv=0x6106f20) at main.c:287

[23:35:34] Cookie 8. Playing this sound unless out of range.
[23:35:34] Stopping cookie 7 with sound source index 0
[23:35:34] Trying to add sound: 26 (Kick1) at 144, 120. Camera: 133, 118
[23:35:34] Inserting new source at index 0/2
[23:35:34] Cookie 9. Playing this sound unless out of range.
[23:35:35] Stopping cookie 8 with sound source index 0
[23:35:38] Trying to add sound: 26 (Kick1) at 144, 120. Camera: 136, 119
[23:35:38] Inserting new source at index 0/1
[23:35:38] Cookie 10. Playing this sound unless out of range.
[23:35:38] Trying to add sound: 22 (Walk) at 136, 119. Camera: 136, 119
[23:35:38] Inserting new source at index 1/2

 

fighting sounds seem to be a really big problem

Edited by Florian

Share this post


Link to post
Share on other sites
next one

<snip>
#6  0x000a3699 in anything_under_the_mouse (object_id=0, object_type=4) at misc.c:142
<snip>

That one's not mine!

 

This one was really weird. Weather effects (rain, lightning) and decreasing health messages still worked, the rest was frozen ... even the death bag appeared ...

However, that kinda sounds like it might be. I have seen such things by overloading the sound system. I assume that its overloading a couple of threads, but others are free to process which is why some things work and others don't.

 

and another one

#0  0x900248c7 in semaphore_wait_signal_trap ()
#1  0x90001582 in pthread_mutex_lock ()
<snip>

 

/EDIT2

and another one

#0  0x900248c7 in semaphore_wait_signal_trap ()
#1  0x90001582 in pthread_mutex_lock ()
<snip>

 

fighting sounds seem to be a really big problem

Yeah, more mutex problems. Probably because so many sounds are being added and removed... there are bugs in the mutex handling (like I haven't really coded any... just enabled what was previously disabled), and so when lots of things are happening they will appear.

 

Out of interest, if you disable the mutex stuff you won't have this problem (but will have others). Change:

#define	LOCK_SOUND_LIST() SDL_LockMutex(sound_list_mutex);
#define	UNLOCK_SOUND_LIST() SDL_UnlockMutex(sound_list_mutex);

to:

#define	LOCK_SOUND_LIST() # SDL_LockMutex(sound_list_mutex);
#define	UNLOCK_SOUND_LIST() # SDL_UnlockMutex(sound_list_mutex);

 

To some extent this isn't something I've been focusing on yet, and I'm not really planning on focusing on it too much for the moment. For now I want to get things turned on and off at the correct times. Once I'm happy with that, I'll look further into the complexities of multiple sounds. It is still Alpha, but getting closer. ;-)

 

/edit: Out of interest, there will be a fairly major overhaul to how the sounds are loaded and handled at some stage. I haven't gone through that part of the existing code very carefully, but I have noticed that sounds are loaded into sources directly, rather than loading them into buffers and checking which sounds we are playing, then loading those we need into sources. I have one thing I'm working on now, and then this will be my next task. I'm aiming to cover locking and unlocking the sources list after that.

Edited by Torg

Share this post


Link to post
Share on other sites

#define	LOCK_SOUND_LIST() [b]//[/b] SDL_LockMutex(sound_list_mutex);
#define	UNLOCK_SOUND_LIST() [b]//[/b] SDL_UnlockMutex(sound_list_mutex);

 

:blink:

 

#0  0x90009cd7 in mach_msg_trap ()
#1  0x90009c38 in mach_msg ()
#2  0x90be7949 in io_connect_method_structureI_structureO ()
#3  0x124d672b in gldInitDispatch ()
#4  0x123959b1 in glReadPixels_Exec ()
#5  0x92b22c87 in glReadPixels ()
#6  0x000a37b9 in anything_under_the_mouse (object_id=0, object_type=4) at misc.c:142
#7  0x000cdbce in draw_sun_shadowed_scene (any_reflection=0) at shadows.c:861
#8  0x0006e3e0 in display_game_handler (win=0x59c5600) at gamewin.c:981
#9  0x0005bfc1 in draw_window (win=0x59c5600) at elwindows.c:1076
#10 0x0005c1dc in display_windows (level=1) at elwindows.c:1243
#11 0x0004d7af in draw_scene () at draw_scene.c:129
#12 0x0009c435 in start_rendering () at main.c:167
#13 0x0009c4a5 in SDL_main (argc=1, argv=0x6106f20) at main.c:287

 

#0  0x900248c7 in semaphore_wait_signal_trap ()
#1  0x90001582 in pthread_mutex_lock ()
#2  0x9add00d6 in CAMutex::Lock ()
#3  0x9add24be in OALSource::Stop ()
#4  0x9adc61d5 in alSourceStop ()
#5  0x000cfa95 in stop_sound_source_at_index (index=0) at sound.c:2836
#6  0x0000ab48 in destroy_all_actors () at actor_scripts.c:989
#7  0x0000f5c4 in add_command_to_actor (actor_id=2423, command=20 '\024') at actor_scripts.c:1017
#8  0x000a63ca in process_message_from_server (in_data=0x61d9470 "\002\004", data_length=6) at multiplayer.c:530
#9  0x0009c407 in start_rendering () at main.c:154
#10 0x0009c4a5 in SDL_main (argc=1, argv=0x6106f20) at main.c:287

Share this post


Link to post
Share on other sites

Interesting. I expected other problems, but hey... I'm still learning about OpenAL.

 

I'm just in the middle of a couple of other things, after the next patch (probably) I'll move onto this problem. I'm not sure how long it will be. I was hoping to have it done tonight, but it looks like it will take a bit longer because of RL distractions. :-S

Share this post


Link to post
Share on other sites

Ok... added support for crowd sounds (only the default at the moment) and defaults for background and crowd sounds.

 

There will be a new package with extended config and sounds for all the new features when I have finished the crowd sound configuration code. Hopefully that will be within a day, but naturally that's dependant on availablity. In the mean time, hopefully there aren't too many new issues. :-P

Share this post


Link to post
Share on other sites

Ok... *finally* got the code fixed for crowd sounds etc. Also fixed a couple of other bugs.

 

The largest fix however was consolodating a lot of the code, especially for the streams. Moving common code into functions and basing more of the code around the stream_data struct to ease management of the streams and make common functionality much easier.

 

The meant that most of the sound and music, on and off code was completely different, so that was relocated. There will be further tidying of the code over the next week or so.

 

There are also a couple of new packages (full and patch) which provide some config for the new code, and some example files.

 

The client is now very noisy. Also, fires now work! However, this can be an issue in some locations where there are lots of lit fireplaces on a map (map insides - eg Portland). Either turn off sound before entering, or avoid them for the time being.

 

Anyways, enjoy this update. Hopefully there aren't too many bugs (although the larger number of sounds and streams is likely to cause more issues with overlapping sound updates. Grrrr.)

Share this post


Link to post
Share on other sites

The current CVS version freezes and the char is not moving. Can't test anything :/

Did that happen when fighting sounds were played?

 

/EDIT:

 

observations:

- some sounds fade in, some don't. fountains should fade in

- harv events don't have sounds. missing event or just missing soundfile?

- no more freezes watching people fight

Edited by Florian

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.

×